aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-10-06[gdb] Fix more common misspellingsTom de Vries10-10/+10
Fix the following common misspellings: ... addres -> address, adders behavour -> behavior, behaviour intented -> intended, indented ther -> there, their, the throught -> thought, through, throughout ... Tested on x86_64-linux.
2024-10-06[gdb] Fix common misspellingsTom de Vries112-176/+176
Fix the following common misspellings: ... accidently -> accidentally additonal -> additional addresing -> addressing adress -> address agaisnt -> against albiet -> albeit arbitary -> arbitrary artifical -> artificial auxillary -> auxiliary auxilliary -> auxiliary bcak -> back begining -> beginning cannonical -> canonical compatiblity -> compatibility completetion -> completion diferent -> different emited -> emitted emiting -> emitting emmitted -> emitted everytime -> every time excercise -> exercise existance -> existence fucntion -> function funtion -> function guarentee -> guarantee htis -> this immediatly -> immediately layed -> laid noone -> no one occurances -> occurrences occured -> occurred originaly -> originally preceeded -> preceded preceeds -> precedes propogate -> propagate publically -> publicly refering -> referring substract -> subtract substracting -> subtracting substraction -> subtraction taht -> that targetting -> targeting teh -> the thier -> their thru -> through transfered -> transferred transfering -> transferring upto -> up to vincinity -> vicinity whcih -> which whereever -> wherever wierd -> weird withing -> within writen -> written wtih -> with doesnt -> doesn't ... Tested on x86_64-linux.
2024-10-06[gdb/contrib] Add spellcheck.shTom de Vries1-0/+287
I came across a table containing common misspellings [1], and wrote a script to detect and correct these misspellings. The table also contains entries that have alternatives, like this: ... addres->address, adders ... and for those the script prints a TODO instead. The script downloads the webpage containing the table, extracts the table and caches it in .git/wikipedia-common-misspellings.txt to prevent downloading it over and over again. Example usage: ... $ gdb/contrib/spellcheck.sh gdb* ... ChangeLog files are silently skipped. Checked with shellcheck. Tested on x86_64-linux, by running it on the gdb* dirs on doing a build and test run. The results of running it are in the two following patches. Reviewed-By: Andrew Burgess <aburgess@redhat.com> Approved-By: Tom Tromey <tom@tromey.com> [1] https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2024-10-06Automatic date update in version.inGDB Administrator1-1/+1
2024-10-05objcopy fixes for commit 68bbe1183379Alan Modra1-5/+11
* objcopy.c (is_specified_symbol): Handle NULL name. (filter_symbols): Drop syms with a NULL name.
2024-10-05elf.c and elflink.c fixes for commit 68bbe1183379Alan Modra2-16/+26
Plus some tidies to swap_out_syms. * elf.c (swap_out_syms): Handle NULL sym name. Use correct type for return of _bfd_elf_strtab_add. Simplify. * elflink.c (bfd_elf_match_symbols_in_sections): Handle NULL sym name.
2024-10-05Automatic date update in version.inGDB Administrator1-1/+1
2024-10-04gdb segv in elfread.c:elf_rel_plt_readAlan Modra1-0/+2
After commit 68bbe1183379, ELF symbols read via bfd_canonicalize_symtab and similar functions which have bad st_name fields will have NULL in the name rather than "(null)". gdb.base/bfd-errors.exp deliberately creates a faulty shared library with st_name pointing outside of .dynsym for some symbols, and thus now results in NULL symbol names. This triggers a segv on string_buffer.assign(name). Fix that.
2024-10-04dlltool fixes for commit 68bbe1183379Alan Modra1-4/+5
For some reason, dlltool supports mcore-elf input files. * dlltool.c (filter_symbols): Drop symbols with NULL names. (identify_member_contains_symname): Don't consider symbols with NULL names.
2024-10-04is_target_special_symbol fixes for commit 68bbe1183379Alan Modra3-3/+13
* elf.c (_bfd_elf_is_local_label_name): Don't segv on NULL name. * elf32-v850.c (v850_elf_is_local_label_name): Likewise. * elfnn-riscv.c (riscv_elf_is_target_special_symbol): Likewise.
2024-10-04get_synthetic_symtab fixes for commit 68bbe1183379Alan Modra6-132/+158
Given that relocation symbol name can now be NULL for ELF, adjust various get_synthetic_symtab routines so they don't segfault. * elf.c (_bfd_elf_get_synthetic_symtab): Cope with sym->name possibly being NULL. * elf32-arm.c (elf32_arm_get_synthetic_symtab): Likewise. * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise. * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise. * elfxx-mips.c (_bfd_mips_elf_get_synthetic_symtab): Likewise. * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Likewise.
2024-10-04bfd_elf_sym_name_rawAlan Modra4-10/+21
Many uses of bfd_elf_sym_name report errors. They ought to not return a NULL, as was the case prior to commit 68bbe1183379. Introduce a new function for cases where we'd like to know there is a problem with a symbol st_name. * elf-bfd.h (bfd_elf_sym_name_raw): Declare. * elf.c (bfd_elf_sym_name_raw): New function. (bfd_elf_sym_name): Revert to behaviour prior to 68bbe1183379, but returning "<null>" rather than "(null)" for st_name errors. (group_signature): Use bfd_elf_sym_name_raw. * elfcode.h (elf_slurp_symbol_table): Likewise. * elf32-i386.c (elf_i386_scan_relocs): Whitespace.
2024-10-04gas: hide emulation struct format_ops instances when not neededJan Beulich7-114/+131
Most targets don't even support emulations, so this data (and certain functions) are entirely dead code for them.
2024-10-04x86: prune OBJ_MAYBE_... usesJan Beulich3-169/+113
With the removal of emulations, OBJ_MAYBE_... can no longer be defined. Tidy code wherever they're used, which also includes the dropping of most IS_ELF and uses and checks of OUTPUT_FLAVOR. Where touching such constructs anyway, also drop TE_PEP checks when used together with TE_PE ones (the former implies the latter).
2024-10-04x86: drop largely defunct gas emulationsJan Beulich10-185/+2
Both ELF and COFF have various sub-flavors, each of which would then require its own emulation: Right now when configuring a COFF/PE secondary target (with perhaps an ELF primary one), one gets plain COFF emulation rather than COFF/PE one. As such a multitude of emulations would be unwieldy (and likely fragile) drop gas emulations altogether instead.
2024-10-04include: de-duplicate i386.h and x86_64.hJan Beulich4-73/+62
Move common definitions to a new x86.h, thus allowing gas'es obj-coff.h to include just that, getting rid of a TE_PEP compile-time dependency.
2024-10-04gas: drop generate_asm_lineno emulation hookJan Beulich5-14/+0
It's not wired up, so can't be used.
2024-10-04gas: don't use COFF-specific SF_SET_LOCAL() directly from read.cJan Beulich8-3/+23
Make this a proper obj-format hook instead.
2024-10-04gas/dw2gencfi: correct .sframe section conditionalJan Beulich1-6/+5
While originally this was in preparation of a subsequent change making SUPPORT_FRAME_LINKONCE potentially dependent on a global variable, the construct appears unlikely to have been correct in the first place: The variable would have been passed reliably uninitialized when SUPPORT_FRAME_LINKONCE is build-time true. While there correct indentation of the parameters passed to get_cfi_seg().
2024-10-04gas: put emul decls in emul.hJan Beulich3-5/+5
The individual struct emulation instances shouldn't be declared in a .c file; it and the producers of the symbols want to both see the declarations, so declarations and definitions don't go out of sync. Move these declarations to emul.h. While there also adjust the conditional around this_format: That symbol is never #define-d anywhere, and it's needed only when USE_EMULATIONS is defined. (Really, when obj-multi isn't in use, it also is effectively only ever written to.)
2024-10-04gas: drop unused fields from struct emulationJan Beulich9-76/+0
Neither .match not .bfd_name appear to ever have been used in the last about 25 years. Purge them.
2024-10-04MAINTAINERS: move M R Swami Reddy to Past MaintainersJan Beulich1-2/+1
He/she cannot be reached at the given address anymore, and the name is apparently too common to identify the person to attempt to establish another contact. Sadly this orphans the CR16 and CRx ports.
2024-10-04MAINTAINERS: move Matt Thomas to Past MaintainersJan Beulich1-2/+1
Matt cannot be reached at the @netbsd.org address anymore, and I was unable to find another one, even with the help of the NetBSD community (where his resigning was announced over 4 years ago [1]). [1] http://mail-index.netbsd.org/netbsd-announce/2020/05/07/msg000314.html
2024-10-04Automatic date update in version.inGDB Administrator1-1/+1
2024-10-03gdb-dap: disable events when deleting breakpointsoltolm1-3/+3
when I disable a breakpoint in VS Code the breakpoint is removed instead. I compared the behavior to lldb-dap and disabled events when removing a breakpoint. Now it is possible to disable and enable breakpoints in VS Code.
2024-10-03bfd: fix unnecessary bfd.info regenAlexey Izbyshev2-2/+2
When building from an unmodified release tarball, a REGEN_TEXI invocation is supposed to create a symlink to the .texi file in the source directory and discard the newly generated .tmp file. However, after commit bd32be01c997 ("bfd: merge doc subdir up a level") it creates the symlink at the wrong level, and then a .texi with a fresh timestamp, which in turn forces bfd.info regeneration. This breaks builds in environments without makeinfo program. Fix this by creating the symlink at the level of the target stamp. Fixes: bd32be01c997 ("bfd: merge doc subdir up a level") Signed-off-by: Alexey Izbyshev <izbyshev@ispras.ru>
2024-10-03peicode.h formattingAlan Modra1-69/+76
Fix some overlong line, comment block style, whitespace issues.
2024-10-03Enable dlltool --leading-underscore for targets other than x86Alan Modra2-57/+7
This also makes the dlltool tests run more PE targets, finding that sh-pe dlltool reports "Machine 'sh' not supported". I guess no one cares about that. PR19459 * dlltool.c (asm_prefix): Remove "mach" parameter. Return leading_underscore independent of machine. (ASM_PREFIX): Adjust. * testsuite/binutils-all/dlltool.exp: Run on any target satisfying is_pecoff_format for which dlltool is built. Revert commit 0398b8d6c86a. Remove target_xfail.
2024-10-03dlltool leading_underscoreAlan Modra1-42/+25
This patch tidies dlltool code dealing with adding a leading underscore to generated symbol names. There should be no functional change here, but there could be if we ever have a bfd target with symbol_leading_char something other than '_' or 0. * dlltool.c (leading_underscore): Change from an int to a char*. Update all uses. If neither --leading-underscore or --no=leading-underscore is given, set leading_underscore to a string with first char returned by bfd_get_target_info as the target's symbol underscoring.
2024-10-03nm: don't try to print line numbers for symbols without namesAlan Modra1-3/+3
It doesn't make much sense trying to print line numbers for what are usually broken symbols, and there is a possibility of a segfault if we pass strcmp a NULL.
2024-10-03Don't return "(null)" from bfd_elf_sym_nameAlan Modra6-24/+24
A NULL return from bfd_elf_string_from_elf_section indicates an error. That shouldn't be masked by bfd_elf_sym_name but rather passed up to callers such as group_signature. If we want to print "(null)" then that should be done at a higher level. That's what this patch does, except that I chose to print "<null>" instead, like readelf. If we see "(null)" we're probably passing a NULL to printf. I haven't changed aoutx.h or pdp11.c print_symbol functions because they already handle NULL names by omitting the name. I also haven't changed mach-o.c, mmo.c, som.c, srec.c, tekhex.c, vms-alpha.c and wasm-module.c print_symbol function because it looks like they will never have NULL symbol names. bfd/ * elf.c (bfd_elf_sym_name): Don't turn a NULL name into a pointer to "(null)". (bfd_elf_print_symbol): Print "<null>" for NULL symbol names. * coffgen.c (coff_print_symbol): Likewise. * ecoff.c (_bfd_ecoff_print_symbol): Likewise. * pef.c (bfd_pef_print_symbol): Likewise. * syms.c (bfd_symbol_info): Return "<null>" in symbol_info.name if symbol name is NULL. ld/ * ldlang.c (ld_is_local_symbol): Don't check for "(null)" symbol name.
2024-10-03Automatic date update in version.inGDB Administrator1-1/+1
2024-10-02gprofng: fix a problem with hardware event countersRuud van der Pas1-325/+441
Fix a bug where an experiment with hardware event counter data causes the source and disassembly files not to be generated. No longer suppress zero valued metrics and change the name of the man page in a warning message. Adapt line lengths to not exceed 79. gprofng/ChangeLog 2024-09-24 Ruud van der Pas <ruud.vanderpas@oracle.com> PR 32193 PR 32199 PR 32201 * gp-display-html/gp-display-html.in: Implement all the above changes.
2024-10-02gdb: more file name stylingAndrew Burgess4-23/+41
While looking at the recent line number styling commit I noticed a few places where we could add more file name styling. So lets do that. Approved-By: Tom Tromey <tom@tromey.com>
2024-10-02Add support for IMPORT_NAME_EXPORTAS in ILF (MSVC style) import librariesMartin Storsjö2-7/+37
This import name type is formally yet undocumented, but MSVC produces/supports it, primarily for ARM64EC import libraries. LLVM/LLD also supports this import name type. Since recently, llvm-dlltool also uses this type for certain kinds of renamed imports (that are easy to do in the long style import libraries produced by GNU dlltool, but require this name type in short import libraries). This name type contains a third string, in addition to the symbol name and the DLL name, indicating the actual imported name to reference in the import tables - which now can be distinct different from the symbol name on the object file level. https://github.com/llvm/llvm-project/commit/8f23464a5d957242c89ca6f33d4379c42519cd81 and https://github.com/llvm/llvm-project/commit/7b275aa2438c22604505d618dd37ee60052f2800 show how this import name type was added in LLVM. Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02Automatic date update in version.inGDB Administrator1-1/+1
2024-10-01Introduce and use operation::type_pTom Tromey7-20/+32
There's currently code in gdb that checks if an expression evaluates to a type. In some spots this is done by comparing the opcode against OP_TYPE, but other spots more correctly also compare with OP_TYPEOF and OP_DECLTYPE. This patch cleans up this area, replacing opcode-checking with a new method on 'operation'. Generally, checking the opcode should be considered deprecated, although it's unfortunately difficult to get rid of opcodes entirely. I also took advantage of this change to turn eval_op_type into a method, removing a bit of indirection. Reviewed-by: Keith Seitz <keiths@redhat.com>
2024-10-01Automatic date update in version.inGDB Administrator1-1/+1
2024-10-01Re: dlltool: file name too longAlan Modra1-36/+22
Allow for "snnnnn.o" suffix when testing against NAME_MAX, and tidy TMP_STUB handling by overwriting a prior nnnnn.o string rather than copying the entire name. * dlltool.c (TMP_STUB): Add "nnnnn.o" to format. (make_one_lib_file): Localise variables. Don't copy TMP_STUB, overwrite suffix instead. (gen_lib_file): Similarly. (main): Allow for max suffix when testing against NAME_MAX.
2024-10-01segv in read_a_source_fileAlan Modra1-0/+1
On some paths through read_a_source file, "s" may not be set. * read.c (read_a_source_file): Correct code ignoring comment.
2024-10-01segv in bfd_elf_get_str_sectionAlan Modra2-2/+3
Attempting to write a termination NUL to PROT_READ mmap'd memory was a silly idea. PR 32109 * elf.c (bfd_elf_get_str_section): Don't write terminating NUL if missing. * libbfd.c (_bfd_munmap_readonly_temporary): Correct comment.
2024-09-30Add line-number stylingTom Tromey28-55/+131
This patch adds separate styling for line numbers. That is, whenever gdb prints a source line number, it uses this style. v2 includes a change to ensure that %ps works in query. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Reviewed-by: Keith Seitz <keiths@redhat.com>
2024-09-30Improve the placement of orphan note sections.Nick Clifton14-13/+71
PR 32219
2024-09-30gdb: fix filename completion in the middle of a lineAndrew Burgess2-4/+189
I noticed that filename completion in the middle of a line doesn't work as I would expect it too. For example, assuming '/tmp/filename' exists, and is the only file in '/tmp/' then when I do the following: (gdb) file "/tmp/filen<TAB> GDB completes to: (gdb) file "/tmp/filename" But, if I type this: (gdb) file "/tmp/filen "xxx" Then move the cursor to the end of '/tmp/filen' and press <TAB>, GDB will complete the line to: (gdb) file "/tmp/filename "xxx" But GDB will not insert the trailing double quote character. The reason for this is found in readline/readline/complete.c in the function append_to_match. This is the function that appends the trailing closing quote character, however, the closing quote is only inserted if the cursor (rl_point) is at the end (rl_end) of the line being completed. In this patch, what I do instead is add the closing quote in the function gdb_completer_file_name_quote, which is called from readline through the rl_filename_quoting_function hook. The docs for rl_filename_quoting_function say (see 'info readline'): "... The MATCH_TYPE is either 'SINGLE_MATCH', if there is only one completion match, or 'MULT_MATCH'. Some functions use this to decide whether or not to insert a closing quote character. ..." This is exactly what I'm doing in this patch, and clearly this is not an unusual choice. Now after completing a filename that is not at the end of the line GDB will add the closing quote character if appropriate. I have managed to write some tests for this. I send a line of text to GDB which includes a partial filename followed by a trailing string, I then send the escape sequence to move the cursor left, and finally I send the tab character. Obviously, expect doesn't actually see the complete output with the extra text "in place", instead expect sees the original line followed by some escape sequences to reflect the cursor movement, then an escape sequence to indicate that text is being inserted in the middle of a line, followed by the new characters ... it's a bit messy, but I think it holds together. Reviewed-By: Tom Tromey <tom@tromey.com>
2024-09-30gdb: fix for completing a second filename for a commandAndrew Burgess2-103/+121
After the recent filename completion changes I noticed that the following didn't work as expected: (gdb) file "/path/to/some/file" /path/to/so<TAB> Now, I know that the 'file' command doesn't actually take multiple filenames, but currently (and this was true before the recent filename completion changes too) the completion function doesn't know that the command only expects a single filename, and should complete any number of filenames. And indeed, this works: (gdb) file "/path/to/some/file" "/path/to/so<TAB> In this case I quoted the second path, and now GDB is happy to offer completions. It turns out that the problem in the first case is an off-by-one bug in gdb_completer_file_name_char_is_quoted. This function tells GDB if a character within the line being completed is escaped or not. An escaped character cannot be a word separator. The algorithm in gdb_completer_file_name_char_is_quoted is to scan forward through the line keeping track of whether we are inside double or single quotes, or if a character follows a backslash. When we find an opening quote we skip forward to the closing quote and then check to see if we skipped over the character we are looking for, if we did then the character is within the quoted string. The problem is that this "is character inside quoted string" check used '>=' instead if '>'. As a consequence a character immediately after a quoted string would be thought of as inside the quoted string. In our first example this means that the single white space character after the quoted string was thought to be quoted, and was not considered a word breaking character. As such, GDB would not try to complete the second path. And indeed, if we tried this: (gdb) file "/path/to/some/file" /path/to/so<TAB> That is, place multiple spaces after the first path, then GDB would consider the first space as quoted, but the second space is NOT quoted, and would be a word break. Now GDB does complete the second path. By changing '>=' to '>' in gdb_completer_file_name_char_is_quoted this bug is resolved, now the original example works and GDB will correctly complete the second path. For testing I've factored out the core of one testing proc, and I now run those tests multiple times, once with no initial path, once with an initial path in double quotes, once with an initial path in single quotes, and finally, with an unquoted initial path. Reviewed-By: Tom Tromey <tom@tromey.com>
2024-09-30gdb/MAINTAINERS: add myself to maintainersGerlicher, Klaus1-0/+1
2024-09-30gdb: Remove myself as x86 maintainer and update my emailFelix Willgerodt1-3/+2
2024-09-30gdb, testsuite: clean duplicate header includesGerlicher, Klaus14-15/+0
Some of the gdb and testsuite files double include some headers. While all headers use include guards, it helps a bit keeping the code base tidy. No functional change. Approved-by: Kevin Buettner <kevinb@redhat.com>
2024-09-30Automatic date update in version.inGDB Administrator1-1/+1
2024-09-29Automatic date update in version.inGDB Administrator1-1/+1