aboutsummaryrefslogtreecommitdiff
path: root/gdb/contrib
AgeCommit message (Collapse)AuthorFilesLines
2024-06-15[gdb/testsuite] Clean up formatting in gdb/contrib/cc-with-tweaks.shTom de Vries1-20/+20
In emacs, on gdb/contrib/cc-with-tweaks.sh, do: - M-x whitespace-cleanup, - M-x mark-whole-buffer and M-x indent-region, and - and undo the unwanted changes in the header comment. Only whitespace changes. Tested on x86_64-linux. Approved-by: Kevin Buettner <kevinb@redhat.com>
2024-06-15[gdb/testsuite] Clean up gdb/contrib/cc-with-tweaks.shTom de Vries1-14/+19
Fix shellcheck warnings in script gdb/contrib/cc-with-tweaks.sh. Tested on x86_64-linux. Approved-by: Kevin Buettner <kevinb@redhat.com>
2024-06-15[gdb/testsuite] Clean up gdb/contrib/expect-read1.shTom de Vries1-5/+20
Clean up script gdb/contrib/expect-read1.sh by: - fixing shellcheck warnings, - using mktemp (which takes TMPDIR into account) instead of a hardcoded "/tmp/expect-read1.$$.so", - adding comments, and - adding emacs / vi settings for local tab size 2 (copied from ./ltmain.sh). Tested on x86_64-linux. Approved-by: Kevin Buettner <kevinb@redhat.com>
2024-01-12Update copyright year range in header of all files managed by GDBAndrew Burgess10-10/+10
This commit is the result of the following actions: - Running gdb/copyright.py to update all of the copyright headers to include 2024, - Manually updating a few files the copyright.py script told me to update, these files had copyright headers embedded within the file, - Regenerating gdbsupport/Makefile.in to refresh it's copyright date, - Using grep to find other files that still mentioned 2023. If these files were updated last year from 2022 to 2023 then I've updated them this year to 2024. I'm sure I've probably missed some dates. Feel free to fix them up as you spot them.
2023-11-27[gdb/testsuite] Add boards/cc-with-index-cache.expTom de Vries1-0/+12
We have a target board cc-with-gdb-index that uses the gdb-add-index script to add a .gdb_index index to an exec. There is however an alternative way of adding a .gdb_index: the index-cache. Add a new target board cc-with-index-cache. This is not superfluous for two reasons: - there is functionality that gdb-add-index doesn't support, but the index-cache does: the index-cache can add an index to an exec with a .gnu_debugaltlink (note that when using the cc-with-gdb-index board this case is quietly ignored), and - using the index-cache is excercised in only a few test-cases, and having this target board extends the test coverage to the entire test suite. This is for instance relevant because the index-cache is written by a worker thread in the background, so we can check more thoroughly for data races (see PR symtab/30837). Tested on x86_64-linux. Shell script changes checked with shellcheck. Approved-By: Tom Tromey <tom@tromey.com>
2023-08-31[gdb/contrib] Require minimal dwz version in cc-with-tweaks.shTom de Vries1-0/+18
I usually run target boards cc-with-dwz and cc-with-dwz-m using a dwz build from current trunk, but the pathname to the build dir changed and I forgot to update my test scripts, so the test scripts reverted to using system dwz, version 0.12. Consequently, I ran into: ... (gdb) p ZERO^M No symbol "ZERO" in current context.^M (gdb) FAIL: gdb.base/enumval.exp: p ZERO ... which is due to PR dwz/24468, which was fixed in version 0.13. Fix this by minimally requiring dwz version 0.13 in cc-with-tweaks.sh, such that this situation is detected and we get instead: ... gdb compile failed, cc-with-tweaks.sh: dwz version 0.12 detected, version \ 0.13 or higher required ... Tested on x86_64-linux, verified with shellcheck. Approved-By: Tom Tromey <tom@tromey.com>
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker10-10/+10
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-10-14[gdb/contrib] Handle STRIP_ARGS_{STRIP,KEEP}_DEBUG in cc-with-tweaks.shTom de Vries1-2/+7
Handle new environment variable STRIP_ARGS_STRIP_DEBUG, defaulting to --strip-debug in gdb/contrib/cc-with-tweaks.sh, such that we can easily reproduce the PR29277 assert using: ... $ export STRIP_ARGS_STRIP_DEBUG=--strip-all $ make check RUNTESTFLAGS="gdb.base/jit-reader.exp \ --target_board cc-with-gnu-debuglink" ... For completeness sake and to avoid confusion about which of the two used strip invocations the passed args apply to, likewise add STRIP_ARGS_KEEP_DEBUG, defaulting to --only-keep-debug. Script checked with shellcheck, no new warnings added. Tested on x86_64-linux.
2022-10-12[gdb/contrib] Use OBJCOPY everywhere in cc-with-tweaks.shTom de Vries1-1/+1
I noticed that the $want_gnu_debuglink code in gdb/contrib/cc-with-tweaks.sh uses objcopy instead of $OBJCOPY. Fix this. Script checked with shellcheck, no new warnings added. Tested on x86_64-linux.
2022-04-26gdb: make some random Python files Python 3-compatibleSimon Marchi1-15/+15
I noticed that these files failed to format with Black, because they use print without parenthesis (which isn't Python 3 compatible). I don't know if these files are still relevant, but the change is trivial, so here it is. Change-Id: I116445c2b463486016f824d32effffc915b60766
2022-02-25gdb-add-index: disable debuginfodAaron Merey1-0/+1
gdb-add-index may trigger debuginfod's first-use notice. The notice is misleading in this case. It instructs the user to modify .gdbinit in order to permanently enable/disable debuginfod but gdb-add-index invokes gdb with -nx which ignores .gdbinit. Additionally debuginfod is not needed for gdb-add-index since the symbol file is given as an argument and should already be present locally. Fix this by disabling debuginfod when gdb-add-index invokes gdb.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker10-10/+10
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-08-02[gdb/testsuite] Fix gdb.dwarf2/fission-relative-dwo.exp with cc-with-gdb-indexTom de Vries1-0/+14
When running with target board cc-with-gdb-index, we run into: ... gdb compile failed, warning: Could not find DWO CU \ fission-relative-dwo.dwo(0x1234) referenced by CU at offset 0xc7 \ [in module outputs/gdb.dwarf2/fission-relative-dwo/.tmp/fission-relative-dwo] UNTESTED: gdb.dwarf2/fission-relative-dwo.exp: fission-relative-dwo.exp ERROR: failed to compile fission-relative-dwo ... The problem is that: - the .dwo file is found relative to the executable, and - cc-with-tweaks.sh moves the executable to a temp dir, but not the .dwo file. Fix this by copying the .dwo file alongside the executable in the temp dir. Verified changes using shellcheck. Tested on x86_64-linux. gdb/ChangeLog: 2021-08-02 Tom de Vries <tdevries@suse.de> * contrib/cc-with-tweaks.sh: Copy .dwo files alongside executable.
2021-05-21[gdb/testsuite] Add target board cc-with-gnu-debuglink.expTom de Vries1-1/+45
Add target board cc-with-gnu-debuglink.exp that splits off debuginfo into a seperate .debug file and links to it using .gnu_debuglink. Tested on x86_64-linux. gdb/ChangeLog: 2021-05-21 Tom de Vries <tdevries@suse.de> PR testsuite/25047 * contrib/cc-with-tweaks.sh: Handle -l. gdb/testsuite/ChangeLog: 2021-05-21 Tom de Vries <tdevries@suse.de> PR testsuite/25047 * boards/cc-with-gnu-debuglink.exp: New file.
2021-05-10[PR gdb/27614] gdb-add-index fails on symlinks.Lancelot SIX1-0/+28
PR 27614 shows that gdb-add-index fails to generate the index when its argument is a symlink. The following one liner illustrates the reported problem: $ echo 'int main(){}'|gcc -g -x c -;ln -s a.out symlink;gdb-add-index symlink gdb-add-index: No index was created for symlink gdb-add-index: [Was there no debuginfo? Was there already an index?] $ ls -l -rwxr-xr-x 1 25712 Mar 19 23:05 a.out* -rw------- 1 8277 Mar 19 23:05 a.out.gdb-index lrwxrwxrwx 1 5 Mar 19 23:05 symlink -> a.out* GDB generates the .gdb-index file with a name that matches the name of the actual program (a.out.gdb-index here), not the symlink that references it. The remaining of the script is looking for a file named after the provided argument (would be 'symlink.gdb-index' in our example). gdb/ChangeLog: PR gdb/27614 * contrib/gdb-add-index.sh: Fix when called with a symlink as an argument. gdb/testsuite/ChangeLog: PR gdb/27614 * gdb.dwarf2/gdb-add-index-symlink.exp: New test.
2021-05-07gdb: re-format Python files using black 21.4b0Simon Marchi1-143/+160
Re-format all Python files using black [1] version 21.4b0. The goal is that from now on, we keep all Python files formatted using black. And that we never have to discuss formatting during review (for these files at least) ever again. One change is needed in gdb.python/py-prettyprint.exp, because it matches the string representation of an exception, which shows source code. So the change in formatting must be replicated in the expected regexp. To document our usage of black I plan on adding this to the "GDB Python Coding Standards" wiki page [2]: --8<-- All Python source files under the `gdb/` directory must be formatted using black version 21.4b0. This specific version can be installed using: $ pip3 install 'black == 21.4b0' All you need to do to re-format files is run `black <file/directory>`, and black will re-format any Python file it finds in there. It runs quite fast, so the simplest is to do: $ black gdb/ from the top-level. If you notice that black produces changes unrelated to your patch, it's probably because someone forgot to run it before you. In this case, don't include unrelated hunks in your patch. Push an obvious patch fixing the formatting and rebase your work on top of that. -->8-- Once this is merged, I plan on setting a up an `ignoreRevsFile` config so that git-blame ignores this commit, as described here: https://github.com/psf/black#migrating-your-code-style-without-ruining-git-blame I also plan on working on a git commit hook (checked in the repo) to automatically check the formatting of the Python files on commit. [1] https://pypi.org/project/black/ [2] https://sourceware.org/gdb/wiki/Internals%20GDB-Python-Coding-Standards gdb/ChangeLog: * Re-format all Python files using black. gdb/testsuite/ChangeLog: * Re-format all Python files using black. * gdb.python/py-prettyprint.exp (run_lang_tests): Adjust. Change-Id: I28588a22c2406afd6bc2703774ddfff47cd61919
2021-03-26gdb-add-index.sh: Remove use of non posix 'local'Lancelot SIX1-13/+12
While working on gdb-add-index.sh, it appeared that it uses the non POSIX 'local' keyword. Instead of using local to allow variable shadowing, I rename the local one to avoid name conflicts altogether. This commit gets rid of the following shellcheck warning: In gdb-add-index.sh line 63: local file="$1" ^--------^ SC2039: In POSIX sh, 'local' is undefined. gdb/ChangeLog: * contrib/gdb-add-index.sh: Avoid variable shadowing and get rid of 'local'.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker10-10/+10
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-04-24[gdb/contrib] Use temp dir for gdb-add-index in cc-with-tweaks.shTom de Vries1-9/+5
When running test-case gdb.dwarf2/gdb-index.exp cleanly by issuing this command: ... $ rm -Rf build/gdb/testsuite/outputs/gdb.dwarf2/gdb-index ... before running, it passes both with native and target board cc-with-gdb-index. But when we run the test-case first with native and then with cc-with-gdb-index without intermediate cleanup, we get instead: ... Running src/gdb/testsuite/gdb.dwarf2/gdb-index.exp ... gdb compile failed, cc-with-tweaks.sh: Index file \ build/gdb/testsuite/outputs/gdb.dwarf2/gdb-index/gdb-index.gdb-index \ exists, won't clobber. === gdb Summary === # of untested testcases 1 ... What happens is that the native run produces a file build/gdb/testsuite/outputs/gdb.dwarf2/gdb-index/gdb-index.gdb-index, which causes gdb/contrib/cc-with-tweaks.sh to hit this code: ... index_file="${output_file}.gdb-index" if [ "$want_index" = true ] && [ -f "$index_file" ] then echo "$myname: Index file $index_file exists, won't clobber." >&2 exit 1 fi ... The gdb-add-index script has a problem that it uses temp files alongside the executable, filed as PR25843. The code in cc-with-tweaks.sh attempts to detect the case that creating such a temp file would overwrite an pre-existing file. It however does this only for a single file, while gdb-add-index uses more temporary files: - <exec>.gdb-index - <exec>.debug_names - <exec>.debug_str - <exec>.debug_str.merge - <exec>.debug_str.err Fix this by working around PR25843 in a more generic way: - move the executable into a temp directory - execute gdb-add-index, allowing it to create any temp file alongside the executable in the temp directory - move the executable back to the original location Tested on x86_64-linux, with target board cc-with-debug-index. gdb/ChangeLog: 2020-04-24 Tom de Vries <tdevries@suse.de> * contrib/cc-with-tweaks.sh: Remove <exec>.gdb-index file handling. Run gdb-add-index inside temp dir.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker10-10/+10
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-12-13Remove ARI check for multiple calls to warning or errorTom Tromey1-15/+0
ARI has a check for multiple calls to warning or error, suggesting that they be combined into a single call. This triggers at three places in gdb -- throw_bad_regnum_error, guile_repl_command, and the end of value_cast -- and after examining these, I think they all make sense as-is. Instead, it makes sense to remove this check from ARI. gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Remove check for multiple calls to warning or error. Change-Id: I0618683623a3c7324460c7b9e5d7f252d88c2e8d
2019-12-13Remove "fix" call for "long long" from ARITom Tromey1-2/+0
ARI has a "fix" call for "long long", but this call is incorrect. This patch removes it. gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Remove call to "fix" for "long long". Change-Id: I97bca2dc04b579fcf7c9dba7fe7fd939451bcefa
2019-12-13Accept -Wno- prefix in ARITom Tromey1-3/+16
This adds -Wno- support to ARI, so that warnings can be disabled selectively. I use this to ignore "deprecated" warnings. gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Handle -Wno- prefix. Change-Id: I6919faedf920e857df4f597df66f0ba3943e0eac
2019-12-13Change ARI usage to GNU styleTom Tromey1-2/+2
This changes the ARI usage text to use the GNU style for "metasyntactic variables". gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh (usage): Use GNU style. Change-Id: Ibe5a867571382d2985d1b8b78dfef3ddd02291ff
2019-12-13Silence ARI warning about floatformat_to_doubleTom Tromey1-1/+0
This silences ARI at the one spot that is permitted to call floatformat_to_double, and also removes the corresponding "fix" call from gdb_ari.sh -- it was incorrect, and now is not needed. gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Remove "fix" call for floatformat_to_double. * target-float.c (host_float_ops<T>::from_target): Add ARI comment. Change-Id: I778a17a04da417c113194004dd7de3b1df381266
2019-12-13Silence ARI for valid calls to abortTom Tromey1-1/+0
There are a handful of spots in gdb that validly call abort. This patch adds the appropriate ARI marker to these lines, to silence the ARI report. This also removes the "fix" call for "abort" from gdb_ari.sh; it was incorrect and now is not needed. gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Remove "fix" call for abort. * utils.c (abort_with_message, dump_core, internal_vproblem): Add ARI marker to abort. * event-top.c (handle_sigsegv): Add ARI marker to abort. Change-Id: I09ce6aa5010bbe4e5bb73ffdb727481be39d34d6
2019-12-13Fix ARI text for floatformat_from_doubleTom Tromey1-1/+1
ARI reports the wrong substitution for floatformat_from_double. "floatformat_from_doublest" was renamed in 2017. gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Fix floatformat_from_double text. Change-Id: Ibf1b194ea509b12ae8bc30ce285c809c96218557
2019-12-13Remove ATTRIBUTE_UNUSED check from ARITom Tromey1-11/+0
The text for the ATTRIBUTE_UNUSED check in ARI is plainly incorrect now -- gdb does in fact use ATTRIBUTE_UNUSED, and there's no issue in doing so, when done properly. This patch removes this check. gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Remove ATTRIBUTE_UNUSED check. Change-Id: I13fd8e9b40dbaab3978dbf9b6c4228b62299d944
2019-12-13Remove "boolean" and "var_boolean" checks from ARITom Tromey1-26/+0
The "boolean" and "var_boolean" checks from ARI seem only to generate false reports. Now that gdb is in C++, at least the "boolean" check seems unlikely to ever generate a true report. The "var_boolean" check likewise doesn't seem valuable any more -- presumably this refers to some ancient way of doing things in gdb, and isn't likely to find a bug in the future. Therefore, this patch removes these two checks. gdb/ChangeLog 2019-12-13 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Remove "boolean" and "var_boolean" checks. Change-Id: Iaf449b51e8182ffa0b9ed25fe688e0ff64a07a67
2019-11-25[gdb/contrib] Add -c option to words.sh scriptTom de Vries1-8/+21
The words.sh script in its current form extracts c comments from files, which it then transforms into a list of words. To use the script on the documentation (as I did for commit 6b92c0d3533 "[gdb/doc] Fix typos"), I needed to disable the "extract c comments" part. Add an option -c that enables extracting c comments, and is off by default. gdb/ChangeLog: 2019-11-25 Tom de Vries <tdevries@suse.de> * contrib/words.sh: Add -c option. Change-Id: Ifa34d435b3c41b3ff845dc07ae4b0d9f02d92a2d
2019-11-22[gdb/contrib] Improve words extraction in words.sh scriptTom de Vries1-1/+2
Remove more punctuation and quoting in words.sh script. gdb/ChangeLog: 2019-11-22 Tom de Vries <tdevries@suse.de> * contrib/words.sh: Improve words extraction. Change-Id: I1d9eea165731af4e6c4e1c7e09aed9b07af6395c
2019-11-22[gdb/contrib] Combine sed invocations in words.sh scriptTom de Vries1-5/+6
Currently running words.sh on all the c source and header files in the repo takes ~16s in user time: ... $ time ./gdb/contrib/words.sh \ $(find -type f -name "*.c" -o -name "*.h") \ >/dev/null real 0m7,787s user 0m16,349s sys 0m0,367s ... Rewrite the sed invocations using the -e option from this: ... | sed <sedprog1> | sed <sedprog2> ... into this: ... | sed \ -e <sedprog1> -e <sedprog2> ... and reduce user time to ~11s: ... $ time ./gdb/contrib/words.sh \ $(find -type f -name "*.c" -o -name "*.h") \ >/dev/null real 0m7,243s user 0m11,220s sys 0m0,205s ... gdb/ChangeLog: 2019-11-22 Tom de Vries <tdevries@suse.de> * contrib/words.sh: Combine sed invocations. Change-Id: Ib08453f3712f32ed02d9f503ee960711ebb9421b
2019-11-07[gdb/contrib] Add words.sh scriptTom de Vries1-0/+129
Add a script that takes a list of files as arguments and output a list of words from the C comments with their frequencies. For: ... $ ./gdb/contrib/words.sh $(find gdb -type f -name "*.c" -o -name "*.h") ... it generates a list of ~15000 words prefixed with frequency. This could be used to generate a dictionary that is kept as part of the sources, against which new code can be checked, generating a warning or error. The hope is that misspellings would trigger this frequently, and rare words rarely, otherwise the burden of updating the dictionary would be too much. And for: ... $ ./gdb/contrib/words.sh -f 1 $(find gdb -type f -name "*.c" -o -name "*.h") ... it generates a list of ~5000 words with frequency 1. This can be used to scan for misspellings manually. Change-Id: I7b119c9a4519cdbf62a3243d1df2927c80813e8b
2019-10-08Let ARI allow gdb %p printf extensionsTom Tromey1-1/+2
As pointed out by Simon, this changes ARI to allow the gdb-specific %p printf extensions. gdb/ChangeLog 2019-10-08 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh (%p): Allow gdb-specific %p extensions.
2019-09-29[gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdirTom de Vries1-4/+12
When running a test-case gdb.base/foo.exp with cc-with-dwz-m, a file build/gdb/testsuite/outputs/gdb.base/foo/foo.dwz will be created, alongside executable build/gdb/testsuite/outputs/gdb.base/foo/foo. This can cause problems in f.i. test-cases that test file name completion. Make these problems less likely by moving foo.dwz to a .tmp subdir: build/gdb/testsuite/outputs/gdb.base/foo/.tmp/foo.dwz. Tested on x86_64-linux. gdb/ChangeLog: 2019-09-29 Tom de Vries <tdevries@suse.de> * contrib/cc-with-tweaks.sh (get_tmpdir): New function. Use $tmpdir/$(basename "$output_file").dwz instead of "${output_file}.dwz". gdb/testsuite/ChangeLog: 2019-09-29 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/gdb-index.exp: Handle new location of .dwz file.
2019-07-19Change ARI to mention C++11, and remove some rulesTom Tromey1-36/+6
I noticed that ARI mentions "ISO C 90", but now gdb uses C++11. This patch updates some text to reflect this change. I also noticed that a few rules can be removed now. ARGSUSED doesn't seem to be an issue any more (there's no code mentioning this and I doubt most of us even remember this convention); PARAMS was specific to K&R C; and __func__ is available in C++11. gdb/ChangeLog 2019-07-19 Tom Tromey <tromey@adacore.com> * contrib/ari/gdb_ari.sh: Mention C++11, not ISO C 90. (ARGSUSED, PARAMS, __func__): Remove rules.
2019-07-09Rename common to gdbsupportTom Tromey1-5/+5
This is the next patch in the ongoing series to move gdbsever to the top level. This patch just renames the "common" directory. The idea is to do this move in two parts: first rename the directory (this patch), then move the directory to the top. This approach makes the patches a bit more tractable. I chose the name "gdbsupport" for the directory. However, as this patch was largely written by sed, we could pick a new name without too much difficulty. Tested by the buildbot. gdb/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * contrib/ari/gdb_ari.sh: Change common to gdbsupport. * configure: Rebuild. * configure.ac: Change common to gdbsupport. * gdbsupport: Rename from common. * acinclude.m4: Change common to gdbsupport. * Makefile.in (CONFIG_SRC_SUBDIR, COMMON_SFILES) (HFILES_NO_SRCDIR, stamp-version, ALLDEPFILES): Change common to gdbsupport. * aarch64-tdep.c, ada-lang.c, ada-lang.h, agent.c, alloc.c, amd64-darwin-tdep.c, amd64-dicos-tdep.c, amd64-fbsd-nat.c, amd64-fbsd-tdep.c, amd64-linux-nat.c, amd64-linux-tdep.c, amd64-nbsd-tdep.c, amd64-obsd-tdep.c, amd64-sol2-tdep.c, amd64-tdep.c, amd64-windows-tdep.c, arch-utils.c, arch/aarch64-insn.c, arch/aarch64.c, arch/aarch64.h, arch/amd64.c, arch/amd64.h, arch/arm-get-next-pcs.c, arch/arm-linux.c, arch/arm.c, arch/i386.c, arch/i386.h, arch/ppc-linux-common.c, arch/riscv.c, arch/riscv.h, arch/tic6x.c, arm-tdep.c, auto-load.c, auxv.c, ax-gdb.c, ax-general.c, ax.h, breakpoint.c, breakpoint.h, btrace.c, btrace.h, build-id.c, build-id.h, c-lang.h, charset.c, charset.h, cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c, cli/cli-dump.c, cli/cli-option.h, cli/cli-script.c, coff-pe-read.c, command.h, compile/compile-c-support.c, compile/compile-c.h, compile/compile-cplus-symbols.c, compile/compile-cplus-types.c, compile/compile-cplus.h, compile/compile-loc2c.c, compile/compile.c, completer.c, completer.h, contrib/ari/gdb_ari.sh, corefile.c, corelow.c, cp-support.c, cp-support.h, cp-valprint.c, csky-tdep.c, ctf.c, darwin-nat.c, debug.c, defs.h, disasm-selftests.c, disasm.c, disasm.h, dtrace-probe.c, dwarf-index-cache.c, dwarf-index-cache.h, dwarf-index-write.c, dwarf2-frame.c, dwarf2expr.c, dwarf2loc.c, dwarf2read.c, event-loop.c, event-top.c, exceptions.c, exec.c, extension.h, fbsd-nat.c, features/aarch64-core.c, features/aarch64-fpu.c, features/aarch64-pauth.c, features/aarch64-sve.c, features/i386/32bit-avx.c, features/i386/32bit-avx512.c, features/i386/32bit-core.c, features/i386/32bit-linux.c, features/i386/32bit-mpx.c, features/i386/32bit-pkeys.c, features/i386/32bit-segments.c, features/i386/32bit-sse.c, features/i386/64bit-avx.c, features/i386/64bit-avx512.c, features/i386/64bit-core.c, features/i386/64bit-linux.c, features/i386/64bit-mpx.c, features/i386/64bit-pkeys.c, features/i386/64bit-segments.c, features/i386/64bit-sse.c, features/i386/x32-core.c, features/riscv/32bit-cpu.c, features/riscv/32bit-csr.c, features/riscv/32bit-fpu.c, features/riscv/64bit-cpu.c, features/riscv/64bit-csr.c, features/riscv/64bit-fpu.c, features/tic6x-c6xp.c, features/tic6x-core.c, features/tic6x-gp.c, filename-seen-cache.h, findcmd.c, findvar.c, fork-child.c, gcore.c, gdb_bfd.c, gdb_bfd.h, gdb_proc_service.h, gdb_regex.c, gdb_select.h, gdb_usleep.c, gdbarch-selftests.c, gdbthread.h, gdbtypes.h, gnu-nat.c, go32-nat.c, guile/guile.c, guile/scm-ports.c, guile/scm-safe-call.c, guile/scm-type.c, i386-fbsd-nat.c, i386-fbsd-tdep.c, i386-go32-tdep.c, i386-linux-nat.c, i386-linux-tdep.c, i386-tdep.c, i387-tdep.c, ia64-libunwind-tdep.c, ia64-linux-nat.c, inf-child.c, inf-ptrace.c, infcall.c, infcall.h, infcmd.c, inferior-iter.h, inferior.c, inferior.h, inflow.c, inflow.h, infrun.c, infrun.h, inline-frame.c, language.h, linespec.c, linux-fork.c, linux-nat.c, linux-tdep.c, linux-thread-db.c, location.c, machoread.c, macrotab.h, main.c, maint.c, maint.h, memattr.c, memrange.h, mi/mi-cmd-break.h, mi/mi-cmd-env.c, mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-interp.c, mi/mi-main.c, mi/mi-parse.h, minsyms.c, mips-linux-tdep.c, namespace.h, nat/aarch64-linux-hw-point.c, nat/aarch64-linux-hw-point.h, nat/aarch64-linux.c, nat/aarch64-sve-linux-ptrace.c, nat/amd64-linux-siginfo.c, nat/fork-inferior.c, nat/linux-btrace.c, nat/linux-btrace.h, nat/linux-namespaces.c, nat/linux-nat.h, nat/linux-osdata.c, nat/linux-personality.c, nat/linux-procfs.c, nat/linux-ptrace.c, nat/linux-ptrace.h, nat/linux-waitpid.c, nat/mips-linux-watch.c, nat/mips-linux-watch.h, nat/ppc-linux.c, nat/x86-dregs.c, nat/x86-dregs.h, nat/x86-linux-dregs.c, nat/x86-linux.c, nto-procfs.c, nto-tdep.c, objfile-flags.h, objfiles.c, objfiles.h, obsd-nat.c, observable.h, osdata.c, p-valprint.c, parse.c, parser-defs.h, ppc-linux-nat.c, printcmd.c, probe.c, proc-api.c, procfs.c, producer.c, progspace.h, psymtab.h, python/py-framefilter.c, python/py-inferior.c, python/py-ref.h, python/py-type.c, python/python.c, record-btrace.c, record-full.c, record.c, record.h, regcache-dump.c, regcache.c, regcache.h, remote-fileio.c, remote-fileio.h, remote-sim.c, remote.c, riscv-tdep.c, rs6000-aix-tdep.c, rust-exp.y, s12z-tdep.c, selftest-arch.c, ser-base.c, ser-event.c, ser-pipe.c, ser-tcp.c, ser-unix.c, skip.c, solib-aix.c, solib-target.c, solib.c, source-cache.c, source.c, source.h, sparc-nat.c, spu-linux-nat.c, stack.c, stap-probe.c, symfile-add-flags.h, symfile.c, symfile.h, symtab.c, symtab.h, target-descriptions.c, target-descriptions.h, target-memory.c, target.c, target.h, target/waitstatus.c, target/waitstatus.h, thread-iter.h, thread.c, tilegx-tdep.c, top.c, top.h, tracefile-tfile.c, tracefile.c, tracepoint.c, tracepoint.h, tui/tui-io.c, ui-file.c, ui-out.h, unittests/array-view-selftests.c, unittests/child-path-selftests.c, unittests/cli-utils-selftests.c, unittests/common-utils-selftests.c, unittests/copy_bitwise-selftests.c, unittests/environ-selftests.c, unittests/format_pieces-selftests.c, unittests/function-view-selftests.c, unittests/lookup_name_info-selftests.c, unittests/memory-map-selftests.c, unittests/memrange-selftests.c, unittests/mkdir-recursive-selftests.c, unittests/observable-selftests.c, unittests/offset-type-selftests.c, unittests/optional-selftests.c, unittests/parse-connection-spec-selftests.c, unittests/ptid-selftests.c, unittests/rsp-low-selftests.c, unittests/scoped_fd-selftests.c, unittests/scoped_mmap-selftests.c, unittests/scoped_restore-selftests.c, unittests/string_view-selftests.c, unittests/style-selftests.c, unittests/tracepoint-selftests.c, unittests/unpack-selftests.c, unittests/utils-selftests.c, unittests/xml-utils-selftests.c, utils.c, utils.h, valarith.c, valops.c, valprint.c, value.c, value.h, varobj.c, varobj.h, windows-nat.c, x86-linux-nat.c, xml-support.c, xml-support.h, xml-tdesc.h, xstormy16-tdep.c, xtensa-linux-nat.c, dwarf2read.h: Change common to gdbsupport. gdb/gdbserver/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac: Change common to gdbsupport. * acinclude.m4: Change common to gdbsupport. * Makefile.in (SFILES, OBS, GDBREPLAY_OBS, IPA_OBJS) (version-generated.c, gdbsupport/%-ipa.o, gdbsupport/%.o): Change common to gdbsupport. * ax.c, event-loop.c, fork-child.c, gdb_proc_service.h, gdbreplay.c, gdbthread.h, hostio-errno.c, hostio.c, i387-fp.c, inferiors.c, inferiors.h, linux-aarch64-tdesc-selftest.c, linux-amd64-ipa.c, linux-i386-ipa.c, linux-low.c, linux-tic6x-low.c, linux-x86-low.c, linux-x86-tdesc-selftest.c, linux-x86-tdesc.c, lynx-i386-low.c, lynx-low.c, mem-break.h, nto-x86-low.c, regcache.c, regcache.h, remote-utils.c, server.c, server.h, spu-low.c, symbol.c, target.h, tdesc.c, tdesc.h, thread-db.c, tracepoint.c, win32-i386-low.c, win32-low.c: Change common to gdbsupport.
2019-06-16[gdb/contrib] Fix gdb/contrib/gdb-add-index.sh for dwz-m-ed execsTom de Vries1-47/+91
Atm gdb-add-index.exp fails with target board cc-with-dwz-m. Fix this by updating gdb/contrib/gdb-add-index.sh to handle a dwz-m-ed executable. Tested on x86_64-linux. gdb/ChangeLog: 2019-06-16 Tom de Vries <tdevries@suse.de> PR gdb/24445 * contrib/gdb-add-index.sh: Update to handle dwz-m-ed executable.
2019-05-10cc-with-tweaks: show dwz stderr and verify resultSimon Marchi1-2/+32
When running the gdb.base/index-cache.exp test case with the cc-with-dwz-m board, I noticed that the final executable didn't actually contain a .gnu_debugaltlink section with the name of the external dwz file: $ readelf --debug-dump=links testsuite/outputs/gdb.base/index-cache/index-cache * empty * Running dwz by hand, I realized it's because dwz complains that the output .debug_info section is empty and fails: $ gcc ~/src/binutils-gdb/gdb/testsuite/gdb.base/index-cache.c -g3 -O0 -o a && cp a b $ dwz -m foo a b dwz: foo: .debug_info section not present $ echo $? 1 This is because index-cache.c is trivial (just an empty main) and dwz doesn't find anything to factor out to the dwz file. [1] I think that cc-with-tweaks should fail in this scenario: if the user asks for an external dwz file to be generated (the -m flag), then it should be an error if cc-with-tweaks doesn't manage to produce an executable with the proper link to this external dwz file. Otherwise, the test runs with a regular non-dwzified executable, which gives a false sense of security about whether the feature under test works with dwzified executables. So this patch adds checks for that after invoking dwz. It also removes the 2>&1 to allow the error message to be printed like so: Running /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/index-cache.exp ... gdb compile failed, dwz: /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/index-cache/index-cache.dwz: .debug_info section not present - In the -m case (multi-file compression), we check if the expected output file exists. - In the -z case (single-file compression), we check if the file contents has changed. This should catch cases where dwz doesn't modify the file because it's not worth it. It was chosen not to check for dwz's exit code, as it is not very reliable up to dwz 0.12. With this patch, fewer tests will pass than before with the cc-with-dwz and cc-with-dwz-m boards, but those were false positives anyway, as the test ran with regular executables. [1] Note that dwz has been patched by Tom de Vries to work correctly in this case, so we can use dwz master to run the test: https://sourceware.org/git/?p=dwz.git;a=commit;h=08becc8b33453b6d013a65e7eeae57fc1881e801 gdb/ChangeLog: * contrib/cc-with-tweaks.sh: Validate dwz's work.
2019-05-04[gdb/testsuite] Add cc-with-debug-names.expTom de Vries1-2/+6
Add a target board that makes it easy to run the test suite with a .debug_names section added to executables. gdb/ChangeLog: 2019-05-04 Tom de Vries <tdevries@suse.de> * contrib/cc-with-tweaks.sh: Support -n arg. gdb/testsuite/ChangeLog: 2019-05-04 Tom de Vries <tdevries@suse.de> * boards/cc-with-debug-names.exp: New file.
2019-04-23[gdb/contrib] Remove superfluous .alt file after dwz invocation in ↵Tom de Vries1-0/+1
cc-with-tweaks.sh The -m option of cc-with-tweaks.sh sets want_multi to true, invoking dwz like this: ... elif [ "$want_multi" = true ]; then cp $output_file ${output_file}.alt $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt \ > /dev/null 2>&1 fi ... The problem that is being solved here, is that we want to test dwz in multifile mode, which requires more than one input file, while we only have (at the scope of cc-with-tweaks.sh) one executable. We handle this by copying the executable and offering this as a second input (and using a copy has the additional benefit that it maximally enables dwz transformation). However, after the dwz invocation, the copy is no longer used, and the presence of the file actually causes a test regression: ... FAIL: gdb.base/jit-so.exp: test jit-reader-load filename completion ... Fix this by removing the superflous copy after dwz invocation. Tested on x86_64-linux. gdb/ChangeLog: 2019-04-23 Tom de Vries <tdevries@suse.de> PR gdb/24438 * contrib/cc-with-tweaks.sh: Remove superfluous .alt file after dwz invocation.
2019-01-05Remove the exception and cleanup checkersTom Tromey4-874/+0
Now that gdb is transitioning away from cleanups, there is no reason to keep the cleanup and exception checker scripts around. This patch removes them. gdb/ChangeLog 2019-01-05 Tom Tromey <tom@tromey.com> * contrib/cleanup_check.py: Remove. * contrib/gcc-with-excheck: Remove. * contrib/exsummary.py: Remove. * contrib/excheck.py: Remove.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker13-13/+13
This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
2018-07-07contrib/gdb-add-index.sh -dwarf-5Jan Kratochvil1-2/+8
------------------------------------------------------------------------------ (gdb) help save gdb-index Save a gdb-index file. Usage: save gdb-index [-dwarf-5] DIRECTORY No options create one file with .gdb-index extension for pre-DWARF-5 compatible .gdb_index section. With -dwarf-5 creates two files with extension .debug_names and .debug_str for DWARF-5 .debug_names section. ------------------------------------------------------------------------------ But gdb-add-index command provided no way how to pass the -dwarf-5 option. gdb/ChangeLog 2018-07-07 Jan Kratochvil <jan.kratochvil@redhat.com> * contrib/gdb-add-index.sh ($dwarf5): New, use it.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker13-13/+13
gdb/ChangeLog: Update copyright year range in all GDB files
2017-12-13Fix typo in gdb_ari.shSimon Marchi1-1/+1
gdb/ChangeLog: * contrib/ari/gdb_ari.sh: Fix typo in help.
2017-12-08DWARF-5: .debug_names index producerJan Kratochvil1-6/+47
This adds a new "-dwarf-5" switch to "save gdb-index" that makes it generate index files with DWARF-5 .debug_names/.debug_str sections instead of GDB's own .gdb_index. We should probably add a command line option to contrib/gdb-add-index.sh (incl. cc-with-tweaks.sh) for the new -dwarf-5 GDB option, and a new target board to make it more convenient to exercise this. To be done later. gdb/ChangeLog 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * contrib/gdb-add-index.sh (index): Rename to ... (index4): ... here. (index5, debugstr, debugstrmerge, debugstrerr): New variables. Support also .debug_names and .debug_str. * dwarf2read.c: Include cmath, set, list. (INDEX_SUFFIX): Rename to ... (INDEX4_SUFFIX): ... here. (INDEX5_SUFFIX, DEBUG_STR_SUFFIX): New. (file_write(FILE *, const void *, size_t)): New. (file_write(FILE *, const std::vector<Elem, Alloc> &)): New. (data_buf::append_unsigned_leb128, data_buf::empty): New. (data_buf::file_write): Use ::file_write. (data_buf::c_str, dwarf5_djb_hash, debug_names) (check_dwarf64_offsets): New. (psyms_seen_size, write_gdbindex): New from write_psymtabs_to_index code. (dwarf5_gdb_augmentation, write_debug_names, assert_file_size) (enum dw_index_kind): New. (write_psymtabs_to_index): New parameter index_kind. Support filename_str and out_file_str. Move code to write_gdbindex, possibly call write_debug_names. (save_gdb_index_command): New parameter -dwarf-5. (_initialize_dwarf2_read): Document the new parameter -dwarf-5. gdb/doc/ChangeLog 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Index Files): Document .debug_names and -dwarf-5. -- gdb/contrib/gdb-add-index.sh | 53 ++ gdb/doc/gdb.texinfo | 24 + gdb/dwarf2read.c | 919 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 935 insertions(+), 61 deletions(-)
2017-12-08cc-with-tweaks.sh: Use gdb-add-index.shJan Kratochvil1-17/+23
With DWARF-5 .debug_names, the commands to add the index to the symbol file are more complicated, as now also .debug_str needs to be modified. Currently, contrib/cc-with-tweaks.sh calls objcopy to handle the '-i' option instead of using contrib/gdb-add-index.sh which basically does the same. To help with .debug_names, this commit makes contrib/cc-with-tweaks.sh reuse contrib/gdb-add-index.sh instead. A problem this ran into is whether contrib/cc-with-tweaks.sh should fail or not when no index is produced. Currently, contrib/cc-with-tweaks.sh is more quiet (=successful) than contrib/gdb-add-index.sh and so with no further changes testsuite runs with an index would "regress". This commit tries to keep the behavior unchanged. Some cases still error with: Ada is not currently supported by the index But some cases (such as some trivial gdb.dwarf2/ testcases with no DWARF data to index) produce no index while the testcases still PASS now instead of: -PASS: gdb.arch/i386-bp_permanent.exp: stack pointer value matches +gdb compile failed, gdb-add-index.sh: No index was created for gdb/testsuite.unix.-m64/outputs/gdb.arch/i386-bp_permanent/i386-bp_permanent +gdb-add-index.sh: [Was there no debuginfo? Was there already an index?] +UNTESTED: gdb.arch/i386-bp_permanent.exp: failed to compile gdb/ChangeLog 2017-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * contrib/cc-with-tweaks.sh: Change interpreter to bash, incl. initial comment. (GDB_ADD_INDEX): New variable. <$want_index>: Call $GDB_ADD_INDEX.
2017-01-01update copyright year range in GDB filesJoel Brobecker13-13/+13
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-11-25Remove check requiring void argument to functions with no parameters.John Baldwin1-10/+0
C++ treats an empty parameter list as no parameters unlike C. gdb/ChangeLog: * contrib/ari/gdb_ari.sh (no parameter function): Remove check.