aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-11-16gdbsupport: move xfree into its own fileAndrew Burgess4-16/+43
In the next commit I'd like to reference gdb_unique_ptr within the common-utils.h file. However, this requires that I include gdb_unique_ptr.h, which requires that xfree be defined. Interestingly, gdb_unique_ptr.h doesn't actually include anything that defines xfree, but I was finding that when I added a gdb_unique_ptr.h include to common-utils.h I was getting a dependency cycle; before my change xfree was defined when gdb_unique_ptr.h was processed, while after my change it was not, and this made g++ unhappy. To break this cycle, I propose to move xfree into its own header file, gdb-xfree.h, which I'll then include into gdb_unique_ptr.h and common-utils.cc.
2021-11-16gdb: throw OPTIMIZED_OUT_ERROR rather than GENERIC_ERRORAndrew Burgess1-2/+3
While reviewing this patch: https://sourceware.org/pipermail/gdb-patches/2021-November/183227.html I spotted that the patch could be improved if we threw OPTIMIZED_OUT_ERROR rather than GENERIC_ERROR in a few places. This commit updates error_value_optimized_out and require_not_optimized_out to throw OPTIMIZED_OUT_ERROR. I ran the testsuite and saw no regressions. This doesn't really surprise me, we don't usually write code like: catch (const gdb_exception_error &ex) { (if ex.error == GENERIC_ERROR) ... else ... } There are a three places where we write something like: catch (const gdb_exception_error &ex) { (if ex.error == OPTIMIZED_OUT_ERROR) ... } In frame.c:unwind_pc, stack.c:info_frame_command_core, and value.c:value_optimized_out, but if we are hitting these cases then it's not significantly changing GDB's behaviour.
2021-11-16Remove config.cache in gdbserver's "distclean"Tom Tromey1-2/+1
PR gdb/28586 points out that "make distclean" fails to delete config.cache from gdbserver/. This patch fixes the bug, and removes a duplicate "Makefile" deletion that was also pointed out in the PR.
2021-11-16[gdb/testsuite] Remove inferior output in gdb.base/foll-vfork.expTom de Vries4-12/+11
Test-case gdb.base/foll-vfork.exp has inferior output that is not needed, but which makes the regexp matching more difficult (see commit 1f28b70def1 "[gdb/testsuite] Fix regexp in gdb.base/foll-vfork.exp"). Remove the inferior output, and revert commit 1f28b70def1 to make the matching more restrictive. Tested on x86_64-linux.
2021-11-16x86: Don't allow KMOV in TLS code sequencesH.J. Lu6-5/+35
Don't allow KMOV in TLS code sequences which require integer MOV instructions. PR target/28595 * config/tc-i386.c (match_template): Don't allow KMOV in TLS code sequences. * testsuite/gas/i386/i386.exp: Run inval-tls and x86-64-inval-tls tests. * testsuite/gas/i386/inval-tls.l: New file. * testsuite/gas/i386/inval-tls.s: Likewise. * testsuite/gas/i386/x86-64-inval-tls.l: Likewise. * testsuite/gas/i386/x86-64-inval-tls.s: Likewise.
2021-11-16sim: run: support concise env var settingsMike Frysinger2-2/+23
Support the same syntax as other common utilities where env vars can be specified before the program to be run without an explicit option. This behavior can be suppressed by using the -- marker.
2021-11-16sim: nrun: add --env-{set,unset,clear} command line optionsMike Frysinger5-10/+107
Provide explicit control over the program's environment with the basic set/unset/clear options. These are a bit clunky to use, but they're functional. The env set operation is split out into a separate function as it'll be used in the next commit. With these in place, we can adjust the custom cris testsuite to use the now standard options and not its one-off hack.
2021-11-16sim: syscall: hoist argc/argn/argnlen to common codeMike Frysinger2-33/+40
Now that the callback framework supports argv & envp, we can move the Blackfin implementation of these syscalls to the common code.
2021-11-16sim: syscall: fix argvlen & argv implementationMike Frysinger1-42/+50
Now that we have access to the argv & envp strings, finish implementing these syscalls. Delete unused variables, fix tbuf by incrementing the pointer instead of setting to the length, and make sure we don't write more data than the bufsize says is available.
2021-11-16sim: callback: expose argv & environMike Frysinger14-10/+79
Pass the existing strings data to the callbacks so that common libgloss syscalls can be implemented (which we'll do shortly).
2021-11-16sim: keep track of program environment stringsMike Frysinger14-7/+85
We've been passing the environment strings to sim_create_inferior, but most ports don't do anything with them. A few will use ad-hoc logic to stuff the stack for user-mode programs, but that's it. Let's formalize this across the board by storing the strings in the normal sim state. This will allow (in future commits) supporting more functionality in the run interface, and to unify some of the libgloss syscalls.
2021-11-16sim: iq2000: fix some missing prototypes warningsMike Frysinger4-5/+10
Turns out some of these were hiding real bugs like not passing the pc variable down.
2021-11-16RISC-V: Scalar crypto instruction and entropy source CSR testcases.jiawei41-3/+490
Add testcases for Scalar Crypto extension, with total testcase contain all instructions in k-ext/k-ext-64 and sub-extension testcase for zbk* zk*. Also add testcase for new CSR name 'seed' which is the Entropy Source in zkr. In fact these whole testcases can be combined into one file, after we have supported the .option arch +-= directives. gas/ * testsuite/gas/riscv/k-ext-64.d: New testcase for crypto instructions. * testsuite/gas/riscv/k-ext-64.s: Likewise. * testsuite/gas/riscv/k-ext.d: Likewise. * testsuite/gas/riscv/k-ext.s: Likewise. * testsuite/gas/riscv/zbkb-32.d: Likewise. * testsuite/gas/riscv/zbkb-32.s: Likewise. * testsuite/gas/riscv/zbkb-64.d: Likewise. * testsuite/gas/riscv/zbkb-64.s: Likewise. * testsuite/gas/riscv/zbkc-32.d: Likewise. * testsuite/gas/riscv/zbkc-64.d: Likewise. * testsuite/gas/riscv/zbkc.s: Likewise. * testsuite/gas/riscv/zbkx-32.d: Likewise. * testsuite/gas/riscv/zbkx-64.d: Likewise. * testsuite/gas/riscv/zbkx.s: Likewise. * testsuite/gas/riscv/zknd-32.d: Likewise. * testsuite/gas/riscv/zknd-32.s: Likewise. * testsuite/gas/riscv/zknd-64.d: Likewise. * testsuite/gas/riscv/zknd-64.s: Likewise. * testsuite/gas/riscv/zkne-32.d: Likewise. * testsuite/gas/riscv/zkne-32.s: Likewise. * testsuite/gas/riscv/zkne-64.d: Likewise. * testsuite/gas/riscv/zkne-64.s: Likewise. * testsuite/gas/riscv/zknh-32.d: Likewise. * testsuite/gas/riscv/zknh-32.s: Likewise. * testsuite/gas/riscv/zknh-64.d: Likewise. * testsuite/gas/riscv/zknh-64.s: Likewise. * testsuite/gas/riscv/zksed-32.d: Likewise. * testsuite/gas/riscv/zksed-64.d: Likewise. * testsuite/gas/riscv/zksed.s: Likewise. * testsuite/gas/riscv/zksh-32.d: Likewise. * testsuite/gas/riscv/zksh-64.d: Likewise. * testsuite/gas/riscv/zksh.s: Likewise. * testsuite/gas/riscv/priv-reg-fail-zkr.d: New testcase for zkr csr check. * testsuite/gas/riscv/priv-reg-fail-zkr.l: Likewise. * testsuite/gas/riscv/priv-reg-fail-version-1p10.d: Updated march to rv32if_zkr. * testsuite/gas/riscv/priv-reg-fail-version-1p11.d: Likewise. * testsuite/gas/riscv/priv-reg-fail-version-1p9p1.d: Likewise. * testsuite/gas/riscv/priv-reg-version-1p10.d: Added Crypto seed csr. * testsuite/gas/riscv/priv-reg-version-1p11.d: Likewise. * testsuite/gas/riscv/priv-reg-version-1p9p1.d: Likewise. * testsuite/gas/riscv/priv-reg.s: Likewise.
2021-11-16RISC-V: Scalar crypto instructions and operand set.jiawei6-20/+227
Add instructions in k-ext, some instruction in zbkb, zbkc is reuse from zbb,zbc, we just change the class attribute to make them both support. The 'aes64ks1i' and 'aes64ks2' instructions are present in both the Zknd and Zkne extensions on rv64. Add new operand letter 'y' to present 'bs' symbol and 'Y' to present 'rnum' symbolc for zkn instructions. Also add a new Entropy Source CSR define 'seed' located at address 0x015. bfd/ * elfxx-riscv.c (riscv_multi_subset_supports): Added support for crypto extension. gas/ *config/tc-riscv.c (enum riscv_csr_class): Added CSR_CLASS_ZKR. (riscv_csr_address): Checked for CSR_CLASS_ZKR. (validate_riscv_insn): Added y and Y for bs and rnum operands. (riscv_ip): Handle y and Y operands. include/ * opcode/riscv-opc.h: Added encodings of crypto instructions. Also defined new csr seed, which address is 0x15. * opcode/riscv.h: Defined OP_* and INSN_CLASS_* for crypto. opcodes/ * riscv-dis.c (print_insn_args): Recognized new y and Y operands. * riscv-opc.c (riscv_opcodes): Added crypto instructions.
2021-11-16RISC-V: Minimal support of scalar crypto extension.jiawei1-1/+29
Minimal support of scalar crypto extension, add "k" in the riscv_supported_std_ext, to make the order check right with "zk" behind "zb". bfd/ * elfxx-riscv.c (riscv_implicit_subsets): Added implicit rules for zk* extensions. (riscv_supported_std_ext): Added entry for k. (riscv_supported_std_z_ext): Added entries for zk*.
2021-11-15gdb: rework "set debuginfod" commandsSimon Marchi3-203/+142
As discussed here [1], do some re-work in the "set debuginfod commands". First, use "set debuginfod enabled on/off/ask" instead of "set debuginfod on/off/ask". This is more MI-friendly, and it gives an output that makes more sense in "info set", for example. Then, make the show commands not call "error" when debuginfod support is not compiled in. This makes the commands "show" and "show debuginfod" stop early, breaking gdb.base/default.exp: Running /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/default.exp ... FAIL: gdb.base/default.exp: info set FAIL: gdb.base/default.exp: show - Make the "debuginfod enabled" setting default to "off" when debuginfod support is not compiled in, and "ask" otherwise. - Make the setter of "debuginfod enabled" error out when debuginfod support is not compiled in, so that "debuginfod enabled" will always remain "off" in that case. - Make the setter of "debuginfod verbose" work in any case. I don't see the harm in letting the user change that setting, since the user will hit an error if they try to enable the use of debuginfod. - I would do the same for the "debuginfod urls" setter, but because this one needs to see the DEBUGINFOD_URLS_ENV_VAR macro, provided by libdebuginfod, I made that one error out as well if debuginfod support is not compiled it (otherwise, I would have left it like "debuginfod verbose". Alternatively, we could hard-code "DEBUGINFOD_URLS" in the code (in fact, it was prior to this patch, but I think it was an oversight, as other spots use DEBUGINFOD_URLS_ENV_VAR), or use a dummy string to store the setting, but I don't really see the value in that. Rename debuginfod_enable to debuginfod_enabled, just so it matches the setting name. [1] https://sourceware.org/pipermail/gdb-patches/2021-October/182937.html Change-Id: I45fdb2993f668226a5639228951362b7800f09d5 Co-Authored-By: Aaron Merey <amerey@redhat.com>
2021-11-15gdb: adjust gdbarch_tdep calls in nat filesSimon Marchi13-105/+118
Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") forgot to update the gdbarch_tdep calls in the native files other than x86-64 Linux. This patch updates them all (to the best of my knowledge). These are the files I was able to build-test: aarch64-linux-nat.c amd64-bsd-nat.c arm-linux-nat.c ppc-linux-nat.c windows-nat.c xtensa-linux-nat.c And these are the ones I could not build-test: aix-thread.c arm-netbsd-nat.c ppc-fbsd-nat.c ppc-netbsd-nat.c ia64-tdep.c (the part that needs libunwind) ppc-obsd-nat.c rs6000-nat.c If there are still some build problems related to gdbarch_tdep in them, they should be pretty obvious to fix. Change-Id: Iaa3d791a850e4432973757598e634e3da6061428
2021-11-15gdb: remove unused variables in xtensa-linux-nat.cSimon Marchi1-2/+0
While build-testing this file, the compiler complained about these two unused variables, remove them. Change-Id: I3c54f779f12c16ef6184af58aca75eaad042ce4e
2021-11-15gdb: add arc-newlib-tdep.c to ALL_TARGET_OBSSimon Marchi2-1/+2
This file is currently not compiled in an --enable-targets=all build, but it should be. Add it to ALL_TARGET_OBS. Update the gdbarch_tdep call that commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") forgot to update. Change-Id: I86248a01493eea5e70186e9c46a298ad3994b034
2021-11-15Update my email address.Jim Wilson1-1/+1
I've left SiFive and have a new gmail account because it is convenient to use with git send-email. I'm planning to use this for my RISC-V work. My tuliptree address still works, it just isn't as convenient. binutils: * MAINTAINERS (RISC-V): Update my address.
2021-11-16Automatic date update in version.inGDB Administrator1-1/+1
2021-11-15[gdb] Don't use gdb_stdlog for inferior-eventsTom de Vries2-26/+14
The test-case gdb.base/foll-vfork.exp contains: ... if [gdb_debug_enabled] { untested "debug is enabled" return 0 } ... To understand what it does, I disabled this bit and ran with GDB_DEBUG=infrun, like so: ... $ cd $build/gdb/testsuite $ make check GDB_DEBUG=infrun RUNTESTFLAGS=gdb.base/foll-vfork.exp ... and ran into: ... (gdb) PASS: gdb.base/foll-vfork.exp: exec: \ vfork parent follow, through step: set follow-fork parent next^M 33 if (pid == 0) {^M (gdb) FAIL: gdb.base/foll-vfork.exp: exec: \ vfork parent follow, through step: step ... The problem is that the test-case expects: ... (gdb) PASS: gdb.base/foll-vfork.exp: exec: \ vfork parent follow, through step: set follow-fork parent next^M [Detaching after vfork from child process 28169]^M 33 if (pid == 0) {^M (gdb) PASS: gdb.base/foll-vfork.exp: exec: \ vfork parent follow, through step: step ... but the "Detaching" line has been redirected to $outputs/gdb.base/foll-vfork/gdb.debug. I looked at the documentation of "set logging debugredirect [on|off]": ... By default, GDB debug output will go to both the terminal and the logfile. Set debugredirect if you want debug output to go only to the log file. ... and my interpretation of it was that "debug output" did not match the "messages" description of inferior-events: ... The set print inferior-events command allows you to enable or disable printing of messages when GDB notices that new inferiors have started or that inferiors have exited or have been detached. ... Fix the discrepancy by not using gdb_stdlog for inferior-events. Update the gdb.base/foll-vfork.exp test-case to not require gdb_debug_enabled == 0. Tested on x86_64-linux. Tested test-case gdb.base/foll-vfork.exp with and without GDB_DEBUG=infrun.
2021-11-15ld: Fix testsuite failures under --enable-textrel-check=errorRoland McGrath4-3/+10
ld/ * testsuite/ld-aarch64/dt_textrel.d: Pass explicit -z notext in case ld was configured with --enable-textrel-check=error. * testsuite/ld-aarch64/pr22764.d: Likewise. * testsuite/ld-aarch64/pr20402.d: Likewise.
2021-11-15Extend the prologue analyzer to handle the bti instructionLuis Machado2-0/+41
Handle the BTI instruction in the prologue analyzer. The patch handles all the variations of the BTI instruction.
2021-11-15gdb: fix gdbarch_tdep ODR violationSimon Marchi133-1325/+1514
I would like to be able to use non-trivial types in gdbarch_tdep types. This is not possible at the moment (in theory), because of the one definition rule. To allow it, rename all gdbarch_tdep types to <arch>_gdbarch_tdep, and make them inherit from a gdbarch_tdep base class. The inheritance is necessary to be able to pass pointers to all these <arch>_gdbarch_tdep objects to gdbarch_alloc, which takes a pointer to gdbarch_tdep. These objects are never deleted through a base class pointer, so I didn't include a virtual destructor. In the future, if gdbarch objects deletable, I could imagine that the gdbarch_tdep objects could become owned by the gdbarch objects, and then it would become useful to have a virtual destructor (so that the gdbarch object can delete the owned gdbarch_tdep object). But that's not necessary right now. It turns out that RISC-V already has a gdbarch_tdep that is non-default-constructible, so that provides a good motivation for this change. Most changes are fairly straightforward, mostly needing to add some casts all over the place. There is however the xtensa architecture, doing its own little weird thing to define its gdbarch_tdep. I did my best to adapt it, but I can't test those changes. Change-Id: Ic001903f91ddd106bd6ca09a79dabe8df2d69f3b
2021-11-15COFF: avoid modifications over C_FILE filename aux entries.Clément Chigot1-2/+10
Commit e86fc4a5bc37 ("PR 28447: implement multiple parameters for .file on XCOFF") introduces C_FILE entries which can store additional information. However, some modifications are needed by them but not by the original C_FILE entries, usually representing the filename. This patch ensures that filename entries are kept as is, in order to protect targets not supporting the additional entries. * coffgen.c (coff_write_symbol): Protect filename entries (coff_write_symbols): Likewise. (coff_print_symbol): Likewise.
2021-11-15Deal with full path in .file 0 directiveEric Botcazou8-24/+184
Gas uses the directory part, if present, of the .file 0 directive to set entry 0 of the directory table in DWARF 5, which represents the "current directory". Now Gas also uses the file part of the same directive to set entry 0 of the file table, which represents the "current compilation file". But the latter need not be located in the former so GCC will use a full path in the file part when it is passed a full path: gcc -c /full/path/test.c -save-temps yields: .file 0 "/current/directory" "/full/path/test.c" in the assembly file and: The Directory Table (offset 0x22, lines 2, columns 1): Entry Name 0 (indirect line string, offset: 0x25): /current/directory 1 (indirect line string, offset: 0x38): /full/path The File Name Table (offset 0x30, lines 2, columns 2): Entry Dir Name 0 0 (indirect line string, offset: 0x43): /full/path/test.c in the object file. Note the full path and the questionable Dir value in the 0 entry of the file table.
2021-11-15sim: cris: make error message test a little more flexibleMike Frysinger1-1/+1
The point of this test is to just make sure the usage text is shown, not the exact details of the usage text. So shorten the output test to match the beginning. This fixes breakage when the output changed slightly to include [--].
2021-11-15sim: run: fix crash in argc==0 error situationMike Frysinger1-7/+17
The new argv processing code assumed that we were always passed a command line. If we weren't, make sure we don't crash before we get a chance to output an error message about incorrect usage.
2021-11-15sim: cris: touch up rvdummy handlingMike Frysinger1-2/+2
Add quiet build support and make sure it's removed with `make clean`.
2021-11-15sim: cris: replace custom "dest" test field with new --argv0Mike Frysinger4-8/+5
The #dest field used in the cris testsuite is a bit of hack to set the argv[0] for the tests to read out later on. Now that the sim has an option to set argv[0] explicitly, we don't need this custom field, so let's drop it to harmonize the testsuites a little.
2021-11-15sim: run: add --argv0 option to control argv[0]Mike Frysinger4-4/+27
We default argv[0] to the program we run which is a standard *NIX convention, but sometimes we want to be able to control the argv[0] setting independently (especially for programs that inspect argv[0] to change their behavior or output). Add an option to control it.
2021-11-15sim: split program path out of argv vectorMike Frysinger31-119/+40
We use the program argv to both find the program to run (argv[0]) and to hold the arguments to the program. Most of the time this is fine, but if we want to let programs specify argv[0] independently (which is possible in standard *NIX programs), this double duty doesn't work. So let's split the path to the program to run out into a separate field by itself. This simplifies the various sim_open funcs too. By itself, this code is more of a logical cleanup than something that is super useful. But it will open up customization of argv[0] in a follow up commit. Split the changes to make it easier to review.
2021-11-15sim: bfin: fix mach/xfail usage in testsMike Frysinger4-6/+6
Set the mach to the right value all the time, and update xfail to say the test fails on all targets. WIth multitarget testing, the idea of target here doesn't make much sense.
2021-11-15-Waddress fixes for gold testsuiteAlan Modra4-28/+28
Current mainline gcc. common_test_1.c: In function 'main': common_test_1.c:56:14: error: comparison between two arrays [-Werror=array-compare] 56 | assert (c5 > c4); | ^ common_test_1.c:56:14: note: use '&c5[0] > &c4[0]' to compare the addresses * testsuite/common_test_1.c: Avoid -Waddress warnings. * testsuite/common_test_1_v1.c: Likewise. * testsuite/common_test_1_v2.c: Likewise. * testsuite/script_test_2.cc: Likewise.
2021-11-15PowerPC64 @notoc in non-power10 codeAlan Modra7-398/+356
R_PPC64_REL24_P9NOTOC is a variant of R_PPC64_REL24_NOTOC for use on @notoc cals from non-power10 code in the rare case that using such a construct is useful. R_PPC64_REL24_P9NOTOC will be emitted by gas rather than R_PPC64_REL24_NOTOC when @notoc is used in a branch instruction if power10 instructions are not enabled at that point. The new relocation tells the linker to not use power10 instructions on any stub emitted for that branch, unless overridden by --power10-stubs=yes. The current linker heuristic of only generating power10 instructions for stubs if power10-only relocations are detected, continues to be used. include/ * elf/ppc64.h (R_PPC64_REL24_P9NOTOC): Define. bfd/ * reloc.c (BFD_RELOC_PPC64_REL24_P9NOTOC): Define. * elf64-ppc.c (ppc64_elf_howto_raw): Add entry for new reloc. (ppc64_elf_reloc_type_lookup): Handle it. (enum ppc_stub_type): Delete. (enum ppc_stub_main_type, ppc_stub_sub_type): New. (struct ppc_stub_type): New. (struct ppc_stub_hash_entry): Use the above new type. (struct ppc_link_hash_table): Update stub_count. (is_branch_reloc, ppc64_elf_check_relocs), (toc_adjusting_stub_needed): Handle new reloc. (stub_hash_newfunc, select_alt_stub, ppc_merge_stub), (ppc_type_of_stub, plt_stub_size, build_plt_stub), (build_tls_get_addr_head, build_tls_get_addr_tail), (ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_size_stubs), (ppc64_elf_build_stubs, ppc64_elf_relocate_section): Handle new reloc. Modify stub handling to suit new scheme. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas/ * config/tc-ppc.c (ppc_elf_suffix): When power10 is not enabled return BFD_RELOC_PPC64_REL24_P9NOTOC for @notoc. (fixup_size, ppc_force_relocation, ppc_fix_adjustable): Handle BFD_RELOC_PPC64_REL24_P9NOTOC. ld/ * testsuite/ld-powerpc/callstub-2.s: Add .machine power10.
2021-11-15Regenerate a couple of filesAlan Modra3-7/+6
A couple of files changed on my latest --enable-maintainer-mode build. ld/Makefile.in had a missing dependency but better sorting of the loongson entries. intl/ * configure: Regenerate. ld/ * Makefile.am: Sort loongson entries. * Makefile.in: Regenerate.
2021-11-14Fix build with current GCC: EL_EXPLICIT(location) always non-NULLPedro Alves1-6/+5
Compiling GDB with current GCC (1b4a63593b) runs into this: src/gdb/location.c: In function 'int event_location_empty_p(const event_location*)': src/gdb/location.c:963:38: error: the address of 'event_location::<unnamed union>::explicit_loc' will never be NULL [-Werror=address] 963 | return (EL_EXPLICIT (location) == NULL | ^ src/gdb/location.c:57:30: note: 'event_location::<unnamed union>::explicit_loc' declared here 57 | struct explicit_location explicit_loc; | ^~~~~~~~~~~~ GCC is right, EL_EXPLICIT is defined as returning the address of an union field: /* An explicit location. */ struct explicit_location explicit_loc; #define EL_EXPLICIT(P) (&((P)->u.explicit_loc)) and thus must always be non-NULL. Change-Id: Ie74fee7834495a93affcefce03c06e4d83ad8191
2021-11-15Automatic date update in version.inGDB Administrator1-1/+1
2021-11-14[PR gdb/16238] Add completer for the show user commandLancelot SIX2-1/+143
The 'show user' command (which shows the definition of non-python/scheme user defined commands) is currently missing a completer. This is mentioned in PR 16238. Having one can improve the user experience. In this commit I propose an implementation for such completer as well as the associated tests. Tested on x86_64 GNU/Linux. All feedbacks are welcome. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16238
2021-11-14sync libbacktrace from gccAlan Modra4-21/+54
2021-11-14Automatic date update in version.inGDB Administrator1-1/+1
2021-11-13Sync Makefile.tpl with GCCH.J. Lu2-23/+366
* Makefile.tpl: Sync with GCC. * Makefile.in: Regenerate.
2021-11-13sim: sh: fix switch-bool warningsMike Frysinger1-51/+28
This code triggers -Werror=switch-bool warnings with <=gcc-5 versions. Rework it to use if statements instead as it also simplifies a bit.
2021-11-13sim: sh: rework carry checks to not rely on integer overflowsMike Frysinger1-4/+4
In <=gcc-7 versions, -fstrict-overflow is enabled by default, and that triggers warnings in this code that relies on integer overflows to test for carries. Change the logic to test against the limit directly.
2021-11-13Automatic date update in version.inGDB Administrator1-1/+1
2021-11-12Fix gdb.base/sigstep.exp test for ppcCarl Love1-1/+11
The test stops at <signal_handler called> which is the call to the handler rather than in the handler as intended. This patch replaces the gdb_test "$enter_cmd to handler" with a gdb_test_multiple test. The multiple test looks for the stop at <signal_handler called>. If found, the command is issued again. The test passes if gdb stops in the handler as expected. (gdb) PASS: gdb.base/sigstep.exp: stepi to handler, nothing in handler, step from handler: continue to signal stepi <signal handler called> 1: x/i $pc => 0x7ffff7f80440 <__kernel_start_sigtramp_rt64>: bctrl (gdb) stepi handler (sig=551) at sigstep.c:32 32 { 1: x/i $pc => 0x10000097c <handler>: addis r2,r12,2 (gdb) PASS: gdb.base/sigstep.exp: stepi to handler, nothing in handler, step from handler: stepi to handler Patch has been tested on x86_64-linux and ppc64le-linux with no test failures.
2021-11-12[gdb/testsuite] Fix regexp in gdb.base/foll-vfork.expTom de Vries1-3/+3
On OBS I ran into: ... (gdb) PASS: gdb.base/foll-vfork.exp: exit: \ vfork relations in info inferiors: continue to child exit info inferiors^M Num Description Connection Executable ^M 1 <null> foll-vfork-exit ^M * 2 <null> foll-vfork-exit ^M (gdb) I'm the proud parent of child #5044!^M FAIL: gdb.base/foll-vfork.exp: exit: vfork relations in info inferiors: \ vfork relation no longer appears in info inferiors (timeout) ... Fix this by removing the '$' anchor in the corresponding '$gdb_prompt $' regexps. Tested on x86_64-linux.
2021-11-12Don't compile some opcodes files when bfd is 32-bit onlyAlan Modra5-56/+74
* Makefile.am (TARGET_LIBOPCODES_CFILES): Split into.. (TARGET64_LIBOPCODES_CFILES): ..this and.. (TARGET32_LIBOPCODES_CFILES): ..this. (ALL_MACHINES): Likewise split to (ALL64_MACHINES, ALL32_MACHINES): ..this. * disassemble.c: Define some ARCH_* when ARCH_all only if BFD64. * configure.ac (BFD_MACHINES): Defined depending on BFD_ARCH_SIZE. * Makefile.in: Regenerate. * configure: Regenerate.
2021-11-12Import Makefile.def from gccAlan Modra2-1634/+12128
* Makefile.def: Import from gcc. * Makefile.in: Regenerate.