aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-02-17gdb: remove unused include in symfile-debug.cSimon Marchi1-1/+0
This is reported as unused by clangd. Change-Id: Ida5a93b632cd4477fb91df1ab0edf66f12a28f64
2025-02-17gdb: remove unused include in objfiles.hSimon Marchi1-1/+0
clangd reports this include as unused. Change-Id: I6a4224d8aa581fea2336da124c89ade09f573af3
2025-02-17testsuite, mi: fix indentation in get_mi_thread_listTankut Baris Aktemur1-29/+29
The `get_mi_thread_list` procedure's body is incorrectly indented. Fix it. There is one line that was already long. Consider it an exception and don't bother breaking it.
2025-02-17Automatic date update in version.inGDB Administrator1-1/+1
2025-02-16gdb: fix color_option_def compile error (clang)Andrew Oates1-1/+1
color_option_def was added in commit 6447969d0 ("Add an option with a color type."), but not used. The color_option_def constructor passes the wrong number of arguments to the option_def constructor. Since color_option_def is a template and never actually instantiated, GCC does not fail to compile this. clang generates an error (see below). This passes nullptr to the extra_literals_ option_def ctor argument, which matches what filename_option_def above it does. clang's generated error: ../../gdb/cli/cli-option.h:343:7: error: no matching constructor for initialization of 'option_def' : option_def (long_option_, var_color, ^ ~~~~~~~~~~~~~~~~~~~~~~~~ ../../gdb/cli/cli-option.h:50:13: note: candidate constructor not viable: requires 8 arguments, but 7 were provided constexpr option_def (const char *name_, ^ ../../gdb/cli/cli-option.h:37:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 7 were provided struct option_def ^ ../../gdb/cli/cli-option.h:37:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 7 were provided Approved-By: Tom de Vries <tdevries@suse.de>
2025-02-16Automatic date update in version.inGDB Administrator1-1/+1
2025-02-16score-elf gas SEGVAlan Modra4-2/+18
Commit 3fb6f5457e5b typoed an array subscript. * config/tc-score7.c (s7_gen_reloc): Correct array subscript. * testsuite/gas/score/pr32700.d, * testsuite/gas/score/pr32700.s: New test. * testsuite/gas/score/relax.exp: Run it.
2025-02-16PR32698, potential null pointer dereference in tekhex.cAlan Modra1-24/+20
PR 32698 * tekhex.c (find_chunk): Remove unnecessary casts. (insert_byte): Check and return status from find_chunk. (move_section_contents): Likewise. (tekhex_get_section_contents, tekhex_set_arch_mach): Return status from move_section_contents. (first_phase): Check and return status from first_phase.
2025-02-16riscv disassembler leakAlan Modra1-1/+4
Commit 3f61a38b5e81 moved the disassembler subset_list from a static variable to disassembler private_data. It is now malloc'd in riscv_init_disasm_info so should be freed when disassemble_free_target runs. * riscv-dis.c (disassemble_free_riscv): Free subset_list.
2025-02-15MIPS objdump: Add `eabi32` and `eabi64` ABI optionsAnghelo Carvajal6-0/+114
Extend gpr and fpr register names with names suitable for both EABIs. Heavily inspired by the EABI documenation written by Eric Christopher, which can be read at https://sourceware.org/legacy-ml/binutils/2003-06/msg00436.html 2025-02-15 Anghelo Carvajal <angheloalf95@gmail.com> * mips-dis.c (mips_fpr_names_eabi32): New variable. (mips_fpr_names_eabi64): New variable. (mips_abi_choices): Add "eabi32" and "eabi64" options. Signed-off-by: Anghelo Carvajal <angheloalf95@gmail.com>
2025-02-15MIPS/GAS/testsuite: Reuse n64 GPR disassembly for n32Maciej W. Rozycki1-39/+1
The MIPS ABI register names are the same between n64 and n32, so remove duplication and use n64 GPR disassembly output for the n32 test as well. The tests were developed long before we gained output reuse support.
2025-02-15MIPS/GAS: Fix comment about "img" vendor configurationsMaciej W. Rozycki2-2/+2
Adjust a comment about "img" vendor configurations to comply with the GNU coding standards.
2025-02-15MIPS/GAS: Set default CPU to MIPS64r6 for 64-bit "img" configurationsMaciej W. Rozycki3-2/+9
Fix broken commit 070961b377b3 ("MIPS: Set r6 as default arch if vendor is img") that sets up GAS in an inconsistent way where "img" vendor has been used with a 64-bit configuration, such as `mips64-img-linux-gnu'. In that case GAS is set up to use a 64-bit ABI by default combined with the MIPS32r6 CPU, which is 32-bit. Consequently GAS always fails to assemble even trivial input, producing a message such as: Assembler messages: Error: -march=mips32r6 is not compatible with the selected ABI .../gas/testsuite/gas/all/nop.s:2: Error: `gp=32' used with a 64-bit ABI unless the defaults have been suitably overridden either for the ABI or the CPU. Set the default CPU to MIPS64r6 for 64-bit "img" vendor configurations then and adjust the GAS testsuite accordingly, removing 1048 FAIL and 3 ERROR regression test results for the `mips64-img-linux-gnu' and `mips64el-img-linux-gnu' targets each.
2025-02-15MIPS/GAS/testsuite: Support negated targets for default architectureMaciej W. Rozycki1-5/+13
Add support for giving negated targets in the list of targets passed to `mips_arch_create' for the purpose of setting the default architecture. This is so that a subset of targets can be excluded from matching within a broader set of targets.
2025-02-15alpha, ld: remove -taso optionIvan Kokshaysky4-38/+3
The -taso switch was quite useful 25 years ago for porting 32-bit code with broken integer-pointer casting. Not anymore. The EF_ALPHA_32BIT Linux support is going to be dropped in kernel v6.14 [1], NetBSD and OpenBSD never had it, so there is no point in keeping the -taso option around. Also remove alpha special case that uses -taso from gdb.base/dump.exp in gdb testsuite. [1] https://lore.kernel.org/all/87jzb2tdb7.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: Ivan Kokshaysky <ink@unseen.parts> Reviewed-By: Maciej W. Rozycki <macro@orcam.me.uk> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-15Automatic date update in version.inGDB Administrator1-1/+1
2025-02-14gdb/testsuite: clean ups in gdb.python/py-source-styling.expAndrew Burgess1-8/+8
The top comment in gdb.python/py-source-styling.exp was completely wrong, clearly a cut&paste job from elsewhere. Write a comment that actually reflects what the test does. I've also moved the allow_python_tests check earlier in the file. And I changed some 'return -1' into just 'return'. I'm not aware that the '-1' adds any value. I also folded a 'pass $gdb_test_name' into the preceding gdb_assert, which I think is neater. There is no change in what is actually being tested after this commit. Approved-By: Tom Tromey <tom@tromey.com>
2025-02-14gdb/tui: use maybe_update for source centring in an extra caseAndrew Burgess3-1/+89
I noticed that, with recent versions of GDB, when the TUI is enabled before the inferior is started, the source code display is not as helpful as it used to be. Here's a simple test program being displayed using GDB 15.2, at this point the inferior has not started, all I've done is 'tui enable': ┌─hello.c────────────────────────────────────────────────┐ │ 10 return 0; │ │ 11 } │ │ 12 │ │ 13 /* The main function. */ │ │ 14 │ │ 15 int │ │ 16 main () │ │ 17 { │ │ 18 printf ("Hello World\n"); │ │ 19 call_me ( 0, 1, 2, 3, 4, 5, 6, 7 ); │ │ 20 return 0; │ │ 21 } │ │ │ │ │ └────────────────────────────────────────────────────────┘ Compare this to GDB 16.2: ┌─hello.c────────────────────────────────────────────────┐ │ 17 { │ │ 18 printf ("Hello World\n"); │ │ 19 call_me ( 0, 1, 2, 3, 4, 5, 6, 7 ); │ │ 20 return 0; │ │ 21 } │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └────────────────────────────────────────────────────────┘ I think the new layout is not as good because it is missing the context of the function name. The new behaviour started with the commit: commit 49e607f511c1fab82a0116990a72d1915c74bb4a Author: Stephan Rohr <stephan.rohr@intel.com> Date: Sat Aug 3 02:07:42 2024 -0700 gdb: adjust the default place of 'list' to main's prologue I don't think the new behaviour is really a problem with that commit, rather, when using 'tui enable' before the inferior has started GDB ends up calling tui_source_window_base::rerender(), and then passes through the code path which calls update_source_window_with_addr(). When using 'tui enable' after the inferior has started, GDB again calls tui_source_window_base::rerender(), but this time has a frame, and so takes the second code path, which centres the selected source line, and then calls update_source_window. The point is that the update_source_window_with_addr() path doesn't include the logic to centre the source line. Before the above commit this was fine as GDB's default location would be prior to main, and so we got the "good" TUI output. After the above commit the default location is now main's prologue, and without the centring logic, the first line shown is main's prologue. I propose fixing this by having update_source_window_with_addr() call maybe_update(). This will first check if the requested line is already visible, and if not, show the requested line with centring applied. After this commit, the 'tui enable' state is now: ┌─hello.c─────────────────────────────────────────────────────┐ │ 11 } │ │ 12 │ │ 13 /* The main function. */ │ │ 14 │ │ 15 int │ │ 16 main () │ │ 17 { │ │ 18 printf ("Hello World\n"); │ │ 19 call_me ( 0, 1, 2, 3, 4, 5, 6, 7 ); │ │ 20 return 0; │ │ 21 } │ │ │ │ │ │ │ └─────────────────────────────────────────────────────────────┘ It's not identical to the old behaviour, but that was never the objective, we do however, see the context around main's prologue, which will usually be enough to see the function name and return type, which I think is useful. Approved-By: Tom Tromey <tom@tromey.com>
2025-02-14gdb/tui: update maybe_update to take gdbarchAndrew Burgess6-12/+11
This is a refactor to setup for the next commit. The maybe_update function currently takes a frame_info_ptr&, however, it only uses this to get the frame's gdbarch. In the next commit I want to call maybe_update when I have a gdbarch, but no frame_info_ptr& (the inferior hasn't even started). So, update maybe_update to take the gdbarch, and update the callers to pass that through. Most callers already have the gdbarch to hand, but in one place I do need to extract this from the frame_info_ptr&. There should be no user visible changes after this commit. Approved-By: Tom Tromey <tom@tromey.com>
2025-02-14Handle DW_FORM_data4 in read-debug-names.cTom Tromey1-3/+17
The recent .debug_names patches caused the writer to emit DW_FORM_data4. Unfortunately the reader did not handle this form. This patch updates the reader to handle a few DW_FORM_data* forms. The complaint that is there went unnoticed -- I only found this when debugging a failure in another series. More evidence, IMO, that complaints should be removed. I think the reason the failure itself went unnoticed is that the symbol table code in gdb often works by accident, and in particular in small programs like the ones in the test suite, it's often the case that a CU will be expanded for some other reason, causing the test to pass without really touching the index code. The aforementioned series is aimed at fixing this. It would probably be good to unify the abbrev/form code to some degree, but it's mildly a pain as some forms don't make sense here and because we recently discovered other issues with gdb's DW_FORM_data* handling. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-02-14gdbserver: use `gdb::unordered_map`Simon Marchi3-7/+6
Replace the few uses of `std::unordered_map` in gdbserver with `gdb::unordered_map`. The only one of these that is likely to ever see a lot of elements is probably `process_info::m_ptid_thread_map`. It was added precisely to improve performance when there are a lot of threads, so I guess using `gdb::unordered_map` here won't hurt. I changed the others too, since it's easy. Change-Id: Ibc4ede5245551fdd7717cb349a012d05726f4363 Reviewed-By: Stephan Rohr <stephan.rohr@intel.com>
2025-02-14gdb/dwarf: unique_ptr cleanupSimon Marchi14-55/+67
Throughout gdb/dwarf2, use `*_up` typedefs. Add a few missing typedefs, and move some so they are, ideally, just after the corresponding class. Change-Id: Iab5cd8fc2e9989d4bd8d4868586703c2312f254f Approved-By: Tom Tromey <tom@tromey.com>
2025-02-14gdb/dwarf: rename cooked_index_worker subclassesSimon Marchi2-10/+10
Rename them to include "worker" in the name. Otherwise, it's easy to be confused and think that they are sub-classes of "cooked_index". Change-Id: I625ef076f9485f3873db530493f60a53d02c1991 Approved-By: Tom Tromey <tom@tromey.com>
2025-02-14gdb/dwarf: use term "shard" instead of "index"Simon Marchi2-10/+11
A bit more changes as in 8e745eac7db3 ("gdb/dwarf: rename cooked_index::m_vector to m_shards"). I think it's clearer if the term "index" is reserved for the whole thing, while "shard" or "index shard" are used for the parts. Change-Id: I457bb0016a70f3f9918f4a3c3977262a7801705b Approved-By: Tom Tromey <tom@tromey.com>
2025-02-14gdb/python/dap: prefix internal attributes with underscoreSimon Marchi7-118/+116
I'm currently reading the DAP code, and I think this would help. This is pretty much standard Python style, we do it as some places but not others. I think it helps readability, by saying that this attribute isn't mean to be accessed outside the class. A similar pass could be done for internal methods, I haven't done that. Change-Id: I8e8789b39adafe62d14404d19f7fc75e2a364e01 Approved-By: Tom Tromey <tom@tromey.com>
2025-02-14gdb: only update m_last_subfile after writing a line table entryAndrew Burgess3-3/+264
While working on another patch which changes how we parse the line DWARF line tables I noticed what I think is a minor bug in how we process the line tables. What I noticed is that my new line table parser was adding more END markers into the parsed table than GDB's current approach. This difference was observed when processing the debug information for libstdc++. Here is the line table from the new test, this is a reasonable reproduction of the problem case that I observed in the actual debug line table: Contents of the .debug_line section: dw2-skipped-line-entries-1.c: File name Line number Starting address View Stmt dw2-skipped-line-entries-1.c 101 0x40110a x /tmp/dw2-skipped-line-entries-2.c: dw2-skipped-line-entries-2.c 201 0x401114 x /tmp/dw2-skipped-line-entries-3.c: dw2-skipped-line-entries-3.c 301 0x40111e x /tmp/dw2-skipped-line-entries-1.c: dw2-skipped-line-entries-1.c 102 0x401128 x dw2-skipped-line-entries-1.c 103 0x401128 x dw2-skipped-line-entries-1.c 104 0x401128 x /tmp/dw2-skipped-line-entries-2.c: dw2-skipped-line-entries-2.c 211 0x401128 /tmp/dw2-skipped-line-entries-3.c: dw2-skipped-line-entries-3.c 311 0x401132 /tmp/dw2-skipped-line-entries-1.c: dw2-skipped-line-entries-1.c 104 0x40113c dw2-skipped-line-entries-1.c 105 0x401146 x dw2-skipped-line-entries-1.c - 0x401150 The problem is caused by the entry for line 211. Notice that this entry is at the same address as the previous entries. Further, the entry for 211 is a non-statement entry, while the previous entries are statement entries. As the entry for line 211 is a non-statement entry, and the previous entries at that address are statement entries in a different symtab, it is thought that it is better to prefer the earlier entries (in dw2-skipped-line-entries-1.c), and so the entry for line 211 will be discarded. As GDB parses the line table it switches between the 3 symtabs (based on source filename) adding the relevant entries to each symtab. Additionally, as GDB switches symtabs, it adds an END entry to the previous symtab. The problem then is that, for the line 211 entry, this is the only entry in dw2-skipped-line-entries-2.c before we switch symtab again. But the line 211 entry is discarded. This means that GDB switches from dw2-skipped-line-entries-1.c to dw2-skipped-line-entries-2.c, and then on to dw2-skipped-line-entries-3.c without ever adding an entry to dw2-skipped-line-entries-2.c. And here then is the bug. GDB updates its idea of the previous symtab not when an entry is written into a symtab, but every time we change symtab. In this case, when we switch to dw2-skipped-line-entries-3.c we add the END marker to dw2-skipped-line-entries-2.c, even though no entries were written to dw2-skipped-line-entries-2.c. At the same time, no END marker is ever written into dw2-skipped-line-entries-1.c as the dw2-skipped-line-entries-2.c entry (for line 211) was discarded. Here is the 'maint info line-table' for dw2-skipped-line-entries-1.c before this patch: INDEX LINE REL-ADDRESS UNREL-ADDRESS IS-STMT PROLOGUE-END EPILOGUE-BEGIN 0 101 0x000000000040110a 0x000000000040110a Y 1 END 0x0000000000401114 0x0000000000401114 Y 2 102 0x0000000000401128 0x0000000000401128 Y 3 103 0x0000000000401128 0x0000000000401128 Y 4 104 0x0000000000401128 0x0000000000401128 Y 5 104 0x000000000040113c 0x000000000040113c 6 105 0x0000000000401146 0x0000000000401146 Y 7 END 0x0000000000401150 0x0000000000401150 Y And after this patch: INDEX LINE REL-ADDRESS UNREL-ADDRESS IS-STMT PROLOGUE-END EPILOGUE-BEGIN 0 101 0x000000000040110a 0x000000000040110a Y 1 END 0x0000000000401114 0x0000000000401114 Y 2 102 0x0000000000401128 0x0000000000401128 Y 3 103 0x0000000000401128 0x0000000000401128 Y 4 104 0x0000000000401128 0x0000000000401128 Y 5 END 0x0000000000401132 0x0000000000401132 Y 6 104 0x000000000040113c 0x000000000040113c 7 105 0x0000000000401146 0x0000000000401146 Y 8 END 0x0000000000401150 0x0000000000401150 Y Notice that we gained an extra entry, the END marker that was added at position #5 in the table. Now, does this matter? I cannot find any bugs that trigger because of this behaviour. So why fix it? First, the current behaviour is inconsistent, as we switch symtabs, we usually get an END marker in the previous symtab. But occasionally we don't. I don't like things that are inconsistent for no good reason. And second, as I said, I want to change the line table parsing. To do this I want to check that my new parser creates an identical table to the current parser. But my new parser naturally "fixes" this inconsistency, so I have two choices, do extra work to make my new parser bug-compatible with the current one, or fix the current one. I'd prefer to just fix the current line table parser. There's a test that includes the above example and checks that the END markers are put in the correct place. But as I said, I've not been able to trigger any negative behaviour from the current solution, so there's no test that exposes any broken behaviour. Approved-By: Tom Tromey <tom@tromey.com>
2025-02-14x86: drop redundant i.operands checks from output_disp()Jan Beulich1-3/+0
The opcode space, major opcode, and - where applicable - opcode extension checks fully qualify the insns we're after; operand matching has been done far earlier, so wrong operand counts cannot occur here.
2025-02-14x86: drop redundant checks from ISA-used version determinationJan Beulich1-2/+0
All F16C and all FMA insns are VEX-encoded; there's no need to check for their Cpu* attributes.
2025-02-14x86: correct ISA-used version recordingJan Beulich2-15/+21
Updating should be based solely on the current instruction. For example, recording of VEX-encoded insns as v3 should be independent of there being earlier AMX insns. Further for BASELINE only a very limited set of the GNU_PROPERTY_X86_FEATURE_2_* bits should actually be taken into account: Most of the bits represent advanced (later) features (XSAVE, XSAVEOPT, and XSAVEC for example being part of v3).
2025-02-14gas: fix rs_fill_nop listingJan Beulich4-2/+14
In commit a0094f1a70e1 ("gas: make .nops output visible in listing") I was wrongly assuming fr_fix would be zero for rs_fill_nop, when that's only a side effect of listing_newline() inserting dummy frags, but only when file/line did actually change from the previous invocation. This is in particular not going to be true when the .nops directive isn't the first statement on a line.
2025-02-14x86/APX: make .insn extended-EVEX capableJan Beulich6-25/+197
So far tricks had to be played to use .insn to encode extended-EVEX insns; the X4 bit couldn't be controlled at all. Extend the syntax just enough to cover all features, taking care to reject invalid feature combinations (albeit aiming at being as lax there as possible, to offer users as much flexibility as we can - we don't, after all, know what future will bring). In a pre-existing testcase replace all but one .byte; the one that needs to remain wants to have EVEX.U clear in a way that's neither controllable via AVX10/256 embedded rounding (would otherwise also set EVEX.ND), nor via the index register (EVEX.X4), as there's no memory operand. For one of the converted instances ModR/M.mod needs correcting: An 8-bit displacement requires that to be 1, not 2. Also adjust source comments to better represent what the bad insns mimic.
2025-02-14RISC-V: Add missing doc for OP_VKito Cheng1-0/+3
2025-02-14RISC-V: Add OP_VE for .insnKito Cheng6-4/+12
OP_VE is the opcode space for crypto vector instructions. Ref: https://github.com/riscv/riscv-isa-manual/blob/main/src/vector-crypto.adoc#crypto-vector-cryptographic-instructions
2025-02-14RISC-V: Make SSAMOSWAP.W available for rv64Hau Hsu3-4/+20
Previously we limited SSAMOSWAP.W only available on RV32, but it should be available on RV64 as well. See https://github.com/riscv/riscv-cfi/blob/main/src/cfi_backward.adoc https://github.com/riscv/riscv-isa-manual/blob/702a3e6e843235a2a13b918ae6938b04f8974ffc/src/unpriv-cfi.adoc#L789
2025-02-14Automatic date update in version.inGDB Administrator1-1/+1
2025-02-14dlltool memory leaksAlan Modra3-134/+118
dlltool copies strings with strdup all over the place, seeming to take the attitude that anything might be modified. That leads to lots of memory leaks. Fixing the leaks by removing the strdup calls of course means you need to take good care that strings *aren't* modified. This isn't as easy as it sounds due to functions like xlate that have const char* params but then manage to modify the strings. I've fixed xlate, but if I've missed something somewhere then this patch likely will break dlltool. Testsuite coverage of dlltool isn't good. The leaks in defparse.y are small. It also is a little work to verify that all the strings I'm freeing in defparse.y are in fact malloc'd, which is no doubt why the leaks are there. Using bfd_xalloc in make_one_lib_file and functions called from there results in memory being freed automatically at the bfd_close in make_one_lib_file, without any fuss. The patch also makes use of xasprintf to replace xmalloc followed by sprintf. * defparse.y (opt_name2): Free incoming ID strings after adding prefix/suffix. * dlltool.c (struct ifunct): Constify char* fields. (struct iheadt, struct dlist): Likewise. (set_dll_name_from_def, def_heapsize, def_stacksize), (def_section, assemble_file): Use xasprintf. (def_name, def_library): Free dll_name and name. (def_description, new_directove): Don't strdup incoming args. (append_import): Likewise. (def_import): Free module after appending dllext. (run): Free temp_base. (scan_filtered_symbols): Don't segfault on NULL strchr return. Remove unnecessary strdup. (scan_drectve_symbols): Likewise. Constify pointers. Use bfd_malloc_and_get_section. Use xmemdup. (add_excludes): Use xasprintf and xstrdup. (gen_exp_file): Free xlate return. Constify pointer to suit struct changes. Free copy. (xlate): Always copy arg. Use xasprintf and xstrdup. (make_imp_label): Add bfd arg. Use bfd_xalloc. (gen_lib_file): Adjust to suit. (make_one_lib_file): Likewise. Use bfd_xalloc for section data and relocs. Simplify code calling xlate, and free xlate return. (dll_name_list_free_contents): Flatten recursion. (mangle_defs): Free d_export_vec. (main): Formatting. Use xasprintf. * resres.c (write_res_id): Free section data.
2025-02-14gas: replace bfd_alloc with notes_allocAlan Modra2-9/+3
bfd_alloc can return NULL on out-of-memory so code needs to check the return value and print an error. That check was missing in write.c. notes_alloc won't return NULL, instead the underlying obstack_alloc prints an OOM message and the process exits. This is more convenient, and when the bfd_alloc memory is attached to the gas output bfd it is released only slightly before the notes obstack. * config/obj-macho.c (obj_mach_o_set_indirect_symbols): Use notes_calloc rather than bfd_zalloc. * write.c (set_symtab): Use notes_alloc.
2025-02-14gas obj-coff memory leaksAlan Modra4-25/+40
This patch addresses memory leaks in gas that show up when running the testsuite on x86_64-w64-mingw32. The seh_ctx_cur, and weak sym naming leaks can occur many times during assembly. The symbol hook and section leaks are not so important since this memory needs to persist until closing the output bfd. * config/obj-coff-seh.c (do_seh_endproc): Free seh_ctx_cur and its fields. * config/obj-coff-seh.h (struct seh_context): Remove unused "next" field. * config/obj-coff.c (coff_obj_symbol_new_hook): Use notes_alloc for aux entries. (coff_obj_symbol_clone_hook): Likewise. (obj_coff_def): Don't strdup name unless we need to do so for tc_canonicalize_symbol_name. Free after making symbol. (weak_name2altname, weak_altname2name): Return a char*. (weak_uniquify): Use notes_concat. (pecoff_obj_set_weak_hook, pecoff_obj_clear_weak_hook): Free name returned by weak_name2altname. (coff_frob_symbol): Similarly for weak_altname2name. (obj_coff_section): Use notes_memdup0. * symbols.h: Add include guard. (notes_memdup0): New inline function.
2025-02-13Remove assumption from py-symbol.expTom Tromey1-8/+12
The current py-symbol.exp test makes an assumption about which symbol will be returned first. I don't think gdb should really make promises about the order in which the symbols are listed, though, and a series I am working on changes this behavior. This patch changes the test to merely ensure that both symbols are returned. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-02-13Update my maintenance areas in MAINTAINERS fileKevin Buettner1-5/+0
I've dropped maintenance of the mep target. Additionally, I'm removed myself as an authorized committer for PowerPC, ia64, AIX, and GNU/Linux PPC native.
2025-02-13gdb, testsuite: Rename set_sanitizer procedures to append_environment.Christina Schimpe6-16/+16
The procedures set_sanitizer_1, set_sanitizer and set_sanitizer_default are used for the configuration of ASAN specific environment variables. However, they are actually generic. Rename them to append_environment* so that their purpose is more clear. Approved-By: Tom Tromey <tom@tromey.com>
2025-02-13aarch64: fix a crash during maintenance print cooked-registersKlaus Gerlicher1-0/+3
On aarch64 with pauth enabled a crash when can be seen when using "maintenance print cooked-registers". This happens because the register dump code tries to read a pseudo reg that is not handled here because it is supposedly only used in unwinding. Fix this by returning a zero value typed as a built-in uint64. Approved-By: Luis Machado <luis.machado@arm.com>
2025-02-13Automatic date update in version.inGDB Administrator1-1/+1
2025-02-12Reorder gnatmake arguments in inline-section-gc.exp, againTom Tromey1-3/+9
Tom de Vries pointed out that commit 8cfa1fc4 ("Reorder gnatmake arguments in inline-section-gc.exp") caused a regression with an older version of dejagnu. This patch works around that problem by further reordering the arguments to gnatmake and also arranging to leave gnatmake in "-margs" mode.
2025-02-12Add copyright header to gnat_debug_info_test.adbTom Tromey1-0/+15
I noticed that gdb/testsuite/lib/gnat_debug_info_test.adb is missing a copyright header. This adds one, using the date range from the original commit.
2025-02-11gdb: cleanup includes in mi/Simon Marchi10-20/+1
Remove a few includes reported as unused by clangd. Change-Id: I7365b7cce04c9ef1a4164764191303914da42ef9
2025-02-12Automatic date update in version.inGDB Administrator1-1/+1
2025-02-11gdb: remove check for minimal symbols in 'start_command'Rohr, Stephan1-6/+0
GDB aborts the 'start' command if the minimal symbols cannot be resolved. On Windows, GDB reads the minimal symbols from the COFF header of the PE file. The symbol table is deprecated and the number of symbols in the COFF header may be zero: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format This is reproducible with clang version 18.1.8 on Windows: clang++ -g -O0 -gdwarf -fuse-ld=lld test.cpp -o test_clang The COFF file header shows: FILE HEADER VALUES 8664 machine (x64) E number of sections 66E889EC time date stamp Mon Sep 16 21:41:32 2024 FB400 file pointer to symbol table 0 number of symbols F0 size of optional header 22 characteristics GDB is not able to read the minimal symbols; the `start' command fails with an error: (gdb) start No symbol table loaded. Use the "file" command. Manually inserting a breakpoint in main works fine: (gdb) tbreak main Temporary breakpoint 1 at 0x14000100c: file test.cpp, line 6. (gdb) run Starting program: C:\test-clang Temporary breakpoint 1, main () at test.cpp:6 6 std::cout << "Hello World.\n"; Remove the check entirely; a 'NOT_FOUND_ERROR' is thrown if 'main' cannot be resolved. The error is consumed in 'create_breakpoint ()' and an error message is displayed to the user. Approved-by: Kevin Buettner <kevinb@redhat.com> Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
2025-02-11gdb/dwarf: rename cooked_index::m_vector to m_shardsSimon Marchi2-19/+19
I think that is clearer and helps readability. Rename a few iteration variables from "index" or "idx" to "shard". In my mental model, the "index" is the whole thing, so it's confusing to use that word when referring to shards. Change-Id: I208cb839e873c514d1f8eae250d4a16f31016148 Approved-By: Tom Tromey <tom@tromey.com>
2025-02-11gdb/dwarf: remove cooked_index::vec_typeSimon Marchi2-8/+5
I find this typedef to be confusing. The name is a bit too generic, so it's not clear what it represents. When using the typedef for a cooked_index_shard unique pointer, I think that spelling out the vector type is not overly long. Change-Id: I99fdab5cd925c37c3835b466ce40ec9c1ec7209d Approved-By: Tom Tromey <tom@tromey.com>