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.
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.
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.
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.
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.
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.
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).
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.
...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
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.
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
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.
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.
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.