2
0
mirror of https://sourceware.org/git/binutils-gdb.git synced 2025-01-06 12:09:26 +08:00
Commit Graph

108040 Commits

Author SHA1 Message Date
Mike Frysinger
f098231806 sim: ppc: handle \r in igen inputs [PR sim/28476]
Make sure we consume & ignore \r bytes in inputs in case the file
encodings are from a non-LF systems (e.g. Windows).
2021-10-31 22:35:41 -04:00
Mike Frysinger
fc3579da2e sim: ppc: constify strings in igen tooling 2021-10-31 22:34:02 -04:00
GDB Administrator
e7360783ae Automatic date update in version.in 2021-11-01 00:00:19 +00:00
Tom Tromey
6e195444fb Fix latent bug in DWARF test case
On my branch that replaces the DWARF psymtab reader,
dw2-stack-boundary.exp started failing.  However, when I look at the
output in gdb.log, it is correct:

    file /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary
    Reading symbols from /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary...
    During symbol reading: location description stack overflow
    During symbol reading: location description stack underflow

What happens to cause the failure is that the two branches in
gdb_test_multiple appear in this order:

    -re "\r\nDuring symbol reading: location description stack underflow" {
    [...]
    -re "\r\nDuring symbol reading: location description stack overflow" {

The first one will match the above, without causing the second one to
ever match -- leading to a spurious failure.

Anchoring the regexps seems to fix the problem, and works for the
current gdb as well.
2021-10-31 11:35:28 -06:00
Tom Tromey
2a8f1f4744 Fix unittest.exp failure due to 'set debuginfod' addition
The 'set debuginfod' change caused a regression in unittest.exp:

    Running selftest help_doc_invariants.
    help doc broken invariant: command 'info set debuginfod' help doc first line is not terminated with a '.' character
    help doc broken invariant: command 'set debuginfod' help doc first line is not terminated with a '.' character
    help doc broken invariant: command 'show debuginfod' help doc first line is not terminated with a '.' character
    Self test failed: self-test failed at ../../binutils-gdb/gdb/unittests/command-def-selftests.c:100

This patch fixes the problem.  I'm checking it in.
2021-10-31 11:34:06 -06:00
Mike Frysinger
c26c6bc0a5 sim: ppc: use silent build rules here too
The ppc codebase is unique and doesn't leverage common/, so have to
add silent rules to it specifically.
2021-10-31 05:26:57 -04:00
Mike Frysinger
5231e3f242 sim: rl78: drop obsolete manual dependency rules
We have GNU make generate these for us automatically now, so there's
no need to manually specify any deps.
2021-10-31 05:09:09 -04:00
Mike Frysinger
f9bfc01578 sim: drop unused targ-vals.h includes
This is used in a few places where it's not needed.  Drop the include
to avoid the build-time generated header file as we move to drop it.
2021-10-31 04:53:22 -04:00
Mike Frysinger
cd3ee89d38 sim: unify callback.o building
Now that the use of TARGET_xxx defines have been removed, we can move
this to the common logic so we only build it once for multi-targets.
2021-10-31 04:51:44 -04:00
Mike Frysinger
670817b947 sim: nltvals: pull target open flags out into a dedicated source file
Like we just did for pulling out the errno & signal maps, pull out the
open flag map into a dedicated common file.  All newlib ports are using
the same map which makes it easy.
2021-10-31 04:51:44 -04:00
Mike Frysinger
b868a2393b sim: nltvals: localize TARGET_<open> defines
Code should not be using these directly, instead they should be
resolving these dynamically via the open_map.  Rework the common
callback code that was using the defines to use symbolic names
instead, and localize some of the defines in the ARM code (since
it's a bit unclear how many different APIs it supports currently),
then remove the defines out of the header so no new code can rely on
them.
2021-10-31 04:50:44 -04:00
Mike Frysinger
88c8370b25 sim: nltvals: pull target signal out into a dedicated source file
Like we just did for pulling out the errno map, pull out the signal
map into a dedicated common file.  All newlib ports are using the
same signal map which makes it easy.
2021-10-31 04:39:13 -04:00
Mike Frysinger
a7e40a9931 sim: nltvals: pull target errno out into a dedicated source file
The current system maintains a list of target errno constants in the
nltvals.def file, then runs a build-time tool to turn that into a C
file.  This list of errno values is the same for all arches, so we
don't need the arch-specific flexibility.  Further, these are only
for newlib/libgloss environments, which makes it confusing to support
other userland runtimes (like Linux).  Let's simplify to make this
easier to understand & build.  We don't namespace the variables yet,
but sets up the framework for it.

Create a new target-newlib-errno.c template file.  The template file
is hand written, but the inline map is still automatically generated.

This allows us to move it to the common set of objects so it's only
built once in a multi-target build.

Now we can remove the output from the gentmap build-time tool since
it's checked into the tree.

Then we stop including the errno lists in nltvals.def since nothing
uses it.
2021-10-31 04:31:28 -04:00
Mike Frysinger
f9cd2be59c sim: erc32: use silent build rules with sis linkage 2021-10-31 04:19:41 -04:00
Mike Frysinger
5b3c2b9f3b sim: erc32: fix a few more build warnings
Tweak the if indentation & brace style to avoid ambiguous warnings.

Add ATTRIBUTE_UNUSED to UART functions that aren't used when FAST_UART
is defined (which is the default).
2021-10-31 04:18:58 -04:00
Orgad Shaneh
4ab6404b1c sim: erc32: fix signedness compatibility and redefinition warnings 2021-10-31 04:11:38 -04:00
Mike Frysinger
65dcce8f79 sim: add arch-specific conditional logic
This will make it easy to include arch-specific logic (build files)
as we migrate ports to the common top level build.
2021-10-31 02:03:16 -04:00
Mike Frysinger
68c2129ae6 sim: v850: delete old gencode logic
The v850 port used to have a gencode helper, but it was deleted long
ago.  Clean up the settings that no longer make sense w/out it.
2021-10-31 01:49:17 -04:00
Mike Frysinger
2213e33dd2 sim: common: merge multiple clean commands
This provides a minor speedup when cleaning in a multi-target build.
2021-10-31 01:17:10 -04:00
Mike Frysinger
b46621118d sim: m32c: tighten up opc2c build output
Drop the single debugging line that repeats the command line option,
and use the silent build helpers to tighten up output.
2021-10-31 01:11:41 -04:00
Mike Frysinger
9709fa5bcb sim: tighten up build regen rules
Update the makefile & configure related rules to use the silent
build helpers.
2021-10-31 01:08:05 -04:00
Mike Frysinger
4837497a7f sim: tighten up gencode output
Update the gencode rules to use the silent build helpers.
2021-10-31 01:05:27 -04:00
Mike Frysinger
ac9b6df28f sim: igen: tighten up build output
Add a new stamp helper for quiet builds, and don't dump the command
line options when it runs.  That isn't standard tool behavior, and
doesn't really seem necessary in any way.
2021-10-31 00:55:50 -04:00
Mike Frysinger
65f42b88ff sim: tighten up stamp rules
Add a new ECHO_STAMP helper and convert existing stamp code over
to it.  This is mostly common rules and cgen mloop rules.
2021-10-31 00:49:39 -04:00
Mike Frysinger
b6143d3162 sim: silence stamp touch rules
We pretty much never care about these stamp touches, so silence them.
Also switch to using $@ when it makes sense.
2021-10-31 00:46:28 -04:00
Mike Frysinger
4f2b181ecb sim: standardize move-if-change rules
Use the srcroot path and make them all silent.
2021-10-31 00:39:40 -04:00
Mike Frysinger
bdcbd1b67f sim: mips/v850: remove redundant variable setup
The common/Make-common.in fragment already provides these variables.
2021-10-31 00:23:36 -04:00
Orgad Shaneh
1352aabb23 sim: fix compilation on mingw64 [PR sim/28476]
...by reordering includes.

1. sim-utils.c

sim/mips/sim-main.h defines UserMode, while there is a struct in winnt.h
which has UserMode as a member. So if sim-main.h is included before winnt.h,
compilation fails.

2. ppc

registers.h defines CR, which is used as a member in winnt.h.

winsock2.h is included by sys/time.h, so sys/time.h has to be included
before registers.h.

Bug: https://sourceware.org/PR28476
2021-10-30 23:50:09 -04:00
Alan Modra
590abc168f Don't include coff/pe.h in coff-x86_64.c
This (and other) code from coffcode.h is broken for x86_64_coff_vec,
and has been ever since support was added in 2006 commit 99ad839030
Here, bfd_coff_aoutsz must match coff_swap_aouthdr_out otherwise we
end up writing garbage.

      /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
	 include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)).  */
      char * buff;
      bfd_size_type amount = bfd_coff_aoutsz (abfd);

      buff = (char *) bfd_malloc (amount);
      if (buff == NULL)
	return false;

      coff_swap_aouthdr_out (abfd, & internal_a, buff);
      amount = bfd_bwrite (buff, amount, abfd);

We have removed support for --target=x86_64-coff, likely because it
never worked properly, but still produce coff-x86_64.o with
--enable-targets=all.  This means objcopy can recognize x86_64 COFF
files but will write garbage to the output file, a fact found by
fuzzers.  I suspect x86_64 COFF is still broken after this fix, and
mention of coff-x86_64.* should be removed from bfd/Makefile.am.

	* coff-x86_64.c: Don't include coff/pe.h.
	(COFF_WITH_pex64): Don't define here.
	* pe-x86_64.c: Include coff/pe.h and other headers.
	(PEI_HEADERS): Define.
2021-10-31 11:42:52 +10:30
Alan Modra
1c5e9d8d8c Re: PR28420, ecoff fuzzing failures
sym_ptr_ptr NULL results in segfaults.

	PR 28420
	* ecoff.c (ecoff_slurp_reloc_table): Don't leave sym_ptr_ptr NULL.
2021-10-31 11:42:08 +10:30
Alan Modra
9216910ed8 ubsan: alpha-vms: undefined shift
* vms-alpha.c (evax_bfd_print_image): Shift left 1u.
2021-10-31 11:41:39 +10:30
Alan Modra
3c8ed65a5d PR28518: signed integer overflow & free on unmalloced address
PR 28518
	* vms-alpha.c (build_module_list): Don't lose malloc buffer address.
	Use unsigned variables.
2021-10-31 10:57:52 +10:30
GDB Administrator
fb9f44d410 Automatic date update in version.in 2021-10-31 00:00:09 +00:00
Simon Marchi
311d36251d gdb: fix gdb.gdb/unittest.exp with C++17 compiler
On a machine with gcc 11, I get:

    FAIL: gdb.gdb/unittest.exp: test_completion: tab complete "maintenance selftest string_v" (second tab) (timeout)
    FAIL: gdb.gdb/unittest.exp: test_completion: tab complete "maintenance selftest string_vie" (timeout)

That's because when compiling with C++ >= 17, we use the standard
version of string_view, and don't have a selftest for it.  So the list
of selftests shown by the tab completion when completing "string_v"
differs.

Change the test to use the copy_* tests instead.

Change-Id: I85f6aa44ee5fc9652b9bd4451e0506b89773526b
2021-10-29 22:17:07 -04:00
Aaron Merey
3ea44f2129 gdb.texinfo: Expand documentation for debuginfod
Add section describing GDB's usage of debuginfod.

Refer to this new section in the description of the '--with-debuginfod'
configure option.

Mention debuginfod in the 'Separate Debug Files' section.
2021-10-29 20:58:21 -04:00
Aaron Merey
7811fa5995 gdb: add set/show commands for managing debuginfod
Add 'set debuginfod' command.  Accepts 'on', 'off' or 'ask' as an
argument.  'on' enables debuginfod for the current session.  'off'
disables debuginfod for the current session.  'ask' will prompt
the user to either enable or disable debuginfod when the next query
is about to be performed:

    This GDB supports auto-downloading debuginfo from the following URLs:
    <URL1> <URL2> ...
    Enable debuginfod for this session? (y or [n]) y
    Debuginfod has been enabled.
    To make this setting permanent, add 'set debuginfod on' to .gdbinit.

For interactive sessions, 'ask' is the default.  For non-interactive
sessions, 'off' is the default.

Add 'show debuginfod status' command.  Displays whether debuginfod
is set to 'on', 'off' or 'ask'.

Add 'set/show debuginfod urls' commands. Accepts a string of
space-separated debuginfod server URLs to be queried.  The default
value is copied from the DEBUGINFOD_URLS environment variable.

Finally add 'set/show debuginfod verbose' commands to control whether
debuginfod-related output is displayed.  Verbose output is enabled
by default.

    (gdb) run
    Starting program: /bin/sleep 5
    Download failed: No route to host.  Continuing without debug info for /lib64/libc.so.6.

If GDB is not built with debuginfod then these commands will just display

    Support for debuginfod is not compiled into GDB.
2021-10-29 20:58:21 -04:00
GDB Administrator
4a3a56c5f3 Automatic date update in version.in 2021-10-30 00:00:26 +00:00
Simon Marchi
51e36a3aaa gdb: remove TYPE_FIELD_DWARF_BLOCK
Remove TYPE_FIELD_DWARF_BLOCK, replace with type::field +
field::loc_dwarf_block.

Change-Id: I10af9410bb5f46d342b8358a7956998c7e804b64
2021-10-29 16:44:45 -04:00
Simon Marchi
e06c3e112e gdb: remove TYPE_FIELD_STATIC_PHYSADDR
Remove TYPE_FIELD_STATIC_PHYSADDR replace with type::field +
field::loc_physaddr.

Change-Id: Ica9bc4a48f34750ec82ec86c298d3ecece81bcbd
2021-10-29 16:44:45 -04:00
Simon Marchi
fcbbbd90f0 gdb: remove TYPE_FIELD_STATIC_PHYSNAME
Remove TYPE_FIELD_STATIC_PHYSNAME, replace with type::field +
field::loc_physname.

Change-Id: Ie35d446b67dd1d02f39998b406001bdb7e6d5abb
2021-10-29 16:44:45 -04:00
Simon Marchi
970db51860 gdb: remove TYPE_FIELD_ENUMVAL
Remove TYPE_FIELD_ENUMVAL, replace with type::field +
field::loc_enumval.

Change-Id: I2ada73e4635aad3363ce2eb22c1dc52698ee2072
2021-10-29 16:44:45 -04:00
Simon Marchi
b610c04548 gdb: remove TYPE_FIELD_BITPOS
Remove TYPE_FIELD_BITPOS, replace its uses with type::field +
field::loc_bitpos.

Change-Id: Iccd8d5a77e5352843a837babaa6bd284162e0320
2021-10-29 16:44:44 -04:00
Simon Marchi
2ad53ea10c gdb: remove TYPE_FIELD_LOC_KIND
Remove TYPE_FIELD_LOC_KIND, replace its uses with type::field +
field::loc_kind.

Change-Id: Ib124a26365df82ac1d23df7962d954192913bd90
2021-10-29 16:44:21 -04:00
Simon Marchi
d8557c3d22 gdb: remove FIELD_DWARF_BLOCK macro
Remove FIELD_DWARF_BLOCK, replace its uses with field::loc_dwarf_block.

Change-Id: I66b7d6a960cb5e341e61e21bd3cc9a6ac26de6a8
2021-10-29 16:44:21 -04:00
Simon Marchi
31a1516a81 gdb: remove FIELD_STATIC_PHYSADDR macro
Remove FIELD_LOC_KIND_PHYSADDR, replace its uses with
field::loc_physaddr.

Change-Id: Ifd8b2bdaad75f42bfb1404ef8c396ffe7e10ac55
2021-10-29 16:44:21 -04:00
Simon Marchi
16654a591a gdb: remove FIELD_STATIC_PHYSNAME macro
Remove FIELD_STATIC_PHYSNAME, replace its uses with field::loc_physname.

Change-Id: Iaa8952410403b4eb5bbd68411feea27e2405d657
2021-10-29 16:44:21 -04:00
Simon Marchi
5d2038e3f5 gdb: remove FIELD_ENUMVAL macro
Remove FIELD_ENUMVAL, replace its uses with field::loc_enumval.

Change-Id: Id4861cee91a8bb583a9836f1aa5da0a320fbf4d9
2021-10-29 16:44:21 -04:00
Simon Marchi
3a543e211e gdb: remove FIELD_BITPOS macro
Remove FIELD_BITPOD, replace its uses with field::loc_bitpos.

Change-Id: Idb99297e0170661254276c206383a7e9bf1a935a
2021-10-29 16:44:21 -04:00
Simon Marchi
8d939e8ea4 gdb: remove FIELD_LOC_KIND macro
Remove FIELD_LOC_KIND, replace its uses with field::loc_kind or
call_site_target::loc_kind.

Change-Id: I0368d8c3ea269d491bb215aa70e32edbdf55f389
2021-10-29 16:44:20 -04:00
Tom Tromey
d3771fe234 Add gdb.Architecture.integer_type Python function
This adds a new Python function, gdb.Architecture.integer_type, which
can be used to look up an integer type of a given size and
signed-ness.  This is useful to avoid dependency on debuginfo when a
particular integer type would be useful.

v2 moves this to be a method on gdb.Architecture and addresses other
review comments.
2021-10-29 07:52:31 -06:00