Compare commits

...

273 Commits

Author SHA1 Message Date
Joel Brobecker
ef6ec3333e Set GDB version number to 11.2.
gdb/ChangeLog:

	* version.in: Set GDB version number to 11.2.
2022-01-16 15:02:34 +04:00
Joel Brobecker
afe4096699 Manual copyright year update of various GDB files
This commit updates the copyright year of various files which
gdb/copyright.py is not able to handle automatically.

gdb/ChangeLog:

        * gdbarch.sh: Update end year of copyright year range for
        copyright header of generated files.

gdb/doc/ChangeLog:

        * gdb.texinfo: Change end year of the manual's copyright notice
        to 2022.
        * refcard.tex: Ditto.
2022-01-16 14:47:00 +04:00
Joel Brobecker
88b9d36337 Automatic Copyright Year update after running gdb/copyright.py
This commit brings all the changes made by running gdb/copyright.py
as per GDB's Start of New Year Procedure.

For the avoidance of doubt, all changes in this commits were
performed by the script.
2022-01-16 14:38:12 +04:00
Joel Brobecker
f2126454e7 gdb/copyright.py: Do not update gdbsupport/Makefile.in
This file is generated, so we should not modify it (any modification
we make is going to be undone at the next re-generation anyway).

gdb/ChangeLog:

	* copyright.py (EXCLUDE_LIST): Add "gdbsupport/Makefile.in".

(cherry picked from commit a3f3402131)
2022-01-16 14:34:15 +04:00
Joel Brobecker
b5c91ebd98 Update copyright year in version output for gdb, gdbserver and gdbreplay
This commit changes the end year of the copyright year range
printed by gdb, gdbserver and gdbreplay to be 2022. This reflects
the fact that some changes were made on this branch this year.

gdb/ChangeLog:

        * top.c: Update year range in copyright notice.
        (print_gdb_version): Update copyright year to 2022.

gdbserver/ChangeLog:

       * gdbreplay.cc: Update year range in copyright notice.
       (gdbreplay_version): Update copyright year to 2022.
       * server.cc: Update year range in copyright notice.
       (gdbserver_version): Update copyright year to 2022.
2022-01-16 14:29:26 +04:00
GDB Administrator
2198a5eca5 Automatic date update in version.in 2022-01-16 00:00:32 +00:00
GDB Administrator
6afe5a4bf5 Automatic date update in version.in 2022-01-15 00:00:26 +00:00
GDB Administrator
6ff73cab9e Automatic date update in version.in 2022-01-14 00:00:53 +00:00
GDB Administrator
707055a26d Automatic date update in version.in 2022-01-13 00:00:31 +00:00
Mike Frysinger
685c3b6b8f sim: add ChangeLog for SIGSTKSZ update 2022-01-12 06:58:31 -05:00
Mike Frysinger
17d6f2152b sim: filter out SIGSTKSZ [PR sim/28302]
We map target signals to host signals so we can propagate signals
between the host & simulated worlds.  That means we need to know
the symbolic names & values of all signals that might be sent.

The tools that generate that list use signal.h and include all
symbols that start with "SIG" so as to automatically include any
new symbols that the C library might add.  Unfortunately, this
also picks up "SIGSTKSZ" which is not actually a signal itself,
but a signal related setting -- it's the size of the stack when
a signal is handled.

By itself this doesn't super matter as we will never see a signal
with that same value (since the range of valid signals tend to be
way less than 1024, and the size of the default signal stack will
never be that small).  But with recent glibc changes that make this
into a dynamic value instead of a compile-time constant, some users
see build failures when building the sim.

As suggested by Adam Sampson, update our scripts to ignore this
symbol to simplify everything and avoid the build failure.

Bug: https://sourceware.org/PR28302
2022-01-12 06:02:08 -05:00
GDB Administrator
2e894896ae Automatic date update in version.in 2022-01-12 00:00:37 +00:00
GDB Administrator
7a52f4e7ba Automatic date update in version.in 2022-01-11 00:00:49 +00:00
Fangrui Song
fb0b83d80d bfd_section_from_shdr: Support SHT_RELR sections
If a.so contains an SHT_RELR section, objcopy a.so will fail with:

    a.so: unknown type [0x13] section `.relr.dyn'

This change allows objcopy to work.

bfd/
    * elf.c (bfd_section_from_shdr): Support SHT_RELR.

(cherry picked from commit a619b58721)
2022-01-10 05:05:22 -08:00
Fangrui Song
67609c9c70 readelf: Support SHT_RELR/DT_RELR for -r
The -r output for SHT_RELR looks like:

Relocation section '.relr.dyn' at offset 0x530 contains 4 entries:
  7 offsets
00000000000028c0
00000000000028c8
0000000000003ad0
0000000000003ad8
0000000000003ae0
0000000000003ae8
0000000000003af0

For --use-dynamic, the header looks like

    'RELR' relocation section at offset 0x530 contains 32 bytes:

include/
    * elf/common.h (DT_ENCODING): Bump to 38.
    * elf/external.h (Elf32_External_Relr): New.
    (Elf64_External_Relr): New.

(cherry picked from commit a7fd118627)
2022-01-10 05:05:22 -08:00
Fangrui Song
1b244ed9d3 readelf: Support RELR in -S and -d and output
readelf -r dumping support is not added in this patch.

include/
	* elf/common.h: Add SHT_RELR, DT_RELR{,SZ,ENT}
bfd/
	* elf.c (_bfd_elf_print_private_bfd_data): Add DT_RELR{,SZ,ENT}.

(cherry picked from commit dd207c1302)
2022-01-10 05:05:22 -08:00
GDB Administrator
6473a19828 Automatic date update in version.in 2022-01-10 00:00:40 +00:00
GDB Administrator
c3ed5e03da Automatic date update in version.in 2022-01-09 00:00:36 +00:00
GDB Administrator
a1620b8ad4 Automatic date update in version.in 2022-01-08 00:00:27 +00:00
GDB Administrator
3a9183ba79 Automatic date update in version.in 2022-01-07 00:00:33 +00:00
GDB Administrator
99e28ccf1c Automatic date update in version.in 2022-01-06 00:00:26 +00:00
GDB Administrator
e62a5735c6 Automatic date update in version.in 2022-01-05 00:00:39 +00:00
GDB Administrator
131890b09d Automatic date update in version.in 2022-01-04 00:00:33 +00:00
GDB Administrator
7932ed1d8a Automatic date update in version.in 2022-01-03 00:00:47 +00:00
GDB Administrator
0611afc4a5 Automatic date update in version.in 2022-01-02 00:00:36 +00:00
GDB Administrator
ca396c1289 Automatic date update in version.in 2022-01-01 00:00:33 +00:00
GDB Administrator
9a1012563c Automatic date update in version.in 2021-12-31 00:00:34 +00:00
GDB Administrator
ab31db4296 Automatic date update in version.in 2021-12-30 00:00:29 +00:00
GDB Administrator
4e3308b4ef Automatic date update in version.in 2021-12-29 00:00:36 +00:00
GDB Administrator
a661fc7968 Automatic date update in version.in 2021-12-28 00:00:23 +00:00
GDB Administrator
6567268b01 Automatic date update in version.in 2021-12-27 00:00:23 +00:00
GDB Administrator
a03fbc6504 Automatic date update in version.in 2021-12-26 00:00:27 +00:00
GDB Administrator
caa9934704 Automatic date update in version.in 2021-12-25 00:00:25 +00:00
GDB Administrator
345b218476 Automatic date update in version.in 2021-12-24 00:00:26 +00:00
Andrew Burgess
6eccc2c811 gdb/remote: handle attach when stop packet lacks thread-id
Bug PR gdb/28405 reports a regression when using attach with an
extended-remote target.  In this case the target is not including a
thread-id in the stop packet it sends back after the attach.

The regression was introduced with this commit:

  commit 8f66807b98
  Date:   Wed Jan 13 20:26:58 2021 -0500

      gdb: better handling of 'S' packets

The problem is that when GDB processes the stop packet, it sees that
there is no thread-id and so has to "guess" which thread the stop
should apply to.

In this case the target only has one thread, so really, there's no
guessing needed, but GDB still runs through the same process, this
shouldn't cause us any problems.

However, after the above commit, GDB now expects itself to be more
internally consistent, specifically, only a thread that GDB thinks is
resumed, can be a candidate for having stopped.

It turns out that, when GDB attaches to a process through an
extended-remote target, the threads of the process being attached too,
are not, initially, marked as resumed.

And so, when GDB tries to figure out which thread the stop might apply
too, it finds no threads in the processes marked resumed, and so an
assert triggers.

In extended_remote_target::attach we create a new thread with a call
to add_thread_silent, rather than remote_target::remote_add_thread,
the reason is that calling the latter will result in a call to
'add_thread' rather than 'add_thread_silent'.  However,
remote_target::remote_add_thread includes additional
actions (i.e. calling remote_thread_info::set_resumed and set_running)
which are missing from extended_remote_target::attach.  These missing
calls are what would serve to mark the new thread as resumed.

In this commit I propose that we add an extra parameter to
remote_target::remote_add_thread.  This new parameter will force the
new thread to be added with a call to add_thread_silent.  We can now
call remote_add_thread from the ::attach method, the extra
actions (listed above) will now be performed, and the thread will be
left in the correct state.

Additionally, in PR gdb/28405, a segfault is reported.  This segfault
triggers when 'set debug remote 1' is used before trying to reproduce
the original assertion failure.  The cause of this is in
remote_target::select_thread_for_ambiguous_stop_reply, where we do
this:

  remote_debug_printf ("first resumed thread is %s",
		       pid_to_str (first_resumed_thread->ptid).c_str ());
  remote_debug_printf ("is this guess ambiguous? = %d", ambiguous);

  gdb_assert (first_resumed_thread != nullptr);

Notice that when debug printing is on we dereference
first_resumed_thread before we assert that the pointer is not
nullptr.  This is the cause of the segfault, and is resolved by moving
the assert before the debug printing code.

I've extended an existing test, ext-attach.exp, so that the original
test is run multiple times; we run in the original mode, as normal,
but also, we now run with different packets disabled in gdbserver.  In
particular, disabling Tthread would trigger the assertion as it was
reported in the original bug.  I also run the test in all-stop and
non-stop modes now for extra coverage, we also run the tests with
target-async enabled, and disabled.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28405

This is a cherry pick of commit b622494ee3 with a minor edit
in gdb.server/ext-attach.exp to disable some tests that fail due to
unrelated bugs.  Those unrelated bugs have been fixed in the master
branch.

gdb/ChangeLog:

	PR gdb/28405
	* remote.c (remote_target::remote_add_thread): Add new silent_p
	argument, use as needed.
	(remote_target::remote_notice_new_inferior): Pass additional
	argument to remote_add_thread.
	(remote_target::remote_notice_new_inferior): Likewise.
	(extended_remote_target::attach): Call remote_add_thread instead
	of add_thred_silent directly.
	(remote_target::select_thread_for_ambiguous_stop_reply): Move
	assert earlier, before we use the thing we're asserting is not
	nullptr.

gdb/testsuite/ChangeLog:

	PR gdb/28405
	* gdb.server/ext-attach.exp (run_test): New proc containing all of
	the old code for running the core of the test.  This proc is then
	called multiple times from the global scope.
2021-12-23 12:31:17 +00:00
GDB Administrator
f76f728ffd Automatic date update in version.in 2021-12-23 00:00:37 +00:00
GDB Administrator
a370d72ecf Automatic date update in version.in 2021-12-22 00:00:26 +00:00
GDB Administrator
929b774352 Automatic date update in version.in 2021-12-21 00:00:35 +00:00
GDB Administrator
5605cc18dd Automatic date update in version.in 2021-12-20 00:00:24 +00:00
GDB Administrator
d98eeb47ea Automatic date update in version.in 2021-12-19 00:00:39 +00:00
GDB Administrator
810d072bd7 Automatic date update in version.in 2021-12-18 00:00:24 +00:00
GDB Administrator
e3d95ca82e Automatic date update in version.in 2021-12-17 00:00:34 +00:00
GDB Administrator
e6e466cedd Automatic date update in version.in 2021-12-16 00:00:24 +00:00
GDB Administrator
ea170f6ffe Automatic date update in version.in 2021-12-15 00:00:39 +00:00
GDB Administrator
45be8a2b16 Automatic date update in version.in 2021-12-14 00:00:23 +00:00
GDB Administrator
273fac204d Automatic date update in version.in 2021-12-13 00:00:23 +00:00
GDB Administrator
ab55bbac1f Automatic date update in version.in 2021-12-12 00:00:18 +00:00
Bruno Larsen
b6fc91c70a PR gdb/28480: Improve ambiguous member detection
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.

gdb/ChangeLog:

        PR gdb/28480
        * valops.c (struct_field_searcher::update_result): Improve
        ambiguous member detection.

gdb/testsuite/ChangeLog:

        PR gdb/28480

        Pushed by Joel Brobecker  <brobecker@adacore.com>
        * gdb.cp/ambiguous.cc: Add code to permit ambiguous member testing.
        * gdb.cp/ambiguous.exp: Add ambiguous member test.

(cherry picked from commit a41ad3474c)
2021-12-11 11:47:53 +04:00
GDB Administrator
773d894825 Automatic date update in version.in 2021-12-11 00:00:18 +00:00
GDB Administrator
2d77b379a9 Automatic date update in version.in 2021-12-10 00:00:33 +00:00
GDB Administrator
2d5dce68ed Automatic date update in version.in 2021-12-09 00:00:34 +00:00
GDB Administrator
d317660e0f Automatic date update in version.in 2021-12-08 00:00:27 +00:00
GDB Administrator
f032db248f Automatic date update in version.in 2021-12-07 00:00:22 +00:00
GDB Administrator
50cf27bed5 Automatic date update in version.in 2021-12-06 00:00:25 +00:00
GDB Administrator
f6447d9f92 Automatic date update in version.in 2021-12-05 00:00:31 +00:00
GDB Administrator
fc73c76917 Automatic date update in version.in 2021-12-04 00:00:26 +00:00
GDB Administrator
59830e9697 Automatic date update in version.in 2021-12-03 00:00:25 +00:00
GDB Administrator
63d2050f29 Automatic date update in version.in 2021-12-02 00:00:27 +00:00
GDB Administrator
c652828a45 Automatic date update in version.in 2021-12-01 00:00:24 +00:00
GDB Administrator
70dbf597ad Automatic date update in version.in 2021-11-30 00:00:35 +00:00
Tom Tromey
29b161c9be 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.

(cherry picked from commit 1c0e43634c)
2021-11-29 13:26:44 -07:00
GDB Administrator
a15b33284f Automatic date update in version.in 2021-11-29 00:00:19 +00:00
GDB Administrator
9c23016e64 Automatic date update in version.in 2021-11-28 00:00:25 +00:00
GDB Administrator
f7f95dcace Automatic date update in version.in 2021-11-27 00:00:25 +00:00
GDB Administrator
06c0d1d26c Automatic date update in version.in 2021-11-26 00:00:36 +00:00
GDB Administrator
3dbaf8b8d6 Automatic date update in version.in 2021-11-25 00:00:28 +00:00
GDB Administrator
5fcc74d627 Automatic date update in version.in 2021-11-24 00:00:20 +00:00
GDB Administrator
11d793d493 Automatic date update in version.in 2021-11-23 00:00:32 +00:00
GDB Administrator
a3d56dd2ce Automatic date update in version.in 2021-11-22 00:00:28 +00:00
GDB Administrator
fa99595e20 Automatic date update in version.in 2021-11-21 00:00:24 +00:00
GDB Administrator
8bf74da8b5 Automatic date update in version.in 2021-11-20 00:00:23 +00:00
GDB Administrator
844167be7e Automatic date update in version.in 2021-11-19 00:00:21 +00:00
GDB Administrator
cd7cd26244 Automatic date update in version.in 2021-11-18 00:00:28 +00:00
GDB Administrator
999d24edf9 Automatic date update in version.in 2021-11-17 00:00:22 +00:00
GDB Administrator
505b342993 Automatic date update in version.in 2021-11-16 00:00:20 +00:00
GDB Administrator
13ba01c9c0 Automatic date update in version.in 2021-11-15 00:00:40 +00:00
GDB Administrator
e16aac146c Automatic date update in version.in 2021-11-14 00:00:26 +00:00
GDB Administrator
84c7311167 Automatic date update in version.in 2021-11-13 00:00:49 +00:00
GDB Administrator
c340a77598 Automatic date update in version.in 2021-11-12 00:00:57 +00:00
GDB Administrator
08487122c9 Automatic date update in version.in 2021-11-11 00:00:49 +00:00
GDB Administrator
30e9dd04ca Automatic date update in version.in 2021-11-10 00:00:40 +00:00
Tom Tromey
df9ebc472a Fix build on rhES5
The rhES5 build failed due to an upstream import a while back.  The
bug here is that, while the 'personality' function exists,
ADDR_NO_RANDOMIZE is only defined in <linux/personality.h>, not
<sys/personality.h>.

However, <linux/personality.h> does not declare the 'personality'
function, and <sys/personality.h> and <linux/personality.h> cannot
both be included.

This patch restores one of the removed configure checks and updates
the code to check it.

We had this as a local patch at AdaCore, because it seemed like there
was no interest upstream.  However, now it turns out that this fixes
PR build/28555, so I'm sending it now.
2021-11-09 14:21:39 -07:00
GDB Administrator
73bcd9e0d6 Automatic date update in version.in 2021-11-09 00:00:40 +00:00
GDB Administrator
c43a199306 Automatic date update in version.in 2021-11-08 00:00:33 +00:00
GDB Administrator
3de9076f4a Automatic date update in version.in 2021-11-07 00:00:23 +00:00
GDB Administrator
4a19a411c7 Automatic date update in version.in 2021-11-06 00:00:37 +00:00
GDB Administrator
733f5ecd42 Automatic date update in version.in 2021-11-05 00:00:45 +00:00
GDB Administrator
34e1abb0e8 Automatic date update in version.in 2021-11-04 00:00:30 +00:00
Luis Machado
eb79b23180 [AArch64] Make gdbserver register set selection dynamic
The current register set selection mechanism for AArch64 is static, based
on a pre-populated array of register sets.

This means that we might potentially probe register sets that are not
available. This is OK if the kernel errors out during ptrace, but probing the
tag_ctl register, for example, does not result in a ptrace error if the kernel
supports the tagged address ABI but not MTE (PR 28355).

Making the register set selection dynamic, based on feature checks, solves
this and simplifies the code a bit. It allows us to list all of the register
sets only once, and pick and choose based on HWCAP/HWCAP2 or other properties.

gdb/ChangeLog:

2021-11-03  Luis Machado  <luis.machado@linaro.org>

	PR gdb/28355

	* arch/aarch64.h (struct aarch64_features): New struct.

gdbserver/ChangeLog:

2021-11-03  Luis Machado  <luis.machado@linaro.org>

	PR gdb/28355

	* linux-aarch64-low.cc (is_sve_tdesc): Remove.
	(aarch64_target::low_arch_setup): Rework to adjust the register sets.
	(aarch64_regsets): Update to list all register sets.
	(aarch64_regsets_info, regs_info_aarch64): Replace NULL with nullptr.
	(aarch64_sve_regsets, aarch64_sve_regsets_info)
	(regs_info_aarch64_sve): Remove.
	(aarch64_adjust_register_sets): New.
	(aarch64_target::get_regs_info): Remove references to removed structs.
	(initialize_low_arch): Likewise.
2021-11-03 10:02:31 -03:00
GDB Administrator
a941d3fdb1 Automatic date update in version.in 2021-11-03 00:00:31 +00:00
GDB Administrator
5ada555838 Automatic date update in version.in 2021-11-02 00:00:34 +00:00
GDB Administrator
a0e862d7f7 Automatic date update in version.in 2021-11-01 00:00:30 +00:00
GDB Administrator
67287a7c43 Automatic date update in version.in 2021-10-31 00:00:35 +00:00
GDB Administrator
02eb14bd47 Automatic date update in version.in 2021-10-30 00:00:54 +00:00
GDB Administrator
26fa2cb834 Automatic date update in version.in 2021-10-29 00:00:43 +00:00
GDB Administrator
cf99bfd1ca Automatic date update in version.in 2021-10-28 00:00:40 +00:00
GDB Administrator
2fd704fd2a Automatic date update in version.in 2021-10-27 00:00:32 +00:00
GDB Administrator
db9f6e8a99 Automatic date update in version.in 2021-10-26 00:00:42 +00:00
GDB Administrator
3da237413c Automatic date update in version.in 2021-10-25 00:00:42 +00:00
GDB Administrator
987c028c2e Automatic date update in version.in 2021-10-24 00:00:29 +00:00
GDB Administrator
6084d652a5 Automatic date update in version.in 2021-10-23 00:00:28 +00:00
GDB Administrator
2e68dcbe8f Automatic date update in version.in 2021-10-22 00:00:32 +00:00
Tom de Vries
cfd85eb3ef [gdb/tui] Fix breakpoint display functionality
In commit 81e6b8eb20 "Make tui-winsource not use breakpoint_chain", a loop
body was transformed into a lambda function body:
...
-      for (bp = breakpoint_chain;
-           bp != NULL;
-           bp = bp->next)
+      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
...
and consequently:
- a continue was replaced by a return, and
- a final return was added.

Then in commit 240edef62f "gdb: remove iterate_over_breakpoints function", we
transformed back to a loop body:
...
-      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
+      for (breakpoint *bp : all_breakpoints ())
...
but without reverting the changes that introduced the two returns.

Consequently, breakpoints no longer show up in the tui source window.

Fix this by reverting the changes that introduced the two returns.

Build on x86_64-linux, tested with all .exp test-cases that contain
tuiterm_env.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28483

gdb/ChangeLog:

2021-10-22  Tom de Vries  <tdevries@suse.de>

	PR tui/28483
	* tui/tui-winsource.c (tui_source_window_base::update_breakpoint_info):
	Fix returns in loop body.

gdb/testsuite/ChangeLog:

2021-10-22  Tom de Vries  <tdevries@suse.de>

	PR tui/28483
	* gdb.tui/break.exp: New file.
2021-10-22 00:28:14 +02:00
GDB Administrator
255f124ebf Automatic date update in version.in 2021-10-21 00:00:34 +00:00
GDB Administrator
45ac9b3304 Automatic date update in version.in 2021-10-20 00:00:24 +00:00
GDB Administrator
5b76f7b82a Automatic date update in version.in 2021-10-19 00:00:40 +00:00
GDB Administrator
87e0dc2d33 Automatic date update in version.in 2021-10-18 00:00:26 +00:00
GDB Administrator
1c1dcae053 Automatic date update in version.in 2021-10-17 00:00:30 +00:00
GDB Administrator
81ec5585c4 Automatic date update in version.in 2021-10-16 00:00:26 +00:00
GDB Administrator
b7bbf079cb Automatic date update in version.in 2021-10-15 00:00:23 +00:00
GDB Administrator
02b2935bac Automatic date update in version.in 2021-10-14 00:00:26 +00:00
GDB Administrator
d94297b3f4 Automatic date update in version.in 2021-10-13 00:00:19 +00:00
GDB Administrator
71533ee68d Automatic date update in version.in 2021-10-12 00:00:27 +00:00
GDB Administrator
08b9a7669f Automatic date update in version.in 2021-10-11 00:00:30 +00:00
GDB Administrator
7ac26e5532 Automatic date update in version.in 2021-10-10 00:00:32 +00:00
GDB Administrator
088463f10f Automatic date update in version.in 2021-10-09 00:00:32 +00:00
GDB Administrator
77155dc2c1 Automatic date update in version.in 2021-10-08 00:00:25 +00:00
GDB Administrator
a7898ff640 Automatic date update in version.in 2021-10-07 00:00:20 +00:00
GDB Administrator
2fa5031035 Automatic date update in version.in 2021-10-06 00:00:25 +00:00
GDB Administrator
61c4e60495 Automatic date update in version.in 2021-10-05 00:00:20 +00:00
Tom de Vries
9b4d030ed5 [gdb/build] Add CXX_DIALECT to CXX
Say we use a gcc version that (while supporting c++11) does not support c++11
by default, and needs an -std setting to enable it.

If gdb would use the default AX_CXX_COMPILE_STDCXX from autoconf-archive, then
we'd have:
...
CXX="g++ -std=gnu++11"
...

That mechanism however has the following problem (quoting from commit
0bcda68539):
...
the top level Makefile passes CXX down to subdirs, and that overrides whatever
gdb/Makefile may set CXX to.  The result would be that a make invocation from
the build/gdb/ directory would use "g++ -std=gnu++11" as expected, while a
make invocation at the top level would not.
...

Commit 0bcda68539 fixes this by using a custom AX_CXX_COMPILE_STDCXX which
does:
...
CXX=g++
CXX_DIALECT=-std=gnu++11
...

The problem reported in PR28318 is that using the custom instead of the
default AX_CXX_COMPILE_STDCXX makes the configure test for std::thread
support fail.

We could simply add $CXX_DIALECT to the test for std::thread support, but
that would have to be repeated for each added c++ support test.

Instead, fix this by doing:
...
CXX="g++ -std=gnu++11"
CXX_DIALECT=-std=gnu++11
...

This is somewhat awkward, since it results in -std=gnu++11 occuring twice in
some situations:
...
$ touch src/gdb/dwarf2/read.c
$ ( cd build/gdb; make V=1 dwarf2/read.o )
g++-4.8 -std=gnu++11 -x c++ -std=gnu++11 ...
...

However, both settings are needed:
 - the switch in CXX for the std::thread tests (and other tests)
 - the switch in CXX_DIALECT so it can be appended in Makefiles, to
   counteract the fact that the top-level Makefile overrides CXX

The code added in gdb/ax_cxx_compile_stdcxx.m4 is copied from the default
AX_CXX_COMPILE_STDCXX from autoconf-archive.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28318

gdb/ChangeLog:

2021-10-04  Tom de Vries  <tdevries@suse.de>

	PR build/28318
	* ax_cxx_compile_stdcxx.m4: Add CXX_DIALECT to CXX.
	* configure: Regenerate.

gdbserver/ChangeLog:

2021-10-04  Tom de Vries  <tdevries@suse.de>

	PR build/28318
	* configure: Regenerate.

gdbsupport/ChangeLog:

2021-10-04  Tom de Vries  <tdevries@suse.de>

	PR build/28318
	* configure: Regenerate.
2021-10-04 18:56:42 +02:00
GDB Administrator
7061d67445 Automatic date update in version.in 2021-10-04 00:00:21 +00:00
GDB Administrator
2d78340547 Automatic date update in version.in 2021-10-03 00:00:26 +00:00
GDB Administrator
d3784526c2 Automatic date update in version.in 2021-10-02 00:00:24 +00:00
GDB Administrator
acb52ed980 Automatic date update in version.in 2021-10-01 00:00:26 +00:00
GDB Administrator
cce80da09d Automatic date update in version.in 2021-09-30 00:00:21 +00:00
GDB Administrator
30be4ac09a Automatic date update in version.in 2021-09-29 00:00:28 +00:00
GDB Administrator
b1efafb912 Automatic date update in version.in 2021-09-28 00:00:19 +00:00
GDB Administrator
96609cb359 Automatic date update in version.in 2021-09-27 00:00:21 +00:00
GDB Administrator
aa20be8d05 Automatic date update in version.in 2021-09-26 00:00:17 +00:00
GDB Administrator
fc0ff94085 Automatic date update in version.in 2021-09-25 00:00:34 +00:00
GDB Administrator
2cbc1315ac Automatic date update in version.in 2021-09-24 00:00:26 +00:00
GDB Administrator
957b1d8f2f Automatic date update in version.in 2021-09-23 00:00:20 +00:00
GDB Administrator
28e12bc76d Automatic date update in version.in 2021-09-22 00:00:21 +00:00
GDB Administrator
c5de623fa3 Automatic date update in version.in 2021-09-21 00:00:28 +00:00
GDB Administrator
a4ec45d1bf Automatic date update in version.in 2021-09-20 00:00:29 +00:00
GDB Administrator
b588e7944b Automatic date update in version.in 2021-09-19 00:00:32 +00:00
GDB Administrator
85bcf07db6 Automatic date update in version.in 2021-09-18 00:00:19 +00:00
GDB Administrator
3d3a078e98 Automatic date update in version.in 2021-09-17 00:00:20 +00:00
GDB Administrator
aeeddd7146 Automatic date update in version.in 2021-09-16 00:00:36 +00:00
GDB Administrator
be34cc2df4 Automatic date update in version.in 2021-09-15 00:00:20 +00:00
GDB Administrator
5bca320a3d Automatic date update in version.in 2021-09-14 00:00:31 +00:00
Joel Brobecker
824d17dbdb Bump GDB version number to 11.1.90.DATE-git.
gdb/ChangeLog:

	* version.in: Set GDB version number to 11.1.90.DATE-git.

gdb/testsuite/ChangeLog:

	* gdb.base/default.exp: Change $_gdb_minor to 2.
2021-09-12 18:54:34 -07:00
Joel Brobecker
8cdd8568bf Document the GDB 11.1 release in gdb/ChangeLog
gdb/ChangeLog:

	GDB 11.1 released.
2021-09-12 18:41:19 -07:00
Joel Brobecker
c599303f92 Set GDB version number to 11.1.
gdb/ChangeLog:

	* version.in: Set GDB version number to 11.1.
2021-09-12 18:32:10 -07:00
GDB Administrator
73a2711e86 Automatic date update in version.in 2021-09-13 00:00:33 +00:00
GDB Administrator
23b81cc63e Automatic date update in version.in 2021-09-12 00:00:16 +00:00
GDB Administrator
0c177cbe0a Automatic date update in version.in 2021-09-11 00:00:19 +00:00
Tom de Vries
7883d1e157 [gdb/testsuite] Handle unrecognized command line option in gdb_compile_test
When running the gdb testsuite with gnatmake-4.8, I get many fails of the
following form:
...
gcc: error: unrecognized command line option '-fgnat-encodings=all'^M
gnatmake: "gdb.ada/O2_float_param/foo.adb" compilation error^M
compiler exited with status 1
compilation failed: gcc ... gdb.ada/O2_float_param/foo.adb
gcc: error: unrecognized command line option '-fgnat-encodings=all'
gnatmake: "gdb.ada/O2_float_param/foo.adb" compilation error
FAIL: gdb.ada/O2_float_param.exp: scenario=all: compilation foo.adb
...

Fix this by marking the test unsupported instead, such that we have:
...
UNSUPPORTED: gdb.ada/O2_float_param.exp: scenario=all: compilation foo.adb \
  (unsupported option '-fgnat-encodings=all')
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-09-10  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (gdb_compile_test): Handle unrecognized command line
	option.
2021-09-10 18:36:36 +02:00
GDB Administrator
55fc911ad6 Automatic date update in version.in 2021-09-10 00:00:19 +00:00
Tom Tromey
b06653b60a Add ChangeLog entry for previous patch
I forgot to 'git commit' the ChangeLog for the previous patch.

2021-09-08  Tom Tromey  <tom@tromey.com>

	* dwarf2/read.h (dwarf2_per_objfile::resize_symtabs): Remove.
	* dwarf2/read.c (all_comp_units_iterator, all_comp_units_range):
	New classes.
	(dwarf2_per_objfile::symtab_set_p)
	(dwarf2_per_objfile::get_symtab, dwarf2_per_objfile::set_symtab):
	Adjust to resizeable vectors.
	(dwarf2_gdb_index::expand_symtabs_matching)
	(dwarf2_base_index_functions::map_symbol_filenames)
	(dwarf2_debug_names_index::expand_symtabs_matching): Use
	all_comp_units_range.
	(dwarf2_initialize_objfile, dwarf2_build_psymtabs)
	(add_type_unit): Don't call resize_symtabs.
2021-09-09 09:58:12 -06:00
Tom de Vries
5e6741a157 [gdb/testsuite] Fix gdb.base/coredump-filter-build-id.exp with older eu-unstrip
On openSUSE Leap 42.3 with eu-unstrip 0.158, we run into:
...
(gdb) PASS: gdb.base/coredump-filter-build-id.exp: save corefile
First line of eu-unstrip: \
  0x400000+0x202000 f4ae8502bd6a14770182382316bc595e9dc6f08b@0x400284 - - [exe]
FAIL: gdb.base/coredump-filter-build-id.exp: gcore dumped mapping with build-id
...

The test expects an actual file name instead of '[exe]', but that only got
introduced with eu-unstrip 0.161.  Before it printed '[exe]' or '[pie]'.

Fix this by updating the regexp.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-09-09  Tom de Vries  <tdevries@suse.de>

	* gdb.base/coredump-filter-build-id.exp: Handle older eu-unstrip.
2021-09-09 13:55:02 +02:00
Tom de Vries
127e9f8549 [gdb/testsuite] Fix various issues in gdb.mi/mi-sym-info.exp
I noticed this failure in gdb.mi/mi-sym-info.exp with gcc-4.8:
...
FAIL: gdb.mi/mi-sym-info.exp: -symbol-info-functions --max-results 1 \
  (unexpected output)
...
due to function f2 instead of f3 being listed.

AFAICT, this is caused by a difference in debug info:
...
$ readelf -wi outputs/gdb.mi/mi-sym-info/mi-sym-info1.o \
  | egrep "DW_AT_name.*: f[1-3]"
    <72>   DW_AT_name        : f1
    <a1>   DW_AT_name        : f2
    <d0>   DW_AT_name        : f3
...
vs:
...
$ readelf -wi outputs/gdb.mi/mi-sym-info/mi-sym-info1.o \
  | egrep "DW_AT_name.*: f[1-3]"
    <f4>   DW_AT_name        : f3
    <123>   DW_AT_name        : f2
    <152>   DW_AT_name        : f1
...
and the command documentation does not mention an imposed order, so fix this
by allowing f2 as well.

Doing this fix, it made sense to do a refactoring of adding f2_re and f3_re
variables, in order to write (?:$f2_re|$f3_re), and I applied the same pattern
overall.

Furthermore, I found a silent FAIL due to calling mi_gdb_proc with 2 args, fix
by updating the regexp.

Then I ran with clang and found another FAIL, fix by updating the regexp.

Tested on x86_64-linux with gcc-4.8.5, gcc-7.5.0, gcc-11.2.1, clang-7.0.1 and
clang-12.0.1.

gdb/testsuite/ChangeLog:

2021-09-09  Tom de Vries  <tdevries@suse.de>

	* gdb.mi/mi-sym-info.exp: Fix regexps.  Add missing message argument
	to mi_gdb_test.  Factor out regexps for functions and variables.
2021-09-09 13:55:02 +02:00
GDB Administrator
706ff47ce2 Automatic date update in version.in 2021-09-09 00:00:21 +00:00
Tom Tromey
de2143d60b Fix two regressions caused by CU / TU merging
PR symtab/28160 and PR symtab/27893 concern GDB crashes in the test
suite when using the "fission" target board.  They are both caused by
the patches that merge the list of CUs with the list of TUs (and to a
lesser degree by the patches to share DWARF data across objfiles), and
the underlying issue is the same: it turns out that reading a DWO can
cause new type units to be created.  This means that the list of
dwarf2_per_cu_data objects depends on precisely which CUs have been
expanded.  However, because the type units can be created while
expanding a CU means that the vector of CUs can expand while it is
being iterated over -- a classic mistake.  Also, because a TU can be
added later, it means the resize_symtabs approach is incorrect.

This patch fixes resize_symtabs by removing it, and having set_symtab
resize the vector on demand.  It fixes the iteration problem by
introducing a safe (index-based) iterator and changing the relevant
spots to use it.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28160
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27893

(cherry picked from commit d58e54bd27)
2021-09-08 14:50:50 -06:00
Luis Machado
cdf4e8ae55 Revert: [AArch64] MTE corefile support
bfd     * elf.c (elfcore_make_memtag_note_section): New function.
		(elfcore_grok_note): Handle NT_MEMTAG note types.

	binutils* readelf.c (get_note_type): Handle NT_MEMTAG note types.

	include * elf/common.h (NT_MEMTAG): New constant.
		(NT_MEMTAG_TYPE_AARCH_MTE): New constant.
2021-09-08 08:58:44 -03:00
GDB Administrator
dd0fea103f Automatic date update in version.in 2021-09-08 00:00:27 +00:00
John Baldwin
aaa394b7df fbsd-nat: Don't use '%jd' and '%ju' with printf_filtered.
The handler for 'info proc status' for native processes on FreeBSD
uses the 'j' size modifier along with uintmax_t / intmax_t casts to
output integer values for types such as off_t that are not aliases of
a basic C type such as 'int' or 'long'.  printf_filtered does not
support the 'j' modifer, so this resulted in runtime errors in
practice:

(gdb) info proc stat
process 8674
Name: ls
State: T (stopped)
Parent process: 8673
Process group: 8674
Session id: 2779
Unrecognized format specifier 'j' in printf

Instead, use plongest and pulongest to generate the output strings of
these integer values.

gdb/ChangeLog:

	* fbsd-nat.c (fbsd_nat_target::info_proc): Use plongest and
	pulongest instead of %j.
2021-09-07 16:09:17 -07:00
GDB Administrator
1aa04a582c Automatic date update in version.in 2021-09-07 00:00:19 +00:00
GDB Administrator
244d1aadd7 Automatic date update in version.in 2021-09-06 00:00:26 +00:00
GDB Administrator
2b195da8a2 Automatic date update in version.in 2021-09-05 00:00:30 +00:00
Tom de Vries
a6e40b53ef [gdb/testsuite] Check avx support in gdb.arch/amd64-disp-step-avx.exp
On a machine on Open Build Service I'm running into a SIGILL for test-case
gdb.arch/amd64-disp-step-avx.exp:
...
Program received signal SIGILL, Illegal instruction.^M
test_rip_vex2 () at gdb.arch/amd64-disp-step-avx.S:40^M
40              vmovsd ro_var(%rip),%xmm0^M
(gdb) FAIL: gdb.arch/amd64-disp-step-avx.exp: vex2: \
  continue to test_rip_vex2_end
...
The SIGILL happens when trying to execute the first avx instruction in the
executable.

I can't directly access the machine, but looking at the log for test-case
gdb.arch/i386-avx.exp, it seems that there's no avx support:
...
Breakpoint 1, main (argc=1, argv=0x7fffffffd6b8) at gdb.arch/i386-avx.c:68^M
68        if (have_avx ())^M
(gdb) print have_avx ()^M
$1 = 0^M
...

Fix this by:
- adding a gdb_caching_proc have_avx, similar to have_mpx, using the have_avx
  function from gdb.arch/i386-avx.c
- using proc have_avx in both gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp
  and gdb/testsuite/gdb.arch/i386-avx.exp.

Tested on my x86_64-linux laptop with avx support, where both test-cases pass.

gdb/testsuite/ChangeLog:

2021-09-04  Tom de Vries  <tdevries@suse.de>

	PR testsuite/26950
	* gdb/testsuite/gdb.arch/i386-avx.c (main): Remove call to have_avx.
	(have_avx): Move ...
	* gdb/testsuite/lib/gdb.exp (have_avx): ... here.  New proc.
	* gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp: Use have_avx.
	* gdb/testsuite/gdb.arch/i386-avx.exp: Same.
2021-09-04 12:11:35 +02:00
GDB Administrator
76c001c234 Automatic date update in version.in 2021-09-04 00:00:24 +00:00
Tom de Vries
e34a209edf [gdb/testsuite] Add untested case in gdb.gdb/complaints.exp
When building gdb with "-Wall -O2 -g -flto=auto", I run into:
...
(gdb) call clear_complaints()^M
No symbol "clear_complaints" in current context.^M
(gdb) FAIL: gdb.gdb/complaints.exp: clear complaints
...

The problem is that lto has optimized away clear_complaints, and consequently
the selftests cannot run.

Fix this by:
- using info function to detect presence of clear_complaints
- handling the absence of clear_complaints by calling untested
...
(gdb) UNTESTED: gdb.gdb/complaints.exp: \
  Cannot find clear_complaints, skipping test
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-09-03  Tom de Vries  <tdevries@suse.de>

	* gdb.gdb/complaints.exp: Use untested if clear_complaints cannot
	be found.
2021-09-03 17:40:10 +02:00
Tom de Vries
5c177fed07 [gdb/testsuite] Add untested case in selftest_setup
When building gdb with "-Wall -O2 -g -flto=auto", I run into:
...
FAIL: gdb.gdb/python-helper.exp: breakpoint in captured_main \
  (got interactive prompt)
FAIL: gdb.gdb/python-helper.exp: run until breakpoint at captured_main
WARNING: Couldn't test self
...
and similar in gdb.gdb/selftest.exp.

The first FAIL in more detail:
...
(gdb) break captured_main^M
Function "captured_main" not defined.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) FAIL: gdb.gdb/python-helper.exp: breakpoint in captured_main \
  (got interactive prompt)
...

The problem is that lto has optimized away the captured_main function
and consequently the selftests dependent on that cannot run.

Fix this by:
- using gdb_breakpoint to detect failure to set the breakpoint
- handling the failure to set a breakpoint by calling untested
- not emitting the warning if we've already got untested
such that we have:
...
(gdb) UNTESTED: gdb.gdb/python-helper.exp: Cannot set breakpoint at \
  captured_main, skipping testcase.
...

gdb/testsuite/ChangeLog:

2021-09-03  Tom de Vries  <tdevries@suse.de>

	* lib/selftest-support.exp: Emit untested when not being able to set
	breakpoint.
2021-09-03 15:13:14 +02:00
GDB Administrator
c6c2468fdf Automatic date update in version.in 2021-09-03 00:00:38 +00:00
GDB Administrator
26db900e8d Automatic date update in version.in 2021-09-02 00:00:29 +00:00
Tom de Vries
c52e9db30f [gdb/testsuite] Fix dwo path in fission-*.S
[ Using $build for /home/vries/gdb_versions/devel/build to make things a bit
more readable. ]

When using make check// to run test-case gdb.dwarf2/fission-base.exp:
...
( cd $build/gdb; make check//unix RUNTESTFLAGS="fission-base.exp" )
...
we run into:
...
(gdb) file \
  $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base^M
Reading symbols from \
  $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base...^M
warning: Could not find DWO CU \
  $build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo \
  (0x807060504030201) referenced by CU at offset 0xc7 [in module \
  $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base]^M
...

The problem is that the executable refers to the dwo file using path name
$build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo,
while the actual dwo file is at
$build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base.dwo.

This is caused by this trick in fission-base.S:
...
 #define XSTR(s) STR(s)
 #define STR(s) #s
   ...
   .asciz XSTR(DWO)        # DW_AT_GNU_dwo_name
...
and:
...
$ echo | gcc -E -dD - | grep "define unix"
...

I used this trick to avoid doing additional_flags=-DDWO=\"$dwo\", since I was
concerned that there could be quoting issues.

However, I've found other uses of this pattern, f.i. in
gdb/testsuite/gdb.base/corefile-buildid.exp:
...
  additional_flags=-DSHLIB_NAME=\"$dlopen_lib\"]
...

So, fix this by:
- using additional_flags=-DDWO=\"$dwo\" and
- using plain DWO instead of XSTR(DWO)

Likewise in other gdb.dwarf2/fission*.exp test-cases.

Tested on x86_64-linux, using make check//unix.

gdb/testsuite/ChangeLog:

2021-09-01  Tom de Vries  <tdevries@suse.de>

	PR testsuite/28298
	* gdb.dwarf2/fission-base.S: Use DWO instead of XSTR(DWO).
	* gdb.dwarf2/fission-loclists-pie.S: Same.
	* gdb.dwarf2/fission-loclists.S: Same.
	* gdb.dwarf2/fission-reread.S: Same.
	* gdb.dwarf2/fission-base.exp: Use additional_flags=-DDWO=\"$dwo\".
	* gdb.dwarf2/fission-loclists-pie.exp: Same.
	* gdb.dwarf2/fission-loclists.exp: Same.
	* gdb.dwarf2/fission-reread.exp: Same.
2021-09-01 20:14:53 +02:00
Tom de Vries
351b63eca9 [gdb/testsuite] Fix gdb.fortran/call-no-debug.exp symbol search
On openSUSE Tumbleweed I ran into:
...
(gdb) ptype outstring_func.part^M
No symbol "outstring_func" in current context.^M
(gdb) FAIL: gdb.fortran/call-no-debug.exp: ptype outstring_func.part
...
while on openSUSE Leap 15.2 I have instead:
...
(gdb) ptype string_func_^M
type = <unknown return type> ()^M
(gdb) PASS: gdb.fortran/call-no-debug.exp: ptype string_func_
...

The difference is caused by the result for "info function string_func", which
is this for the latter:
...
(gdb) info function string_func^M
All functions matching regular expression "string_func":^M
^M
Non-debugging symbols:^M
0x000000000040089c  string_func_^M
...
but this for the former:
...
(gdb) info function string_func^M
All functions matching regular expression "string_func":^M
^M
Non-debugging symbols:^M
0x00000000004012bb  string_func_^M
0x00007ffff7bac5b0  outstring_func.part^M
0x00007ffff7bb1a00  outstring_func.part^M
...

The extra symbols are part of glibc:
...
$ nm /lib64/libc.so.6 | grep string_func
00000000000695b0 t outstring_func.part.0
000000000006ea00 t outstring_func.part.0
...

If glibc debug info is installed, we get instead:
...
(gdb) info function string_func^M
All functions matching regular expression "string_func":^M
^M
File /usr/src/debug/glibc-2.33-9.1.x86_64/stdio-common/vfprintf-internal.c:^M
236:    static int outstring_func(int, size_t, const unsigned int *, FILE *);^M
^M
File vfprintf-internal.c:^M
236:    static int outstring_func(int, size_t, const unsigned char *, FILE *);^M
^M
Non-debugging symbols:^M
0x00000000004012bb  string_func_^M
...
and the FAIL doesn't trigger.

Fix this by calling "info function string_func" before starting the exec, such
that only symbols of the exec are taken into account.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-09-01  Tom de Vries  <tdevries@suse.de>

	* gdb.fortran/call-no-debug.exp: Avoid shared lib symbols for
	find_mangled_name calls.
2021-09-01 11:38:02 +02:00
GDB Administrator
5b766b015c Automatic date update in version.in 2021-09-01 00:00:25 +00:00
GDB Administrator
8ba9495958 Automatic date update in version.in 2021-08-31 00:00:22 +00:00
Tom de Vries
e1652de24a [gdb/cli] Don't assert on empty string for core-file
With current gdb we run into:
...
$ gdb -batch '' ''
: No such file or directory.
pathstuff.cc:132: internal-error: \
  gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): \
  Assertion `path != NULL && path[0] != '\0'' failed.
...

Fix this by skipping the call to gdb_abspath in core_target_open in the
empty-string case, such that we have instead:
...
$ gdb -batch '' ''
: No such file or directory.
: No such file or directory.
$
...

Tested on x86_64-linux.

gdb/ChangeLog:

2021-08-30  Tom de Vries  <tdevries@suse.de>

	PR cli/28290
	* gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the
	empty-string case.

gdb/testsuite/ChangeLog:

2021-08-30  Tom de Vries  <tdevries@suse.de>

	PR cli/28290
	* gdb.base/batch-exit-status.exp: Add gdb '' and gdb '' '' tests.
2021-08-30 16:03:15 +02:00
GDB Administrator
897254e073 Automatic date update in version.in 2021-08-30 00:00:17 +00:00
GDB Administrator
0f6a3150d5 Automatic date update in version.in 2021-08-29 00:00:20 +00:00
GDB Administrator
7350820d0d Automatic date update in version.in 2021-08-28 00:00:22 +00:00
GDB Administrator
f566731d15 Automatic date update in version.in 2021-08-27 00:00:23 +00:00
GDB Administrator
c986baa363 Automatic date update in version.in 2021-08-26 00:00:27 +00:00
GDB Administrator
1862155361 Automatic date update in version.in 2021-08-25 00:00:21 +00:00
GDB Administrator
106177faac Automatic date update in version.in 2021-08-24 00:00:23 +00:00
Tom de Vries
2840a1862b [gdb] Fix 'not in executable format' error message
With trying to load a non-executable file into gdb, we run into PR26880:
...
$ gdb -q -batch test.c
"0x7ffc87bfc8d0s": not in executable format: \
  file format not recognized
...

The problem is caused by using %ps in combination with the error function
(note that confusingly, it does work in combination with the warning
function).

Fix this by using plain "%s" instead.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-08-23  Tom de Vries  <tdevries@suse.de>

	PR gdb/26880
	* gdb/exec.c (exec_file_attach): Use %s instead of %ps in call to
	error function.

gdb/testsuite/ChangeLog:

2021-08-23  Tom de Vries  <tdevries@suse.de>

	PR gdb/26880
	* gdb.base/non-executable.exp: New file.
2021-08-23 21:08:51 +02:00
GDB Administrator
61bdb9457a Automatic date update in version.in 2021-08-23 00:00:18 +00:00
GDB Administrator
eccb3ba799 Automatic date update in version.in 2021-08-22 00:00:22 +00:00
GDB Administrator
e284d00d3e Automatic date update in version.in 2021-08-21 00:00:30 +00:00
GDB Administrator
e0e48e8cf9 Automatic date update in version.in 2021-08-20 00:00:19 +00:00
GDB Administrator
8f1a907b47 Automatic date update in version.in 2021-08-19 00:00:56 +00:00
GDB Administrator
89c2f0e527 Automatic date update in version.in 2021-08-18 00:00:44 +00:00
GDB Administrator
6fc08811a1 Automatic date update in version.in 2021-08-17 00:00:46 +00:00
GDB Administrator
8609cba017 Automatic date update in version.in 2021-08-16 00:00:40 +00:00
GDB Administrator
dc1daf51ae Automatic date update in version.in 2021-08-15 00:01:17 +00:00
GDB Administrator
c9e63461e5 Automatic date update in version.in 2021-08-14 00:00:38 +00:00
GDB Administrator
86cf585239 Automatic date update in version.in 2021-08-13 00:00:49 +00:00
Tom Tromey
d2374b0755 Update documentation to mention Pygments
Philippe Blain pointed out that the gdb documentation does not mention
that Pygments may be used for source highlighting.  This patch updates
the docs to reflect how highlighting is actually done.

(cherry picked from commit 6a33fa0efe)

gdb/doc/ChangeLog
2021-08-12  Tom Tromey  <tromey@adacore.com>

	* gdb.texinfo (Output Styling): Mention Pygments.
2021-08-12 14:29:56 -06:00
GDB Administrator
fb1b7fcec2 Automatic date update in version.in 2021-08-12 00:00:52 +00:00
GDB Administrator
1780f3e77e Automatic date update in version.in 2021-08-11 00:00:42 +00:00
GDB Administrator
b80f2606ef Automatic date update in version.in 2021-08-10 00:00:46 +00:00
GDB Administrator
d26ac0b905 Automatic date update in version.in 2021-08-09 00:00:51 +00:00
GDB Administrator
246c1d7974 Automatic date update in version.in 2021-08-08 00:00:40 +00:00
GDB Administrator
b3dc0eac65 Automatic date update in version.in 2021-08-07 00:00:41 +00:00
Tom de Vries
a656ee0831 [gdb/symtab] Fix zero address complaint for shlib
In PR28004 the following warning / Internal error is reported:
...
$ gdb -q -batch \
    -iex "set sysroot $(pwd -P)/repro" \
    ./repro/gdb \
    ./repro/core \
    -ex bt
  ...
 Program terminated with signal SIGABRT, Aborted.
 #0  0x00007ff8fe8e5d22 in raise () from repro/usr/lib/libc.so.6
 [Current thread is 1 (LWP 1762498)]
 #1  0x00007ff8fe8cf862 in abort () from repro/usr/lib/libc.so.6
 warning: (Internal error: pc 0x7ff8feb2c21d in read in psymtab, \
           but not in symtab.)
 warning: (Internal error: pc 0x7ff8feb2c218 in read in psymtab, \
           but not in symtab.)
  ...
 #2  0x00007ff8feb2c21e in __gnu_debug::_Error_formatter::_M_error() const \
   [clone .cold] (warning: (Internal error: pc 0x7ff8feb2c21d in read in \
   psymtab, but not in symtab.)

) from repro/usr/lib/libstdc++.so.6
...

The warning is about the following:
- in find_pc_sect_compunit_symtab we try to find the address
  (0x7ff8feb2c218 / 0x7ff8feb2c21d) in the symtabs.
- that fails, so we try again in the partial symtabs.
- we find a matching partial symtab
- however, the partial symtab has a full symtab, so
  we should have found a matching symtab in the first step.

The addresses are:
...
(gdb) info sym 0x7ff8feb2c218
__gnu_debug::_Error_formatter::_M_error() const [clone .cold] in \
  section .text of repro/usr/lib/libstdc++.so.6
(gdb) info sym 0x7ff8feb2c21d
__gnu_debug::_Error_formatter::_M_error() const [clone .cold] + 5 in \
  section .text of repro/usr/lib/libstdc++.so.6
...
which correspond to unrelocated addresses 0x9c218 and 0x9c21d:
...
$ nm -C  repro/usr/lib/libstdc++.so.6.0.29 | grep 000000000009c218
000000000009c218 t __gnu_debug::_Error_formatter::_M_error() const \
  [clone .cold]
...
which belong to function __gnu_debug::_Error_formatter::_M_error() in
/build/gcc/src/gcc/libstdc++-v3/src/c++11/debug.cc.

The partial symtab that is found for the addresses is instead the one for
/build/gcc/src/gcc/libstdc++-v3/src/c++98/bitmap_allocator.cc, which is
incorrect.

This happens as follows.

The bitmap_allocator.cc CU has DW_AT_ranges at .debug_rnglist offset 0x4b50:
...
    00004b50 0000000000000000 0000000000000056
    00004b5a 00000000000a4790 00000000000a479c
    00004b64 00000000000a47a0 00000000000a47ac
...

When reading the first range 0x0..0x56, it doesn't trigger the "start address
of zero" complaint here:
...
      /* A not-uncommon case of bad debug info.
         Don't pollute the addrmap with bad data.  */
      if (range_beginning + baseaddr == 0
          && !per_objfile->per_bfd->has_section_at_zero)
        {
          complaint (_(".debug_rnglists entry has start address of zero"
                       " [in module %s]"), objfile_name (objfile));
          continue;
        }
...
because baseaddr != 0, which seems incorrect given that when loading the
shared library individually in gdb (and consequently baseaddr == 0), we do see
the complaint.

Consequently, we run into this case in dwarf2_get_pc_bounds:
...
  if (low == 0 && !per_objfile->per_bfd->has_section_at_zero)
    return PC_BOUNDS_INVALID;
...
which then results in this code in process_psymtab_comp_unit_reader being
called with cu_bounds_kind == PC_BOUNDS_INVALID, which sets the set_addrmap
argument to 1:
...
      scan_partial_symbols (first_die, &lowpc, &highpc,
                            cu_bounds_kind <= PC_BOUNDS_INVALID, cu);
...
and consequently, the CU addrmap gets build using address info from the
functions.

During that process, addrmap_set_empty is called with a range that includes
0x9c218 and 0x9c21d:
...
(gdb) p /x start
$7 = 0x9989c
(gdb) p /x end_inclusive
$8 = 0xb200d
...
but it's called for a function at DIE 0x54153 with DW_AT_ranges at 0x40ae:
...
    000040ae 00000000000b1ee0 00000000000b200e
    000040b9 000000000009989c 00000000000998c4
    000040c3 <End of list>
...
and neither range includes 0x9c218 and 0x9c21d.

This is caused by this code in partial_die_info::read:
...
            if (dwarf2_ranges_read (ranges_offset, &lowpc, &highpc, cu,
                                    nullptr, tag))
             has_pc_info = 1;
...
which pretends that the function is located at addresses 0x9989c..0xb200d,
which is indeed not the case.

This patch fixes the first problem encountered: fix the "start address of
zero" complaint warning by removing the baseaddr part from the condition.
Same for dwarf2_ranges_process.

The effect is that:
- the complaint is triggered, and
- the warning / Internal error is no longer triggered.

This does not fix the observed problem in partial_die_info::read, which is
filed as PR28200.

Tested on x86_64-linux.

Co-Authored-By: Simon Marchi <simon.marchi@polymtl.ca>

gdb/ChangeLog:

2021-08-06  Simon Marchi  <simon.marchi@polymtl.ca>
	    Tom de Vries  <tdevries@suse.de>

	PR symtab/28004
	* dwarf2/read.c (dwarf2_rnglists_process, dwarf2_ranges_process):
	Fix zero address complaint.

gdb/testsuite/ChangeLog:

2021-08-06  Simon Marchi  <simon.marchi@polymtl.ca>
	    Tom de Vries  <tdevries@suse.de>

	PR symtab/28004
	* gdb.dwarf2/dw2-zero-range-shlib.c: New test.
	* gdb.dwarf2/dw2-zero-range.c: New test.
	* gdb.dwarf2/dw2-zero-range.exp: New file.
2021-08-06 18:02:28 +02:00
GDB Administrator
76e1bef3bf Automatic date update in version.in 2021-08-06 00:00:39 +00:00
GDB Administrator
91a78f327b Automatic date update in version.in 2021-08-05 00:01:00 +00:00
GDB Administrator
e649c6c2a2 Automatic date update in version.in 2021-08-04 00:00:46 +00:00
GDB Administrator
4b7e7a3499 Automatic date update in version.in 2021-08-03 00:00:48 +00:00
Tom Tromey
3e5ec878a4 Avoid crash in varobj deletion
PR varobj/28131 points out a crash in the varobj deletion code.  It
took a while to reproduce this, but essentially what happens is that a
top-level varobj deletes its root object, then deletes the "dynamic"
object.  However, deletion of the dynamic object may cause
~py_varobj_iter to run, which in turn uses gdbpy_enter_varobj:

gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
: gdbpy_enter (var->root->exp->gdbarch, var->root->exp->language_defn)
{
}

However, because var->root has already been destroyed, this is
invalid.

I've added a new test case.  This doesn't reliably crash, but the
problem can easily be seen under valgrind (and, I presume, with ASAN,
though I did not try this).

Tested on x86-64 Fedora 32.  I also propose putting this on the GDB 11
branch, with a suitable ChangeLog entry of course.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28131

(cherry picked from commit 4d0754c5f5)

gdb/ChangeLog
2021-08-02  Tom Tromey  <tromey@adacore.com>

	PR varobj/28131
	* varobj.c (~varobj): Delete 'dynamic' before 'root'.

gdb/testsuite/ChangeLog
2021-08-02  Tom Tromey  <tromey@adacore.com>

	PR varobj/28131
	* gdb.python/py-mi-var-info-path-expression.exp: Add regression
	test.
2021-08-02 09:48:58 -06:00
Shahab Vahedi
e4c1aea498 gdb: Make the builtin "boolean" type an unsigned type
When printing the fields of a register that is of a custom struct type,
the "unpack_bits_as_long ()" function is used:

    do_val_print (...)
      cp_print_value_fields (...)
        value_field_bitfield (...)
          unpack_value_bitfield (...)
            unpack_bits_as_long (...)

This function may sign-extend the extracted field while returning it:

    val >>= lsbcount;

    if (...)
      {
        valmask = (((ULONGEST) 1) << bitsize) - 1;
        val &= valmask;
        if (!field_type->is_unsigned ())
  	  if (val & (valmask ^ (valmask >> 1)))
  	      val |= ~valmask;
      }

    return val;

lsbcount:   Number of lower bits to get rid of.
bitsize:    The bit length of the field to be extracted.
val:        The register value.
field_type: The type of field that is being handled.

While the logic here is correct, there is a problem when it is
handling "field_type"s of "boolean".  Those types are NOT marked
as "unsigned" and therefore they end up being sign extended.
Although this is not a problem for "false" (0), it definitely
causes trouble for "true".

This patch constructs the builtin boolean type as such that it is
marked as an "unsigned" entity.

The issue tackled here was first encountered for arc-elf32 target
running on an x86_64 machine.  The unit-test introduced in this change
has passed for all the targets (--enable-targets=all) running on the
same x86_64 host.

gdb/ChangeLog:

	PR gdb/28104
	* gdbtypes.c (gdbtypes_post_init): Use
	"arch_boolean_type (..., unsigned=1, ...) to construct
	"boolean".
	cp-valprint.c (test_print_flags): New.
	(_initialize_cp_valprint): Run the "test_print_flags" unit-test.
2021-08-02 13:04:48 +02:00
GDB Administrator
3bea08edb3 Automatic date update in version.in 2021-08-02 00:00:44 +00:00
GDB Administrator
f9e4d38eec Automatic date update in version.in 2021-08-01 00:00:41 +00:00
GDB Administrator
33a6518147 Automatic date update in version.in 2021-07-31 00:00:51 +00:00
Tom de Vries
7fab8f850f [gdb/build] Disable attribute nonnull
With trunk gcc (12.0) we're running into a -Werror=nonnull-compare build
breaker in gdb, which caused a broader review of the usage of the nonnull
attribute.

The current conclusion is that it's best to disable this.  This is explained
at length in the gdbsupport/common-defs.h comment.

Tested by building with trunk gcc.

gdbsupport/ChangeLog:

2021-07-30  Tom de Vries  <tdevries@suse.de>

	* common-defs.h (ATTRIBUTE_NONNULL): Disable.
2021-07-30 14:12:30 +02:00
GDB Administrator
c0f71837f8 Automatic date update in version.in 2021-07-30 00:00:37 +00:00
GDB Administrator
4e0069d879 Automatic date update in version.in 2021-07-29 00:00:49 +00:00
Tom de Vries
52a49e1615 [gdb/symtab] Fix unhandled dwarf expression opcode with gcc-11 -gdwarf-5
[ I've confused things by forgetting to add -gdwarf-4 in $subject of
commit 0057a7ee0d "[gdb/testsuite] Add KFAILs for gdb.ada FAILs with
gcc-11".  So I'm adding here -gdwarf-5 in $subject, even though -gdwarf-5 is
the default for gcc-11.  I keep getting confused because of working with a
system gcc-11 compiler that was patched to switch the default back to
-gdwarf-4. ]

When running test-case gdb.ada/arrayptr.exp with gcc-11 (and default
-gdwarf-5), I run into:
...
(gdb) print pa_ptr.all^M
Unhandled dwarf expression opcode 0xff^M
(gdb) FAIL: gdb.ada/arrayptr.exp: scenario=all: print pa_ptr.all
...

What happens is that pa_ptr:
...
 <2><1523>: Abbrev Number: 3 (DW_TAG_variable)
    <1524>   DW_AT_name        : pa_ptr
    <1529>   DW_AT_type        : <0x14fa>
...
has type:
...
 <2><14fa>: Abbrev Number: 2 (DW_TAG_typedef)
    <14fb>   DW_AT_name        : foo__packed_array_ptr
    <1500>   DW_AT_type        : <0x1504>
 <2><1504>: Abbrev Number: 4 (DW_TAG_pointer_type)
    <1505>   DW_AT_byte_size   : 8
    <1505>   DW_AT_type        : <0x1509>
...
which is a pointer to a subrange:
...
 <2><1509>: Abbrev Number: 12 (DW_TAG_subrange_type)
    <150a>   DW_AT_lower_bound : 0
    <150b>   DW_AT_upper_bound : 0x3fffffffffffffffff
    <151b>   DW_AT_name        : foo__packed_array
    <151f>   DW_AT_type        : <0x15cc>
    <1523>   DW_AT_artificial  : 1
 <1><15cc>: Abbrev Number: 5 (DW_TAG_base_type)
    <15cd>   DW_AT_byte_size   : 16
    <15ce>   DW_AT_encoding    : 7      (unsigned)
    <15cf>   DW_AT_name        : long_long_long_unsigned
    <15d3>   DW_AT_artificial  : 1
...
with upper bound of form DW_FORM_data16.

In gdb/dwarf/attribute.h we have:
...
  /* Return non-zero if ATTR's value falls in the 'constant' class, or
     zero otherwise.  When this function returns true, you can apply
     the constant_value method to it.
     ...
     DW_FORM_data16 is not considered as constant_value cannot handle
     that.  */
  bool form_is_constant () const;
...
so instead we have attribute::form_is_block (DW_FORM_data16) == true.

Then in attr_to_dynamic_prop for the upper bound, we get a PROC_LOCEXPR
instead of a PROP_CONST and end up trying to evaluate the constant
0x3fffffffffffffffff as if it were a locexpr, which causes the
"Unhandled dwarf expression opcode 0xff".

In contrast, with -gdwarf-4 we have:
...
    <164c>   DW_AT_upper_bound : 18 byte block: \
      9e 10 ff ff ff ff ff ff ff ff 3f 0 0 0 0 0 0 0 \
      (DW_OP_implicit_value 16 byte block: \
        ff ff ff ff ff ff ff ff 3f 0 0 0 0 0 0 0 )
...

Fix the dwarf error by translating the DW_FORM_data16 constant into a
PROC_LOCEXPR, effectively by prepending 0x9e 0x10, such that we have same
result as with -gdwarf-4:
...
(gdb) print pa_ptr.all^M
That operation is not available on integers of more than 8 bytes.^M
(gdb) KFAIL: gdb.ada/arrayptr.exp: scenario=all: print pa_ptr.all \
  (PRMS: gdb/20991)
...

Tested on x86_64-linux, with gcc-11 and target board
unix/gdb:debug_flags=-gdwarf-5.

gdb/ChangeLog:

2021-07-28  Tom de Vries  <tdevries@suse.de>

	* dwarf2/read.c (attr_to_dynamic_prop): Handle DW_FORM_data16.
2021-07-28 10:17:44 +02:00
GDB Administrator
791b706a9e Automatic date update in version.in 2021-07-28 00:00:44 +00:00
Tom de Vries
c12608fcff [gdb/testsuite] Add xfail for PR gcc/101643
With gcc 8.5.0 I run into:
...
(gdb) print bad^M
$2 = (0 => 0 <repeats 25 times>)^M
(gdb) FAIL: gdb.ada/big_packed_array.exp: scenario=minimal: print bad
...
while with gcc 9.3.1 we have instead:
...
(gdb) print bad^M
$2 = (false <repeats 196 times>)^M
(gdb) PASS: gdb.ada/big_packed_array.exp: scenario=minimal: print bad
...

This is caused by gcc PR, which I've filed at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101643 "[debug, ada] packed array
not described as packed".

Fix by marking this as XFAIL.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-07-27  Tom de Vries  <tdevries@suse.de>

	PR testsuite/26904
	* gdb/testsuite/gdb.ada/big_packed_array.exp: Add xfail.
2021-07-27 17:14:18 +02:00
Tom de Vries
7e292f1ab8 [gdb/testsuite] Add xfail for PR gcc/101633
With gcc 7.5.0, I run into:
...
(gdb) print objects^M
$1 = ((tag => object, values => ()), (tag => unused))^M
(gdb) FAIL: gdb.ada/array_of_variant.exp: scenario=minimal: print entire array
...
while with gcc 8.5.0 we have:
...
(gdb) print objects^M
$1 = ((tag => object, values => (2, 2, 2, 2, 2)), (tag => unused))^M
(gdb) PASS: gdb.ada/array_of_variant.exp: scenario=minimal: print entire array
...

This is due to a gcc PR, which I've filed at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101633 "Bug 101633 - [debug]
DW_TAG_subrange_type missing DW_AT_upper_bound".

Fix by marking this and related FAILs as XFAIL.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-07-27  Tom de Vries  <tdevries@suse.de>

	PR testsuite/26903
	* gdb/testsuite/gdb.ada/array_of_variant.exp: Add xfails.
2021-07-27 17:14:17 +02:00
GDB Administrator
26e4f978b0 Automatic date update in version.in 2021-07-27 00:00:45 +00:00
Frederic Cambus
1693a7cf35 Update the NetBSD system call table to match NetBSD-current.
Generated from sys/sys/syscall.h revision 1.319.

We can safely remove the _lwp_gettid syscall, which was never exposed
in libc and never made it into a release.

gdb/ChangeLog:

2021-07-26  Frederic Cambus  <fred@statdns.com>

	* syscalls/netbsd.xml: Regenerate.
2021-07-26 08:14:48 -07:00
Shahab Vahedi
70417f28b5 gdb: Fix numerical field extraction for target description "flags"
The "val_print_type_code_flags ()" function is responsible for
extraction of fields for "flags" data type.  These data types are
used when describing a custom register type in a target description
XML.  The logic used for the extraction though is not sound:

    unsigned field_len = TYPE_FIELD_BITSIZE (type, field);
    ULONGEST field_val
      = val >> (TYPE_FIELD_BITPOS (type, field) - field_len + 1);

TYPE_FIELD_BITSIZE: The bit length of the field to be extracted.
TYPE_FIELD_BITPOS:  The starting position of the field; 0 is LSB.
val:                The register value.

Imagine you have a field that starts at position 1 and its length
is 4 bits.  According to the third line of the code snippet the
shifting right would become "val >> -2", or "val >> 0xfff...fe"
to be precise.  That will result in a "field_val" of 0.

The correct extraction should be:

    ULONGEST field_val = val >> TYPE_FIELD_BITPOS (type, field);

The rest of the algorithm that masks out the higher bits is OK.

gdb/ChangeLog:
2021-07-26  Shahab Vahedi  <shahab@synopsys.com>
            Simon Marchi  <simon.marchi@efficios.com>

	PR gdb/28103
	* valprint.c (val_print_type_code_flags): Merely shift the VAL
	to the right to get rid of the lower bits.
	(test_print_flags): New.
	(_initialize_valprint): Invoke the "test_print_flags" as a unit-test.

Co-Authored-By: Simon Marchi <simon.marchi@efficios.com>
2021-07-26 15:05:09 +02:00
Tankut Baris Aktemur
86271cfa32 gdb/mi: handle no condition argument case for -break-condition
As reported in PR gdb/28076 [1], passing no condition argument to the
-break-condition command (e.g.: "-break-condition 2") should clear the
condition for breakpoint 2, just like CLI's "condition 2", but instead
an error message is returned:

  ^error,msg="-break-condition: Missing the <number> and/or <expr> argument"

The current implementation of the -break-condition command's argument
handling (79aabb7308 "gdb/mi: add a '--force' flag to the
'-break-condition' command") was done according to the documentation,
where the condition argument seemed mandatory.  However, the
-break-condition command originally (i.e. before the 79aabb7308
patch) used the CLI's "cond" command, and back then not passing a
condition argument was clearing out the condition.  So, this is a
regression in terms of the behavior.

Fix the argument handling of the -break-condition command to allow not
having a condition argument, and also update the document to make the
behavior clear.  Also add test cases to test the scenarios which were
previously not covered.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=28076

gdb/ChangeLog:
2021-07-26  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	PR gdb/28076
	* mi/mi-cmd-break.c (mi_cmd_break_condition): Handle the case
	of having no condition argument.

gdb/doc/ChangeLog:
2021-07-26  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	PR gdb/28076
	* gdb.texinfo (GDB/MI Breakpoint Commands): Mention clearing
	the condition in the -break-condition command.

gdb/testsuite/ChangeLog:
2021-07-26  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	PR gdb/28076
	* gdb.mi/mi-break.exp: Add more tests to check clearing the
	breakpoint condition.
2021-07-26 08:28:12 +02:00
GDB Administrator
fc3f144a3e Automatic date update in version.in 2021-07-26 00:00:40 +00:00
GDB Administrator
011ab47fa4 Automatic date update in version.in 2021-07-25 00:00:37 +00:00
GDB Administrator
f0927d2036 Automatic date update in version.in 2021-07-24 00:00:33 +00:00
GDB Administrator
c47bde01bb Automatic date update in version.in 2021-07-23 00:00:43 +00:00
Tom de Vries
5924fafaf6 [gdb/testsuite] Fix FAILs due to PR gcc/101575
When running test-case gdb.ada/formatted_ref.exp with gcc-11 and target board
unix/gdb:debug_flags=-gdwarf-4 we run into:
...
(gdb) print/x s^M
No definition of "s" in current context.^M
(gdb) FAIL: gdb.ada/formatted_ref.exp: print/x s
...
which is caused by "runto defs.adb:20" taking us to defs__struct1IP:
...
(gdb) break defs.adb:20^M
Breakpoint 1 at 0x402cfd: defs.adb:20. (2 locations)^M
(gdb) run ^M
Starting program: formatted_ref ^M
^M
Breakpoint 1, defs__struct1IP () at defs.adb:20^M
20            return s.x;                   -- Set breakpoint marker here.^M
(gdb) print s1'access^M
...
instead of the expected defs.f1:
...
(gdb) break defs.adb:20^M
Breakpoint 1 at 0x402d0e: file defs.adb, line 20.^M
(gdb) run ^M
Starting program: formatted_ref ^M
^M
Breakpoint 1, defs.f1 (s=...) at defs.adb:20^M
20            return s.x;                   -- Set breakpoint marker here.^M
...

This is caused by incorrect line info due to gcc PR 101575 - "[gcc-11,
-gdwarf-4] Missing .file <n> directive causes invalid line info".

Fix this by when landing in defs__struct1IP:
- xfailing the runto, and
- issuing a continue to land in defs.f1.

Likewise in a few other test-cases.

Tested on x86_64-linux, with:
- system gcc.
- gcc-11 and target boards unix/gdb:debug_flags=-gdwarf-4 and
  unix/gdb:debug_flags=-gdwarf-5.

gdb/testsuite/ChangeLog:

2021-07-22  Tom de Vries  <tdevries@suse.de>

	* gdb.ada/formatted_ref.exp: Add xfail for PR gcc/101575.
	* gdb.ada/iwide.exp: Same.
	* gdb.ada/pkd_arr_elem.exp: Same.
2021-07-22 17:21:21 +02:00
Tom de Vries
f08513e821 [gdb/testsuite] Fix gdb.cp/step-and-next-inline.exp with gcc-11
When running test-case gdb.cp/step-and-next-inline.exp with gcc-11, I run
into:
...
KPASS: gdb.cp/step-and-next-inline.exp: no_header: next step 1 \
  (PRMS symtab/25507)
FAIL: gdb.cp/step-and-next-inline.exp: no_header: next step 2
KPASS: gdb.cp/step-and-next-inline.exp: no_header: next step 3 \
  (PRMS symtab/25507)
...

[ Note that I get the same result with gcc-11 and target board
unix/gdb:debug_flags=-gdwarf-4, so this is not a dwarf 4 vs 5 issue. ]

With gcc-10, I have this trace:
...
64        get_alias_set (&xx);
get_alias_set (t=0x601038 <xx>) at step-and-next-inline.cc:51
51        if (t != NULL
40        if (t->x != i)
52            && TREE_TYPE (t).z != 1
43        return x;
53            && TREE_TYPE (t).z != 2
43        return x;
54            && TREE_TYPE (t).z != 3)
43        return x;
main () at step-and-next-inline.cc:65
65        return 0;
...
and with gcc-11, I have instead:
...
64        get_alias_set (&xx);
get_alias_set (t=0x601038 <xx>) at step-and-next-inline.cc:51
51        if (t != NULL
52            && TREE_TYPE (t).z != 1
43        return x;
53            && TREE_TYPE (t).z != 2
43        return x;
54            && TREE_TYPE (t).z != 3)
43        return x;
main () at step-and-next-inline.cc:65
65        return 0;
...
and with clang-10, I have instead:
...
64        get_alias_set (&xx);
get_alias_set (t=0x601034 <xx>) at step-and-next-inline.cc:51
51        if (t != NULL
52            && TREE_TYPE (t).z != 1
53            && TREE_TYPE (t).z != 2
54            && TREE_TYPE (t).z != 3)
51        if (t != NULL
57      }
main () at step-and-next-inline.cc:65
65        return 0;
...

The test-case tries to verify that we don't step into inlined function
tree_check (lines 40-43) (so, with the clang trace we get that right).

The test-case then tries to kfail the problems when using gcc, but this is
done in such a way that the testing still gets out of sync after a failure.
That is: the "next step 2" check that is supposed to match
"TREE_TYPE (t).z != 2" is actually matching "TREE_TYPE (t).z != 1":
...
(gdb) next^M
52            && TREE_TYPE (t).z != 1^M
(gdb) PASS: gdb.cp/step-and-next-inline.exp: no_header: next step 2
...

Fix this by issuing extra nexts to arrive at the required lines.

Tested on x86_64-linux, with gcc-8, gcc-9, gcc-10, gcc-11, clang-8, clang-10
and clang-12.

gdb/testsuite/ChangeLog:

2021-07-22  Tom de Vries  <tdevries@suse.de>

	* gdb.cp/step-and-next-inline.cc (tree_check, get_alias_set, main):
	Tag closing brace with comment.
	* gdb.cp/step-and-next-inline.h: Update to keep identical with
	step-and-next-inline.cc.
	* gdb.cp/step-and-next-inline.exp: Issue extra next when required.
2021-07-22 02:10:07 +02:00
GDB Administrator
1f0f4c0f55 Automatic date update in version.in 2021-07-22 00:00:45 +00:00
Tom de Vries
0e9c2a33e4 [gdb/testsuite] Fix FAILs due to PR gcc/101452
When running test-case gdb.base/ptype-offsets.exp with gcc-11 (with -gdwarf-5
default) or gcc-10 with target board unix/gdb:debug_flags=-gdwarf-5 we run
into this regression:
...
 (gdb) ptype/o static_member^M
 /* offset      |    size */  type = struct static_member {^M
-                               static static_member Empty;^M
 /*      0      |       4 */    int abc;^M
 ^M
                                /* total size (bytes):    4 */^M
                              }^M
-(gdb) PASS: gdb.base/ptype-offsets.exp: ptype/o static_member
+(gdb) FAIL: gdb.base/ptype-offsets.exp: ptype/o static_member
...

This is caused by missing debug info, which I filed as gcc PR101452 - "[debug,
dwarf-5] undefined static member removed by
-feliminate-unused-debug-symbols".

It's not clear yet whether this is a bug or a feature, but work around this in
the test-cases by:
- defining the static member
- adding additional_flags=-fno-eliminate-unused-debug-types.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-07-21  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (gcc_major_version): New proc.
	* gdb.base/ptype-offsets.cc: Define static member static_member::Empty.
	* gdb.cp/templates.exp: Define static member using -DGCC_BUG.
	* gdb.cp/m-static.exp: Add
	additional_flags=-fno-eliminate-unused-debug-types.
	* gdb.cp/pr-574.exp: Same.
	* gdb.cp/pr9167.exp: Same.
2021-07-21 14:22:16 +02:00
Tom de Vries
f26101b199 [gdb/testsuite] Add KFAILs for gdb.ada FAILs with gcc-11
With gcc-11 we run into:
...
(gdb) print pa_ptr.all^M
That operation is not available on integers of more than 8 bytes.^M
(gdb) KFAIL: gdb.ada/arrayptr.exp: scenario=all: print pa_ptr.all (PRMS: gdb/20991)
...

This is due to PR exp/20991 - "__int128 type support".  Mark this and similar
FAILs as KFAIL.

Also mark this FAIL:
....
(gdb) print pa_ptr(3)^M
cannot subscript or call something of type `foo__packed_array_ptr'^M
(gdb) FAIL: gdb.ada/arrayptr.exp: scenario=minimal: print pa_ptr(3)
...
as a KFAIL for PR ada/28115 - "Support packed array encoded as
DW_TAG_subrange_type".

Tested on x86_64-linux, with gcc-10 and gcc-11.

gdb/testsuite/ChangeLog:

2021-07-21  Tom de Vries  <tdevries@suse.de>

	* gdb.ada/arrayptr.exp: Add KFAILs for PR20991 and PR28115.
	* gdb.ada/exprs.exp: Add KFAILs for PR20991.
	* gdb.ada/packed_array_assign.exp: Same.
2021-07-21 14:22:16 +02:00
GDB Administrator
647c0a29f2 Automatic date update in version.in 2021-07-21 00:00:47 +00:00
Luis Machado
4f3fb91acc Fix printing of non-address types when memory tagging is enabled
When the architecture supports memory tagging, we handle
pointer/reference types in a special way, so we can validate tags and
show mismatches.

Unfortunately, the currently implementation errors out when the user
prints non-address values: composite types, floats, references, member
functions and other things.

Vector registers:

 (gdb) p $v0
 Value can't be converted to integer.

Non-existent internal variables:

 (gdb) p $foo
 Value can't be converted to integer.

The same happens for complex types and printing struct/union types.

There are a few problems here.

The first one is that after print_command_1 evaluates the expression
to print, the tag validation code call value_as_address
unconditionally, without making sure we have have a suitable type
where it makes to sense to call it.  That results in value_as_address
(if it isn't given a pointer-like type) trying to treat the value as
an integer and convert it to an address, which #1 - doesn't make sense
(i.e., no sense in validating tags after "print 1"), and throws for
non-integer-convertible types.  We fix this by making sure we have a
pointer or reference type first, and only if so then proceed to check
if the address-like value has tags.

The second is that we're calling value_as_address even if we have an
optimized out or unavailable value, which throws, because the value's
contents aren't fully accessible/readable.  This error currently
escapes out and aborts the print.  This case is fixed by checking for
optimized out / unavailable explicitly.

Third, the tag checking process does not gracefully handle exceptions.
If any exception is thrown from the tag validation code, we abort the
print.  E.g., the target may fail to access tags via a running thread.
Or the needed /proc files aren't available.  Or some other untold
reason.  This is a bit too rigid.  This commit changes print_command_1
to catch errors, print them, and still continue with the normal
expression printing path instead of erroring out and printing nothing
useful.

With this patch, printing works correctly again:

 (gdb) p $v0
 $1 = {d = {f = {2.0546950501119882e-81, 2.0546950501119882e-81}, u = {3399988123389603631, 3399988123389603631}, s = {
       3399988123389603631, 3399988123389603631}}, s = {f = {1.59329203e-10, 1.59329203e-10, 1.59329203e-10, 1.59329203e-10}, u = {
       791621423, 791621423, 791621423, 791621423}, s = {791621423, 791621423, 791621423, 791621423}}, h = {bf = {1.592e-10,
       1.592e-10, 1.592e-10, 1.592e-10, 1.592e-10, 1.592e-10, 1.592e-10, 1.592e-10}, f = {0.11224, 0.11224, 0.11224, 0.11224, 0.11224,
       0.11224, 0.11224, 0.11224}, u = {12079, 12079, 12079, 12079, 12079, 12079, 12079, 12079}, s = {12079, 12079, 12079, 12079,
       12079, 12079, 12079, 12079}}, b = {u = {47 <repeats 16 times>}, s = {47 <repeats 16 times>}}, q = {u = {
       62718710765820030520700417840365121327}, s = {62718710765820030520700417840365121327}}}
 (gdb) p $foo
 $2 = void
 (gdb) p 2 + 2i
 $3 = 2 + 2i

gdb/ChangeLog

2021-07-20  Luis Machado  <luis.machado@linaro.org>
	    Pedro Alves  <pedro@palves.net>

	PR gdb/28110
	* gdbarch.sh: Updated documentation for gdbarch_tagged_address_p.
	* gdbarch.h: Regenerate.
	* printcmd.c (should_validate_memtags): Reorder comparisons and only
	validate tags for pointer and reference types.  Skip validation of
	optimized out or unavailable values.
	(print_command_1): Guard call memory tagging validation code with
	a try/catch block.

Co-Authored-By: Pedro Alves <pedro@palves.net>
Change-Id: I82bf00ac88d23553b3f7563c9872dfa6ca1f2207
2021-07-20 07:27:13 -03:00
GDB Administrator
bbfd0b2867 Automatic date update in version.in 2021-07-20 00:00:42 +00:00
Tom Tromey
e22715ce30 Avoid expression parsing crash with unknown language
PR gdb/28093 points out that gdb crashes when language is set to
"unknown" and expression parsing is attempted.  At first I thought
this was a regression due to the expression rewrite, but it turns out
that older versions crash as well.

This patch avoids the crash by changing the default expression parser
to throw an exception.  I think this is preferable -- the current
behavior of silently doing nothing does not really make sense.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28093
(cherry picked from commit dcd482c1b7)

gdb/ChangeLog
2021-07-19  Tom Tromey  <tromey@adacore.com>

	PR gdb/28093
	* language.c (auto_or_unknown_language::parser): Call error.

gdb/testsuite/ChangeLog
2021-07-19  Tom Tromey  <tromey@adacore.com>

	PR gdb/28093
	* gdb.base/langs.exp: Add tests.
2021-07-19 11:01:47 -06:00
GDB Administrator
51799bd45f Automatic date update in version.in 2021-07-19 00:00:30 +00:00
GDB Administrator
85e022aa1a Automatic date update in version.in 2021-07-18 00:00:47 +00:00
Sergey Belyashov
28b48aa109 Add basic Z80 CPU support
Supported ISAs:
- Z80 (all undocumented instructions)
- Z180
- eZ80 (Z80 mode only)

Datasheets:
Z80: https://www.zilog.com/manage_directlink.php?filepath=docs/z80/um0080&extn=.pdf
Z180: https://www.zilog.com/manage_directlink.php?filepath=docs/z180/ps0140&extn=.pdf
eZ80: http://www.zilog.com/force_download.php?filepath=YUhSMGNEb3ZMM2QzZHk1NmFXeHZaeTVqYjIwdlpHOWpjeTlWVFRBd056Y3VjR1Jt

To debug Z80 programs using GDB you must configure and embed
z80-stub.c to your program (SDCC compiler is required). Or
you may use some simulator with GDB support.

gdb/ChangeLog:

	* Makefile.in (ALL_TARGET_OBS): Add z80-tdep.c.
	* NEWS: Mention z80 support.
	* configure.tgt: Handle z80*.
	* features/Makefile (XMLTOC): Add z80.xml.
	* features/z80-cpu.xml: New.
	* features/z80.c: Generate.
	* features/z80.xml: New.
	* z80-tdep.c: New file.
	* z80-tdep.h: New file.

gdb/stubs/ChangeLog:

	* z80-stub.c: New file.

Change-Id: Id0b7a6e210c3f93c6853c5e3031b7bcee47d0db9
2021-07-17 10:23:54 -04:00
GDB Administrator
97f3dfbc4f Automatic date update in version.in 2021-07-17 00:00:36 +00:00
GDB Administrator
a35647809a Automatic date update in version.in 2021-07-16 00:00:24 +00:00
GDB Administrator
e8bd220d37 Automatic date update in version.in 2021-07-15 00:00:31 +00:00
Tom de Vries
26e27615ab [gdb/testsuite] Fix gdb.base/gold-gdb-index.exp
When running test-case gdb.base/gold-gdb-index.exp on openSUSE Tumbleweed,
I run into:
...
FAIL: gdb.base/gold-gdb-index.exp: maint info symtabs
...

This is due to a dummy .gdb_index:
...
Contents of the .gdb_index section:

Version 7

CU table:

TU table:

Address table:

Symbol table:
...

The dummy .gdb_index is ignored when loading the symbols, and instead partial
symbols are used.  Consequently, we get the same result as if we'd removed
-Wl,--gdb-index from the compilation.

Presumably, gold fails to generate a proper .gdb_index because it lacks
DWARF5 support.

Anyway, without a proper .gdb_index we can't test the gdb behaviour we're
trying to excercise.  Fix this by detecting whether we actually used a
.gdb_index for symbol loading.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-07-14  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (have_index): New proc.
	* gdb.base/gold-gdb-index.exp: Use have_index.
2021-07-14 11:46:50 +02:00
GDB Administrator
7d11b094f4 Automatic date update in version.in 2021-07-14 00:00:28 +00:00
Lancelot SIX
f1d9f19978 Use /bin/sh as shebang in gdb/make-init-c
While testing the NixOS[1] packaging for gdb-11.0.90.tar.xz, I got the
following error:

  [...]
  CXX    aarch32-tdep.o
  CXX    gdb.o
  GEN    init.c
  /nix/store/26a78ync552m8j4sbjavhvkmnqir8c9y-bash-4.4-p23/bin/bash: ./make-init-c: /usr/bin/env: bad interpreter: No such file or directory
  make[2]: *** [Makefile:1866: stamp-init] Error 126
  make[2]: *** Waiting for unfinished jobs....
  make[2]: Leaving directory '/build/gdb-11.0.90/gdb'
  make[1]: *** [Makefile:9814: all-gdb] Error 2
  make[1]: Leaving directory '/build/gdb-11.0.90'
  make: *** [Makefile:903: all] Error 2
  builder for '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed with exit code 2
  error: build of '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed

In the nix build environment, /usr/bin/env is not present, only /bin/sh
is.  This patch makes sure that gdb/make-init-c uses '/bin/sh' as
interpreter as this is the only one available on this platform.

I do not think this change will cause regressions on any other
configuration.

[1] https://nixos.org/

gdb/Changelog

	* make-init-c: Use /bin/sh as shebang.
2021-07-13 23:09:14 +01:00
Pedro Alves
3e0910a5f0 Avoid letting exceptions escape gdb_bfd_iovec_fileio_close (PR gdb/28080)
Before PR gdb/28080 was fixed by the previous patch, GDB was crashing
like this:

 (gdb) detach
 Detaching from program: target:/any/program, process 3671843
 Detaching from process 3671843
 Ending remote debugging.
 [Inferior 1 (process 3671843) detached]
 In main
 terminate called after throwing an instance of 'gdb_exception_error'
 Aborted (core dumped)

Here's the exception above being thrown:

 (top-gdb) bt
 #0  throw_error (error=TARGET_CLOSE_ERROR, fmt=0x555556035588 "Remote connection closed") at src/gdbsupport/common-exceptions.cc:222
 #1  0x0000555555bbaa46 in remote_target::readchar (this=0x555556a11040, timeout=10000) at src/gdb/remote.c:9440
 #2  0x0000555555bbb9e5 in remote_target::getpkt_or_notif_sane_1 (this=0x555556a11040, buf=0x555556a11058, forever=0, expecting_notif=0, is_notif=0x0) at src/gdb/remote.c:9928
 #3  0x0000555555bbbda9 in remote_target::getpkt_sane (this=0x555556a11040, buf=0x555556a11058, forever=0) at src/gdb/remote.c:10030
 #4  0x0000555555bc0e75 in remote_target::remote_hostio_send_command (this=0x555556a11040, command_bytes=13, which_packet=14, remote_errno=0x7fffffffcfd0, attachment=0x0, attachment_len=0x0) at src/gdb/remote.c:12137
 #5  0x0000555555bc1b6c in remote_target::remote_hostio_close (this=0x555556a11040, fd=8, remote_errno=0x7fffffffcfd0) at src/gdb/remote.c:12455
 #6  0x0000555555bc1bb4 in remote_target::fileio_close (During symbol reading: .debug_line address at offset 0x64f417 is 0 [in module build/gdb/gdb]
 this=0x555556a11040, fd=8, remote_errno=0x7fffffffcfd0) at src/gdb/remote.c:12462
 #7  0x0000555555c9274c in target_fileio_close (fd=3, target_errno=0x7fffffffcfd0) at src/gdb/target.c:3365
 #8  0x000055555595a19d in gdb_bfd_iovec_fileio_close (abfd=0x555556b9f8a0, stream=0x555556b11530) at src/gdb/gdb_bfd.c:439
 #9  0x0000555555e09e3f in opncls_bclose (abfd=0x555556b9f8a0) at src/bfd/opncls.c:599
 #10 0x0000555555e0a2c7 in bfd_close_all_done (abfd=0x555556b9f8a0) at src/bfd/opncls.c:847
 #11 0x0000555555e0a27a in bfd_close (abfd=0x555556b9f8a0) at src/bfd/opncls.c:814
 #12 0x000055555595a9d3 in gdb_bfd_close_or_warn (abfd=0x555556b9f8a0) at src/gdb/gdb_bfd.c:626
 #13 0x000055555595ad29 in gdb_bfd_unref (abfd=0x555556b9f8a0) at src/gdb/gdb_bfd.c:715
 #14 0x0000555555ae4730 in objfile::~objfile (this=0x555556515540, __in_chrg=<optimized out>) at src/gdb/objfiles.c:573
 #15 0x0000555555ae955a in std::_Sp_counted_ptr<objfile*, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x555556c20db0) at /usr/include/c++/9/bits/shared_ptr_base.h:377
 #16 0x000055555572b7c8 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x555556c20db0) at /usr/include/c++/9/bits/shared_ptr_base.h:155
 #17 0x00005555557263c3 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x555556bf0588, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:730
 #18 0x0000555555ae745e in std::__shared_ptr<objfile, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x555556bf0580, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:1169
 #19 0x0000555555ae747e in std::shared_ptr<objfile>::~shared_ptr (this=0x555556bf0580, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr.h:103
 #20 0x0000555555b1c1dc in __gnu_cxx::new_allocator<std::_List_node<std::shared_ptr<objfile> > >::destroy<std::shared_ptr<objfile> > (this=0x5555564cdd60, __p=0x555556bf0580) at /usr/include/c++/9/ext/new_allocator.h:153
 #21 0x0000555555b1bb1d in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<objfile> > > >::destroy<std::shared_ptr<objfile> > (__a=..., __p=0x555556bf0580) at /usr/include/c++/9/bits/alloc_traits.h:497
 #22 0x0000555555b1b73e in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::_M_erase (this=0x5555564cdd60, __position=std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x555556515540}) at /usr/include/c++/9/bits/stl_list.h:1921
 #23 0x0000555555b1afeb in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::erase (this=0x5555564cdd60, __position=std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x555556515540}) at /usr/include/c++/9/bits/list.tcc:158
 #24 0x0000555555b19576 in program_space::remove_objfile (this=0x5555564cdd20, objfile=0x555556515540) at src/gdb/progspace.c:210
 #25 0x0000555555ae4502 in objfile::unlink (this=0x555556515540) at src/gdb/objfiles.c:487
 #26 0x0000555555ae5a12 in objfile_purge_solibs () at src/gdb/objfiles.c:875
 #27 0x0000555555c09686 in no_shared_libraries (ignored=0x0, from_tty=1) at src/gdb/solib.c:1236
 #28 0x00005555559e3f5f in detach_command (args=0x0, from_tty=1) at src/gdb/infcmd.c:2769

Note frame #14:

 #14 0x0000555555ae4730 in objfile::~objfile (this=0x555556515540, __in_chrg=<optimized out>) at src/gdb/objfiles.c:573

That's a dtor, thus noexcept.  That's the reason for the
std::terminate.

The previous patch fixed things such that the exception above isn't
thrown anymore.  However, it's possible that e.g., the remote
connection drops just while a user types "nosharedlibrary", or some
other reason that leads to objfile::~objfile, and then we end up the
same std::terminate problem.

Also notice that frames #9-#11 are BFD frames:

 #9  0x0000555555e09e3f in opncls_bclose (abfd=0x555556bc27e0) at src/bfd/opncls.c:599
 #10 0x0000555555e0a2c7 in bfd_close_all_done (abfd=0x555556bc27e0) at src/bfd/opncls.c:847
 #11 0x0000555555e0a27a in bfd_close (abfd=0x555556bc27e0) at src/bfd/opncls.c:814

BFD is written in C and thus throwing exceptions over such frames may
either not clean up properly, or, may abort if bfd is not compiled
with -fasynchronous-unwind-tables (x86-64 defaults that on, but not
all GCC ports do).

Thus frame #8 seems like a good place to swallow exceptions.  More so
since in this spot we already ignore target_fileio_close return
errors.  That's what this commit does.  Without the previous fix, we'd
see:

 (gdb) detach
 Detaching from program: target:/any/program, process 2197701
 Ending remote debugging.
 [Inferior 1 (process 2197701) detached]
 warning: cannot close "target:/lib64/ld-linux-x86-64.so.2": Remote connection closed

Note it prints a warning, which would still be a regression compared
to GDB 10, if it weren't for the previous fix.

gdb/ChangeLog:
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	PR gdb/28080
	* gdb_bfd.c (gdb_bfd_close_warning): New.
	(gdb_bfd_iovec_fileio_close): Wrap target_fileio_close in
	try/catch and print warning on exception.
	(gdb_bfd_close_or_warn): Use gdb_bfd_close_warning.

Change-Id: Ic7a26ddba0a4444e3377b0e7c1c89934a84545d7
2021-07-13 15:34:51 +01:00
Pedro Alves
97c5ca8c34 Fix detach with target remote (PR gdb/28080)
Commit 408f66864a ("detach in all-stop
with threads running") regressed "detach" with "target remote":

 (gdb) detach
 Detaching from program: target:/any/program, process 3671843
 Detaching from process 3671843
 Ending remote debugging.
 [Inferior 1 (process 3671843) detached]
 In main
 terminate called after throwing an instance of 'gdb_exception_error'
 Aborted (core dumped)

Here's the exception above being thrown:

 (top-gdb) bt
 #0  throw_error (error=TARGET_CLOSE_ERROR, fmt=0x555556035588 "Remote connection closed") at src/gdbsupport/common-exceptions.cc:222
 #1  0x0000555555bbaa46 in remote_target::readchar (this=0x555556a11040, timeout=10000) at src/gdb/remote.c:9440
 #2  0x0000555555bbb9e5 in remote_target::getpkt_or_notif_sane_1 (this=0x555556a11040, buf=0x555556a11058, forever=0, expecting_notif=0, is_notif=0x0) at src/gdb/remote.c:9928
 #3  0x0000555555bbbda9 in remote_target::getpkt_sane (this=0x555556a11040, buf=0x555556a11058, forever=0) at src/gdb/remote.c:10030
 #4  0x0000555555bc0e75 in remote_target::remote_hostio_send_command (this=0x555556a11040, command_bytes=13, which_packet=14, remote_errno=0x7fffffffcfd0, attachment=0x0, attachment_len=0x0) at src/gdb/remote.c:12137
 #5  0x0000555555bc1b6c in remote_target::remote_hostio_close (this=0x555556a11040, fd=8, remote_errno=0x7fffffffcfd0) at src/gdb/remote.c:12455
 #6  0x0000555555bc1bb4 in remote_target::fileio_close (During symbol reading: .debug_line address at offset 0x64f417 is 0 [in module build/gdb/gdb]
 this=0x555556a11040, fd=8, remote_errno=0x7fffffffcfd0) at src/gdb/remote.c:12462
 #7  0x0000555555c9274c in target_fileio_close (fd=3, target_errno=0x7fffffffcfd0) at src/gdb/target.c:3365
 #8  0x000055555595a19d in gdb_bfd_iovec_fileio_close (abfd=0x555556b9f8a0, stream=0x555556b11530) at src/gdb/gdb_bfd.c:439
 #9  0x0000555555e09e3f in opncls_bclose (abfd=0x555556b9f8a0) at src/bfd/opncls.c:599
 #10 0x0000555555e0a2c7 in bfd_close_all_done (abfd=0x555556b9f8a0) at src/bfd/opncls.c:847
 #11 0x0000555555e0a27a in bfd_close (abfd=0x555556b9f8a0) at src/bfd/opncls.c:814
 #12 0x000055555595a9d3 in gdb_bfd_close_or_warn (abfd=0x555556b9f8a0) at src/gdb/gdb_bfd.c:626
 #13 0x000055555595ad29 in gdb_bfd_unref (abfd=0x555556b9f8a0) at src/gdb/gdb_bfd.c:715
 #14 0x0000555555ae4730 in objfile::~objfile (this=0x555556515540, __in_chrg=<optimized out>) at src/gdb/objfiles.c:573
 #15 0x0000555555ae955a in std::_Sp_counted_ptr<objfile*, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x555556c20db0) at /usr/include/c++/9/bits/shared_ptr_base.h:377
 #16 0x000055555572b7c8 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x555556c20db0) at /usr/include/c++/9/bits/shared_ptr_base.h:155
 #17 0x00005555557263c3 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x555556bf0588, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:730
 #18 0x0000555555ae745e in std::__shared_ptr<objfile, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x555556bf0580, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:1169
 #19 0x0000555555ae747e in std::shared_ptr<objfile>::~shared_ptr (this=0x555556bf0580, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr.h:103
 #20 0x0000555555b1c1dc in __gnu_cxx::new_allocator<std::_List_node<std::shared_ptr<objfile> > >::destroy<std::shared_ptr<objfile> > (this=0x5555564cdd60, __p=0x555556bf0580) at /usr/include/c++/9/ext/new_allocator.h:153
 #21 0x0000555555b1bb1d in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<objfile> > > >::destroy<std::shared_ptr<objfile> > (__a=..., __p=0x555556bf0580) at /usr/include/c++/9/bits/alloc_traits.h:497
 #22 0x0000555555b1b73e in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::_M_erase (this=0x5555564cdd60, __position=std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x555556515540}) at /usr/include/c++/9/bits/stl_list.h:1921
 #23 0x0000555555b1afeb in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::erase (this=0x5555564cdd60, __position=std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x555556515540}) at /usr/include/c++/9/bits/list.tcc:158
 #24 0x0000555555b19576 in program_space::remove_objfile (this=0x5555564cdd20, objfile=0x555556515540) at src/gdb/progspace.c:210
 #25 0x0000555555ae4502 in objfile::unlink (this=0x555556515540) at src/gdb/objfiles.c:487
 #26 0x0000555555ae5a12 in objfile_purge_solibs () at src/gdb/objfiles.c:875
 #27 0x0000555555c09686 in no_shared_libraries (ignored=0x0, from_tty=1) at src/gdb/solib.c:1236
 #28 0x00005555559e3f5f in detach_command (args=0x0, from_tty=1) at src/gdb/infcmd.c:2769

So frame #28 already detached the remote process, and then we're
purging the shared libraries.  GDB had opened remote shared libraries
via the target: sysroot, so it tries closing them.  GDBserver is
tearing down already, so remote communication breaks down and we close
the remote target and throw TARGET_CLOSE_ERROR.

Note frame #14:

 #14 0x0000555555ae4730 in objfile::~objfile (this=0x555556515540, __in_chrg=<optimized out>) at src/gdb/objfiles.c:573

That's a dtor, thus noexcept.  That's the reason for the
std::terminate.

Stepping back a bit, why do we still have open remote files if we've
managed to detach already, and, we're debugging with "target remote"?
The reason is that commit 408f66864a
makes detach_command hold a reference to the target, so the remote
target won't be finally closed until frame #28 returns.  It's closing
the target that invalidates target file I/O handles.

This commit fixes the issue by not relying on target_close to
invalidate the target file I/O handles, instead invalidate them
immediately in remote_unpush_target.  So when GDB purges the solibs,
and we end up in target_fileio_close (frame #7 above), there's nothing
to do, and we don't try to talk with the remote target anymore.

The regression isn't seen when testing with
--target_board=native-gdbserver, because that does "set sysroot" to
disable the "target:" sysroot, for test run speed reasons.  So this
commit adds a testcase that explicitly tests detach with "set sysroot
target:".

gdb/ChangeLog:
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	PR gdb/28080
	* remote.c (remote_unpush_target): Invalidate file I/O target
	handles.
	* target.c (fileio_handles_invalidate_target): Make extern.
	* target.h (fileio_handles_invalidate_target): Declare.

gdb/testsuite/ChangeLog:
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	PR gdb/28080
	* gdb.base/detach-sysroot-target.exp: New.
	* gdb.base/detach-sysroot-target.c: New.

Reported-By: Jonah Graham <jonah@kichwacoders.com>

Change-Id: I851234910172f42a1b30e731161376c344d2727d
2021-07-13 15:34:02 +01:00
Tom de Vries
58a136f3e7 [gdb/testsuite] Fix check-libthread-db.exp FAILs with glibc 2.33
When running test-case gdb.threads/check-libthread-db.exp on openSUSE
Tumbleweed with glibc 2.33, I get:
...
(gdb) maint check libthread-db^M
Running libthread_db integrity checks:^M
  Got thread 0x7ffff7c79b80 => 9354 => 0x7ffff7c79b80; errno = 0 ... OK^M
libthread_db integrity checks passed.^M
(gdb) FAIL: gdb.threads/check-libthread-db.exp: user-initiated check: \
  libpthread.so not initialized (pattern 2)
...

The test-case expects instead:
...
  Got thread 0x0 => 9354 => 0x0 ... OK^M
...
which is what I get on openSUSE Leap 15.2 with glibc 2.26, and what is
described in the test-case like this:
...
    # libthread_db should fake a single thread with th_unique == NULL.
...

Using a breakpoint on check_thread_db_callback we can compare the two
scenarios, and find that in the latter case we hit this code in glibc function
iterate_thread_list in nptl_db/td_ta_thr_iter.c:
...
  if (next == 0 && fake_empty)
    {
      /* __pthread_initialize_minimal has not run.  There is just the main
         thread to return.  We cannot rely on its thread register.  They
         sometimes contain garbage that would confuse us, left by the
         kernel at exec.  So if it looks like initialization is incomplete,
         we only fake a special descriptor for the initial thread.  */
      td_thrhandle_t th = { ta, 0 };
      return callback (&th, cbdata_p) != 0 ? TD_DBERR : TD_OK;
    }
...
while in the former case we don't because this preceding statement doesn't
result in next == 0:
...
  err = DB_GET_FIELD (next, ta, head, list_t, next, 0);
...

Note that the comment mentions __pthread_initialize_minimal, but in both cases
it has already run before we hit the callback, so it's possible the comment is
no longer accurate.

The change in behaviour bisect to glibc commit 1daccf403b "nptl: Move stack
list variables into _rtld_global", which moves the initialization of stack
list variables such as __stack_user to an earlier moment, which explains well
enough the observed difference.

Fix this by updating the regexp patterns to agree with what libthread-db is
telling us.

Tested on x86_64-linux, both with glibc 2.33 and 2.26.

gdb/testsuite/ChangeLog:

2021-07-13  Tom de Vries  <tdevries@suse.de>

	PR testsuite/27690
	* gdb.threads/check-libthread-db.exp: Update patterns for glibc 2.33.
2021-07-13 16:11:38 +02:00
Simon Marchi
1bdfa2b1a8 gdb: disable commit-resumed on -exec-interrupt --thread-group
As reported in PR gdb/28077, we hit an internal error when using
-exec-interrupt with --thread-group:

    info threads
    &"info threads\n"
    ~"  Id   Target Id             Frame \n"
    ~"* 1    process 403312 \"loop\" (running)\n"
    ^done
    (gdb)
    -exec-interrupt --thread-group i1
    ~"/home/simark/src/binutils-gdb/gdb/target.c:3768: internal-error: void target_stop(ptid_t): Assertion `!proc_target->commit_resumed_state' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? (y or n) "

This is because this code path never disables commit-resumed (a
requirement for calling target_stop, as documented in
process_stratum_target::»commit_resumed_state) before calling
target_stop.

The other 3 code paths in mi_cmd_exec_interrupt use interrupt_target_1,
which does it.  But the --thread-group code path uses its own thing
which doesn't do it.  Fix this by adding a scoped_disable_commit_resumed
in this code path.

Calling -exec-interrupt with --thread-group is apparently not tested at
the moment (which is why this bug could creep in).  Add a new test for
that.  The test runs two inferiors and tries to interrupt them with
"-exec-interrupt --thread-group X".

This will need to be merged in the gdb-11-branch, so here are ChangeLog
entries:

gdb/ChangeLog:

	* mi/mi-main.c (mi_cmd_exec_interrupt): Use
	scoped_disable_commit_resumed in the --thread-group case.

gdb/testsuite/ChangeLog:

	* gdb.mi/interrupt-thread-group.c: New.
	* gdb.mi/interrupt-thread-group.exp: New.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28077
Change-Id: I615efefcbcaf2c15d47caf5e4b9d82854b2a2fcb
2021-07-13 09:26:50 -04:00
John Ericson
29e079b876 Fix some dangling references to netbsd-tdep
These files were renamed in 1b71cfcfdc,
but evidentially a few dangling references were left behind. This causes
builds to fail:

    $ ./configure --target i686-netbsdelf
    $ make
    make: *** No rule to make target 'nbsd-tdep.c', needed by 'nbsd-tdep.o'.  Stop.

gdb/ChangeLog:

	* sparc-tdep.h: Fix comment.
	* netbsd-tdep.c (nbsd_info_proc_mappings_header): Fix comment.
	(nbsd_init_abi): Fix comment.
	* configure.tgt (*-*-netbsd* | *-*-knetbsd*-gnu): Fix netbsd
	file name.
	(alpha*-*-openbsd*): Likewise.
	(sparc-*-openbsd*): Likewise.
	(sparc64-*-openbsd*): Likewise.

Change-Id: I18a0873902dccadd238615577aac4e08772fa2c8
2021-07-13 00:57:52 -04:00
GDB Administrator
969168ce6f Automatic date update in version.in 2021-07-13 00:00:35 +00:00
Tom de Vries
d6771741f3 [gdb/testsuite] Fix gdb.btrace/tsx.exp on system with tsx disabled in microcode
Recently I started to see this fail with trunk:
...
(gdb) record instruction-history^M
1          0x00000000004004ab <main+4>: call   0x4004b7 <test>^M
2          0x00000000004004c6 <test+15>:        mov    $0x1,%eax^M
3          0x00000000004004cb <test+20>:        ret    ^M
(gdb) FAIL: gdb.btrace/tsx.exp: speculation indication
...

This is due to an intel microcode update (1) that disables Intel TSX by default.

Fix this by updating the pattern.

Tested on x86_64-linux, with both gcc 7.5.0 and clang 12.0.1.

[1] https://www.intel.com/content/www/us/en/support/articles/000059422/processors.html

gdb/testsuite/ChangeLog:

2021-07-12  Tom de Vries  <tdevries@suse.de>

	PR testsuite/28057
	* gdb.btrace/tsx.exp: Add pattern for system with tsx disabled in
	microcode.
2021-07-12 17:33:42 +02:00
Tom de Vries
29119da49d [gdb/testsuite] Fix gdb.mi/mi-info-sources.exp for extra debug info
When running test-case gdb.mi/mi-info-sources.exp, I run into:
...
Running src/gdb/testsuite/gdb.mi/mi-info-sources.exp ...
ERROR: internal buffer is full.
...
due to extra debug info from the shared libraries.

Fix this by using "nosharedlibrary".

Then I run into these FAILs:
...
FAIL: gdb.mi/mi-info-sources.exp: debug_read=false: \
  -file-list-exec-source-files (unexpected output)
FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
  -file-list-exec-source-files (unexpected output)
FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
  -file-list-exec-source-files --group-by-objfile, look for \
  mi-info-sources.c (unexpected output)
FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
  -file-list-exec-source-files --group-by-objfile, look for \
  mi-info-sources-base.c (unexpected output)
...
due to openSUSE executables which have debug info for objects from sources
like sysdeps/x86_64/crtn.S.

Fix these by updating the patterns, and adding "maint expand-symtabs" to
reliably get fully-read objfiles.

Then I run into FAILs when using the readnow target board.  Fix these by
skipping the relevant tests.

Then I run into FAILs when using the cc-with-gnu-debuglink board.  Fix these
by updating the patterns.

Tested on x86_64-linux, with native, check-read1, readnow, cc-with-gdb-index,
cc-with-debug-names, cc-with-gnu-debuglink, cc-with-dwz, cc-with-dwz-m.

gdb/testsuite/ChangeLog:

2021-07-12  Tom de Vries  <tdevries@suse.de>

	* lib/mi-support.exp (mi_readnow): New proc.
	* gdb.mi/mi-info-sources.exp: Use nosharedlibrary.  Update patterns.
	Skip tests for readnow.  Use "maint expand-symtabs".
2021-07-12 14:46:54 +02:00
GDB Administrator
7ad7599a96 Automatic date update in version.in 2021-07-12 00:00:22 +00:00
Tom Tromey
2814ff8388 Fix warning in symtab.c
The compiler gives this warning when building symtab.c:

../../binutils-gdb/gdb/symtab.c:4247:28: warning: 'to_match' may be used uninitialized in this function [-Wmaybe-uninitialized]

This patch fixes the warning by adding a gdb_assert_not_reached.

gdb/ChangeLog:

        * gdb/symtab.c (info_sources_filter::matches): Add default
        case hander in switch statement.

(cherry picked from commit b6aeb717a8)
2021-07-11 06:59:33 -07:00
GDB Administrator
5496271fd4 Automatic date update in version.in 2021-07-11 00:00:22 +00:00
GDB Administrator
3e2cf22eef Automatic date update in version.in 2021-07-10 00:00:23 +00:00
GDB Administrator
789b4fb594 Automatic date update in version.in 2021-07-09 00:00:25 +00:00
Simon Marchi
ff32938d44 gdb: don't set Linux-specific displaced stepping methods in s390_gdbarch_init
According to bug 28056, running an s390x binary gives:

    (gdb) run
    Starting program: /usr/bin/ls
    /home/ubuntu/tmp/gdb-11.0.90.20210705/gdb/linux-tdep.c:2550: internal-error: displaced_step_prepare_status linux_displaced_step_prepare(gdbarch*, thread_info*, CORE_ADDR&): Assertion `gdbarch_data->num_disp_step_buffers > 0' failed.

This is because the s390 architecture registers some Linux-specific
displaced stepping callbacks in the OS-agnostic s390_gdbarch_init:

    set_gdbarch_displaced_step_prepare (gdbarch, linux_displaced_step_prepare);
    set_gdbarch_displaced_step_finish (gdbarch, linux_displaced_step_finish);
    set_gdbarch_displaced_step_restore_all_in_ptid
      (gdbarch, linux_displaced_step_restore_all_in_ptid);

But then the Linux-specific s390_linux_init_abi_any passes
num_disp_step_buffers=0 to linux_init_abi:

    linux_init_abi (info, gdbarch, 0);

The problem happens when linux_displaced_step_prepare is called for the
first time.  It tries to allocate the displaced stepping buffers, but
sees that the number of displaced stepping buffers for that architecture
is 0, which is unexpected / invalid.

s390_gdbarch_init should not register the linux_* callbacks, that is
expected to be done by linux_init_abi.  If debugging a bare-metal s390
program, or an s390 program on another OS GDB doesn't know about, we
wouldn't want to use them.  We would either register no callbacks, if
displaced stepping isn't supported, or register a different set of
callbacks if we wanted to support displaced stepping in those cases.

The commit that refactored the displaced stepping machinery and
introduced these set_gdbarch_displaced_step_* calls is 187b041e25
("gdb: move displaced stepping logic to gdbarch, allow starting
concurrent displaced steps").  However, even before that,
s390_gdbarch_init did:

  set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location);

... which already seemed wrong.  The Linux-specific callback was used
even for non-Linux system.  Maybe that was on purpose, because it would
also happen to work in some other non-Linux case, or maybe it was simply
a mistake.  I'll assume that this was a small mistake when
s390-tdep.{h,c} where factored out of s390-linux-tdep.c, in d6e5894564
("s390: Split up s390-linux-tdep.c into two files").

Fix this by removing the setting of these displaced step callbacks from
s390_gdbarch_init.  Instead, pass num_disp_step_buffers=1 to
linux_init_abi, in s390_linux_init_abi_any.  Doing so will cause
linux_init_abi to register these same callbacks.  It will also mean that
when debugging a bare-metal s390 executable or an executable on another
OS that GDB doesn't know about, gdbarch_displaced_step_prepare won't be
set, so displaced stepping won't be used.

This patch will need to be merged in the gdb-11-branch, since this is a
GDB 11 regression, so here's the ChangeLog entry:

gdb/ChangeLog:

	* s390-linux-tdep.c (s390_linux_init_abi_any): Pass 1 (number
	of displaced stepping buffers to linux_init_abi.
	* s390-tdep.c (s390_gdbarch_init): Don't set the Linux-specific
	displaced-stepping gdbarch callbacks.

Change-Id: Ieab2f8990c78fde845ce7378d6fd4ee2833800d5
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28056
2021-07-08 10:05:16 -04:00
Simon Marchi
6f0fe250d9 gdb/Makefile.in: remove testsuite from SUBDIRS
When distclean-ing a configured / built gdb directory, like so:

    $ ./configure && make all-gdb && make distclean

The distclean operation fails with:

    Missing testsuite/Makefile

If we look at the SUBDIRS variable in the generated gdb/Makefile,
testsuite is there twice:

    SUBDIRS = doc  testsuite data-directory testsuite

So we try distclean-ing the testsuite directory twice.  The second time,
gdb/testsuite/Makefile doesn't exist, so it fails.

The first "testsuite" comes from the @subdirs@ replacement, because of
the `AC_CONFIG_SUBDIRS` macro in gdb/configure.ac.  The second one is
hard-coded in gdb/Makefile.in:

    SUBDIRS = doc @subdirs@ data-directory testsuite

The hard-coded was added by:

    bdbbcd5774 ("Always build 'all' in gdb/testsuite")

which came after `testsuite` was removed from @subdirs@ by:

    f99d1d3749 ("Remove gdb/testsuite/configure")

My commit a100a94530 ("gdb/testsuite: restore configure script")
should have removed the hard-coded `testsuite`, since it added it back
as a "subdir", but I missed it because I only looked f99d1d3749 to
write my patch.

Fix this by removing the hard-coded one.

This patch should be pushed to both master and gdb-11-branch, hence the
ChangeLog entry:

gdb/ChangeLog:

	* Makefile.in (SUBDIRS): Remove testsuite.

Change-Id: I63e5590b1a08673c646510b3ecc74600eae9f92d
2021-07-08 09:57:23 -04:00
Tom de Vries
732236a76e [gdb/testsuite] Fix gdb.guile/scm-breakpoint.exp with guile 3.0
When running test-case gdb.guile/scm-breakpoint.exp on openSUSE Tumbleweed
with guile 3.0, I run into:
...
(gdb) guile (define cp (make-breakpoint "syscall" #:type BP_CATCHPOINT))^M
ERROR: In procedure make-breakpoint:^M
In procedure gdbscm_make_breakpoint: unsupported breakpoint type in \
  position 3: "BP_CATCHPOINT"^M
Error while executing Scheme code.^M
(gdb) FAIL: gdb.guile/scm-breakpoint.exp: test_catchpoints: \
  create a catchpoint via the api
...

The same test passes on openSUSE Leap 15.2 with guile 2.0, where the second
line of the error message starts with the same prefix as the first:
...
ERROR: In procedure gdbscm_make_breakpoint: unsupported breakpoint type in \
  position 3: "BP_CATCHPOINT"^M
...

I observe the same difference in many other tests, f.i.:
...
(gdb) gu (print (value-add i '()))^M
ERROR: In procedure value-add:^M
In procedure gdbscm_value_add: Wrong type argument in position 2: ()^M
Error while executing Scheme code.^M
(gdb) PASS: gdb.guile/scm-math.exp: catch error in guile type conversion
...
but it doesn't cause FAILs anywhere else.

Fix this by updating the regexp to make the "ERROR: " prefix optional.

Tested on x86_64-linux, with both guile 2.0 and 3.0.

gdb/testsuite/ChangeLog:

2021-07-08  Tom de Vries  <tdevries@suse.de>

	* gdb.guile/scm-breakpoint.exp: Make additional "ERROR: " prefix in
	exception printing optional.
2021-07-08 11:17:05 +02:00
GDB Administrator
e7ca24a166 Automatic date update in version.in 2021-07-08 00:00:25 +00:00
GDB Administrator
76deb9291d Automatic date update in version.in 2021-07-07 00:00:26 +00:00
Simon Marchi
8043d65ba2 gdb/testsuite: restore configure script
Commit f99d1d3749 ("Remove gdb/testsuite/configure") removed
gdb/testsuite/configure, as anything gdb/testsuite/configure did could
be done by gdb/configure.

There is however one use case that popped up when this changed
propagated to downstream consumers, to run the testsuite on an already
built GDB.  In the workflow of ROCm-GDB at AMD, a GDB package is built
in a CI job.  This GDB package is then tested on different machines /
hardware configurations as part of other CI jobs.  To achieve this,
those CI jobs only configure the testsuite directory and run "make
check" with an appropriate board file.

In light of this use case, the way I see it is that gdb/testsuite could
be considered its own project.  It could be stored in a completely
different repo if we want to, it just happens to be stored inside gdb/.

Since the only downside of having gdb/testsuite/configure is that it
takes a few more seconds to run, but on the other hand it's quite useful
for some people, I propose re-adding it.

In a sense, this is revert of f99d1d3749, but it's not a direct
git-revert, as some things have changed since.

gdb/ChangeLog:

	* configure.ac: Remove things that were moved from
	testsuite/configure.ac.
	* configure: Re-generate.

gdb/testsuite/ChangeLog:

	* configure.ac: Restore.
	* configure: Re-generate.
	* aclocal.m4: Re-generate.
	* Makefile.in (distclean): Add config.status.
	(Makefile): Adjust paths.
	(lib/pdtrace): Adjust paths.
	(config.status): Add.

Change-Id: Ic38c79485e1835712d9c99649c9dfb59667254f1
2021-07-06 15:00:57 -04:00
Tom de Vries
52e44e8d29 [gdb/testsuite] Fix fail in gdb.fortran/ptype-on-functions.exp with gcc-7
Since commit 05b8577206 "gdb/fortran: Add type info of formal parameter for
clang" I see:
...
(gdb) ptype say_string^M
type = void (character*(*), integer(kind=4))^M
(gdb) FAIL: gdb.fortran/ptype-on-functions.exp: ptype say_string
...

The part of the commit causing the fail is:
...
 gdb_test "ptype say_string" \
-    "type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)"
+    "type = void \\(character\[^,\]+, $integer8\\)"
...
which fails to take into account that for gcc-7 and before, the type for
string length of a string argument is int, not size_t.

Fix this by allowing both $integer8 and $integer4.

Tested on x86_64-linux, with gcc-7 and gcc-10.

gdb/testsuite/ChangeLog:

2021-07-06  Tom de Vries  <tdevries@suse.de>

	* gdb.fortran/ptype-on-functions.exp: Allow both $integer8 and
	$integer4 for size of string length.
2021-07-06 17:04:14 +02:00
GDB Administrator
5354f52ba2 Automatic date update in version.in 2021-07-06 00:00:26 +00:00
Simon Marchi
fa8740b675 gdb: fall back on sigpending + sigwait if sigtimedwait is not available
The macOS platform does not provide sigtimedwait, so we get:

      CXX    compile/compile.o
    In file included from /Users/smarchi/src/binutils-gdb/gdb/compile/compile.c:46:
    /Users/smarchi/src/binutils-gdb/gdb/../gdbsupport/scoped_ignore_signal.h:69:4: error: use of undeclared identifier 'sigtimedwait'
              sigtimedwait (&set, nullptr, &zero_timeout);
              ^

An alternative to sigtimedwait with a timeout of 0 is to use sigpending,
to first check which signals are pending, and then sigwait, to consume
them.  Since that's slightly more expensive (2 syscalls instead of 1),
keep using sigtimedwait for the platforms that provide it, and fall back
to sigpending + sigwait for the others.

gdbsupport/ChangeLog:

	* scoped_ignore_signal.h (struct scoped_ignore_signal)
	<~scoped_ignore_signal>: Use sigtimedwait if HAVE_SIGTIMEDWAIT
	is defined, else use sigpending + sigwait.

Change-Id: I2a72798337e81dd1bbd21214736a139dd350af87
Co-Authored-By: John Baldwin <jhb@FreeBSD.org>
2021-07-05 09:56:10 -04:00
Simon Marchi
507af45f62 gdbsupport/common.m4: check for sigtimedwait
The next patch will make the use of sigtimedwait conditional to whether
the platform provides it.  Start by adding a configure check for it.

gdbsupport/ChangeLog:

	* common.m4 (GDB_AC_COMMON): Check for sigtimedwait.
	* config.in, configure: Re-generate.

gdb/ChangeLog:

	* config.in, configure: Re-generate.

gdbserver/ChangeLog:

	* config.in, configure: Re-generate.

Change-Id: Ic7613fe14521b966b4d991bbcd0933ab14629c05
2021-07-05 09:56:05 -04:00
GDB Administrator
4165a99398 Automatic date update in version.in 2021-07-05 00:00:21 +00:00
Simon Marchi
5d91a235cd gdb: return early if no execution in darwin_solib_create_inferior_hook
When loading a file using the file command on macOS, we get:

    $ ./gdb -nx --data-directory=data-directory -q -ex "file ./test"
    Reading symbols from ./test...
    Reading symbols from /Users/smarchi/build/binutils-gdb/gdb/test.dSYM/Contents/Resources/DWARF/test...
    /Users/smarchi/src/binutils-gdb/gdb/thread.c:72: internal-error: struct thread_info *inferior_thread(): Assertion `current_thread_ != nullptr' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

The backtrace is:

    * frame #0: 0x0000000101fcb826 gdb`internal_error(file="/Users/smarchi/src/binutils-gdb/gdb/thread.c", line=72, fmt="%s: Assertion `%s' failed.") at errors.cc:52:3
      frame #1: 0x00000001018a2584 gdb`inferior_thread() at thread.c:72:3
      frame #2: 0x0000000101469c09 gdb`get_current_regcache() at regcache.c:421:31
      frame #3: 0x00000001015f9812 gdb`darwin_solib_get_all_image_info_addr_at_init(info=0x0000603000006d00) at solib-darwin.c:464:34
      frame #4: 0x00000001015f7a04 gdb`darwin_solib_create_inferior_hook(from_tty=1) at solib-darwin.c:515:5
      frame #5: 0x000000010161205e gdb`solib_create_inferior_hook(from_tty=1) at solib.c:1200:3
      frame #6: 0x00000001016d8f76 gdb`symbol_file_command(args="./test", from_tty=1) at symfile.c:1650:7
      frame #7: 0x0000000100abab17 gdb`file_command(arg="./test", from_tty=1) at exec.c:555:3
      frame #8: 0x00000001004dc799 gdb`do_const_cfunc(c=0x000061100000c340, args="./test", from_tty=1) at cli-decode.c:102:3
      frame #9: 0x00000001004ea042 gdb`cmd_func(cmd=0x000061100000c340, args="./test", from_tty=1) at cli-decode.c:2160:7
      frame #10: 0x00000001018d4f59 gdb`execute_command(p="t", from_tty=1) at top.c:674:2
      frame #11: 0x0000000100eee430 gdb`catch_command_errors(command=(gdb`execute_command(char const*, int) at top.c:561), arg="file ./test", from_tty=1, do_bp_actions=true)(char const*, int), char const*, int, bool) at main.c:523:7
      frame #12: 0x0000000100eee902 gdb`execute_cmdargs(cmdarg_vec=0x00007ffeefbfeba0 size=1, file_type=CMDARG_FILE, cmd_type=CMDARG_COMMAND, ret=0x00007ffeefbfec20) at main.c:618:9
      frame #13: 0x0000000100eed3a4 gdb`captured_main_1(context=0x00007ffeefbff780) at main.c:1322:3
      frame #14: 0x0000000100ee810d gdb`captured_main(data=0x00007ffeefbff780) at main.c:1343:3
      frame #15: 0x0000000100ee8025 gdb`gdb_main(args=0x00007ffeefbff780) at main.c:1368:7
      frame #16: 0x00000001000044f1 gdb`main(argc=6, argv=0x00007ffeefbff8a0) at gdb.c:32:10
      frame #17: 0x00007fff20558f5d libdyld.dylib`start + 1

The solib_create_inferior_hook call in symbol_file_command was added by
commit ea142fbfc9 ("Fix breakpoints on file reloads for PIE
binaries").  It causes solib_create_inferior_hook to be called while
the inferior is not running, which darwin_solib_create_inferior_hook
does not expect.  darwin_solib_get_all_image_info_addr_at_init, in
particular, assumes that there is a current thread, as it tries to get
the current thread's regcache.

Fix it by adding a target_has_execution check and returning early.  Note
that there is a similar check in svr4_solib_create_inferior_hook.

gdb/ChangeLog:

	* solib-darwin.c (darwin_solib_create_inferior_hook): Return
	early if no execution.

Change-Id: Ia11dd983a1e29786e5ce663d0fcaa6846dc611bb
2021-07-04 18:50:02 -04:00
GDB Administrator
45959f27d9 Automatic date update in version.in 2021-07-04 00:00:25 +00:00
Joel Brobecker
afc60144d1 Bump GDB version number to 11.0.90.DATE-git.
gdb/ChangeLog:

	* version.in: Set GDB version number to 11.0.90.DATE-git.
2021-07-03 11:37:04 -07:00
Joel Brobecker
3c21f80eb4 Document the GDB 11.0.90 release in gdb/ChangeLog
gdb/ChangeLog:

	GDB 11.0.90 released.
2021-07-03 11:36:36 -07:00
Joel Brobecker
14b921356f Set GDB version number to 11.0.90.
gdb/ChangeLog:

	* version.in: Set GDB version number to 11.0.90.
2021-07-03 11:15:08 -07:00
Joel Brobecker
466ee06bda gdb/NEWS: Replace "Changes since GDB 10" by "Changes in GDB 11".
gdb/ChangeLog:

        * NEWS: Replace "Changes since GDB 10" by "Changes in GDB 11".
2021-07-03 11:04:49 -07:00
Joel Brobecker
828264c1d2 Set development mode to "off" by default.
bfd/ChangeLog:

	* development.sh (development): Set to false.
2021-07-03 10:42:20 -07:00
Joel Brobecker
633fd34015 Bump version to 11.0.90.DATE-git.
Now that the GDB 11 branch has been created, we can
bump the version number.

gdb/ChangeLog:

	GDB 11 branch created (4b51505e33):
	* version.in: Bump version to 11.0.90.DATE-git.
2021-07-03 10:41:28 -07:00
6561 changed files with 17364 additions and 7252 deletions

View File

@@ -1,3 +1,16 @@
2021-09-07 Luis Machado <luis.machado@linaro.org>
Revert: [AArch64] MTE corefile support
2021-05-21 Luis Machado <luis.machado@linaro.org>
* elf.c (elfcore_make_memtag_note_section): New function.
(elfcore_grok_note): Handle NT_MEMTAG note types.
2021-07-03 Joel Brobecker <brobecker@adacore.com>
* development.sh (development): Set to false.
2021-07-03 Nick Clifton <nickc@redhat.com>
* version.m4: Update version number.

View File

@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Controls whether to enable development-mode features by default.
development=true
development=false
# Indicate whether this is a release branch.
experimental=true

View File

@@ -1773,6 +1773,9 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
case DT_REL: name = "REL"; break;
case DT_RELSZ: name = "RELSZ"; break;
case DT_RELENT: name = "RELENT"; break;
case DT_RELR: name = "RELR"; break;
case DT_RELRSZ: name = "RELRSZ"; break;
case DT_RELRENT: name = "RELRENT"; break;
case DT_PLTREL: name = "PLTREL"; break;
case DT_DEBUG: name = "DEBUG"; break;
case DT_TEXTREL: name = "TEXTREL"; break;
@@ -2355,16 +2358,22 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
case SHT_REL:
case SHT_RELA:
case SHT_RELR:
/* *These* do a lot of work -- but build no sections! */
{
asection *target_sect;
Elf_Internal_Shdr *hdr2, **p_hdr;
unsigned int num_sec = elf_numsections (abfd);
struct bfd_elf_section_data *esdt;
bfd_size_type size;
if (hdr->sh_entsize
!= (bfd_size_type) (hdr->sh_type == SHT_REL
? bed->s->sizeof_rel : bed->s->sizeof_rela))
if (hdr->sh_type == SHT_REL)
size = bed->s->sizeof_rel;
else if (hdr->sh_type == SHT_RELA)
size = bed->s->sizeof_rela;
else
size = bed->s->arch_size / 8;
if (hdr->sh_entsize != size)
goto fail;
/* Check for a bogus link to avoid crashing. */
@@ -9599,23 +9608,6 @@ elfcore_make_auxv_note_section (bfd *abfd, Elf_Internal_Note *note,
return true;
}
static bool
elfcore_make_memtag_note_section (bfd *abfd, Elf_Internal_Note *note,
size_t offs)
{
asection *sect = bfd_make_section_anyway_with_flags (abfd, ".memtag",
SEC_HAS_CONTENTS);
if (sect == NULL)
return false;
sect->size = note->descsz - offs;
sect->filepos = note->descpos + offs;
sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32;
return true;
}
/* prstatus_t exists on:
solaris 2.5+
linux 2.[01] + glibc
@@ -10676,8 +10668,6 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
return elfcore_make_note_pseudosection (abfd, ".note.linuxcore.siginfo",
note);
case NT_MEMTAG:
return elfcore_make_memtag_note_section (abfd, note, 0);
}
}

View File

@@ -16,7 +16,7 @@
In releases, the date is not included in either version strings or
sonames. */
#define BFD_VERSION_DATE 20210703
#define BFD_VERSION_DATE 20220116
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
#define REPORT_BUGS_TO @report_bugs_to@

View File

@@ -1,3 +1,11 @@
2021-09-07 Luis Machado <luis.machado@linaro.org>
Revert: [AArch64] MTE corefile support
2021-05-21 Luis Machado <luis.machado@linaro.org>
* readelf.c (get_note_type): Handle NT_MEMTAG note types.
2021-07-03 Nick Clifton <nickc@redhat.com>
* configure: Regenerate.

View File

@@ -18843,8 +18843,6 @@ get_note_type (Filedata * filedata, unsigned e_type)
return _("NT_SIGINFO (siginfo_t data)");
case NT_FILE:
return _("NT_FILE (mapped files)");
case NT_MEMTAG:
return _("NT_MEMTAG (memory tags)");
default:
break;
}

View File

@@ -1,5 +1,5 @@
;; Emacs settings.
;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
;; Copyright (C) 2012-2022 Free Software Foundation, Inc.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by

View File

@@ -1,3 +1,282 @@
2022-01-16 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 11.2.
2022-01-16 Joel Brobecker <brobecker@adacore.com>
* gdbarch.sh: Update end year of copyright year range for
copyright header of generated files.
2022-01-16 Joel Brobecker <brobecker@adacore.com>
Update copyright year in header of all GDB files to 2022,
using the gdb/copyright.py script
2022-01-16 Joel Brobecker <brobecker@adacore.com>
* copyright.py (EXCLUDE_LIST): Add "gdbsupport/Makefile.in".
2022-01-16 Joel Brobecker <brobecker@adacore.com>
* top.c: Update year range in copyright notice.
(print_gdb_version): Update copyright year to 2022.
2021-12-23 Andrew Burgess <andrew.burgess@embecosm.com>
PR gdb/28405
* remote.c (remote_target::remote_add_thread): Add new silent_p
argument, use as needed.
(remote_target::remote_notice_new_inferior): Pass additional
argument to remote_add_thread.
(remote_target::remote_notice_new_inferior): Likewise.
(extended_remote_target::attach): Call remote_add_thread instead
of add_thred_silent directly.
(remote_target::select_thread_for_ambiguous_stop_reply): Move
assert earlier, before we use the thing we're asserting is not
nullptr.
2021-12-11 Bruno Larsen <blarsen@redhat.com>
PR gdb/28480
Pushed by Joel Brobecker <brobecker@adacore.com>
* valops.c (struct_field_searcher::update_result): Improve
ambiguous member detection.
2021-11-03 Luis Machado <luis.machado@linaro.org>
PR gdb/28355
* arch/aarch64.h (struct aarch64_features): New struct.
2021-10-22 Tom de Vries <tdevries@suse.de>
PR tui/28483
* tui/tui-winsource.c (tui_source_window_base::update_breakpoint_info):
Fix returns in loop body.
2021-10-04 Tom de Vries <tdevries@suse.de>
PR build/28318
* ax_cxx_compile_stdcxx.m4: Add CXX_DIALECT to CXX.
* configure: Regenerate.
2021-09-13 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 11.1.90.DATE-git.
2021-09-13 Joel Brobecker <brobecker@adacore.com>
GDB 11.1 released.
2021-09-13 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 11.1.
2021-09-08 Tom Tromey <tom@tromey.com>
* dwarf2/read.h (dwarf2_per_objfile::resize_symtabs): Remove.
* dwarf2/read.c (all_comp_units_iterator, all_comp_units_range):
New classes.
(dwarf2_per_objfile::symtab_set_p)
(dwarf2_per_objfile::get_symtab, dwarf2_per_objfile::set_symtab):
Adjust to resizeable vectors.
(dwarf2_gdb_index::expand_symtabs_matching)
(dwarf2_base_index_functions::map_symbol_filenames)
(dwarf2_debug_names_index::expand_symtabs_matching): Use
all_comp_units_range.
(dwarf2_initialize_objfile, dwarf2_build_psymtabs)
(add_type_unit): Don't call resize_symtabs.
2021-09-07 John Baldwin <jhb@FreeBSD.org>
* fbsd-nat.c (fbsd_nat_target::info_proc): Use plongest and
pulongest instead of %j.
2021-08-30 Tom de Vries <tdevries@suse.de>
PR cli/28290
* gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the
empty-string case.
2021-08-23 Tom de Vries <tdevries@suse.de>
PR gdb/26880
* gdb/exec.c (exec_file_attach): Use %s instead of %ps in call to
error function.
2021-08-06 Simon Marchi <simon.marchi@polymtl.ca>
Tom de Vries <tdevries@suse.de>
PR symtab/28004
* dwarf2/read.c (dwarf2_rnglists_process, dwarf2_ranges_process):
Fix zero address complaint.
2021-08-02 Tom Tromey <tromey@adacore.com>
PR varobj/28131
* varobj.c (~varobj): Delete 'dynamic' before 'root'.
2021-08-02 Shahab Vahedi <shahab@synopsys.com>
PR gdb/28104
* gdbtypes.c (gdbtypes_post_init): Use
"arch_boolean_type (..., unsigned=1, ...) to construct
"boolean".
cp-valprint.c (test_print_flags): New.
(_initialize_cp_valprint): Run the "test_print_flags" unit-test.
2021-07-28 Tom de Vries <tdevries@suse.de>
* dwarf2/read.c (attr_to_dynamic_prop): Handle DW_FORM_data16.
2021-07-27 Tom de Vries <tdevries@suse.de>
PR testsuite/26904
* gdb/testsuite/gdb.ada/big_packed_array.exp: Add xfail.
2021-07-27 Tom de Vries <tdevries@suse.de>
PR testsuite/26903
* gdb/testsuite/gdb.ada/array_of_variant.exp: Add xfails.
2021-07-26 Frederic Cambus <fred@statdns.com>
* syscalls/netbsd.xml: Regenerate.
2021-07-26 Shahab Vahedi <shahab@synopsys.com>
Simon Marchi <simon.marchi@efficios.com>
PR gdb/28103
* valprint.c (val_print_type_code_flags): Merely shift the VAL
to the right to get rid of the lower bits.
(test_print_flags): New.
(_initialize_valprint): Invoke the "test_print_flags" as a unit-test.
2021-07-26 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
PR gdb/28076
* mi/mi-cmd-break.c (mi_cmd_break_condition): Handle the case
of having no condition argument.
2021-07-20 Luis Machado <luis.machado@linaro.org>
Pedro Alves <pedro@palves.net>
PR gdb/28110
* gdbarch.sh: Updated documentation for gdbarch_tagged_address_p.
* gdbarch.h: Regenerate.
* printcmd.c (should_validate_memtags): Reorder comparisons and only
validate tags for pointer and reference types. Skip validation of
optimized out or unavailable values.
(print_command_1): Guard call memory tagging validation code with
a try/catch block.
2021-07-19 Tom Tromey <tromey@adacore.com>
PR gdb/28093
* language.c (auto_or_unknown_language::parser): Call error.
2021-07-17 Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Makefile.in (ALL_TARGET_OBS): Add z80-tdep.c.
* NEWS: Mention z80 support.
* configure.tgt: Handle z80*.
* features/Makefile (XMLTOC): Add z80.xml.
* features/z80-cpu.xml: New.
* features/z80.c: Generate.
* features/z80.xml: New.
* z80-tdep.c: New file.
* z80-tdep.h: New file.
2021-07-13 Lancelot Six <lsix@lancelotsix.com>
* make-init-c: Use /bin/sh as shebang.
2021-07-13 Pedro Alves <pedro@palves.net>
PR gdb/28080
* gdb_bfd.c (gdb_bfd_close_warning): New.
(gdb_bfd_iovec_fileio_close): Wrap target_fileio_close in
try/catch and print warning on exception.
(gdb_bfd_close_or_warn): Use gdb_bfd_close_warning.
2021-07-13 Pedro Alves <pedro@palves.net>
PR gdb/28080
* remote.c (remote_unpush_target): Invalidate file I/O target
handles.
* target.c (fileio_handles_invalidate_target): Make extern.
* target.h (fileio_handles_invalidate_target): Declare.
2021-07-13 Simon Marchi <simon.marchi@polymtl.ca>
* mi/mi-main.c (mi_cmd_exec_interrupt): Use
scoped_disable_commit_resumed in the --thread-group case.
2021-07-13 John Ericson <git@JohnEricson.me>
* sparc-tdep.h: Fix comment.
* netbsd-tdep.c (nbsd_info_proc_mappings_header): Fix comment.
(nbsd_init_abi): Fix comment.
* configure.tgt (*-*-netbsd* | *-*-knetbsd*-gnu): Fix netbsd
file name.
(alpha*-*-openbsd*): Likewise.
(sparc-*-openbsd*): Likewise.
(sparc64-*-openbsd*): Likewise.
2021-07-11 Tom Tromey <tom@tromey.com>
Committed by Joel Brobecker <brobecker@adacore.com>:
* gdb/symtab.c (info_sources_filter::matches): Add default
case hander in switch statement.
2021-07-08 Simon Marchi <simon.marchi@polymtl.ca>
* s390-linux-tdep.c (s390_linux_init_abi_any): Pass 1 (number
of displaced stepping buffers to linux_init_abi.
* s390-tdep.c (s390_gdbarch_init): Don't set the Linux-specific
displaced-stepping gdbarch callbacks.
2021-07-08 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (SUBDIRS): Remove testsuite.
2021-07-06 Simon Marchi <simon.marchi@polymtl.ca>
* configure.ac: Remove things that were moved from
testsuite/configure.ac.
* configure: Re-generate.
2021-07-05 Simon Marchi <simon.marchi@polymtl.ca>
* config.in, configure: Re-generate.
2021-07-04 Simon Marchi <simon.marchi@polymtl.ca>
* solib-darwin.c (darwin_solib_create_inferior_hook): Return
early if no execution.
2021-07-03 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 11.0.90.DATE-git.
2021-07-03 Joel Brobecker <brobecker@adacore.com>
GDB 11.0.90 released.
2021-07-03 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 11.0.90.
2021-07-03 Joel Brobecker <brobecker@adacore.com>
* NEWS: Replace "Changes since GDB 10" by "Changes in GDB 11".
2021-07-03 Joel Brobecker <brobecker@adacore.com>
GDB 11 branch created (4b51505e33441c6165e7789fa2b6d21930242927):
* version.in: Bump version to 11.0.90.DATE-git.
2021-07-02 Tom Tromey <tromey@adacore.com>
* ada-exp.y (chop_selector, chop_separator, write_selectors)

View File

@@ -1,4 +1,4 @@
# Copyright (C) 1989-2021 Free Software Foundation, Inc.
# Copyright (C) 1989-2022 Free Software Foundation, Inc.
# This file is part of GDB.
@@ -852,7 +852,8 @@ ALL_TARGET_OBS = \
xstormy16-tdep.o \
xtensa-config.o \
xtensa-linux-tdep.o \
xtensa-tdep.o
xtensa-tdep.o \
z80-tdep.o
# The following native-target dependent variables are defined on
# configure.nat.
@@ -1591,7 +1592,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
$(SUBDIR_TARGET_OBS) \
$(SUBDIR_GCC_COMPILE_OBS)
SUBDIRS = doc @subdirs@ data-directory testsuite
SUBDIRS = doc @subdirs@ data-directory
CLEANDIRS = $(SUBDIRS)
# List of subdirectories in the build tree that must exist.

View File

@@ -1,7 +1,7 @@
What has changed in GDB?
(Organized release by release)
*** Changes since GDB 10
*** Changes in GDB 11
* The 'set disassembler-options' command now supports specifying options
for the ARC target.
@@ -424,6 +424,7 @@ alias [-a] [--] ALIAS = COMMAND [DEFAULT-ARGS...]
GNU/Linux/RISC-V (gdbserver) riscv*-*-linux*
BPF bpf-unknown-none
Z80 z80-unknown-*
* Python API

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
/* Copyright (C) 1999-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
/* Copyright (C) 1999-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
/* Copyright (C) 2019-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
/* Copyright (C) 2019-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for FreeBSD/aarch64.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for FreeBSD/aarch64.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* FreeBSD/aarch64 target support, prototypes.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for GNU/Linux AArch64.
Copyright (C) 2011-2021 Free Software Foundation, Inc.
Copyright (C) 2011-2022 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for GNU/Linux AArch64.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
Copyright (C) 2009-2022 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* GNU/Linux on AArch64 target support, prototypes.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2022 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for Newlib AArch64.
Copyright (C) 2011-2021 Free Software Foundation, Inc.
Copyright (C) 2011-2022 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ravenscar Aarch64 target support.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ravenscar Aarch64 target support.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GDB on AArch64 systems.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
Copyright (C) 2009-2022 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GDB on AArch64 systems.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
Copyright (C) 2009-2022 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
# Copyright (C) 1992-2021 Free Software Foundation, Inc.
# Copyright (C) 1992-2022 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without

View File

@@ -1,6 +1,6 @@
/* Definitions for Ada expressions
Copyright (C) 2020, 2021 Free Software Foundation, Inc.
Copyright (C) 2020-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* YACC parser for Ada expressions, for GDB.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ada language support routines for GDB, the GNU debugger.
Copyright (C) 1992-2021 Free Software Foundation, Inc.
Copyright (C) 1992-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ada language support definitions for GDB, the GNU debugger.
Copyright (C) 1992-2021 Free Software Foundation, Inc.
Copyright (C) 1992-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* FLEX lexer for Ada expressions, for GDB.
Copyright (C) 1994-2021 Free Software Foundation, Inc.
Copyright (C) 1994-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
/* Copyright (C) 1992-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Support for printing Ada types for GDB, the GNU debugger.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Support for printing Ada values for GDB, the GNU debugger.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* varobj support for Ada.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Copyright (C) 2012-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* addrmap.c --- implementation of address map data structure.
Copyright (C) 2007-2021 Free Software Foundation, Inc.
Copyright (C) 2007-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* addrmap.h --- interface to address map data structure.
Copyright (C) 2007-2021 Free Software Foundation, Inc.
Copyright (C) 2007-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2012-2021 Free Software Foundation, Inc.
/* Copyright (C) 2012-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Low level interface for debugging AIX 4.3+ pthreads.
Copyright (C) 1999-2021 Free Software Foundation, Inc.
Copyright (C) 1999-2022 Free Software Foundation, Inc.
Written by Nick Duffek <nsd@redhat.com>.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Shared allocation functions for GDB, the GNU debugger.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for Alpha BSD's.
Copyright (C) 2000-2021 Free Software Foundation, Inc.
Copyright (C) 2000-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code Alpha BSD's.
Copyright (C) 2000-2021 Free Software Foundation, Inc.
Copyright (C) 2000-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for Alpha BSD's.
Copyright (C) 2002-2021 Free Software Foundation, Inc.
Copyright (C) 2002-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Low level Alpha GNU/Linux interface, for GDB when running native.
Copyright (C) 2005-2021 Free Software Foundation, Inc.
Copyright (C) 2005-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Target-dependent code for GNU/Linux on Alpha.
Copyright (C) 2002-2021 Free Software Foundation, Inc.
Copyright (C) 2002-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Target-dependent mdebug code for the ALPHA architecture.
Copyright (C) 1993-2021 Free Software Foundation, Inc.
Copyright (C) 1993-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for NetBSD/alpha.
Copyright (C) 2002-2021 Free Software Foundation, Inc.
Copyright (C) 2002-2022 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for OpenBSD/alpha.
Copyright (C) 2006-2021 Free Software Foundation, Inc.
Copyright (C) 2006-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for the ALPHA architecture, for GDB, the GNU Debugger.
Copyright (C) 1993-2021 Free Software Foundation, Inc.
Copyright (C) 1993-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Common target dependent code for GDB on Alpha systems.
Copyright (C) 1993-2021 Free Software Foundation, Inc.
Copyright (C) 1993-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for AMD64 BSD's.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for modern AMD64 BSD's.
Copyright (C) 2018-2021 Free Software Foundation, Inc.
Copyright (C) 2018-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Darwin support for GDB, the GNU debugger.
Copyright (C) 1997-2021 Free Software Foundation, Inc.
Copyright (C) 1997-2022 Free Software Foundation, Inc.
Contributed by Apple Computer, Inc.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for Darwin x86-64.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
Copyright (C) 2009-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for DICOS running on x86-64's, for GDB.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
Copyright (C) 2009-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for FreeBSD/amd64.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for FreeBSD/amd64.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for GNU/Linux x86-64.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for GNU/Linux x86-64.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for GNU/Linux AMD64.
Copyright (C) 2006-2021 Free Software Foundation, Inc.
Copyright (C) 2006-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for AMD64.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for AMD64.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for NetBSD/amd64.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for NetBSD/amd64.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for OpenBSD/amd64.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for OpenBSD/amd64.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ravenscar x86-64 target support.
Copyright (C) 2020-2021 Free Software Foundation, Inc.
Copyright (C) 2020-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ravenscar x86-64 target support.
Copyright (C) 2020-2021 Free Software Foundation, Inc.
Copyright (C) 2020-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for AMD64 Solaris.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Joseph Myers, CodeSourcery, LLC.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for AMD64.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.

View File

@@ -1,6 +1,6 @@
/* Target-dependent definitions for AMD64.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
/* Copyright (C) 2008-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2021 Free Software Foundation, Inc.
/* Copyright (C) 2009-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Annotation routines for GDB.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Annotation routines for GDB.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for GNU/Linux ARC.
Copyright 2020-2021 Free Software Foundation, Inc.
Copyright 2020-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target dependent code for GNU/Linux ARC.
Copyright 2020-2021 Free Software Foundation, Inc.
Copyright 2020-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target dependent code for GNU/Linux ARC.
Copyright 2020-2021 Free Software Foundation, Inc.
Copyright 2020-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for Newlib ARC.
Copyright (C) 2016-2021 Free Software Foundation, Inc.
Copyright (C) 2016-2022 Free Software Foundation, Inc.
Contributed by Synopsys Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target dependent code for ARC architecture, for GDB.
Copyright 2005-2021 Free Software Foundation, Inc.
Copyright 2005-2022 Free Software Foundation, Inc.
Contributed by Synopsys Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target dependent code for ARC architecture, for GDB.
Copyright 2005-2021 Free Software Foundation, Inc.
Copyright 2005-2022 Free Software Foundation, Inc.
Contributed by Synopsys Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Dynamic architecture support for GDB, the GNU debugger.
Copyright (C) 1998-2021 Free Software Foundation, Inc.
Copyright (C) 1998-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Dynamic architecture support for GDB, the GNU debugger.
Copyright (C) 1998-2021 Free Software Foundation, Inc.
Copyright (C) 1998-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
/* Copyright (C) 2019-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
/* Copyright (C) 2019-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2021 Free Software Foundation, Inc.
/* Copyright (C) 2009-2022 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2021 Free Software Foundation, Inc.
/* Copyright (C) 2009-2022 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common Linux target-dependent functionality for AArch64 MTE
Copyright (C) 2021 Free Software Foundation, Inc.
Copyright (C) 2021-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common Linux target-dependent definitions for AArch64 MTE
Copyright (C) 2021 Free Software Foundation, Inc.
Copyright (C) 2021-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
/* Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target-dependent functionality for AArch64.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,6 +22,15 @@
#include "gdbsupport/tdesc.h"
/* Holds information on what architectural features are available. This is
used to select register sets. */
struct aarch64_features
{
bool sve = false;
bool pauth = false;
bool mte = false;
};
/* Create the aarch64 target description. A non zero VQ value indicates both
the presence of SVE and the Vector Quotient - the number of 128bit chunks in
an SVE Z register. HAS_PAUTH_P indicates the presence of the PAUTH

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
/* Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
/* Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
/* Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
/* Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common code for ARM software single stepping support.
Copyright (C) 1988-2021 Free Software Foundation, Inc.
Copyright (C) 1988-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common code for ARM software single stepping support.
Copyright (C) 1988-2021 Free Software Foundation, Inc.
Copyright (C) 1988-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GNU/Linux on ARM systems.
Copyright (C) 1999-2021 Free Software Foundation, Inc.
Copyright (C) 1999-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GNU/Linux on ARM systems.
Copyright (C) 1999-2021 Free Software Foundation, Inc.
Copyright (C) 1999-2022 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GDB on ARM systems.
Copyright (C) 1988-2021 Free Software Foundation, Inc.
Copyright (C) 1988-2022 Free Software Foundation, Inc.
This file is part of GDB.

Some files were not shown because too many files have changed in this diff Show More