aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-11-28sim: mn10300: resolve syscalls dynamicallyMike Frysinger3-5/+4
Avoid use of TARGET_<syscall> defines and rely on the callback layers to resolve these dynamically so we can support multiple syscall layers instead of assuming the newlib/libgloss numbers all the time.
2021-11-28sim: nltvals: drop i960Mike Frysinger2-26/+2
This port was dropped from gdb/bfd/sim years ago, so stop including its syscall constants too.
2021-11-28sim: moxie: fix datadir handlingMike Frysinger1-1/+1
Expand the value at `make` time rather than configure generation time so that we handle $(datarootdir) setting properly.
2021-11-28Automatic date update in version.inGDB Administrator1-1/+1
2021-11-27gdb: fix typos in configureSimon Marchi2-8/+8
The variable names used to restore CFLAGS and LDFLAGS here don't quite match the names used above, resulting in losing the original CFLAGS and LDFLAGS. Fix that. Change-Id: I9cc2c3b48b1dc30c31a7143563c893fd6f426a0a
2021-11-27sim: hw: mark hw_descriptors constMike Frysinger2-2/+2
2021-11-27sim: testsuite: add dedicated flag for init toolchain testsMike Frysinger2-6/+15
As we setup more reliable CC_FOR_TARGET variables for each target, the bfin way of overriding it to stuff custom CFLAGS doesn't scale well. Add a dedicated CFLAGS_FOR_TARGET_init setting that each set of tests can setup if they want to add custom options.
2021-11-27sim: testsuite: clean up arch specific toolchain settingsMike Frysinger3-4/+14
In a multitarget build, we process all targets in order, so make sure the toolchain settings from one don't leak into the next.
2021-11-27sim: cris: always search for local rvdummy toolMike Frysinger1-8/+2
If the board info sets the sim to a basename that is found via $PATH (which is the default dejagnu behavior), the logic here to use its dirname to find rvdummy fails because it looks for `./rvdummy`. So switch it to always use the local build of rvdummy which is the one we want to be testing against in the first place. If we get a request for testing against a different setup, we can figure out & document the needs at that point, and then setup some config knobs to control it.
2021-11-27[gdb/testsuite] Fix FAIL in gdb.base/list-missing-source.expTom de Vries1-1/+1
In commit f8080fb7a44 "[gdb/testsuite] Add gdb.base/include-main.exp" a file gdb.base/main.c was added, which caused the following regression: ... (gdb) list^M <gdb.base/main.c> (gdb) FAIL: gdb.base/list-missing-source.exp: list ... The problem is that the test-case does not expect to find a file main.c, but now it finds gdb.base/main.c. Fix this by using the more specific file name list-missing-source.c. Tested on x86_64-linux.
2021-11-26sim: testsuite: fix bits-gen EXEEXT handlingMike Frysinger2-8/+8
Add missing $(EXEEXT) to dependencies on bits-gen. These are actually build-only tools, but automake doesn't allow for build & host tools, so the rules are re-using EXEEXT.
2021-11-26sim: testsuite: initial support for OS-specific testsMike Frysinger107-107/+158
We usually test against the newlib/libgloss environment, but for a few ports that also support Linux apps, we want to test that logic too. A lot of the C code is written such that it works with either newlib/libgloss or glibc/linux toolchains, but we have some tests that end up being Linux-specific. Cris has been using the target tuple as a rough proxy for this (where cris*-*-elf is assumed to be newlib/libgloss, and everything else is glibc/linux), but that is a bit too rough, and it doesn't work in a multitarget build. So lets create a few stub files that we can do compile tests with to detect the different setups, and then let tests declare which one they require (if they require any at all).
2021-11-26sim: testsuite: unify basic C compiler checksMike Frysinger4-40/+53
Both bfin & cris ports test the C compiler to see if it works, but in their own way. Unify the checks in the common code so we can leverage them in more ports in the future, and collapse the bfin & cris code.
2021-11-26sim: testsuite: rework sim_init usageMike Frysinger44-26/+109
The sim_init function was called by runtest for each test when --tool was set to sim. When we changed to --tool '' to collapse the testsuite dir, the init function was no longer called on every test. However, it was still being called explicitly by config/default.exp. It's not clear why that explicit call ever existed since, in the past, it meant it was redundant. Lets drop the single sim_init call in config/default.exp and move it out to all our tests. This replicates the runtest behavior so we can setup variables on a per-test basis which allows us to recollapse the sim_path logic back. We'll also leverage this in the future for toolchain setup. Also add a few comments clarifying the overall runtime behavior.
2021-11-26sim: cris: fix testsuite hang when sim is missingMike Frysinger2-0/+9
If the cris sim hasn't been built yet, trying to run its testsuite will hang indefinitely. The common sim APIs already have this, so copy it over to the cris forks of the test+run functions.
2021-11-26sim: testsuite: fix objdir handlingMike Frysinger9-42/+46
The tests assume that the cwd is the objdir directory and write its intermediates to there all the time. When using runtest's --objdir setting though, this puts the files in the wrong place. This isn't a big problem currently as we never change --objdir, but in order to support parallel test execution, we're going to start setting that option, so clean up the code ahead of time. We also have to tweak some of the cris tests which were making assumptions about the argv[0] value.
2021-11-26sim: testsuite: rename global_sim_options to SIMFLAGS_FOR_TARGETMike Frysinger5-37/+19
Now that all the other toolchain settings have been renamed to match the dejagnu settings of XXX_FOR_TARGET, rename global_sim_options to SIMFLAGS_FOR_TARGET too.
2021-11-26sim: testsuite: replace global_ld_options with LDFLAGS_FOR_TARGETMike Frysinger6-30/+14
Only a few tests actually use global_ld_options, but we can replace the sim-specific settings with the dejagnu common LDFLAGS_FOR_TARGET and get the same result.
2021-11-27Automatic date update in version.inGDB Administrator1-1/+1
2021-11-26Fix ifunc test fails on hppa*-*-*John David Anglin1-1/+2
2021-11-26 John David Anglin <danglin@gcc.gnu.org> PR ld/27442 ld/ChangeLog: * ld/testsuite/ld-ifunc/ifunc.exp (contains_irelative_reloc): Adjust regexp. Skip static ifunc-using executable test on hppa*-*-*.
2021-11-26gas: Update commit 4780e5e4933H.J. Lu2-2/+2
Update commit 4780e5e4933a2497a5aecc4ceabbbb8e82aaf822 Author: Tom de Vries <tdevries@suse.de> Date: Fri Nov 26 09:59:45 2021 +0100 [gas] Fix file 0 dir with -gdwarf-5 1. Replace i with j in for (j = 0; i < NUM_MD5_BYTES; ++j) 2. Pass -W to readelf to force CU: in output due to: if (do_wide || strlen (directory) < 76) printf (_("CU: %s/%s:\n"), directory, file_table[0].name); else printf ("%s:\n", file_table[0].name); PR gas/28629 * dwarf2dbg.c (out_dir_and_file_list): Fix a typo in commit 4780e5e4933. * testsuite/gas/elf/dwarf-5-nop-for-line-table.d: Pass -W to readelf.
2021-11-26sim: testsuite: replace global_as_options with ASFLAGS_FOR_TARGETMike Frysinger4-18/+8
Only a few tests actually use global_as_options, but we can replace the sim-specific settings with the dejagnu common ASFLAGS_FOR_TARGET and get the same result.
2021-11-26[gdb/testsuite] Add gdb.base/include-main.expTom de Vries3-0/+87
The test-case gdb.ada/dgopt.exp uses the -gnatD switch, in combination with -gnatG. This causes the source file $src/gdb/testsuite/gdb.ada/dgopt/x.adb to be expanded into $build/gdb/testsuite/outputs/gdb.ada/dgopt/x.adb.dg, and the debug information should refer to the x.adb.dg file. That is the case for the .debug_line part: ... The Directory Table is empty. The File Name Table (offset 0x1c): Entry Dir Time Size Name 1 0 0 0 x.adb.dg ... but not for the .debug_info part: ... <11> DW_AT_name : $src/gdb/testsuite/gdb.ada/dgopt/x.adb <15> DW_AT_comp_dir : $build/gdb/testsuite/outputs/gdb.ada/dgopt ... Filed as PR gcc/103436. In C we can generate similar debug information, using a source file that does not contain any code, but includes another one that does: ... $ cat gdb/testsuite/gdb.base/include-main.c #include "main.c" ... such that in the .debug_line part we have: ... The Directory Table (offset 0x1c): 1 /home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.base The File Name Table (offset 0x57): Entry Dir Time Size Name 1 1 0 0 main.c ... and in the .debug_info part: ... <11> DW_AT_name : $src/gdb/testsuite/gdb.base/include-main.c <15> DW_AT_comp_dir : $build/gdb/testsuite ... Add a C test-case that mimics gdb.ada/dgopt.exp, that is: - generate debug info as described above, - issue a list of a line in include-main.c, while the corresponding CU is not expanded yet. Tested on x86_64-linux.
2021-11-26sim: testsuite: drop unused global_cc_optionsMike Frysinger1-5/+1
Nothing in the testsuite is using this setting, so let's drop it. Any code that wants to set compiler flags can use CFLAGS_FOR_TARGET instead to get the same effect.
2021-11-26sim: testsuite: punt unused toolchain variablesMike Frysinger3-44/+3
These haven't been used in over 20 years. The sim testsuite used to run these tools itself directly, but back in ~1999 it switched to the dejagnu helpers (e.g. target_assemble & target_link), and the dejagnu logic only utilizes XXX_FOR_TARGET variables. Punt them here to avoid confusion with dead code.
2021-11-26gdb: add risc-v disassembler options supportAndrew Burgess1-0/+8
This commit adds support for RISC-V disassembler options to GDB. This commit is based on this patch which was never committed: https://sourceware.org/pipermail/binutils/2021-January/114944.html All of the binutils refactoring has been moved to a separate, earlier, commit, so this commit is pretty straight forward, just registering the required gdbarch hooks. Co-authored-by: Simon Cook <simon.cook@embecosm.com>
2021-11-26opcodes/riscv: add disassembler options support to libopcodesAndrew Burgess4-9/+153
In preparation for the next commit, which will add GDB support for RISC-V disassembler options, this commit restructures how the disassembler options are managed within libopcodes. The implementation provided here is based on this mailing list patch which was never committed: https://sourceware.org/pipermail/binutils/2021-January/114944.html which in turn took inspiration from the MIPS implementation of the same feature. The biggest changes from the original mailing list post are: 1. The GDB changes have been split into a separate patch, and 2. The `riscv_option_args_privspec` variable, which held the valid priv-spec values is now gone, instead we use the `riscv_priv_specs` array from bfd/cpu-riscv.c instead. Co-authored-by: Simon Cook <simon.cook@embecosm.com> include/ChangeLog: * dis-asm.h (disassembler_options_riscv): Declare. opcodes/ChangeLog: * riscv-dis.c (enum riscv_option_arg_t): New enum typedef. (riscv_options): New static global. (disassembler_options_riscv): New function. (print_riscv_disassembler_options): Rewrite to use disassembler_options_riscv.
2021-11-26[gas] Fix file 0 dir with -gdwarf-5Tom de Vries3-3/+16
In out_dir_and_file_list, if file 0 is copied from file 1, only the filename is copied, and the dir and md5 fields are left to their default values. Fix this by adding the copy of the dir and md5 fields. gas/ChangeLog: 2021-11-26 Tom de Vries <tdevries@suse.de> PR 28629 * dwarf2dbg.c (out_dir_and_file_list): When copying file 1 to file 0, also copy dir and md5 fields. * testsuite/gas/i386/dwarf5-line-4.d: Adjust expected output.
2021-11-25sim: mips: avoid _ namespaceMike Frysinger1-3/+3
Some C libraries export _P symbols in their headers (like older newlib and its ctype.h), so use P_ instead to avoid conflicts.
2021-11-25ld: fix POSIX shell test usageMike Frysinger2-2/+2
POSIX test uses = for compares, not == which is a bashism.
2021-11-25gas: enable silent build rulesMike Frysinger2-2/+42
2021-11-25ld: fix --disable-multiple-abs-defs alignment in helpMike Frysinger11-11/+12
2021-11-26Automatic date update in version.inGDB Administrator1-1/+1
2021-11-25gdb: ensure extension_language_python is always definedEnze Li1-0/+4
In this commit: commit c6a6aad52d9e839d6a84ac31cabe2b7e1a2a31a0 Date: Mon Oct 25 17:25:45 2021 +0100 gdb/python: make some global variables static building without Python was broken. The extension_language_python global was moved from being always defined, to only being defined when the HAVE_PYTHON macro was defined. As a consequence, building without Python support would result in errors like: /usr/bin/ld: extension.o:(.rodata+0x120): undefined reference to `extension_language_python' This commit fixes the problem by moving the definition of extension_language_python outside of the HAVE_PYTHON macro protection.
2021-11-25Revert "gdb: add assert in remote_target::wait relating to async being off"Andrew Burgess1-5/+1
This commit introduced a test failure in gdb.server/attach-flag.exp. I didn't spot this failure originally as the problem is fixed by this, as yet unpushed patch: https://sourceware.org/pipermail/gdb-patches/2021-November/183768.html I unfortunately didn't test each patch in the original series independently. I'll repost this patch after the above patch has been merged. This reverts commit 32b1f5e8d6b8ddd3be6e471c26dd85a1dac31dda.
2021-11-25Fix building the AArch64 assembler and disassembler when assertions are ↵Nick Clifton4-32/+45
disabled. PR 28614 * aarch64-asm.c: Replace assert(0) with real code. * aarch64-dis.c: Likewise. * aarch64-opc.c: Likewise.
2021-11-25PR gdb/28480: Improve ambiguous member detectionBruno Larsen3-0/+57
Basic ambiguity detection assumes that when 2 fields with the same name have the same byte offset, it must be an unambiguous request. This is not always correct. Consider the following code: class empty { }; class A { public: [[no_unique_address]] empty e; }; class B { public: int e; }; class C: public A, public B { }; if we tried to use c.e in code, the compiler would warn of an ambiguity, however, since A::e does not demand an unique address, it gets the same address (and thus byte offset) of the members, making A::e and B::e have the same address. however, "print c.e" would fail to report the ambiguity, and would instead print it as an empty class (first path found). The new code solves this by checking for other found_fields that have different m_struct_path.back() (final class that the member was found in), despite having the same byte offset. The testcase gdb.cp/ambiguous.exp was also changed to test for this behavior.
2021-11-25coff-go32: consistent 16-byte section alignmentJan W. Jagersma1-2/+10
Section alignment for coff-go32 is inconsistent - The '.text' and '.data' sections are 16-byte aligned, but named sections '.text.*' and '.data.*' are only 4-byte aligned. '.gnu.linkonce.r.*' is aligned to 16 bytes, yet '.rodata' and '.rodata.*' are aligned to 4 bytes. For '.bss' all input sections are only aligned to 4 bytes. This primarily can cause trouble when using SSE instructions, which require their memory operands to be aligned to 16-byte boundaries. This patch solves the issue simply by setting the section alignment to 16 bytes, for all code and data sections referenced in the default linker script. * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Use partial name match for .text, .data. Add entries for .const, .rodata, .bss, .gnu.linkonce.b.
2021-11-25Re: AArch64: Add support for AArch64 EFI (efi-*-aarch64)Alan Modra4-21/+22
Commit b69c9d41e8 edited bfd/Makefile.in rather than using automake, which meant a typo in Makefile.am was not discovered and other differences in Makefile.in are seen with a proper regeneration. One difference was lack of an empty line between the pe-aarch64igen.c rule and the following $(BFD32_LIBS) etc. dependency rule, in the regenerated file. Not that it matters for proper "make" behaviour, but it's nicer with a line between those rules. Moving the rule earlier seems to cure the missing empty line. * Makefile.am (BFD64_BACKENDS): Correct typo. (BFD_H_DEPS, LOCAL_H_DEPS): Move earlier. Move rule using these deps earlier too. * Makefile.in: Regenerate. * po/BLD-POTFILES.in: Regenerate. * po/SRC-POTFILES.in: Regenerate.
2021-11-25Updated French translation for the opcodes directory.Nick Clifton2-236/+264
* po/fr.po; Updated French translation.
2021-11-25gdb: rename source_styling_changed observerAndrew Burgess4-7/+7
In a later commit I plan to add disassembler styling. In the same way that we have a source_styling_changed observer I would need to add a disassembler_styling_changed observer. However, currently, these observers would only be notified from cli-style.c:set_style_enabled, and observed in tui-winsource.c, tui_source_window::style_changed, as a result, having two observers seems unnecessary right now, so, in this commit, I plan to rename source_styling_changed to just styling_changed, then, in the later commit, when disassembler styling is added, I can use the same observer for both source styling, and disassembler styling. There should be no user visible changes after this commit.
2021-11-25gdb/python: make some global variables staticAndrew Burgess1-29/+24
Make a couple of global variables static in python/python.c. To do this I had to move the definition of extension_language_python to later in the file. There should be no user visible changes after this commit.
2021-11-25gdb: add assert in remote_target::wait relating to async being offAndrew Burgess1-1/+5
While working on another patch I ended up in a situation where I had async mode disabled (with 'maint set target-async off'), but the async event token got marked anyway. In this situation GDB was continually calling into remote_target::wait, however, the async token would never become unmarked as the unmarking is guarded by target_is_async_p. We could just unconditionally unmark the token, but that would feel like just ignoring a bug, so, instead, lets assert that if !target_is_async_p, then the async token should not be marked. This assertion would have caught my earlier mistake. There should be no user visible changes with this commit.
2021-11-25gdb: simplify remote_target::is_async_pAndrew Burgess1-6/+1
This commit simplifies remote_target::is_async_p by removing the target_async_permitted check. In previous commits I have added additional assertions around the target_async_permitted flag into target.c, as a result we should now be confident that if target_can_async_p returns false, a target will never have async mode enabled. Given this, it should not be necessary to check target_async_permitted in remote_target::is_async_p, if this flag is false ::is_async_p should return false anyway. There is an assert to this effect in target_is_async_p. There should be no user visible change after this commit.
2021-11-25gdb: add asserts in target.c for target_async_permittedAndrew Burgess1-1/+6
The target_async_permitted flag allows a user to override whether a target can act in async mode or not. In previous commits I have moved the checking of this flag out of the various ::can_async_p methods and into the common target.c code. In this commit I will add some additional assertions into target_is_async_p and target_async. The rules these assertions are checking are: 1. A target that returns false for target_can_async_p should never become "async enabled", and so ::is_async_p should always return false. This is being checked in target_is_async_p. 2. GDB should never try to enable async mode for a target that returns false for target_can_async_p, this is checked in target_async. There are a few places where we call the ::is_async_p method directly, in these cases we will obviously not pass through the assert in target_is_async_p, however, there are also plenty of places where we do call target_is_async_p so if GDB starts to misbehave we should catch it quickly enough. There should be no user visible changes after this commit.
2021-11-25gdb: hoist target_async_permitted checks into target.cAndrew Burgess3-10/+11
This commit moves the target_async_permitted check out of each targets ::can_async_p method and into the target_can_async_p wrapper function. I've left some asserts in the two ::can_async_p methods that I changed, which will hopefully catch any direct calls to these methods that might be added in the future. There should be no user visible changes after this commit.
2021-11-25gdb: introduce a new overload of target_can_async_pAndrew Burgess4-5/+17
There are a few places where we call the target_ops::can_async_p member function directly, instead of using the target_can_async_p wrapper. In some of these places this is because we need to ask before the target has been pushed, and in another location (in target.c) it seems unnecessary to go through the wrapper when we are already in target.c code. However, in the next commit I'd like to hoist some common checks out of target specific code into target.c. To achieve this, in this commit, I introduce a new overload of target_can_async_p which takes a target_ops pointer, and calls the ::can_async_p method directly. I then make use of the new overload where appropriate. There should be no user visible changes after this commit.
2021-11-25ld/testsuite/ld-elfvsb: correctly test "weak hidden symbol DSO last"Clément Chigot1-1/+1
The test must be done with the shared object and not with the object file which is already being tested above. ld/ * testsuite/ld-elfvsb/elfvsb.exp: use .so file in "weak hidden symbol DSO last"
2021-11-25[gdb/cli] Add "set logging enabled", deprecate "set logging on/off"Tom de Vries8-34/+89
Before commit 3b6acaee895 "Update more calls to add_prefix_cmd" we had the following output for "show logging file": ... $ gdb -q -batch -ex "set trace-commands on" \ -ex "set logging off" \ -ex "show logging file" \ -ex "set logging on" \ -ex "show logging file" +set logging off +show logging file Future logs will be written to gdb.txt. +set logging on +show logging file Currently logging to "gdb.txt". ... After that commit we have instead: ... +set logging off +show logging file The current logfile is "gdb.txt". +set logging on +show logging file The current logfile is "gdb.txt". ... Before the commit, whether logging is enabled or not can be deduced from the output of the command. After the commit, the message is unified and it's no longer clear whether logging is enabled or not. Fix this by: - adding a new command "show logging enabled" - adding a corresponding new command "set logging enabled on/off" - making the commands "set logging on/off" deprecated aliases of the "set logging enabled on/off" command. Update the docs and testsuite to use "set logging enabled". Mention the new and deprecated commands in NEWS. Tested on x86_64-linux.
2021-11-25[gdb/cli] Fix typo in logging overwrite help textTom de Vries1-1/+1
Currently we have: ... $ gdb -q -batch -ex "help set logging overwrite" Set whether logging overwrites or appends to the log file. If set, logging overrides the log file. ... Fix overrides -> overwrites typo.