Commit Graph

108249 Commits

Author SHA1 Message Date
Mike Frysinger
c7d1b270c2 libctf: enable silent build rules
Also add $(AM_V_xxx) to various manual rules in here.
2021-11-29 20:28:29 -05:00
Mike Frysinger
c7a92c872b gprof: enable silent build rules
Also add $(AM_V_xxx) to various manual rules in here.
2021-11-29 20:28:29 -05:00
Mike Frysinger
45c06bb712 binutils: merge doc subdir up a level
This avoids a recursive make into the doc subdir and speeds up the
build slightly.  It also allows for more parallelism.
2021-11-29 20:26:26 -05:00
Mike Frysinger
d8bbdb9dd5 binutils: enable silent build rules
Also add $(AM_V_xxx) to various manual rules in here.
2021-11-29 20:26:26 -05:00
Mike Frysinger
75ea503ef0 bfd: enable silent build rules
Also add $(AM_V_xxx) to various manual rules in here.
2021-11-29 20:26:26 -05:00
Mike Frysinger
13678b206f opcodes: enable silent build rules
Also add $(AM_V_xxx) to various manual rules in here.
2021-11-29 20:26:26 -05:00
GDB Administrator
9832d223d6 Automatic date update in version.in 2021-11-30 00:00:11 +00:00
Tom Tromey
1c0e43634c Allow DW_ATE_UTF for Rust characters
The Rust compiler plans to change the encoding of a Rust 'char' type
to use DW_ATE_UTF.  You can see the discussion here:

    https://github.com/rust-lang/rust/pull/89887

However, this fails in gdb.  I looked into this, and it turns out that
the handling of DW_ATE_UTF is currently fairly specific to C++.  In
particular, the code here assumes the C++ type names, and it creates
an integer type.

This comes from commit 53e710acd ("GDB thinks char16_t and char32_t
are signed in C++").  The message says:

    Both places need fixing.  But since I couldn't tell why dwarf2read.c
    needs to create a new type, I've made it use the per-arch built-in
    types instead, so that the types are only created once per arch
    instead of once per objfile.  That seems to work fine.

... which is fine, but it seems to me that it's also correct to make a
new character type; and this approach is better because it preserves
the type name as well.  This does use more memory, but first we
shouldn't be too concerned about the memory use of types coming from
debuginfo; and second, if we are, we should implement type interning
anyway.

Changing this code to use a character type revealed a couple of
oddities in the C/C++ handling of TYPE_CODE_CHAR.  This patch fixes
these as well.

I filed PR rust/28637 for this issue, so that this patch can be
backported to the gdb 11 branch.
2021-11-29 13:24:32 -07:00
Aaron Merey
b9db26b4c4 [PR gdb/27026] CTRL-C is ignored when debug info is downloaded
During debuginfod downloads, ctrl-c should result in the download
being cancelled and skipped.  However in some cases, ctrl-c fails to
get delivered to gdb during downloading.  This can result in downloads
being unskippable.

Fix this by ensuring that target_terminal::ours is in effect for the
duration of each download.

Co-authored-by: Tom de Vries <tdevries@suse.de>
https://sourceware.org/bugzilla/show_bug.cgi?id=27026#c3
2021-11-29 14:58:38 -05:00
Nick Clifton
584294c406 strings: Replace references to -u option with references to -U.
PR 28632
2021-11-29 15:37:24 +00:00
Tom de Vries
49fa1332a6 [gdb/symtab] Fix segfault in search_one_symtab
PR28539 describes a segfault in lambda function search_one_symtab due to
psymbol_functions::expand_symtabs_matching calling expansion_notify with a
nullptr symtab:
...
          struct compunit_symtab *symtab =
            psymtab_to_symtab (objfile, ps);

          if (expansion_notify != NULL)
            if (!expansion_notify (symtab))
              return false;
...

This happens as follows.  The partial symtab ps is a dwarf2_include_psymtab
for some header file:
...
(gdb) p ps.filename
$5 = 0x64fcf80 "/usr/include/c++/11/bits/stl_construct.h"
...

The includer of ps is a shared symtab for a partial unit, with as user:
...
(gdb) p ps.includer().user.filename
$11 = 0x64fc9f0 \
  "/usr/src/debug/llvm13-13.0.0-1.2.x86_64/tools/clang/lib/AST/Decl.cpp"
...

The call to psymtab_to_symtab expands the Decl.cpp symtab (and consequently
the shared symtab), but returns nullptr because:
...
struct dwarf2_include_psymtab : public partial_symtab
{
  ...
  compunit_symtab *get_compunit_symtab (struct objfile *objfile) const override
  {
    return nullptr;
  }
...

Fix this by returning the Decl.cpp symtab instead, which fixes the segfault
in the PR.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28539
2021-11-29 16:19:16 +01:00
Nick Clifton
8fee99c3c8 Update description of string's -n option.
PR 28632
	* strings.c (usage): Update desciption of -n option.
	* doc/binutils.texi: Likewise.
2021-11-29 14:52:42 +00:00
Tom de Vries
c261149278 [gdb/testsuite] Fix typo in proc lines
Proc lines contains a typo:
...
  string_form { set $_line_string_form $value }
...

Remove the incorrect '$' in '$_line_string_form'.

Tested on x86_64-linux.
2021-11-29 09:51:10 +01:00
Tom de Vries
2a0fa84217 [gdb/testsuite] Use unique files in gdb.dwarf2/dw2-lines.exp
While debugging a problem in gdb.dwarf2/dw2-lines.exp, I realized that the
test-case generates all executables and associated temporary files using the
same filenames.

Fix this by adding a new proc prefix_id in lib/gdb.exp, and using it in the
test-case.

Tested on x86_64-linux.
2021-11-29 09:51:10 +01:00
Tom de Vries
97b3f4e86f [gdb/testsuite] Fix gdb.dwarf2/dw2-lines.exp with -m32
When running test-case gdb.dwarf2/dw2-lines.exp with target board -unix/-m32,
we run into another instance of PR28383, where the dwarf assembler generates
64-bit relocations which are not supported by the 32-bit assembler:
...
dw2-lines-dw.S: Assembler messages:^M
outputs/gdb.dwarf2/dw2-lines/dw2-lines-dw.S:76: Error: \
  cannot represent relocation type BFD_RELOC_64^M
...

Fix this by using _op_offset in _line_finalize_header.

Tested on x86_64-linux.
2021-11-29 09:51:10 +01:00
Mike Frysinger
b42f20d2ac sim: testsuite: drop most specific istarget checks
We'll rely on the toolchain probing to determine whether each arch's
tests can be run rather the current configure target.  This allows
testing all of the ports in a multitarget configuration.

For now, we don't reformat the files entirely to make it easier to
review, and in case we need to make adjustments.  Once this feels
like it's stable, we can flatten the code a bit by removing the if
statement entirely.
2021-11-28 21:55:16 -05:00
Mike Frysinger
804de1faf4 sim: testsuite: support parallel execution
Break up the dejagnu logic so that we can parallelize the testsuite.
This takes a page from gcc & gdb where each .exp is run in isolation
instead of in serial.

For most targets, this doesn't make much of a difference as they only
have a single .exp.  A few (like cris & frv) have multiple .exp though
and will see a bit of a speed up.

The real gain is when testing a multitarget build.  This way we can
run all the targets in parallel and cut the execution time a bit.
On my system, it goes from ~155sec to ~100sec.

We can gain further speedups by splitting up some of the larger .exp
files into smaller groups.  We'll do that in a followup though.
2021-11-28 21:55:15 -05:00
Mike Frysinger
7a259895bb sim: testsuite: expand arch specific toolchain settings
Leverage the new per-port toolchain settings to initialize the env
for eeach set of tests.  This allows us to run all the tests in a
multitarget build if the user sets up the vars.  If they don't, we
can still skip all the tests.
2021-11-28 21:55:15 -05:00
Mike Frysinger
8996c21067 sim: testsuite: setup per-port toolchain settings for multitarget build
Gas does not support multitarget builds -- it still only supports
a single input & output format.  ld is a bit better, but requires
manual flags to select the right output.  This makes it impossible
to run the complete testsuite in a multitarget build.

To address this limitation, create a suite of FOR_TARGET variables
so these can be set to precompiled as & ld programs.  It requires
a bit of setup ahead of time, but it's a one-time cost, and makes
running the full testsuite at once much easier.
2021-11-28 21:55:15 -05:00
GDB Administrator
dba322be6e Automatic date update in version.in 2021-11-29 00:00:09 +00:00
Alan Modra
28cdb9c67a PR28629 NIOS2 fallout
The test exactly matched wrong output.

	PR 28629
	* testsuite/gas/nios2/relax.d: Update expected output.
2021-11-29 09:29:29 +10:30
Mike Frysinger
e9307449c3 sim: add checks to core headers to prevent incorrect common building
Some of the core sim headers rely on the SIM_AC_OPTION_BITSIZE macro
which can change the size of core types.  Since these haven't been
unified across ports, add checks to make sure they aren't accidentally
included when building for all ports.  This caught the sim-load file
using poisoned headers that it didn't actually need.
2021-11-28 14:28:35 -05:00
Mike Frysinger
6688220490 sim: unify syscall.o building
Now that we've unified all the syscall tables, this file does not rely
on any port-specific settings, so move it up to building as part of the
common step so we only do it once in a multibuild.
2021-11-28 13:24:04 -05:00
Mike Frysinger
1e42d01772 sim: drop unused gentmap & nltvals.def logic
Now that all ports have switched to target-newlib-* files, there's
no need for these files & generating things at build time.  So punt
the logic and make target-newlib-syscall a hard requirement.
2021-11-28 13:24:00 -05:00
Mike Frysinger
6cbb891faa sim: mcore: switch to new target-newlib-syscall
Use the new target-newlib-syscall module.  This is needed to merge all
the architectures into a single build, and mcore has a custom syscall
table for its newlib/libgloss port.
2021-11-28 13:23:59 -05:00
Mike Frysinger
c8c6ef3807 sim: riscv: switch to new target-newlib-syscall
Use the new target-newlib-syscall module.  This is needed to merge all
the architectures into a single build, and riscv has a custom syscall
table for its newlib/libgloss port.
2021-11-28 13:23:58 -05:00
Mike Frysinger
ab230d13fc sim: cr16: switch to new target-newlib-syscall
Use the new target-newlib-syscall module.  This is needed to merge all
the architectures into a single build, and cr16 has a custom syscall
table for its newlib/libgloss port.

This allows cleaning up the syscall ifdef logic.  We know these will
always exist now.
2021-11-28 13:23:58 -05:00
Mike Frysinger
0bf1633f01 sim: d10v: switch to new target-newlib-syscall
Use the new target-newlib-syscall module.  This is needed to merge all
the architectures into a single build, and d10v has a custom syscall
table for its newlib/libgloss port.

This allows cleaning up the syscall ifdef logic.  We know these will
always exist now.
2021-11-28 13:23:58 -05:00
Mike Frysinger
c44df9148d sim: sh: switch to new target-newlib-syscall
Use the new target-newlib-syscall module.  This is needed to merge all
the architectures into a single build, and sh has a custom syscall
table for its newlib/libgloss port.
2021-11-28 13:23:58 -05:00
Mike Frysinger
96b1eb7e17 sim: v850: switch to new target-newlib-syscall
Use the new target-newlib-syscall module.  This is needed to merge all
the architectures into a single build, and v850 has a custom syscall
table for its newlib/libgloss port.

This allows cleaning up the syscall ifdef logic.  We know these will
always exist now.
2021-11-28 13:23:58 -05:00
Mike Frysinger
e38330f8b0 sim: iq2000/lm32/m32c/moxie/rx: switch to new target-newlib-syscall.h
Use the new target-newlib-syscall.h to provide the target syscall
defines.  These code paths are written specifically for the newlib
ABI rather than being generalized, so switching them to the defines
rather than trying to go through the dynamic callback conversion
seems like the best trade-off for now.  Might have to reconsider
this in the future.
2021-11-28 13:23:58 -05:00
Mike Frysinger
64ae70dde5 sim: nltvals: pull target syscalls out into a dedicated source file
Like we just did for pulling out the errno map, pull out the syscall
maps into a dedicated common file.  Most newlib ports are using the
same syscall map, but not all, which means we have to do a bit more
work to migrate.

This commit adds the maps and switches the ports using the common
default syscall table over to it.  Ports using unique syscall tables
are still using the old targ-map.c logic.

Switching common ports over is easy by checking NL_TARGET, but the
ppc code needs a bit more cleanup here hence its larger diff.
2021-11-28 13:23:57 -05:00
Mike Frysinger
96537189c9 sim: frv: resolve syscalls dynamically
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-28 01:08:25 -05:00
Mike Frysinger
9af706c919 sim: mn10300: resolve syscalls dynamically
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-28 01:01:50 -05:00
Mike Frysinger
d485f8c7c2 sim: nltvals: drop i960
This port was dropped from gdb/bfd/sim years ago, so stop including
its syscall constants too.
2021-11-28 00:57:22 -05:00
Mike Frysinger
961af0641e sim: moxie: fix datadir handling
Expand the value at `make` time rather than configure generation time
so that we handle $(datarootdir) setting properly.
2021-11-28 00:56:44 -05:00
GDB Administrator
8be0a6307c Automatic date update in version.in 2021-11-28 00:00:10 +00:00
Simon Marchi
87bf14457e gdb: fix typos in configure
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-27 14:33:32 -05:00
Mike Frysinger
d9a84d15f2 sim: hw: mark hw_descriptors const 2021-11-27 12:15:16 -05:00
Mike Frysinger
6916d9e65c sim: testsuite: add dedicated flag for init toolchain tests
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-27 03:09:57 -05:00
Mike Frysinger
2b9c7c262e sim: testsuite: clean up arch specific toolchain settings
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-27 01:27:17 -05:00
Mike Frysinger
8613fa4c49 sim: cris: always search for local rvdummy tool
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 01:26:41 -05:00
Tom de Vries
950065a38b [gdb/testsuite] Fix FAIL in gdb.base/list-missing-source.exp
In commit f8080fb7a4 "[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-27 07:11:25 +01:00
Mike Frysinger
429a55b865 sim: testsuite: fix bits-gen EXEEXT handling
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-26 20:41:44 -05:00
Mike Frysinger
1214c97666 sim: testsuite: initial support for OS-specific tests
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-26 20:06:55 -05:00
Mike Frysinger
264dcc17cc sim: testsuite: unify basic C compiler checks
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-26 19:51:15 -05:00
Mike Frysinger
c0d6a6e582 sim: testsuite: rework sim_init usage
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-26 19:48:05 -05:00
Mike Frysinger
4c721b266f sim: cris: fix testsuite hang when sim is missing
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-26 19:37:31 -05:00
Mike Frysinger
e1e1ae6e9b sim: testsuite: fix objdir handling
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-26 19:27:21 -05:00
Mike Frysinger
03c0f9c205 sim: testsuite: rename global_sim_options to SIMFLAGS_FOR_TARGET
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-26 19:17:59 -05:00