summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Changed ld and gas BPF testsCupertino Miranda2023-03-2013-100/+4
| | | | | | Recent BPF patch removed and renamed the list of relocations based on the limitations of BPF instruction set. This patch is a correction to the tests.
* Reloc howto access broken for BPFCupertino Miranda2023-03-201-1/+4
| | | | | | Forgot to change the logic to access the reloc howto from bpf_elf_relocate_section. Problem was introduced in previous BPF commit.
* Use rust_demangle to fix a crashTom Tromey2023-03-203-6/+8
| | | | | | | | | | | | | | | | PR rust/30211 points out a crash caused by a particular completion. This turns out to happen because a Rust minsym winds up in a C++-specific path in strncmp_iw_with_mode, which ultimately causes the completer to pass invalid arguments to string::append. This patch fixes the bug by reordering the language constants so that Rust comes before C++, and then using rust_demangle. This ensures that minsyms are correctly marked as "Rust", avoiding this code and thus the crash. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20367 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30211 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
* Make ui_out::do_progress_end 'private'Tom Tromey2023-03-202-48/+61
| | | | | | | | | I noticed that ui_out::do_progress_end is public, just to support one use in debuginfod-support.c. This patch makes it private, updates progress_info to call it from its destructor, and finally changes debuginfod-support.c to follow.
* gdb: don't use the global thread-id in the saved breakpoints fileAndrew Burgess2023-03-205-5/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that breakpoint::print_recreate_thread was printing the global thread-id. This function is used to implement the 'save breakpoints' command, and should be writing out suitable CLI commands for recreating the current breakpoints. The CLI does not use global thread-ids, but instead uses the inferior specific thread-ids, e.g. "2.1". After some discussion on the mailing list it was suggested that the most consistent solution would be for the saved breakpoints file to always contain the inferior-qualified thread-id, so the file would include "thread 1.1" instead of just "thread 1", even when there is only a single inferior. So, this commit adds print_full_thread_id, which is just like the existing print_thread_id, only it always prints the inferior-qualified thread-id. I then update the existing print_thread_id to make use of this new function, and finally, I update breakpoint::print_recreate_thread to also use this new function. There's a multi-inferior test that confirms the saved breakpoints file correctly includes the fully-qualified thread-id, and I've also updated the single inferior test gdb.base/save-bp.exp to have it validate that the saved breakpoints file includes the inferior-qualified thread-id, even for this single inferior case.
* Revert "segfault at i386-dis.c:9815"Alan Modra2023-03-201-9/+4
| | | | | | | | | | This reverts commit 92d450c79ad321e42f9a77692b5db10d0f7b9344. Accessing these local var structs using a volatile qualified pointer may indeed read the object, but I don't think changed values are guaranteed to be written back to the object unless the actual object is declared volatile. That would probably slow down i386 disassembly unacceptably.
* libctf: unused variableAlan Modra2023-03-201-2/+0
| | | | * ctf-archive.c (arc_mmap_writeout): Delete unused variable.
* gprofng: Use prototype to call libc functionsVladimir Mezentsev2023-03-198-174/+150
| | | | | | | | | | | | | | | | | | | libcollector may not link against libC. We use dlsym() to get a function from libc. In some files, pointers to these functions do not have prototypes. I also moved the shared definitions to libcollector/collect.h. gprofng/ChangeLog 2023-03-15 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> libcollector/collector.c: Add prototypes. libcollector/dispatcher.c: Likewise. libcollector/heaptrace.c: Likewise. libcollector/iotrace.c: Likewise. libcollector/linetrace.c: Likewise. libcollector/mmaptrace.c: Likewise. libcollector/synctrace.c: Likewise. libcollector/collector.h: Add CALL_REAL(), NULL_PTR(), and DBG_LT.
* Automatic date update in version.inGDB Administrator2023-03-201-1/+1
|
* Don't declare psymbol_functions::fill_psymbol_mapTom Tromey2023-03-191-5/+0
| | | | | psymbol_functions::fill_psymbol_map was removed, but I forgot to remove the declaration. This patch removes it. Tested by rebuilding.
* segfault at i386-dis.c:9815Alan Modra2023-03-191-4/+9
| | | | | * i386-dis.c (print_insn): Access "ins" and "priv" via volatile pointers after second sigsetjmp return.
* Enable vector register visibility in core file for AIX binutilsAditya Vidyadhar Kamath2023-03-192-1/+36
| | | | | This patch will enable vector register visibility when AIX FOLKS do core file analysis.
* Regen ld/po/BLD-POTFILES.inAlan Modra2023-03-191-0/+1
|
* XCOFF archive sanity checkAlan Modra2023-03-191-4/+10
| | | | | | | | | XCOFF archive elements are in a linked list. Add a little more sanity checking. This of course doesn't stop the fuzzers finding a way to make a loop, but this check is cheap. * coff-rs6000.c (_bfd_xcoff_openr_next_archived_file): Sanity check that next element isn't pointing back to the header.
* rewrite_elf_program_header and want_p_paddr_set_to_zeroAlan Modra2023-03-191-7/+8
| | | | | | | | | | | | Layout in rewrite_elf_program_header is really done by lma, even if program headers are going to have their p_paddr forced to zero. Thus when not matching against an existing segment, don't try to use a "vma" from elf_segment_map. * elf.c (is_contained_by): Replace "bed" param with "use_vaddr". (IS_SECTION_IN_INPUT_SEGMENT): Adjust is_contained_by call. (rewrite_elf_program_header): Always match against lma in calls to is_contained_by using new maps.
* Another sanity check for read_section_stabs_debugging_infoAlan Modra2023-03-191-0/+1
| | | | | * rddbg.c (read_section_stabs_debugging_info): Ignore invalid stab sections with size less than 12 bytes.
* ctf segfaultsAlan Modra2023-03-192-5/+8
| | | | | | | PR 30228 PR 30229 * ctf-open.c (ctf_bufopen_internal): Check for NULL cts_data. * ctf-archive.c (ctf_arc_bufpreamble, ctf_arc_bufopen): Likewise.
* Automatic date update in version.inGDB Administrator2023-03-191-1/+1
|
* Remove objfile_typeTom Tromey2023-03-182-161/+3
| | | | | | | | | This removes objfile_type, in favor of always using the per-arch builtins. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Add some types to struct builtin_typeTom Tromey2023-03-182-0/+65
| | | | | | | | | This adds some types to struct builtin_type, ensuring it contains all the types currently used by objfile_type. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Rename objfile_type to builtin_typeTom Tromey2023-03-1813-82/+82
| | | | | | | | | This renames objfile_type to be an overload of builtin_type, in preparation for their unification. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Use builtin type when appropriateTom Tromey2023-03-183-17/+4
| | | | | | | | | | | | There are a few spots that check whether a type is objfile-owned, and then choose either the objfile- or arch-specific builtin type. I don't think there is a need to do this any more (if there ever was), because it is ok for an objfile-allocated type to refer to an arch-allocated type. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Use type allocator for set typesTom Tromey2023-03-184-9/+13
| | | | | | | | | | | This changes the set type creation function to accept a type allocator, and updates all the callers. Note that symbol readers should generally allocate on the relevant objfile, regardless of the underlying type of the set, which is what this patch implements. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Use type allocator for array typesTom Tromey2023-03-1811-82/+82
| | | | | | | | | | | | This changes the array type creation functions to accept a type allocator, and updates all the callers. Note that symbol readers should generally allocate on the relevant objfile, regardless of the placement of the index type of the array, which is what this patch implements. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Use type allocator for range typesTom Tromey2023-03-1811-65/+92
| | | | | | | | | | | This changes the range type creation functions to accept a type allocator, and updates all the callers. Note that symbol readers should generally allocate on the relevant objfile, regardless of the underlying type of the range, which is what this patch implements. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Unify arch_pointer_type and init_pointer_typeTom Tromey2023-03-1810-48/+33
| | | | | | | | | This unifies arch_pointer_type and init_pointer_type by using a type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Unify arch_decfloat_type and init_decfloat_typeTom Tromey2023-03-183-22/+13
| | | | | | | | | This unifies arch_decfloat_type and init_decfloat_type by using a type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Unify arch_float_type and init_float_typeTom Tromey2023-03-1821-95/+97
| | | | | | | | | This unifies arch_float_type and init_float_type by using a type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Unify arch_boolean_type and init_boolean_typeTom Tromey2023-03-1811-44/+29
| | | | | | | | | This unifies arch_boolean_type and init_boolean_type by using a type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Unify arch_character_type and init_character_typeTom Tromey2023-03-1810-44/+28
| | | | | | | | | This unifies arch_character_type and init_character_type by using a type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Unify arch_integer_type and init_integer_typeTom Tromey2023-03-1821-205/+201
| | | | | | | | | This unifies arch_integer_type and init_integer_type by using a type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Remove init_typeTom Tromey2023-03-186-83/+69
| | | | | | | | | This removes init_type, replacing all uses with the new type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Remove arch_typeTom Tromey2023-03-1816-88/+91
| | | | | | | | | This removes arch_type, replacing all uses with the new type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Reuse existing builtin typesTom Tromey2023-03-185-11/+5
| | | | | | | | | This changes a few spots to reuse the existing builting "void" type, rather than construct a new one. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Remove alloc_typeTom Tromey2023-03-187-46/+17
| | | | | | | | | This removes alloc_type, replacing all uses with the new type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Remove alloc_type_copyTom Tromey2023-03-185-39/+26
| | | | | | | | | This removes alloc_type_copy, replacing all uses with the new type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Remove alloc_type_archTom Tromey2023-03-182-35/+4
| | | | | | | | | This removes alloc_type_arch, replacing all uses with the new type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* Introduce type_allocatorTom Tromey2023-03-182-27/+189
| | | | | | | | | | This introduces a new type_allocator class. This class will be used to abstract out the placement of new types, so that type-creation code can be simplified and shared. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
* [gdb/testsuite] Handle unbuffer_output.c for remote hostTom de Vries2023-03-1825-28/+79
| | | | | | Handle $srcdir/lib/unbuffer_output.c using lappend_include_file. Tested on x86_64-linux.
* [gdb/testsuite] Handle my-syscalls.h for remote hostTom de Vries2023-03-182-1/+3
| | | | | | Handle $srcdir/lib/my-syscalls.h using lappend_include_dir. Tested on x86_64-linux.
* [gdb/testsuite] Handle attributes.h for remote hostTom de Vries2023-03-1815-25/+81
| | | | | | Handle $srcdir/lib/attributes.h using lappend_include_dir. Tested on x86_64-linux.
* Automatic date update in version.inGDB Administrator2023-03-181-1/+1
|
* Fix line table regressionTom Tromey2023-03-1715-50/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | Simon pointed out a line table regression, and after a couple of false starts, I was able to reproduce it by hand using his instructions. The bug is that most of the code in do_mixed_source_and_assembly uses unrelocated addresses, but one spot does: pc = low; ... after the text offset has been removed. This patch fixes the problem by introducing a new type to represent unrelocated addresses in the line table. This prevents this sort of bug to some degree (it's still possible to manipulate a CORE_ADDR in a bad way, this is unavoidable). However, this did let the compiler flag a few spots in that function, and now it's not possible to compare an unrelocated address from a line table with an ordinary CORE_ADDR. Regression tested on x86-64 Fedora 36, though note this setup never reproduced the bug in the first place. I also tested it by hand on the disasm-optim test program.
* Update the NetBSD system call table to add eventfd(2) and timerfd(2).Frederic Cambus2023-03-171-0/+4
| | | | Generated from sys/sys/syscall.h revision 1.321.
* gdb: introduce bp_loc_tracepointSimon Marchi2023-03-172-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit cb1e4e32c2d9 ("catch catch/throw/rethrow", breakpoint -> catchpoint), this simple tracing scenario does not work: $ gdb/gdb -nx -q --data-directory=gdb/data-directory ./test Reading symbols from ./test... (gdb) tar rem :1234 Remote debugging using :1234 Reading symbols from /lib64/ld-linux-x86-64.so.2... (No debugging symbols found in /lib64/ld-linux-x86-64.so.2) 0x00007ffff7fe5730 in ?? () from /lib64/ld-linux-x86-64.so.2 (gdb) trace do_something Tracepoint 1 at 0x555555555144: file test.c, line 5. (gdb) tstart (gdb) continue Continuing. Target returns error code '01'. The root cause is that the bp_location::nserted flag does not transfer anymore from an old bp_location to the new matching one. When a shared library gets loaded, GDB computes new breakpoint locations for each breakpoint in update_breakpoint_locations. The new locations are in the breakpoint::loc chain, while the old locations are still in the bp_locations global vector. Later, update_global_location_list is called. It tries to map old locations to new locations, and if necessary transfer some properties, like the inserted flag. Since commit cb1e4e32c2d9, the inserted flag isn't transferred for locations of tracepoints. This is because bl_address_is_meaningful used to be implemented like this: static int breakpoint_address_is_meaningful (struct breakpoint *bpt) { enum bptype type = bpt->type; return (type != bp_watchpoint && type != bp_catchpoint); } and was changed to this: static bool bl_address_is_meaningful (bp_location *loc) { return loc->loc_type != bp_loc_other; } Because locations for tracepoints have the bp_loc_other type, bl_address_is_meaningful started to return false for them, where it returned true before. This made update_global_location_list skip the part where it calls swap_insertion. I think this can be solved by introduced a new bp_loc_tracepoint bp_loc_type. I don't know if it's accurate, but my understanding is that bp_loc_type describes roughly "how do we ask the target to insert that location". bp_loc_software_breakpoint are inserted using target_ops::insert_breakpoint_location. bp_loc_hardware_breakpoint are inserted using target_ops::insert_hw_breakpoint. bp_loc_software_watchpoint and bp_loc_hardware_watchpoint are inserted using target_ops::insert_watchpoint. For all these, the address is meaningful, as we ask the target to insert the point at a specific address. bp_loc_other is a catch-all for "the rest", in practice for catchpoints that don't have a specific address (hence why bl_address_is_meaningful returns false for them). For instance, inserting a signal catchpoint is done by asking the target to report that specific signal. GDB doesn't associate an address to that. But tracepoints do have a meaningful address to thems, so they can't be bp_loc_other, with that logic. They also can't be bp_loc_software_breakpoint, because we don't want GDB to insert breakpoints for them (even though they might be implemented using software breakpoints by the remote side). So, the new bp_loc_tracepoint type describes that the way to insert these locations is with target_ops::download_tracepoint. It makes bl_address_is_meaningful return true for them. And they'll be ignored by insert_bp_location and GDB won't try to insert a memory breakpoint for them. With this, I see a few instances of 'Target returns error code: 01' disappearing from gdb.log, and the results of gdb.trace/*.exp improve a little bit: -# of expected passes 3765 +# of expected passes 3781 -# of unexpected failures 518 +# of unexpected failures 498 Things remain quite broken in that area though. Change-Id: Ic40935c450410f4bfaba397c9ebc7faf97320dd3
* PowerPC: fix for gdb.reverse/finish-precsave.exp and ↵Carl Love2023-03-174-9/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb.reverse/finish-reverse.exp PPC64 multiple entry points, a normal entry point and an alternate entry point. The alternate entry point is to setup the Table of Contents (TOC) register before continuing at the normal entry point. When the TOC is already valid, the normal entry point is used, this is typically the case. The alternate entry point is typically referred to as the global entry point (GEP) in IBM. The normal entry point is typically referred to as the local entry point (LEP). When GDB is executing the finish command in reverse, the function finish_backward currently sets the break point at the alternate entry point. This issue is if the function, when executing in the forward direction, entered the function via the normal entry point, execution in the reverse direction will never sees the break point at the alternate entry point. In this case, the reverse execution continues until the next break point is encountered thus stopping at the wrong place. This patch adds a new address to struct execution_control_state to hold the address of the alternate entry point (GEP). The finish_backwards function is updated, if the stopping point is between the normal entry point (LEP) and the end of the function, a breakpoint is set at the normal entry point. If the stopping point is between the entry points, a breakpoint is set at the alternate entry point. This ensures that GDB will always stop at the normal entry point. If the function did enter via the alternate entry point, GDB will detect that and continue to execute backwards in the function until the alternate entry point is reached. The patch fixes the behavior of the reverse-finish command on PowerPC to match the behavior of the command on other platforms, specifically X86. The patch does not change the behavior of the command on X86. A new test is added to verify the reverse-finish command on PowerPC correctly stops at the instruction where the function call is made. The patch fixes 11 regression errors in test gdb.reverse/finish-precsave.exp and 11 regression errors in test gdb.reverse/finish-reverse.exp. The patch has been tested on Power 10 and X86 processor with no new regression failures.
* Move step_until procedureCarl Love2023-03-172-55/+41
| | | | | | | | | | Procedure step_until from test gdb.reverse/step-indirect-call-thunk.exp is moved to lib/gdb.exp and renamed repeat_cmd_until. The existing procedure gdb_step_until in lib/gdb.exp is simpler variant of the new repeat_cmd_until procedure. The existing procedure gdb_step_until is changed to just call the new repeat_cmd_until procedure with the command set to "step" and an optional CURRENT string. The default CURRENT string is set to "\}" to work with the existing uses of procedure gdb_step_until.
* [gdb/testsuite] Fix regexp in gdb.arch/ftrace-insn-reloc.expTom de Vries2023-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | With test-case gdb.arch/ftrace-insn-reloc.exp and host board local-remote-host-notty and target board native-gdbserver I run into: ... (gdb) info sharedlibrary^M From To Syms Read Shared Object Library^M $hex $hex Yes /lib64/ld-linux-x86-64.so.2^M $hex $hex Yes /home/remote-host/libinproctrace.so^M $hex $hex Yes /lib64/libm.so.6^M $hex $hex Yes /lib64/libc.so.6^M $hex $hex Yes /lib64/libdl.so.2^M $hex $hex Yes (*) /usr/lib64/libstdc++.so.6^M $hex $hex Yes (*) /lib64/libgcc_s.so.1^M $hex $hex Yes /lib64/libpthread.so.0^M (*): Shared library is missing debugging information.^M (gdb) FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded ... due to trying to match libinproctrace.so using the target path, while the command lists it using the host path. Fix this by making the regexp less strict. Tested on x86_64-linux.
* [gdb/testsuite] Handle remote host in gdb_load_shlibTom de Vries2023-03-172-6/+20
| | | | | | | | | | | | | | | | | | With test-case gdb.arch/ftrace-insn-reloc.exp and host board local-remote-host-notty and target board native-gdbserver I run into: ... (gdb) tstart^M Target returns error code '.In-process agent library not loaded in process. \ Fast and static trace points unavailable.'.^M (gdb) FAIL: gdb.arch/ftrace-insn-reloc.exp: start trace experiment ... Fix this by: - handling remote host in gdb_load_shlib, and - moving the gdb_load_shlib to after the clean_restart, such that the set solib-search-path can take effect. Tested on x86_64-linux.
* [gdb/testsuite] Fix gdb.arch/i386-biarch-core.exp for remote hostTom de Vries2023-03-171-0/+2
| | | | | | Fix test-case gdb.arch/i386-biarch-core.exp using gdb_download_remote host. Tested on x86_64-linux.