lp:~ubuntu-support-team/binutils/+git/binutils-gdb

Get this repository:
git clone https://git.launchpad.net/~ubuntu-support-team/binutils/+git/binutils-gdb

Import details

Import Status: Reviewed

This repository is an import of the Git repository at git://sourceware.org/git/binutils-gdb.git.

The next import is scheduled to run .

Last successful import was .

Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 4 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 10 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 5 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 17 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 7 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 6 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 9 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 8 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 7 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-0 and finished taking 9 minutes — see the log

Branches

Name Last Modified Last Commit
master 2024-04-23 13:20:42 UTC
gdb: bump black version to 24.4.0

Author: Simon Marchi
Author Date: 2024-04-23 01:43:02 UTC

gdb: bump black version to 24.4.0

Run `pre-commit autoupdate`, this is the outcome. There is no change in
formatting of Python files.

Change-Id: I977781fa6cc924c398cc3b9d9954dc0fbb95d082

users/simark/try-cleanup 2024-04-23 03:40:06 UTC
gdb: remove unused includes of gdbsupport/gdb_vecs.h

Author: Simon Marchi
Author Date: 2024-04-23 03:34:19 UTC

gdb: remove unused includes of gdbsupport/gdb_vecs.h

Change-Id: I6ddc310a7ce2d46b73fdc5bfad2d7f17435627b2

binutils-2_42-branch 2024-04-23 00:01:50 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2024-04-23 00:01:50 UTC

Automatic date update in version.in

gdb-14-branch 2024-04-23 00:00:42 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2024-04-23 00:00:42 UTC

Automatic date update in version.in

users/simark/try-defs.h-cleanup-1 2024-04-22 19:18:53 UTC
gdb: don't include gdbsupport/array-view.h in defs.h

Author: Simon Marchi
Author Date: 2024-04-22 17:44:38 UTC

gdb: don't include gdbsupport/array-view.h in defs.h

Nothing in defs.h actually uses this. Everything that I can compile
still compiles, so I guess that all users of array_view already include
it one way or another. Worst case, if this causes some build failure,
the fix will be one #include away.

Change-Id: I981be98b0653cc18c929d85e9afd8732332efd15

users/ssbssa/try-c++23-multi-subscript 2024-04-20 14:19:44 UTC
C++23 multi-subscript operator[]

Author: Hannes Domani
Author Date: 2024-04-14 11:44:08 UTC

C++23 multi-subscript operator[]

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

users/ibhagat/try-scfi-next 2024-03-28 23:55:50 UTC
gas: x86: fix code comments and other nits

Author: Indu Bhagat
Author Date: 2024-01-18 19:38:44 UTC

gas: x86: fix code comments and other nits

ChangeLog:
 * gas/config/tc-i386.c

users/amerey/index-download 2024-03-20 00:43:32 UTC
gdb/debuginfod: Add .debug_line downloading

Author: Aaron Merey
Author Date: 2024-03-19 22:54:28 UTC

gdb/debuginfod: Add .debug_line downloading

ELF/DWARF section downloading allows gdb to download .gdb_index files in
order to defer full debuginfo downloads. However .gdb_index does not
contain any information regarding source filenames. When a gdb command
includes a filename argument (ex. 'break main.c:50'), this results in
the mass downloading of all deferred debuginfo so that gdb can search the
debuginfo for matching source filenames. This can result in unnecessary
downloads.

To improve this, have gdb instead download each debuginfo's .debug_line
(and .debug_line_str if using DWARF5) when executing these commands.
Download full debuginfo only when its .debug_line contains a matching
filename.

Since the combined size of .debug_line and .debug_line_str is only about
1% the size of the corresponding debuginfo, significant time can be saved
by checking these sections before choosing to download an entire debuginfo.

This patch also redirects stdout and stderr of the debuginfod server
used by testsuite/gdb.debuginfod tests to a server_log standard output
file. While adding tests for this patch I ran into an issue where the
test server would block when logging to stderr, presumably because the
stderr buffer filled up and wasn't being read from. Redirecting the
log to a file fixes this and also makes the server log more accessible
when debugging test failures.

users/simark/try-config-include 2024-03-18 19:54:31 UTC
gdbsupport: move more things to gdbsupport.inc.h

Author: Simon Marchi
Author Date: 2024-02-23 16:07:36 UTC

gdbsupport: move more things to gdbsupport.inc.h

Move some more of the things that should be seen everywhere by all
compilation units from common-defs.h to gdbsupport.inc.h. After this
change, to the best of my knowledge, common-defs.h, server.h and defs.h
are no longer special, they would not need to be included first anymore.

A lot of source files don't need what is directly defined in
common-defs.h / server.h / defs.h , but rather use things in header
files included transitively. There's no rush to do so, but for these
files, we'll be able to remove the inclusion of common-defs.h / server.h
/ defs.h and make them include what they actually use.

Ultimately, I think we could just get rid of these header files, since
they pretty much just server as big bags of includes. Moving to more
fine-graned includes means less unnecessary includes, meaning less
unnecessary recompilation when some header file is modified.

The things moved to gdbsupport.inc.h are:

 - __STDC_CONSTANT_MACROS, __STDC_LIMIT_MACROS, __STDC_FORMAT_MACROS:
   according to the comment, they must be defined before including some
   standard headers. Are these defines still useful though?

 - _FORTIFY_SOURCE: must come before any standard library include.

 - _WIN32_WINNT: must come before including the Windows API headers.

 - ATTRIBUTE_PRINTF, ATTRIBUTE_NONNULL: we override what ansidecl.h
   gives us. So better define it in gdbsupport.inc.h, so that there is
   no chance of some source file including ansidecl.h without having the
   overrides.

 - HAVE_USEFUL_SBRK: this needs to be seen everywhere, in case one does
   `#ifdef HAVE_USEFUL_SBRK`.

 - Inclusion of poison.h, so that all code everywhere, uses our
   overrides of xfree & co. This requires including liberty.h in
   poison.h, since it overrides some macros from it.

 - Since poison.h uses xfree and xfree uses some traits defined in
   poison.h, but gnulib also defines its own (non-templated) version of
   xfree, I had some strange error due to some non-compatible
   redefinitions. All in all, it becomes simpler to move xfree to
   poison.h and get rid of gdb-xfree.h, so do that.

Change-Id: I21ad69e5f38f9fd7a3943d9f96d3782739d4b6df

binutils-2_41-branch 2024-02-23 03:11:04 UTC
as: fixed internal error when immediate value of relocation overflow.

Author: Lulu Cai
Author Date: 2023-10-11 02:20:45 UTC

as: fixed internal error when immediate value of relocation overflow.

The as and ld use _bfd_error_handler to output error messages when
checking relocation alignment and relocation overflow. However, the
abfd value passed by as to the function is NULL, resulting in an
internal error. The ld passes a non-null value to the function,
so it can output an error message normally.

(cherry picked from commit f87cf663af71e5d78c8d647fa48562102f3b0615)

users/gwen/try-frame-unwind-c++-ification-fixed 2024-02-21 14:38:24 UTC
gdb: Migrate frame unwinders to use C++ classes

Author: Guinevere Larsen
Author Date: 2024-02-20 17:27:32 UTC

gdb: Migrate frame unwinders to use C++ classes

Frame unwinders have historically been a structure populated with
callback pointers, so that architectures (or other specific unwinders)
could install their own way to handle the inferior. However, since
moving to c++, we could use polymorphism to get the same functionality
in a more readable way. Polymorphism also makes it simpler to add new
functionality to all frame unwinders, since all that's required is
adding it to the base class.

As part of the changes to add support to disabling frame unwinders,
this commit makes the first baby step in using polymorphism for the
frame unwinders, by making frame_unwind a virtual class, and adds 3 new
classes. The main class added is frame_unwind_legacy, which works the
same as the previous structs, using function pointers as callbacks. This
class was added to allow the transition to happen piecemeal. New
unwinders should instead follow the lead of the other 2 classes
implemented.

The other 2, frame_unwind_python and frame_unwind_trampoline, were added
because it seemed simpler at the moment to do that instead of reworking
the dynamic allocation to work with the legacy class, and can be used as
an example to future implementations.

users/gwen/try-frame-unwind-c++-ification 2024-02-16 17:30:24 UTC
gdb: add "unwinder class" to frame unwinders

Author: Guinevere Larsen
Author Date: 2024-01-19 08:46:46 UTC

gdb: add "unwinder class" to frame unwinders

A future patch will add a way to disable certain unwinders based on
different characteristics. This patch aims done to make it more
convenient to disable related unwinders in bulk, such as architecture
specific ones, by indentifying all unwinders by which part of the code
adds it. The classes, and explanations, are as follows:

* GDB: An internal unwinder, added by GDB core, such as the unwinder
  for dummy frames;
* EXTENSION: Unwinders added by extension languages;
* DEBUGINFO: Unwinders installed by the debug info reader;
* ARCH: Unwinders installed by the architecture specific code.

users/ARM/gcs-binutils-gdb-master 2024-01-30 08:59:55 UTC
aarch64: Add support for GCS in AArch64 linker.

Author: SRINATH PARVATHANENI
Author Date: 2024-01-30 08:59:53 UTC

aarch64: Add support for GCS in AArch64 linker.

This patch adds support for GCS in AArch64 linker.

This patch implements the following:
1) Defines GNU_PROPERTY_AARCH64_FEATURE_1_GCS bit for GCS in
GNU_PROPERTY_AARCH64_FEATURE_1_AND macro.

2) Adds readelf support to read and print the GNU properties
in AArch64.

Displaying notes found in: .note.gnu.property
[ ]+Owner[ ]+Data size[ ]+Description
  GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: GCS

3) Adds support for -z experimental-gcs linker option and document
all the values allowed with option (-z experimental-gcs[=always|never|implicit]).
-z experimental-gcs is equivalent to -z experimental-gcs=always and
when option is not passed in the command line, it defaults to implicit.

4) Adds support for -z experimental-gcs-report linker option and document
all the values allowed with this option (-z experimental-gcs-report[=none|warning|error]).
-z experimental-gcs-report is equivalent to -z experimental-gcs-report=none
and when option is not passed in the command line, it defaults to none.

The ABI changes adding GNU_PROPERTY_AARCH64_FEATURE_1_GCS to the
GNU property GNU_PROPERTY_AARCH64_FEATURE_1_AND is merged into main and
can be found below.
https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst

users/ibhagat/try-scfi-v5 2024-01-11 04:22:43 UTC
gas: testsuite: add an aarch64 testsuite for SCFI

Author: Indu Bhagat
Author Date: 2023-12-11 06:08:03 UTC

gas: testsuite: add an aarch64 testsuite for SCFI

Similar to the x86_64 testcases, all .s files contain the corresponding
CFI directives. Many of the tests are executed with and without the
--scfi=experimental command line option.

gas/testsuite/:
 * gas/scfi/aarch64/scfi-aarch64.exp: New file.
 * gas/scfi/aarch64/scfi-ldrp-1.d: New test.
 * gas/scfi/aarch64/scfi-ldrp-1.l: New test.
 * gas/scfi/aarch64/scfi-ldrp-1.s: New test.
 * gas/scfi/aarch64/scfi-ldrp-2.d: New test.
 * gas/scfi/aarch64/scfi-ldrp-2.l: New test.
 * gas/scfi/aarch64/scfi-ldrp-2.s: New test.
 * gas/scfi/aarch64/scfi-stp-1.d: New test.
 * gas/scfi/aarch64/scfi-stp-1.l: New test.
 * gas/scfi/aarch64/scfi-stp-1.s: New test.
 * gas/scfi/aarch64/scfi-strp-2.d: New test.
 * gas/scfi/aarch64/scfi-strp-2.l: New test.
 * gas/scfi/aarch64/scfi-strp-2.s: New test.

users/vapier/sim/doc 2024-01-02 01:24:00 UTC
sim: ppc: always compile in the sysv sem & shm device files

Author: Mike Frysinger
Author Date: 2024-01-02 01:22:45 UTC

sim: ppc: always compile in the sysv sem & shm device files

Move the stub logic to the device files themselves. This makes the
configure & build logic more static which will make it easier to move
to the top-level build, and matches what we did with the common/ hw
tree already.

This also decouples the logic from the two -- in the past, you needed
both sem & shm in order to enable the device models, but now each one
is tied to its own independent knob. Practically speaking, this will
probably not make a difference, but it simplifies the build a bit.

users/vapier/sim/gnulib-build 2024-01-01 23:23:28 UTC
sim: use build-gnulib with build-time tools [PR sim/30882]

Author: Mike Frysinger
Author Date: 2023-10-15 17:13:56 UTC

sim: use build-gnulib with build-time tools [PR sim/30882]

Some of our build-time tools are fairly complicated and require some
POSIX APIs that the build system doesn't provide. Leverage the new
build-gnulib tree to provide fallback implementations automatically.

users/vapier/sim/gnulib 2024-01-01 23:23:28 UTC
sim: use gnulib to set nonblocking mode

Author: Mike Frysinger
Author Date: 2021-06-08 22:06:07 UTC

sim: use gnulib to set nonblocking mode

Replace various custom ad-hoc fcntl/O_NONBLOCK implementations with
the gnulib nonblocking module. This makes our code much tidier and
portable to other systems (e.g. Windows).

users/vapier/sim/bfin 2024-01-01 23:23:26 UTC
sim: bfin: initial bf60x support

Author: Mike Frysinger
Author Date: 2011-05-18 17:14:24 UTC

sim: bfin: initial bf60x support

users/ARM/morello-binutils-gdb-master 2023-12-06 18:41:36 UTC
morello, testsuite: Fix up morello-stubs-static.d

Author: Alex Coplan
Author Date: 2023-12-06 17:47:52 UTC

morello, testsuite: Fix up morello-stubs-static.d

The expected disassembly for this test is testing for the wrong thing: it
expects the adrp immediate to be zero-extended instead of sign-extended, which
is incorrect. That shows up as a test failure after fixing the disassembly in
the previous patch. This patch fixes the test.

users/palves/step-over-thread-exit-test-race 2023-11-13 16:57:48 UTC
Fix gdb.threads/step-over-thread-exit.exp race

Author: Pedro Alves
Author Date: 2023-11-13 16:30:31 UTC

Fix gdb.threads/step-over-thread-exit.exp race

Change-Id: I9d0a6fab069a02ac5557525b93b129940dbd4bf7

users/lsix/try-require-c++17 2023-10-13 13:59:59 UTC
gdb: Use initializers in lambda captures unconditionally

Author: Lancelot Six
Author Date: 2023-10-13 13:00:08 UTC

gdb: Use initializers in lambda captures unconditionally

Initializer in lambda captures were introduced in C++14, and
conditionally used in gdb/cp-support.c and gdb/dwarf2/cooked-index.c.

Since C++17 is now required by GDB, use this feature unconditionally.

Change-Id: I87a3d567941e5c71217538fa75c952e4d421fa1d

gdb-13-branch 2023-10-08 00:02:20 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2023-10-08 00:02:20 UTC

Automatic date update in version.in

binutils-2_41-release-point 2023-08-04 10:17:04 UTC
The GNU Binutils 2.41 release

Author: Nick Clifton
Author Date: 2023-08-04 10:17:04 UTC

The GNU Binutils 2.41 release

binutils-2_38-branch 2023-08-04 10:16:30 UTC
PR30697, ppc32 mix of local-dynamic and global-dynamic TLS

Author: Alan Modra
Author Date: 2023-08-04 05:39:53 UTC

PR30697, ppc32 mix of local-dynamic and global-dynamic TLS

This fixes miscounting of dynamic relocations on GOT entries when
a) there are both local-dynamic and global-dynamic tls accesss for a
   given symbol, and
b) the symbol is global with non-default visibility, and
c) the __tls_get_addr calls aren't optimised away.

 PR 30697
bfd/
 * elf32-ppc.c (allocate_dynrelocs): Correct local-dynamic
 reloc count.
ld/
 * testsuite/ld-powerpc/tls32ldgd.d,
 * testsuite/ld-powerpc/tls32ldgd.s: New test.
 * testsuite/ld-powerpc/powerpc.exp: Run it.

(cherry picked from commit ae33771224660dac25e64c3f70943a17bfab7681)

binutils-2_39-branch 2023-08-04 08:34:46 UTC
PR30697, ppc32 mix of local-dynamic and global-dynamic TLS

Author: Alan Modra
Author Date: 2023-08-04 05:39:53 UTC

PR30697, ppc32 mix of local-dynamic and global-dynamic TLS

This fixes miscounting of dynamic relocations on GOT entries when
a) there are both local-dynamic and global-dynamic tls accesss for a
   given symbol, and
b) the symbol is global with non-default visibility, and
c) the __tls_get_addr calls aren't optimised away.

 PR 30697
bfd/
 * elf32-ppc.c (allocate_dynrelocs): Correct local-dynamic
 reloc count.
ld/
 * testsuite/ld-powerpc/tls32ldgd.d,
 * testsuite/ld-powerpc/tls32ldgd.s: New test.
 * testsuite/ld-powerpc/powerpc.exp: Run it.

(cherry picked from commit ae33771224660dac25e64c3f70943a17bfab7681)

binutils-2_40-branch 2023-08-04 08:33:16 UTC
PR30697, ppc32 mix of local-dynamic and global-dynamic TLS

Author: Alan Modra
Author Date: 2023-08-04 05:39:53 UTC

PR30697, ppc32 mix of local-dynamic and global-dynamic TLS

This fixes miscounting of dynamic relocations on GOT entries when
a) there are both local-dynamic and global-dynamic tls accesss for a
   given symbol, and
b) the symbol is global with non-default visibility, and
c) the __tls_get_addr calls aren't optimised away.

 PR 30697
bfd/
 * elf32-ppc.c (allocate_dynrelocs): Correct local-dynamic
 reloc count.
ld/
 * testsuite/ld-powerpc/tls32ldgd.d,
 * testsuite/ld-powerpc/tls32ldgd.s: New test.
 * testsuite/ld-powerpc/powerpc.exp: Run it.

(cherry picked from commit ae33771224660dac25e64c3f70943a17bfab7681)

users/ibhagat/libsframe-versioning 2023-06-23 16:37:48 UTC
binutils/NEWS: add note about upcoming libsframe changes

Author: Indu Bhagat
Author Date: 2023-06-01 18:49:45 UTC

binutils/NEWS: add note about upcoming libsframe changes

Some of these changes update the ABI in an incompatible way.

users/aburgess/try-core-file-pid0 2023-06-05 09:05:07 UTC
gdb: handle core files with .reg/0 section names

Author: Andrew Burgess
Author Date: 2023-05-23 10:25:21 UTC

gdb: handle core files with .reg/0 section names

The previous commit added the test gdb.arch/core-file-pid0.exp which
tests GDB's ability to load a core file containing threads with an
lwpid of 0, which is something we GDB can encounter when loading a
vmcore file -- a core file generated by the Linux kernel. The threads
with an lwpid of 0 represents idle cores.

While the previous commit added the test, which confirms GDB doesn't
crash when confronted with such a core file, there are still some
problems with GDB's handling of these core files. These problems all
originate from the fact that the core file (once opened by bfd)
contains multiple sections called .reg/0, these sections all
represents different threads (cpu cores in the original vmcore dump),
but GDB gets confused and thinks all of these .reg/0 sections are all
referencing the same thread.

Here is a GDB session on an x86-64 machine which loads the core file
from the gdb.arch/core-file-pid0.exp, this core file contains two
threads, both of which have a pid of 0:

  $ ./gdb/gdb --data-directory ./gdb/data-directory/ -q
  (gdb) core-file /tmp/x86_64-pid0-core.core
  [New process 1]
  [New process 1]
  Failed to read a valid object file image from memory.
  Core was generated by `./segv-mt'.
  Program terminated with signal SIGSEGV, Segmentation fault.
  The current thread has terminated
  (gdb) info threads
    Id Target Id Frame
    2 process 1 0x00000000004017c2 in ?? ()

  The current thread <Thread ID 1> has terminated. See `help thread'.
  (gdb) maintenance info sections
  Core file: `/tmp/x86_64-pid0-core.core', file type elf64-x86-64.
   [0] 0x00000000->0x000012d4 at 0x00000318: note0 READONLY HAS_CONTENTS
   [1] 0x00000000->0x000000d8 at 0x0000039c: .reg/0 HAS_CONTENTS
   [2] 0x00000000->0x000000d8 at 0x0000039c: .reg HAS_CONTENTS
   [3] 0x00000000->0x00000080 at 0x0000052c: .note.linuxcore.siginfo/0 HAS_CONTENTS
   [4] 0x00000000->0x00000080 at 0x0000052c: .note.linuxcore.siginfo HAS_CONTENTS
   [5] 0x00000000->0x00000140 at 0x000005c0: .auxv HAS_CONTENTS
   [6] 0x00000000->0x000000a4 at 0x00000714: .note.linuxcore.file/0 HAS_CONTENTS
   [7] 0x00000000->0x000000a4 at 0x00000714: .note.linuxcore.file HAS_CONTENTS
   [8] 0x00000000->0x00000200 at 0x000007cc: .reg2/0 HAS_CONTENTS
   [9] 0x00000000->0x00000200 at 0x000007cc: .reg2 HAS_CONTENTS
   [10] 0x00000000->0x00000440 at 0x000009e0: .reg-xstate/0 HAS_CONTENTS
   [11] 0x00000000->0x00000440 at 0x000009e0: .reg-xstate HAS_CONTENTS
   [12] 0x00000000->0x000000d8 at 0x00000ea4: .reg/0 HAS_CONTENTS
   [13] 0x00000000->0x00000200 at 0x00000f98: .reg2/0 HAS_CONTENTS
   [14] 0x00000000->0x00000440 at 0x000011ac: .reg-xstate/0 HAS_CONTENTS
   [15] 0x00400000->0x00401000 at 0x00002000: load1 ALLOC LOAD READONLY HAS_CONTENTS
   [16] 0x00401000->0x004b9000 at 0x00003000: load2 ALLOC READONLY CODE
   [17] 0x004b9000->0x004e5000 at 0x00003000: load3 ALLOC READONLY
   [18] 0x004e6000->0x004ec000 at 0x00003000: load4 ALLOC LOAD HAS_CONTENTS
   [19] 0x004ec000->0x004f2000 at 0x00009000: load5 ALLOC LOAD HAS_CONTENTS
   [20] 0x012a8000->0x012cb000 at 0x0000f000: load6 ALLOC LOAD HAS_CONTENTS
   [21] 0x7fda77736000->0x7fda77737000 at 0x00032000: load7 ALLOC READONLY
   [22] 0x7fda77737000->0x7fda77f37000 at 0x00032000: load8 ALLOC LOAD HAS_CONTENTS
   [23] 0x7ffd55f65000->0x7ffd55f86000 at 0x00832000: load9 ALLOC LOAD HAS_CONTENTS
   [24] 0x7ffd55fc3000->0x7ffd55fc7000 at 0x00853000: load10 ALLOC LOAD READONLY HAS_CONTENTS
   [25] 0x7ffd55fc7000->0x7ffd55fc9000 at 0x00857000: load11 ALLOC LOAD READONLY CODE HAS_CONTENTS
   [26] 0xffffffffff600000->0xffffffffff601000 at 0x00859000: load12 ALLOC LOAD READONLY CODE HAS_CONTENTS
  (gdb)

Notice when the core file is first loaded we see two lines like:

  [New process 1]

And GDB reports:

  The current thread has terminated

Which isn't what we'd expect from a core file -- the core file should
only contain threads that are live at the point of the crash, one of
which should be the current thread. The above message is reported
because GDB has deleted what we think is the current thread!

And in the 'info threads' output we are only seeing a single thread,
again, this is because GDB has deleted one of the threads.

Finally, the 'maintenance info sections' output shows the cause of all
our problems, two sections named .reg/0. When GDB sees the first of
these it creates a new thread. But, when we see the second .reg/0 GDB
tries to create another new thread, but this thread has the same
ptid_t as the first thread, so GDB deletes the first thread and
creates the second thread in its place.

Because both these threads are created with an lwpid of 0 GDB reports
these are 'New process NN' rather than 'New LWP NN' which is what we
would normally expect.

The previous commit includes a little more of the history of GDB
support in this area, but these problems were discussed on the mailing
list a while ago in this thread:

  https://inbox.sourceware.org/gdb-patches/AANLkTi=zuEDw6qiZ1jRatkdwHO99xF2Qu+WZ7i0EQjef@mail.gmail.com/

In this commit I propose a solution to these problems.

What I propose is that GDB should spot when we have .reg/0 sections
and, when these are found, should rename these sections using some
unique non-zero lwpid.

Note in the above output we also have sections like .reg2/0 and
.reg-xstate/0, these are additional register sets, this commit also
renumbers these sections inline with their .reg section.

The user is warned that some section renumbering has been performed.

GDB takes care to ensure that the new numbers assigned are unique and
don't clash with any of the pid's that might already be in use --
remember, in a real vmcore file, 0 is used to indicate an idle core,
non-idle cores will have the pid of whichever process was running on
that core, so we don't want GDB to assign an lwpid that clashes with
an actual pid that is in use in the core file.

After this commit here's the updated GDB session output:

  $ ./gdb/gdb --data-directory ./gdb/data-directory/ -q
  (gdb) core-file /tmp/x86_64-pid0-core.core
  warning: found threads with pid 0, assigned replacement Target Ids: LWP 1, LWP 2
  [New LWP 1]
  [New LWP 2]
  Failed to read a valid object file image from memory.
  Core was generated by `./segv-mt'.
  Program terminated with signal SIGSEGV, Segmentation fault.
  #0 0x00000000004017c2 in ?? ()
  [Current thread is 1 (LWP 1)]
  (gdb) info threads
    Id Target Id Frame
  * 1 LWP 1 0x00000000004017c2 in ?? ()
    2 LWP 2 0x000000000040dda5 in ?? ()
  (gdb) maintenance info sections
  Core file: `/tmp/x86_64-pid0-core.core', file type elf64-x86-64.
   [0] 0x00000000->0x000012d4 at 0x00000318: note0 READONLY HAS_CONTENTS
   [1] 0x00000000->0x000000d8 at 0x0000039c: .reg/1 HAS_CONTENTS
   [2] 0x00000000->0x000000d8 at 0x0000039c: .reg HAS_CONTENTS
   [3] 0x00000000->0x00000080 at 0x0000052c: .note.linuxcore.siginfo/1 HAS_CONTENTS
   [4] 0x00000000->0x00000080 at 0x0000052c: .note.linuxcore.siginfo HAS_CONTENTS
   [5] 0x00000000->0x00000140 at 0x000005c0: .auxv HAS_CONTENTS
   [6] 0x00000000->0x000000a4 at 0x00000714: .note.linuxcore.file/1 HAS_CONTENTS
   [7] 0x00000000->0x000000a4 at 0x00000714: .note.linuxcore.file HAS_CONTENTS
   [8] 0x00000000->0x00000200 at 0x000007cc: .reg2/1 HAS_CONTENTS
   [9] 0x00000000->0x00000200 at 0x000007cc: .reg2 HAS_CONTENTS
   [10] 0x00000000->0x00000440 at 0x000009e0: .reg-xstate/1 HAS_CONTENTS
   [11] 0x00000000->0x00000440 at 0x000009e0: .reg-xstate HAS_CONTENTS
   [12] 0x00000000->0x000000d8 at 0x00000ea4: .reg/2 HAS_CONTENTS
   [13] 0x00000000->0x00000200 at 0x00000f98: .reg2/2 HAS_CONTENTS
   [14] 0x00000000->0x00000440 at 0x000011ac: .reg-xstate/2 HAS_CONTENTS
   [15] 0x00400000->0x00401000 at 0x00002000: load1 ALLOC LOAD READONLY HAS_CONTENTS
   [16] 0x00401000->0x004b9000 at 0x00003000: load2 ALLOC READONLY CODE
   [17] 0x004b9000->0x004e5000 at 0x00003000: load3 ALLOC READONLY
   [18] 0x004e6000->0x004ec000 at 0x00003000: load4 ALLOC LOAD HAS_CONTENTS
   [19] 0x004ec000->0x004f2000 at 0x00009000: load5 ALLOC LOAD HAS_CONTENTS
   [20] 0x012a8000->0x012cb000 at 0x0000f000: load6 ALLOC LOAD HAS_CONTENTS
   [21] 0x7fda77736000->0x7fda77737000 at 0x00032000: load7 ALLOC READONLY
   [22] 0x7fda77737000->0x7fda77f37000 at 0x00032000: load8 ALLOC LOAD HAS_CONTENTS
   [23] 0x7ffd55f65000->0x7ffd55f86000 at 0x00832000: load9 ALLOC LOAD HAS_CONTENTS
   [24] 0x7ffd55fc3000->0x7ffd55fc7000 at 0x00853000: load10 ALLOC LOAD READONLY HAS_CONTENTS
   [25] 0x7ffd55fc7000->0x7ffd55fc9000 at 0x00857000: load11 ALLOC LOAD READONLY CODE HAS_CONTENTS
   [26] 0xffffffffff600000->0xffffffffff601000 at 0x00859000: load12 ALLOC LOAD READONLY CODE HAS_CONTENTS
  (gdb)

Notice the new warning which is issued when the core file is being
loaded. The threads are announced as '[New LWP NN]', and we see two
threads in the 'info threads' output. The 'maintenance info sections'
output shows the result of the section renaming.

The gdb.arch/core-file-pid0.exp test has been update to check for the
improved GDB output.

users/palves/windows-non-stop 2023-05-31 14:41:38 UTC
Mention Windows non-stop support in NEWS

Author: Pedro Alves
Author Date: 2023-05-22 18:16:30 UTC

Mention Windows non-stop support in NEWS

Add a note to gdb/NEWS mentioning Windows non-stop support.

Change-Id: Id0e28525c06e57120c47b07f978581d1627d70f3

users/amerey/try-index-download 2023-05-23 15:45:00 UTC
gdb/testsuite/gdb.debuginfod: Add lazy downloading tests

Author: Aaron Merey
Author Date: 2023-02-27 15:48:31 UTC

gdb/testsuite/gdb.debuginfod: Add lazy downloading tests

Add some tests for 'set debuginfod enabled lazy', .gdb_index downloading
and deferred debuginfo downloading.

users/jemarch/new-bpf-atomics 2023-05-10 18:52:26 UTC
gas: document V3 BPF atomic instructions in the GAS manual

Author: Jose E. Marchesi
Author Date: 2023-05-10 17:02:39 UTC

gas: document V3 BPF atomic instructions in the GAS manual

gas/ChangeLog:

2023-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>

 * doc/c-bpf.texi (BPF Opcodes): Document the V3 BPF atomic
 instructions.

users/jemarch/poke-gdb 2023-04-29 12:55:08 UTC
Integrate GNU poke in GDB

Author: Jose E. Marchesi
Author Date: 2021-05-08 16:11:12 UTC

Integrate GNU poke in GDB

This patch integrates GNU poke (http://jemarch.net/poke) in GDB by
mean of libpoke. It allows the GDB user to execute Poke code from
within the debugger with access to the target memory, types and
values.

How this stuff works:

- GDB links with libpoke.so and uses the interface in libpoke.h.
  This is also how the GNU poke application (the command-line
  editor) is implemented.

- There are three commands:

  poke STR
  poke-add-type EXPR
  poke-add-types REGEXP
  poke-dump-types

  All three commands make sure to start the poke incremental
  compiler if it isn't running already.

- Access to the target's memory is provided by GDB by installing
  a Foreign IO device in the incremental compiler. This is
  `iod_if' in poke.c.

- Access to the terminal is provided by GDB by providing a
  pk_term_if implementation to the incremental compiler. This is
  `poke_term_if' in poke.c.

- Access to GDB values is provided by GDB by installing an alien
  token handler in the incremental compiler. This is
  `poke_alien_token_handler' in poke.c.

gdb/ChangeLog:

2021-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>

 * configure.ac: Support --enable-poke.
 * configure: Regenerate.
 * Makefile.in (POKE_OBS): Define based on @POKE_OBS@.
 (DEPFILES): Add POKE_OBS.
 * poke.c: New file.

gdb/doc/ChangeLog:

2021-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>

 * Makefile.in (GDB_DOC_FILES): Add poke.texi.
 * poke.texi: New file.
 * gdb.texinfo (Data): Add meny entry for Poke and @include poke.texi.

users/jv/wip/feature-py-jit-api 2023-04-21 15:30:11 UTC
gdb/python: add py-jit.exp

Author: Jan Vrany
Author Date: 2022-04-07 08:06:52 UTC

gdb/python: add py-jit.exp

users/jv/patches/pr-30249 2023-03-29 13:09:44 UTC
gdb: fix post-hook execution for remote targets

Author: Jan Vrany
Author Date: 2023-03-29 13:09:44 UTC

gdb: fix post-hook execution for remote targets

Commit b5661ff2 ("gdb: fix possible use-after-free when
executing commands") attempted to fix possible use-after-free
in case command redefines itself.

Commit 37e5833d ("gdb: fix command lookup in execute_command ()")
updated the previous fix to handle subcommands as well by using the
original command string to lookup the command again after its execution.

This fixed the test in gdb.base/define.exp but it turned out that it
does not work (at least) for "target remote" and "target extended-remote".

The problem is that the command buffer P passed to execute_command ()
gets overwritten in dont_repeat () while executing "target remote"
command itself:

 #0 dont_repeat () at top.c:822
 #1 0x000055555730982a in target_preopen (from_tty=1) at target.c:2483
 #2 0x000055555711e911 in remote_target::open_1 (name=0x55555881c7fe ":1234", from_tty=1, extended_p=0)
     at remote.c:5946
 #3 0x000055555711d577 in remote_target::open (name=0x55555881c7fe ":1234", from_tty=1) at remote.c:5272
 #4 0x00005555573062f2 in open_target (args=0x55555881c7fe ":1234", from_tty=1, command=0x5555589d0490)
     at target.c:853
 #5 0x0000555556ad22fa in cmd_func (cmd=0x5555589d0490, args=0x55555881c7fe ":1234", from_tty=1)
     at cli/cli-decode.c:2737
 #6 0x00005555573487fd in execute_command (p=0x55555881c802 "4", from_tty=1) at top.c:688

Therefore the second call to lookup_cmd () at line 697 fails to find
command because the original command string is gone.

This commit addresses this particular problem by creating a *copy* of
original command string for the sole purpose of using it after command
execution to lookup the command again. It may not be the most efficient
way but it's safer given that command buffer is shared and overwritten
in hard-to-foresee situations.

Tested on x86_64-linux.

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

users/palves/step-over-thread-exit-v3.1 2023-03-10 19:14:20 UTC
Cancel execution command on thread exit, when stepping, nexting, etc.

Author: Pedro Alves
Author Date: 2022-06-21 17:05:19 UTC

Cancel execution command on thread exit, when stepping, nexting, etc.

If your target has no support for TARGET_WAITKIND_NO_RESUMED events
(and no way to support them, such as the yet-unsubmitted AMDGPU
target), and you step over thread exit with scheduler-locking on, this
is what you get:

 (gdb) n
 [Thread ... exited]
 *hang*

Getting back the prompt by typing Ctrl-C may not even work, since no
inferior thread is running to receive the SIGINT. Even if it works,
it seems unnecessarily harsh. If you started an execution command for
which there's a clear thread of interest (step, next, until, etc.),
and that thread disappears, then I think it's more user friendly if
GDB just detects the situation and aborts the command, giving back the
prompt.

That is what this commit implements. It does this by explicitly
requesting the target to report thread exit events whenever the main
resumed thread has a thread_fsm. Note that unlike stepping over a
breakpoint, we don't need to enable clone events in this case.

With this patch, we get:

 (gdb) n
 [Thread 0x7ffff7d89700 (LWP 3961883) exited]
 Command aborted, thread exited.
 (gdb)

Change-Id: I901ab64c91d10830590b2dac217b5264635a2b95

users/helflym/try-aarch64nto 2023-02-28 14:14:44 UTC
ld/testsuite: adjust ld-aarch64 tests for aarch64nto address

Author: =?utf-8?q?Cl=C3=A9ment_Chigot?=
Author Date: 2022-10-31 14:36:36 UTC

ld/testsuite: adjust ld-aarch64 tests for aarch64nto address

Some tests are refering to the address of their symbols. These are
dependent of the emulation and must be adjusted when enabling them for a
new one.

ld/ChangeLog:

        * testsuite/ld-aarch64/ifunc-1-local.d: Adjust for aarch64nto
        addresses.
        * testsuite/ld-aarch64/ifunc-1.d: Likewise.
        * testsuite/ld-aarch64/ifunc-2-local.d: Likewise.
        * testsuite/ld-aarch64/ifunc-2.d: Likewise.
        * testsuite/ld-aarch64/ifunc-21.d: Likewise.
        * testsuite/ld-aarch64/ifunc-3a.d: Likewise.

users/simark/clang-format 2023-02-08 20:46:02 UTC
Run clang-format.sh

Author: Simon Marchi
Author Date: 2023-02-08 20:36:23 UTC

Run clang-format.sh

Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968

users/lsix/poke-gdb 2023-02-06 10:34:52 UTC
gdb: Add the $_poke utility function

Author: Lancelot SIX
Author Date: 2023-02-06 10:34:52 UTC

gdb: Add the $_poke utility function

Add the $_poke utility function so it is possible to use poke in
breakpoint condition for example.

The expression must return a poke boolean.

users/aburgess/bp-inferior-calls 2023-01-25 15:48:58 UTC
gdb: rename unwindonsignal to unwind-on-signal

Author: Andrew Burgess
Author Date: 2023-01-18 12:09:05 UTC

gdb: rename unwindonsignal to unwind-on-signal

We now have unwind-on-timeout and unwind-on-terminating-exception, and
then the odd one out unwindonsignal.

I'm not a great fan of these squashed together command names, so in
this commit I propose renaming this to unwind-on-signal.

Obviously I've added the hidden alias unwindonsignal so any existing
GDB scripts will keep working.

There's one test that I've extended to test the alias works, but in
most of the other test scripts I've changed over to use the new name.

The docs are updated to reference the new name.

users/ahajkova/try-frob 2023-01-23 15:39:26 UTC
gdb: Ignore some stringop-overflow and restrict warnings on sparc

Author: Mark J. Wielaard
Author Date: 2023-01-15 00:51:53 UTC

gdb: Ignore some stringop-overflow and restrict warnings on sparc

For some reason g++ 11.2.1 on s390x produces a spurious warning for
stringop-overread and restruct in fsb-tdep.c for some memcpy calls.
Add new DIAGNOSTIC_IGNORE_STRINGOP_OVERFLOW and
DIAGNOSTIC_IGNORE_RESTRICT macro to suppress these warning.

include/ChangeLog:

 * diagnostics.h (DIAGNOSTIC_IGNORE_STRINGOP_OVERFLOW): New
 macro.
 (DIAGNOSTIC_IGNORE_RESTRICT): Likewise.

gdb/ChangeLog:

 * fsb-tdep.c (fbsd_make_note_desc): Use
 DIAGNOSTIC_IGNORE_STRINGOP_OVERFLOW and
 DIAGNOSTIC_IGNORE_RESTRICT on sparc.

users/hjl/try-pr30002 2023-01-16 23:22:40 UTC
ld: Use run_cc_link_tests for PR ld/26391 tests

Author: H.J. Lu
Author Date: 2023-01-16 22:03:02 UTC

ld: Use run_cc_link_tests for PR ld/26391 tests

Use run_cc_link_tests for PR ld/26391 tests to compile PR ld/26391 tests
in C.

 PR ld/30002
 * testsuite/ld-elf/elf.exp: Use run_cc_link_tests for PR ld/26391
 tests.

gdb-12-branch 2022-12-18 00:02:02 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2022-12-18 00:02:02 UTC

Automatic date update in version.in

users/jv/try-fix-use-after-free-fixup-v01 2022-12-12 22:13:27 UTC
gdb: fix command lookup in execute_command ()

Author: Jan Vrany
Author Date: 2022-12-12 22:13:27 UTC

gdb: fix command lookup in execute_command ()

Commit b5661ff2 ("gdb: fix possible use-after-free when
executing commands") used lookup_cmd_exact () to lookup
command again after its execution to avoid possible
use-after-free error.

However this change broke test gdb.base/define.exp which
defines a post-hook for subcommand ("target testsuite").
In this case, lookup_cmd_exact () returned NULL because
there's no command 'testsuite' in top-level commands.

This commit fixes this case by looking up the command again
using the original command line via lookup_cmd ().

users/palves/step-over-thread-exit-v3 2022-12-12 20:01:20 UTC
Cancel execution command on thread exit, when stepping, nexting, etc.

Author: Pedro Alves
Author Date: 2022-06-21 17:05:19 UTC

Cancel execution command on thread exit, when stepping, nexting, etc.

If your target has no support for TARGET_WAITKIND_NO_RESUMED events
(and no way to support them, such as the yet-unsubmitted AMDGPU
target), and you step over thread exit with scheduler-locking on, this
is what you get:

 (gdb) n
 [Thread ... exited]
 *hang*

Getting back the prompt by typing Ctrl-C may not even work, since no
inferior thread is running to receive the SIGINT. Even if it works,
it seems unnecessarily harsh. If you started an execution command for
which there's a clear thread of interest (step, next, until, etc.),
and that thread disappears, then I think it's more user friendly if
GDB just detects the situation and aborts the command, giving back the
prompt.

That is what this commit implements. It does this by explicitly
requesting the target to report thread exit events whenever the main
resumed thread has a thread_fsm. Note that unlike stepping over a
breakpoint, we don't need to enable clone events in this case.

With this patch, we get:

 (gdb) n
 [Thread 0x7ffff7d89700 (LWP 3961883) exited]
 Command aborted, thread exited.
 (gdb)

Change-Id: I901ab64c91d10830590b2dac217b5264635a2b95

users/jhb/cheri-gdb-12-branch 2022-11-18 00:09:00 UTC
RISC-V: Handle capability return values.

Author: John Baldwin
Author Date: 2022-11-18 00:09:00 UTC

RISC-V: Handle capability return values.

Add simple handling of capability function arguments (also used for
return values) and update riscv_return_value to propagate tags.

users/vapier/sim/ppc 2022-11-10 18:45:15 UTC
sim: ppc: drop old dgen.c generator

Author: Mike Frysinger
Author Date: 2022-11-09 19:52:45 UTC

sim: ppc: drop old dgen.c generator

The spreg.[ch] files live in the source tree now and are created
with the dgen.py script, so we don't need this old tool anymore.

users/vapier/sim/cpu-uni 2022-11-10 18:44:21 UTC
[wip] always compile in cgen logic

Author: Mike Frysinger
Author Date: 2022-11-09 03:31:53 UTC

[wip] always compile in cgen logic

see if sizeof cgen structs differ in some way.

users/vapier/sim/am 2022-11-10 18:44:16 UTC
sim: aarch64: remove recursive make entirely

Author: Mike Frysinger
Author Date: 2022-11-07 14:49:03 UTC

sim: aarch64: remove recursive make entirely

users/vapier/gdb/fdpic 2022-11-10 18:44:13 UTC
s

Author: Mike Frysinger
Author Date: 2011-01-11 00:44:06 UTC

s

users/jemarch/gdb-libtool 2022-11-06 13:01:49 UTC
gdb: link executables with libtool

Author: Jose E. Marchesi
Author Date: 2022-11-05 10:52:09 UTC

gdb: link executables with libtool

This patch changes the GDB build system in order to use libtool to
link the several built executables. This makes it possible to refer
to libtool libraries (.la files) in CLIBS.

As an application of the above,

  BFD now refers to ../libbfd/libbfd.la
  OPCODES now refers to ../opcodes/libopcodes.la
  LIBBACKTRACE_LIB now refers to ../libbacktrace/libbacktrace.la
  LIBCTF now refers to ../libctf/libctf.la

NOTE1: The addition of libtool adds a few new configure-time options
       to GDB. Among these, --enable-shared and --disable-shared, which were
       previously ignored. Now GDB shall honor these options when linking,
       picking up the right version of the referred libtool libraries
       automagically.

NOTE2: I have not tested the insight build.

NOTE3: For regenerating configure I used an environment with Autoconf
       2.69 and Automake 1.15.1. This should match the previously
       used version as announced in the configure script.

NOTE4: Now the installed shared object libbfd.so is used by gdb
       if binutils is installed with --enable-shared.

Testing performed:

- --enable-shared and --disable-shared (the default in binutils) work
  as expected: the linked executables link with the archive or shared
  libraries transparently.

- Makefile.in modified for EXEEXT = .exe. It installs the binaries
  just fine. The installed gdb.exe runs fine.

- Native build regtested in x86_64. The installed gdb runs fine.

  In the regression testing I'm observing that the following tests
  doesn't seem to be deterministic:

    gdb.base/step-over-syscall.exp
    gdb.threads/process-dies-while-detaching.exp
    gdb.threads/process-dies-while-handling-bp.exp

  Sometimes some of the the tests in these files unexpectedly fail,
  like in:

  -PASS: gdb.threads/process-dies-while-detaching.exp: single-process: \
         continue: detach: continue
  +FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: \
         continue: detach: continue

  Sometimes they unexpectedly pass:

  -KFAIL: gdb.base/step-over-syscall.exp: clone: displaced=on: \
          check_pc_after_cross_syscall: single step over clone \
          final pc (PRMS: gdb/19675)
  +PASS: gdb.base/step-over-syscall.exp: clone: displaced=on: \
         check_pc_after_cross_syscall: single step over clone final pc

  -KFAIL: gdb.threads/process-dies-while-handling-bp.exp: \
          non_stop=on: cond_bp_target=0: inferior 1 exited \
          (prompt) (PRMS: gdb/18749)
  +PASS: gdb.threads/process-dies-while-handling-bp.exp: \
          non_stop=on: cond_bp_target=0: inferior 1 exited

- Cross build for aarch64-linux-gnu built to exercise
  program_transform_name and friends. The installed
  aarch64-linux-gnu-gdb runs fine.

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

users/aburgess/try-mips-disasm-styling 2022-11-03 12:49:53 UTC
libopcodes/mips: add support for disassembler styling

Author: Andrew Burgess
Author Date: 2022-11-01 14:09:17 UTC

libopcodes/mips: add support for disassembler styling

This commit adds disassembler styling support for MIPS. After this
commit objdump and GDB will style disassembler output.

This is a pretty straight forward change, we switch to use the
disassemble_info::fprintf_styled_func callback, and pass an
appropriate style through as needed. No additional tricks were
needed (compared to say i386, or ARM).

Tested by running all of the objdump commands used by the gas
testsuite and manually inspecting the styled output, everything looks
reasonable, though I'm not a MIPS expert, so it is possible that I've
missed some corner cases. Worst case though is that something will be
styled incorrectly, the actual content should be unchanged.

All the gas, ld, and binutils tests still pass for me.

users/zaric/location_on_dwarf_stack 2022-10-26 09:43:27 UTC
Add support for new DWARF overlay operations

Author: Zoran Zaric
Author Date: 2022-10-25 13:33:36 UTC

Add support for new DWARF overlay operations

Another complex DWARF expression operations, that are usefull for
SIMD/SIMT like architectures are: DW_OP_LLVM_overlay and
DW_OP_LLVM_bit_overlay. These operations pop four stack entries,
where the first must be an integral that represents an overlay size,
the second must be an integral that represents a starting point of the
overlay from the base location, the third must be a location
description that represents the overlay location description and the
forth must be a location description that represents the base location
description.

Resulting composite location description contains parts from base
location description, overlayed by the overlay location description,
starting from the overlay offset, ending at a sum of the overlay offset
and overlay size.

A new test in gdb.dwarf2 called dw2-llvm-overlay has been also added to
test the support for both operations.

users/keiths/try-constify-target_desc2 2022-09-12 17:57:48 UTC
Constify target_desc declarations and features/Makefile

Author: Keith Seitz
Author Date: 2022-09-09 15:44:50 UTC

Constify target_desc declarations and features/Makefile

users/palves/make_function_view 2022-07-22 13:18:49 UTC
Introduce gdb::make_function_view

Author: Pedro Alves
Author Date: 2022-07-21 20:55:37 UTC

Introduce gdb::make_function_view

This adds gdb::make_function_view, which lets you create a function
view from a callable without specifying the function_view's template
parameter. For example, this:

    auto lambda = [&] (int) { ... };
    auto fv = gdb::make_function_view (lambda);

instead of:

    auto lambda = [&] (int) { ... };
    gdb::function_view<void (int)> fv = lambda;

It is particularly useful if you have a template function with an
optional function_view parameter, whose type depends on the function's
template parameters. Like:

    template<typename T>
    void my_function (T v, gdb::function_view<void(T)> callback = nullptr);

For such a function, the type of the callback argument you pass must
already be a function_view. I.e., this wouldn't compile:

    auto lambda = [&] (int) { ... };
    my_function (1, lambda);

With gdb::make_function_view, you can write the call like so:

    auto lambda = [&] (int) { ... };
    my_function (1, gdb::make_function_view (lambda));

Unit tests included.

Tested by building with GCC 9.4, Clang 10, and GCC 4.8.5, on x86_64
GNU/Linux, and running the unit tests.

Change-Id: I5c4b3b4455ed6f0d8878cf1be189bea3ee63f626

users/vries/process-queue-parallel 2022-07-21 13:06:40 UTC
[gdb/symtab] Use task size in parallel for in process_queue

Author: Tom de Vries
Author Date: 2022-07-19 15:01:21 UTC

[gdb/symtab] Use task size in parallel for in process_queue

users/palves/packed 2022-07-19 14:44:07 UTC
struct packed: add fallback byte array implementation, use gcc_struct on Wind...

Author: Pedro Alves
Author Date: 2022-07-18 23:26:33 UTC

struct packed: add fallback byte array implementation, use gcc_struct on Windows, unit tests

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

- Windows hosts need attribute gcc_struct.

- attribute gcc_struct seemingly doesn't work with Clang, so add a
  fallback standard-conforming implementation based on arrays.

- add unit tests to make sure both implementations behave the same
  way.

- add more relational operators while at it.

Change-Id: I023315ee03622c59c397bf4affc0b68179c32374

users/palves/step-over-thread-exit 2022-07-18 16:34:41 UTC
Cancel execution command on thread exit, when stepping, nexting, etc.

Author: Pedro Alves
Author Date: 2022-06-21 17:05:19 UTC

Cancel execution command on thread exit, when stepping, nexting, etc.

If your target has no support for TARGET_WAITKIND_NO_RESUMED events
(and no way to support them, such as the yet-unsubmitted AMDGPU
target), and you step over thread exit with scheduler-locking on, this
is what you get:

 (gdb) n
 [Thread ... exited]
 *hang*

Getting back the prompt by typing Ctrl-C may not even work, since no
inferior thread is running to receive the SIGINT. Even if it works,
it seems unnecessarily harsh. If you started an execution command for
which there's a clear thread of interest (step, next, until, etc.),
and that thread disappears, then I think it's more user friendly if
GDB just detects the situation and aborts the command, giving back the
prompt.

That is what this commit implements. It does this by explicitly
requesting the target to report thread exit events whenever the main
resumed thread has a thread_fsm. Note that unlike stepping over a
breakpoint, we don't need to enable clone events in this case.

With this patch, we get:

 (gdb) n
 [Thread 0x7ffff7d89700 (LWP 3961883) exited]
 Command aborted, thread exited.
 (gdb)

Change-Id: I901ab64c91d10830590b2dac217b5264635a2b95

users/amerey/debuginfod-size 2022-06-21 21:55:29 UTC
Improve cur/total display, remove higher verbosity setting

Author: Aaron Merey
Author Date: 2022-06-21 21:55:29 UTC

Improve cur/total display, remove higher verbosity setting

users/palves/info_breakpoints_improvements 2022-05-24 09:56:10 UTC
Extra indent & extra line

Author: Pedro Alves
Author Date: 2022-05-24 08:54:42 UTC

Extra indent & extra line

Comment out the "#define EXTRA_LINE" line to stop emitting the extra
line.

Change-Id: I174b00d956a0e1585269778570e0ed810906d68c

gdb-11-branch 2022-05-20 00:00:57 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2022-05-20 00:00:57 UTC

Automatic date update in version.in

binutils-2_37-branch 2022-04-28 12:54:50 UTC
s390: Add DT_JMPREL pointing to .rela.[i]plt with static-pie

Author: Stefan Liebler
Author Date: 2022-04-28 12:30:55 UTC

s390: Add DT_JMPREL pointing to .rela.[i]plt with static-pie

In static-pie case, there are IRELATIVE-relocs in
.rela.iplt (htab->irelplt), which will later be grouped
to .rela.plt. On s390, the IRELATIVE relocations are
always located in .rela.iplt - even for non-static case.
Ensure that DT_JMPREL, DT_PLTRELA, DT_PLTRELASZ is added
to the dynamic section even if htab->srelplt->size == 0.
See _bfd_elf_add_dynamic_tags in bfd/elflink.c.

bfd/
 elf64-s390.c (elf_s390_size_dynamic_sections):
 Enforce DT_JMPREL via htab->elf.dt_jmprel_required.

(cherry picked from commit d942d8db12adf4c9e5c7d9ed6496a779ece7149e)

users/ssbssa/pdb-reader-preview 2022-04-20 20:03:36 UTC
PDB: Increase maximum number of "aclass" registrations

Author: Hannes Domani
Author Date: 2022-04-20 20:02:27 UTC

PDB: Increase maximum number of "aclass" registrations

users/roland/gprofng-zlib 2022-03-16 21:13:46 UTC
wip

Author: Roland McGrath
Author Date: 2022-03-16 21:13:46 UTC

wip

users/simark/amdgpu-readelf 2022-03-15 19:09:55 UTC
binutils/readelf: handle AMDGPU relocation types

Author: Simon Marchi
Author Date: 2022-03-01 16:29:06 UTC

binutils/readelf: handle AMDGPU relocation types

Make readelf recognize AMDGPU relocation types, as documented here:

  https://llvm.org/docs/AMDGPUUsage.html#amdgpu-relocation-records

The user-visible change looks like:

    -000000000004 000400000001 unrecognized: 1 0000000000000000 SCRATCH_RSRC_DWORD0
    -00000000000c 000500000001 unrecognized: 1 0000000000000000 SCRATCH_RSRC_DWORD1
    -000000000014 000600000007 unrecognized: 7 0000000000000000 global_var0
    -00000000001c 000700000008 unrecognized: 8 0000000000000000 global_var1
    -000000000024 000800000009 unrecognized: 9 0000000000000000 global_var2
    -00000000002c 00090000000a unrecognized: a 0000000000000000 global_var3
    -000000000034 000a0000000b unrecognized: b 0000000000000000 global_var4
    +000000000004 000400000001 R_AMDGPU_ABS32_LO 0000000000000000 SCRATCH_RSRC_DWORD0
    +00000000000c 000500000001 R_AMDGPU_ABS32_LO 0000000000000000 SCRATCH_RSRC_DWORD1
    +000000000014 000600000007 R_AMDGPU_GOTPCREL 0000000000000000 global_var0
    +00000000001c 000700000008 R_AMDGPU_GOTPCREL 0000000000000000 global_var1
    +000000000024 000800000009 R_AMDGPU_GOTPCREL 0000000000000000 global_var2
    +00000000002c 00090000000a R_AMDGPU_REL32_LO 0000000000000000 global_var3
    +000000000034 000a0000000b R_AMDGPU_REL32_HI 0000000000000000 global_var4

binutils/ChangeLog:

 * readelf.c (dump_relocations): Handle EM_AMDGPU.

include/ChangeLog:

 * elf/amdgpu.h: Add relocation values.

Change-Id: I2ed4589f4cd37ea11ad2e0cb38d4b682271e1334

users/maskray/gold-relr 2021-12-03 22:59:51 UTC
gold: Add --pack-dyn-relocs=relr for arm/aarch64/x86-64 [PR 28601]

Author: Fangrui Song
Author Date: 2021-11-25 02:05:45 UTC

gold: Add --pack-dyn-relocs=relr for arm/aarch64/x86-64 [PR 28601]

elfcpp/
    * elfcpp.h (SHT): New constant SHT_RELR.
    (DT): New constants DT_SYMTAB_SHNDX/DT_RELRSZ/DT_RELR/DT_RELRENT.
    (Elf_sizes): New static data member relr_size.
gold/
    * options.h (class General_options): Add pack_dyn_relocs,
    Pack_dyn_relocs, relr_relocs, and pack_dyn_relocs_enum_.
    * options.cc (General_options::relr_relocs): Define.
    * reloc-types.h (Reloc_types<elfcpp::SHT_RELR, size, big_endian>):
    New.
    * layout.h (Layout::add_target_dynamic_tags): Add dyn_relr.
    * layout.cc (Layout::add_target_dynamic_tags): Add dyn_relr.
    * output.h (set_current_data_size_for_child): Remove assert.
    (Output_reloc<elfcpp::SHT_RELR, dynamic, size, big_endian>): New.
    (Output_data_reloc<elfcpp::SHT_RELR, dynamic, size, big_endian>): New.
    * output.cc (Output_data_reloc_base): Set entsize for SHT_RELR.
    (do_write): Define.
    (Output_data_reloc<elfcpp::SHT_RELR, true, *, *>): Instantiate.
    * aarch64.cc (Target_aarch64): Add Relr_section,
    relr_dyn_section, and relr_dyn_.
    (do_relax): Check SHT_RELR.
    (Target_aarch64::Scan::local): Check SHT_RELR.
    (Target_aarch64::Scan::global): Check SHT_RELR.
    * arm.cc (Target_arm): Add Relr_section,
    relr_dyn_section, and relr_dyn_.
    (do_relax): Check SHT_RELR.
    (Target_arm::Scan::local): Check SHT_RELR.
    (Target_arm::Scan::global): Check SHT_RELR.
    * x86_64.cc (Target_x86_64): Add Relr_section,
    relr_dyn_section, and relr_dyn_.
    (do_relax): Check SHT_RELR.
    (Target_x86_64::Scan::local): Check SHT_RELR.
    (Target_x86_64::Scan::global): Check SHT_RELR.
    * testsuite/Makefile.am: New tests relr_arm.sh relr_aarch64.sh
      relr_x86_64.sh.
    * testsuite/relr_1.s: New.

users/riscv/binutils-integration-branch 2021-10-28 00:52:25 UTC
RISC-V/SiFive: Added SiFive custom cache control instructions.

Author: Nelson Chu
Author Date: 2021-09-27 08:29:58 UTC

RISC-V/SiFive: Added SiFive custom cache control instructions.

According to the chapter 10 of the following U74-MC manual,
https://sifive.cdn.prismic.io/sifive/6d9a2510-2632-44f3-adb9-d0430f139372_sifive_coreip_U74MC_AXI4_rtl_v19_08p2p0_release_manual.pdf

and the implementations of freedom-metal,
https://github.com/sifive/freedom-metal/blob/v201908-branch/src/cache.c

* Encodings,
31-25 24-20 19-15 14-12 11-7 6-0
FUNCT7 RS2 RS1 FUNCT3 RD OPCODE
1111110 00000 xxxxx 000 00000 1110011 CFLUSH.D.L1
1111110 00010 xxxxx 000 00000 1110011 CDISCARD.D.L1
1111110 00001 00000 000 00000 1110011 CFLUSH.I.L1

* Extension names,
xsfcflushdlone: CFLUSH.D.L1.
xsfcdiscarddlone: CDISCARD.D.L1.
xsfcflushilone: CFLUSH.I.L1.

* Vendor target triples,
For assembler, the target vendor is defined as TARGET_VENDOR in the
gas/config.h, but I don't see any related settings in bfd/config.h
and opcode/config. Since we may have vendor relocations in the future,
and these relocation numbers may repeat, I add a new RISCV_TARGET_VENDOR
in the bfd/config.h for riscv. The vendor name will be stored in the
bfd/cpu-riscv.c, so that all tools (gas, bfd, opcode, ...) can get
the vendor name from the configure setting.

If the --with-arch configure option, -march gas option and elf architecture
attributes are not set, then we will generate the default ISA string
according to the chosen target vendor. For example, if you build the
binutils with the configure option, --target=riscv64-sifive-elf, then
the assembler will find the whole supported extension tables in the
bfd/elfxx-riscv.c, and generate the suitable ISA string.

bfd/
 * configure.ac (RISCV_TARGET_VENDOR): Defined to store target_vendor,
 only when the target is riscv*.
 * config.in: Regenerated.
 * configure: Regenerated.
 * cpu-riscv.c (riscv_vendor_name): Defined to RISCV_TARGET_VENDOR.
 * cpu-riscv.h (enum riscv_spec_class): Added VENDOR_SPEC_CLASS_SIFIVE.
 * elfxx-riscv. (EXT_SIFIVE): Defined to choose the default extensions
 for sifive.
 (riscv_supported_vendor_sifive_ext): Added extensions for sifive cache
 control instructions.
 (riscv_supported_std_ext, riscv_all_supported_ext): Updated.
 (riscv_get_default_ext_version): Updated.
 (riscv_set_default_arch): Updated.
gas/
 * config/tc-riscv.c (VENDOR_SIFIVE_EXT): Added.
 (riscv_extended_subset_supports): Handle INSN_CLASS_XSF*.
 (op_vendor_sifive_hash): Added to store sifive opcodes.
 (md_begin): Init the op_vendor_sifive_hash.
 (riscv_find_extended_opcode_hash): Find the opcodes from
 op_vendor_sifive_hash.
 * testsuite/gas/riscv/extended/sifive-insns.d: New testcase.
 * testsuite/gas/riscv/extended/sifive-insns.s: Likewise.
include/
 * opcode/riscv-opc-extended.h: Added opcodes for sifive cache
 instructions.
 * opcode/riscv.h (enum riscv_extended_insn_class): Added INSN_CLASS_XSF*.
opcodes/
 * riscv-opc.c (riscv_vendor_sifive_opcodes): Added.
 (riscv_extended_opcodes): Updated.

users/ARM/efi-aarch64-support-binutils 2021-10-21 15:53:27 UTC
AArch64: Add support for AArch64 EFI (efi-*-aarch64).

Author: Tamar Christina
Author Date: 2021-10-21 15:53:27 UTC

AArch64: Add support for AArch64 EFI (efi-*-aarch64).

This adds support for efi-*-aarch64 by virtue of adding a new PEI target
pei-aarch64-little. This is not a full tagret and only exists to support EFI
at this time.

This means that this target does not support relocation processing and is mostly
a container format.

As such it's not valid for use with gas but only with objcopy.

Any magic number is based on the Microsoft PE specification [1].

[1] https://docs.microsoft.com/en-us/windows/win32/debug/pe-format

bfd/ChangeLog:

2021-10-21 Tamar Christina <tamar.christina@arm.com>

 PR binutils/26218
 * .gitignore (pe-aarch64igen.c): New.
 * Makefile.am (pei-aarch64.lo, pe-aarch64igen.lo, pei-aarch64.c,
 pe-aarch64igen.c): Add support.
 * Makefile.in: Likewise.
 * bfd.c (bfd_get_sign_extend_vma): Add pei-aarch64-little.
 * coff-aarch64.c: New file.
 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
 coff_write_object_contents) Add aarch64 (aarch64_pei_vec) support.
 * config.bfd: Likewise.
 * configure: Likewise.
 * configure.ac: Likewise.
 * libpei.h (GET_OPTHDR_IMAGE_BASE, PUT_OPTHDR_IMAGE_BASE,
 GET_OPTHDR_SIZE_OF_STACK_RESERVE, PUT_OPTHDR_SIZE_OF_STACK_RESERVE,
 GET_OPTHDR_SIZE_OF_STACK_COMMIT, PUT_OPTHDR_SIZE_OF_STACK_COMMIT,
 GET_OPTHDR_SIZE_OF_HEAP_RESERVE, PUT_OPTHDR_SIZE_OF_HEAP_RESERVE,
 GET_OPTHDR_SIZE_OF_HEAP_COMMIT, PUT_OPTHDR_SIZE_OF_HEAP_COMMIT,
 GET_PDATA_ENTRY, _bfd_peAArch64_bfd_copy_private_bfd_data_common,
 _bfd_peAArch64_bfd_copy_private_section_data,
 _bfd_peAArch64_get_symbol_info, _bfd_peAArch64_only_swap_filehdr_out,
 _bfd_peAArch64_print_private_bfd_data_common,
 _bfd_peAArch64i_final_link_postscript,
 _bfd_peAArch64i_only_swap_filehdr_out, _bfd_peAArch64i_swap_aouthdr_in,
 _bfd_peAArch64i_swap_aouthdr_out, _bfd_peAArch64i_swap_aux_in,
 _bfd_peAArch64i_swap_aux_out, _bfd_peAArch64i_swap_lineno_in,
 _bfd_peAArch64i_swap_lineno_out, _bfd_peAArch64i_swap_scnhdr_out,
 _bfd_peAArch64i_swap_sym_in, _bfd_peAArch64i_swap_sym_out,
 _bfd_peAArch64i_swap_debugdir_in, _bfd_peAArch64i_swap_debugdir_out,
 _bfd_peAArch64i_write_codeview_record,
 _bfd_peAArch64i_slurp_codeview_record,
 _bfd_peAArch64_print_ce_compressed_pdata): New.
 * peXXigen.c (_bfd_XXi_swap_aouthdr_in, _bfd_XXi_swap_aouthdr_out,
 pe_print_pdata, _bfd_XX_print_private_bfd_data_common,
 _bfd_XX_bfd_copy_private_section_data, _bfd_XXi_final_link_postscript):
 Support COFF_WITH_peAArch64,
 * pei-aarch64.c: New file.
 * peicode.h (coff_swap_scnhdr_in, pe_ILF_build_a_bfd, pe_ILF_object_p):
 Support COFF_WITH_peAArch64.
 (jtab): Add dummy entry that traps.
 * targets.c (aarch64_pei_vec): New.

binutils/ChangeLog:

2021-10-21 Tamar Christina <tamar.christina@arm.com>

 PR binutils/26218
 * objcopy.c (convert_efi_target): Add efi-*-aarch64 support.
 * testsuite/binutils-all/aarch64/pei-aarch64-little.d: New test.
 * testsuite/binutils-all/aarch64/pei-aarch64-little.s: New test.

include/ChangeLog:

2021-10-21 Tamar Christina <tamar.christina@arm.com>

 PR binutils/26218
 * coff/aarch64.h: New file.
 * coff/pe.h (IMAGE_FILE_MACHINE_ARM64): New.

binutils-2_36-branch 2021-10-07 04:29:53 UTC
PR28422, build_id use-after-free

Author: Alan Modra
Author Date: 2021-10-06 07:58:47 UTC

PR28422, build_id use-after-free

This fixes a bug in commit 5d9bbb73c1df. All fields preserved from a
bfd in struct bfd_preserve need to be cleared in bfd_reinit.

 PR 28422
 * format.c (bfd_reinit): Clear build_id.

(cherry picked from commit 6d661cdc5be46e890ed9255e749806f46a88e26c)

users/simark/refactor-typesafe-var 2021-08-19 22:07:39 UTC
gdb: Setting setter return a bool to tell if the value changed

Author: Lancelot SIX
Author Date: 2021-07-27 20:50:54 UTC

gdb: Setting setter return a bool to tell if the value changed

GDB can notify observers when a parameter is changed.

To do that, do_set_command (in gdb/cli/cli-setshow.c) compares the new
value against the old one before updating it, and based on that notifies
observers. This looks like something like:

    int valuechanged = 0;
    switch (cmd->var.type ())
    {
    case var_integer:
      {
        LONGEST new_val = parse_and_eval_long (arg)
        if (new_val != cmd->var.get<int> ())
        {
          cmd->var.get<int> (new_val);
          value_changes = 1;
        }
      }
      break;
    case var_string:
      {
        std::string val = std::string (arg);
        if (new_val != cmd->var.get<std::string> ())
        {
          cmd->var.get<std::string> (new_val);
          value_changes = 1;
        }
      }
      break;
    case...
      /* And so on for all possible var_types. */
    }

This comparison is done for each possible var_type, which leads to
unnecessary code duplication.

In this patch I propose to move all those checks in one place within the
setting setter method. This limits the code duplication and simplifies
the do_set_command implementation.

This patch also changes slightly the way a value change is detected.
Instead of comparing the user provided value against the current value
of the setting, we compare the value of the setting before and after the
set operation. This is meant to handle edge cases where trying to set
an unrecognized value would be equivalent to a noop (the actual value
remains unchanged).

There should be no user visible change introduced by this commit.

Tested on x86_64 GNU/Linux.

[1] https://review.lttng.org/c/binutils-gdb/+/5831/41

Change-Id: If064b9cede3eb56275aacd2b286f74eceb1aed11

users/riscv/binutils-integration-2.37 2021-07-22 09:24:56 UTC
RISC-V/zfh: Added big endian testcase for .float16 directive.

Author: Nelson Chu
Author Date: 2021-05-10 05:38:23 UTC

RISC-V/zfh: Added big endian testcase for .float16 directive.

gas/
    * testsuite/gas/riscv/extended/extended.exp: Updated.
    * testsuite/gas/riscv/extended/float16.s: Minor fix for sNaNh.
    * testsuite/gas/riscv/extended/float16-le.d: Updated and renamed
    from float16.d.
    * testsuite/gas/riscv/extended/float16-be.d: New testcase.

users/palves/value_string 2021-07-15 14:10:59 UTC
all languages

Author: Pedro Alves
Author Date: 2021-07-15 09:47:56 UTC

all languages

Change-Id: I79ef914087dbf85e1cbc19263843a6034383afe7

users/roland/ar-qL 2021-07-15 02:39:09 UTC
New L modifier for ar q operation to flatten archives.

Author: Roland McGrath
Author Date: 2021-07-15 02:39:09 UTC

New L modifier for ar q operation to flatten archives.

binutils/
 * doc/binutils.texi (ar cmdline): Document L modifier for q operation.
 * NEWS: Mention that.
 * ar.c (flatten_archives): New variable.
 (usage): Describe L.
 (decode_options): Parse L.
 (replace_members): Use L.

gdb-10-branch 2021-07-03 00:00:38 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2021-07-03 00:00:38 UTC

Automatic date update in version.in

users/vries/lazy-symtab-expansion 2021-06-24 15:59:27 UTC
[gdb/symtab] Add reset_compunit_symtab

Author: Tom de Vries
Author Date: 2021-06-12 08:46:05 UTC

[gdb/symtab] Add reset_compunit_symtab

Add a new function reset_compunit_symtab.

users/palves/scoped_ignore_signal 2021-06-15 11:00:11 UTC
Add a unit test for scoped_ignore_sigpipe

Author: Pedro Alves
Author Date: 2021-06-15 09:40:37 UTC

Add a unit test for scoped_ignore_sigpipe

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

 * Makefile.in (SELFTESTS_SRCS): Add
 unittests/scoped_ignore_signal-selftests.c.
 * unittests/scoped_ignore_signal-selftests.c: New.

Change-Id: Idce24aa9432a3f1eb7065bc9aa030b1d0d7dcad5

users/palves/ctrl-c 2021-06-14 21:20:45 UTC
Document pseudo-terminal and interrupting changes

Author: Pedro Alves
Author Date: 2021-06-03 18:39:19 UTC

Document pseudo-terminal and interrupting changes

This documents changes done in previous patches:

 - the fact that on GNU/Linux, GDB creates a pseudo-terminal for the
   inferior instead of juggling terminal settings.

 - That when the inferior and GDB share the terminal, you can't
   interrupt some programs with Ctrl-C.

 - That on GNU/Linux, you may get "Program stopped." instead of
   "Program received SIGINT" in response to Ctrl-C.

 - That run+detach may result in the program dying with SIGHUP.

I was surprised that we do not currently have a node/section
specifically to talk about interrupting programs. Thus I've added a
new "Interrupting" section under the "Stopping and Continuing"
chapter, with some xrefs to other sections.

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

 * NEWS: Document pseudo-terminal, "tty /dev/tty" and Ctrl-C/SIGINT
 changes. Document "set/show debug managed-tty".

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

 * gdb.texinfo (Input/Output): Document that GDB may start a
 program associated with a pseudo-terminal. Document "tty
 /dev/tty". Document "set/show debug managed-tty".
 (Attach): Document what happens on run+detach on systems where GDB
 creates a pseudo-terminal for the inferior.
 (Stopping and Continuing): Add new Interrupting node.
 (Background Execution): Add anchor.
 (Features for Debugging MS Windows PE Executables): Add anchor.

Change-Id: I267a0f9300c7ac4d2e7f14a9ba8eabc1eafcc5a7

binutils-2_34-branch 2021-05-03 06:16:47 UTC
PR27755, powerpc-ld infinite loop

Author: Alan Modra
Author Date: 2021-05-03 04:07:00 UTC

PR27755, powerpc-ld infinite loop

 PR 27755
 * elf32-ppc.c (ppc_elf_inline_plt): Do increment rel in loop.

(cherry picked from commit 337d0bf887a3ed6b6b2123fecfec0736640edcaf)

binutils-2_35-branch 2021-05-03 06:16:00 UTC
PR27755, powerpc-ld infinite loop

Author: Alan Modra
Author Date: 2021-05-03 04:07:00 UTC

PR27755, powerpc-ld infinite loop

 PR 27755
 * elf32-ppc.c (ppc_elf_inline_plt): Do increment rel in loop.

(cherry picked from commit 337d0bf887a3ed6b6b2123fecfec0736640edcaf)

users/simark/black 2021-04-26 15:50:51 UTC
gdb: re-format Python files using black 21.4b0

Author: Simon Marchi
Author Date: 2021-04-26 15:06:27 UTC

gdb: re-format Python files using black 21.4b0

Re-format all Python files using black [1] version 21.4b0.

This specific version (currently the latest) can be installed using:

    $ pip3 install 'black == 21.4b0'

All you need to do to re-format files is run `black <file/directory>`,
and black will re-format any Python file it finds in there. It runs
quite fast, so the simplest is probably to do:

    $ black gdb/

from the top-level.

Change-Id: I28588a22c2406afd6bc2703774ddfff47cd61919

users/clyon/gdb-7.5-fdpic 2021-04-14 14:22:54 UTC
ARM/FDPIC: Add core file support

Author: Christophe Lyon
Author Date: 2021-04-14 14:22:54 UTC

ARM/FDPIC: Add core file support

2021-04-14 Mickael Guene <mickael.guene@st.com>
 Christophe Lyon <christophe.lyon@st.com>

 * bfd/elf32-arm.c (elf32_arm_nabi_grok_prstatus): Add support for
 ARM FDPIC ABI.
 * gdb/solib-fdpic.c (fdpic_get_initial_loadmaps_return_error): New.
 (fdpic_get_initial_loadmaps): Add support for core files.

users/marxin/startswith-v2 2021-04-01 04:49:26 UTC
Remove strneq macro and use startswith.

Author: Martin Liska
Author Date: 2021-03-22 13:56:16 UTC

Remove strneq macro and use startswith.

bfd/ChangeLog:

 * ecoff.c (strneq): Remove strneq and use startswith.
 (_bfd_ecoff_slurp_armap): Likewise.

binutils/ChangeLog:

 * elfcomm.h (strneq): Remove strneq and use startswith.
 * readelf.c (ia64_process_unwind): Likewise.
 (process_note): Likewise.

gas/ChangeLog:

 * config/obj-coff.c (strneq): Remove strneq and use startswith.
 (weak_is_altname): Likewise.
 (obj_coff_section): Likewise.
 * config/tc-cr16.c (process_label_constant): Likewise.
 * config/tc-crx.c (strneq): Likewise.

include/ChangeLog:

 * opcode/cr16.h (strneq): Remove strneq and use startswith.

ld/ChangeLog:

 * ldbuildid.c (strneq): Remove strneq and use startswith.
 (validate_build_id_style): Likewise.
 (compute_build_id_size): Likewise.

opcodes/ChangeLog:

 * arm-dis.c (strneq): Remove strneq and use startswith.
 * cr16-dis.c (print_insn_cr16): Likewise.
 * score-dis.c (streq): Likewise.
 (strneq): Likewise.
 * score7-dis.c (strneq): Likewise.

users/simark/frame-debug 2021-03-25 03:38:19 UTC
gdb: add names to unwinders

Author: Simon Marchi
Author Date: 2021-03-25 03:31:49 UTC

gdb: add names to unwinders

Change-Id: I813f17777422425f0d08b22499817b23922e8ddb

users/tromey/readline-8.1-update 2021-02-06 18:20:46 UTC
Fix Readline 8.1 build on mingw

Author: Tom Tromey
Author Date: 2021-01-23 17:11:30 UTC

Fix Readline 8.1 build on mingw

The mingw build fails with Readline 8.1, because sigprocmask is called
unconditionally. This patch adds the missing check for
HAVE_POSIX_SIGNALS.

I reported this upstream here:

    https://lists.gnu.org/archive/html/bug-readline/2021-01/msg00011.html

2021-02-06 Tom Tromey <tom@tromey.com>

 * readline/signals.c (_rl_handle_signal): Add missing check for
 HAVE_POSIX_SIGNALS.

users/simark/update-gnulib 2021-01-22 20:36:33 UTC
gnulib: update to 776af40e0

Author: Paul E. Murphy
Author Date: 2021-01-22 19:55:45 UTC

gnulib: update to 776af40e0

This fixes PR27184, a failure to compile gdb due to
cdefs.h being out of sync with glibc on ppc64le targets
which are compiled with -mabi=ieeelongdouble and glibc
2.32.

Likewise, update usage of _GL_ATTRIBUTE_FORMAT_PRINTF to
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD.

Likewise, disable newly added rpl_free gnulib api in
gdbserver support libraries.

Likewise, undefine read/write macros before redefining them
on mingw targets.

Likewise, wrap C++ usage of free with GNULIB_NAMESPACE namespace
as needed.

Change-Id: I86517613c0d8ac8f5ea45bbc4ebe2b54a3aef29f

users/palves/detach-step-over 2021-01-13 01:07:13 UTC
Testcase for detaching while stepping over breakpoint

Author: Pedro Alves
Author Date: 2020-12-14 12:07:20 UTC

Testcase for detaching while stepping over breakpoint

This adds a testcase that exercises detaching while GDB is stepping
over a breakpoint, in all combinations of:

  - maint target non-stop off/on
  - set non-stop on/off
  - displaced stepping on/off

This exercises the bugs fixed in the previous 8 patches.

gdb/testsuite/ChangeLog:

 * gdb.threads/detach-step-over.c: New file.
 * gdb.threads/detach-step-over.exp: New file.

users/zoran/allow-location-description-on-dwarf-stack 2020-12-08 16:16:21 UTC
Add support for nested composite locations

Author: Zoran Zaric
Author Date: 2020-12-07 19:00:31 UTC

Add support for nested composite locations

After allowing a location description to be placed on a DWARF stack,
in an effort to achieve a full composability of the DWARF expression,
it is necessary to enable forming of a nested composite location
descriptions.

To be able do this, a new operation DW_OP_LLVM_piece_end needs to be
introduced, along with some additional rules on the way how the
composite location description is formed using the existing DW_OP_piece
and DW_OP_bit_piece operations. These new rules are fully compatible
with the composite forming rules from the DWARF 5 standard.

More details on the new operation and added rules can be found here:

https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html

gdb/ChangeLog:

 * compile/compile-loc2c.c (compute_stack_depth_worker): Add new
 DW_OP_LLVM_piece_end operation support.
 * dwarf2/expr.c (class dwarf_value): Add copy constructor.
 (class dwarf_location): Add copy constructor.
 (class dwarf_undefined): Add copy constructor.
 (class dwarf_memory): Add copy constructor.
 (class dwarf_register): Add copy constructor.
 (class dwarf_implicit): Add copy constructor.
 (class dwarf_implicit_pointer): Add copy constructor.
 (class dwarf_composite): Add copy constructor.
 (read_from_location): Add composite completed check.
 (write_to_location): Add composite completed check.
 (read_value_contents_from_location): New function.
 (dwarf_entry_factory::copy_entry): New method.
 (rw_closure_value): Now calls read_value_contents_from_location
 function.
 (dwarf_expr_context::add_piece): Use new composite forming
 rules.
 (dwarf_expr_context::execute_stack_op): Add new
 DW_OP_LLVM_piece_end operation support.
 * dwarf2/loc.c (dwarf2_get_symbol_read_needs): Add new
 DW_OP_LLVM_piece_end operation support.

include/ChangeLog:

 * dwarf2.def (DW_OP_DUP): Add new DW_OP_LLVM_piece_end
          enumeration.

gdb/testsuite/ChangeLog:

 * gdb.dwarf2/dw2-llvm-piece-end.exp: New test.

Change-Id: Ib0b25e5de3f23df89d7d9e86aad56029c7d173df

binutils-2_33-branch 2020-11-19 09:54:50 UTC
gas, arm: PR26858 Fix availability of single precision vmul/vmla in arm mode

Author: Andre Vieira
Author Date: 2020-11-13 08:59:48 UTC

gas, arm: PR26858 Fix availability of single precision vmul/vmla in arm mode

This patch fixes a mistake when enabling MVE instructions that disabled support
for single precision vmla and vmul for arm mode.

gas/ChangeLog:
2020-11-19 Andre Vieira <andre.simoesdiasvieira@arm.com>

 Backport from mainline.
 2020-11-12 Andre Vieira <andre.simoesdiasvieira@arm.com>

 PR 26858
 * config/tc-arm.c (asm_opcode insns): Fix vmul and vmla's ARM_VARIANT.
 * testsuite/gas/arm/pr26858.s: New test.
 * testsuite/gas/arm/pr26858.d: New test.

users/simark/fix-leading-whitespace 2020-10-26 16:27:18 UTC
gdb, gdbserver, gdbsupport: fix leading space vs tabs issues

Author: Simon Marchi
Author Date: 2020-10-26 15:39:39 UTC

gdb, gdbserver, gdbsupport: fix leading space vs tabs issues

Many spots incorrectly use only spaces for indentation (for example,
there are a lot of spots in ada-lang.c). I've always found it awkward
when I needed to edit one of these spots: do I keep the original wrong
indentation, or do I fix it? What if the lines around it are also
wrong, do I fix them too? I probably don't want to fix them in the same
patch, to avoid adding noise to my patch.

So I propose to fix as much as possible once and for all (hopefully).

One typical counter argument for this is that it makes code archeology
more difficult, because git-blame will show this commit as the last
change for these lines. My counter counter argument is: when
git-blaming, you often need to do "blame the file at the parent commit"
anyway, to go past some other refactor that touched the line you are
interested in, but is not the change you are looking for. So you
already need a somewhat efficient way to do this.

Using some interactive tool, rather than plain git-blame, makes this
trivial. For example, I use "tig blame <file>", where going back past
the commit that changed the currently selected line is one keystroke.
It looks like Magit in Emacs does it too (though I've never used it).
Web viewers of Github and Gitlab do it too. My point is that it won't
really make archeology more difficult.

The other typical counter argument is that it will cause conflicts with
existing patches. That's true... but it's a one time cost, and those
are not conflicts that are difficult to resolve. I have also tried "git
rebase --ignore-whitespace", it seems to work well. Although that will
re-introduce the faulty indentation, so one needs to take care of fixing
the indentation in the patch after that (which is easy).

gdb/ChangeLog:

 * aarch64-linux-tdep.c: Fix indentation.
 * aarch64-ravenscar-thread.c: Fix indentation.
 * aarch64-tdep.c: Fix indentation.
 * aarch64-tdep.h: Fix indentation.
 * ada-lang.c: Fix indentation.
 * ada-lang.h: Fix indentation.
 * ada-tasks.c: Fix indentation.
 * ada-typeprint.c: Fix indentation.
 * ada-valprint.c: Fix indentation.
 * ada-varobj.c: Fix indentation.
 * addrmap.c: Fix indentation.
 * addrmap.h: Fix indentation.
 * agent.c: Fix indentation.
 * aix-thread.c: Fix indentation.
 * alpha-bsd-nat.c: Fix indentation.
 * alpha-linux-tdep.c: Fix indentation.
 * alpha-mdebug-tdep.c: Fix indentation.
 * alpha-nbsd-tdep.c: Fix indentation.
 * alpha-obsd-tdep.c: Fix indentation.
 * alpha-tdep.c: Fix indentation.
 * amd64-bsd-nat.c: Fix indentation.
 * amd64-darwin-tdep.c: Fix indentation.
 * amd64-linux-nat.c: Fix indentation.
 * amd64-linux-tdep.c: Fix indentation.
 * amd64-nat.c: Fix indentation.
 * amd64-obsd-tdep.c: Fix indentation.
 * amd64-tdep.c: Fix indentation.
 * amd64-windows-tdep.c: Fix indentation.
 * annotate.c: Fix indentation.
 * arc-tdep.c: Fix indentation.
 * arch-utils.c: Fix indentation.
 * arch/arm-get-next-pcs.c: Fix indentation.
 * arch/arm.c: Fix indentation.
 * arm-linux-nat.c: Fix indentation.
 * arm-linux-tdep.c: Fix indentation.
 * arm-nbsd-tdep.c: Fix indentation.
 * arm-pikeos-tdep.c: Fix indentation.
 * arm-tdep.c: Fix indentation.
 * arm-tdep.h: Fix indentation.
 * arm-wince-tdep.c: Fix indentation.
 * auto-load.c: Fix indentation.
 * auxv.c: Fix indentation.
 * avr-tdep.c: Fix indentation.
 * ax-gdb.c: Fix indentation.
 * ax-general.c: Fix indentation.
 * bfin-linux-tdep.c: Fix indentation.
 * block.c: Fix indentation.
 * block.h: Fix indentation.
 * blockframe.c: Fix indentation.
 * bpf-tdep.c: Fix indentation.
 * break-catch-sig.c: Fix indentation.
 * break-catch-syscall.c: Fix indentation.
 * break-catch-throw.c: Fix indentation.
 * breakpoint.c: Fix indentation.
 * breakpoint.h: Fix indentation.
 * bsd-uthread.c: Fix indentation.
 * btrace.c: Fix indentation.
 * build-id.c: Fix indentation.
 * buildsym-legacy.h: Fix indentation.
 * buildsym.c: Fix indentation.
 * c-typeprint.c: Fix indentation.
 * c-valprint.c: Fix indentation.
 * c-varobj.c: Fix indentation.
 * charset.c: Fix indentation.
 * cli/cli-cmds.c: Fix indentation.
 * cli/cli-decode.c: Fix indentation.
 * cli/cli-decode.h: Fix indentation.
 * cli/cli-script.c: Fix indentation.
 * cli/cli-setshow.c: Fix indentation.
 * coff-pe-read.c: Fix indentation.
 * coffread.c: Fix indentation.
 * compile/compile-cplus-types.c: Fix indentation.
 * compile/compile-object-load.c: Fix indentation.
 * compile/compile-object-run.c: Fix indentation.
 * completer.c: Fix indentation.
 * corefile.c: Fix indentation.
 * corelow.c: Fix indentation.
 * cp-abi.h: Fix indentation.
 * cp-namespace.c: Fix indentation.
 * cp-support.c: Fix indentation.
 * cp-valprint.c: Fix indentation.
 * cris-linux-tdep.c: Fix indentation.
 * cris-tdep.c: Fix indentation.
 * darwin-nat-info.c: Fix indentation.
 * darwin-nat.c: Fix indentation.
 * darwin-nat.h: Fix indentation.
 * dbxread.c: Fix indentation.
 * dcache.c: Fix indentation.
 * disasm.c: Fix indentation.
 * dtrace-probe.c: Fix indentation.
 * dwarf2/abbrev.c: Fix indentation.
 * dwarf2/attribute.c: Fix indentation.
 * dwarf2/expr.c: Fix indentation.
 * dwarf2/frame.c: Fix indentation.
 * dwarf2/index-cache.c: Fix indentation.
 * dwarf2/index-write.c: Fix indentation.
 * dwarf2/line-header.c: Fix indentation.
 * dwarf2/loc.c: Fix indentation.
 * dwarf2/macro.c: Fix indentation.
 * dwarf2/read.c: Fix indentation.
 * dwarf2/read.h: Fix indentation.
 * elfread.c: Fix indentation.
 * eval.c: Fix indentation.
 * event-top.c: Fix indentation.
 * exec.c: Fix indentation.
 * exec.h: Fix indentation.
 * expprint.c: Fix indentation.
 * f-lang.c: Fix indentation.
 * f-typeprint.c: Fix indentation.
 * f-valprint.c: Fix indentation.
 * fbsd-nat.c: Fix indentation.
 * fbsd-tdep.c: Fix indentation.
 * findvar.c: Fix indentation.
 * fork-child.c: Fix indentation.
 * frame-unwind.c: Fix indentation.
 * frame-unwind.h: Fix indentation.
 * frame.c: Fix indentation.
 * frv-linux-tdep.c: Fix indentation.
 * frv-tdep.c: Fix indentation.
 * frv-tdep.h: Fix indentation.
 * ft32-tdep.c: Fix indentation.
 * gcore.c: Fix indentation.
 * gdb_bfd.c: Fix indentation.
 * gdbarch.sh: Fix indentation.
 * gdbarch.c: Re-generate
 * gdbarch.h: Re-generate.
 * gdbcore.h: Fix indentation.
 * gdbthread.h: Fix indentation.
 * gdbtypes.c: Fix indentation.
 * gdbtypes.h: Fix indentation.
 * glibc-tdep.c: Fix indentation.
 * gnu-nat.c: Fix indentation.
 * gnu-nat.h: Fix indentation.
 * gnu-v2-abi.c: Fix indentation.
 * gnu-v3-abi.c: Fix indentation.
 * go32-nat.c: Fix indentation.
 * guile/guile-internal.h: Fix indentation.
 * guile/scm-cmd.c: Fix indentation.
 * guile/scm-frame.c: Fix indentation.
 * guile/scm-iterator.c: Fix indentation.
 * guile/scm-math.c: Fix indentation.
 * guile/scm-ports.c: Fix indentation.
 * guile/scm-pretty-print.c: Fix indentation.
 * guile/scm-value.c: Fix indentation.
 * h8300-tdep.c: Fix indentation.
 * hppa-linux-nat.c: Fix indentation.
 * hppa-linux-tdep.c: Fix indentation.
 * hppa-nbsd-nat.c: Fix indentation.
 * hppa-nbsd-tdep.c: Fix indentation.
 * hppa-obsd-nat.c: Fix indentation.
 * hppa-tdep.c: Fix indentation.
 * hppa-tdep.h: Fix indentation.
 * i386-bsd-nat.c: Fix indentation.
 * i386-darwin-nat.c: Fix indentation.
 * i386-darwin-tdep.c: Fix indentation.
 * i386-dicos-tdep.c: Fix indentation.
 * i386-gnu-nat.c: Fix indentation.
 * i386-linux-nat.c: Fix indentation.
 * i386-linux-tdep.c: Fix indentation.
 * i386-nto-tdep.c: Fix indentation.
 * i386-obsd-tdep.c: Fix indentation.
 * i386-sol2-nat.c: Fix indentation.
 * i386-tdep.c: Fix indentation.
 * i386-tdep.h: Fix indentation.
 * i386-windows-tdep.c: Fix indentation.
 * i387-tdep.c: Fix indentation.
 * i387-tdep.h: Fix indentation.
 * ia64-libunwind-tdep.c: Fix indentation.
 * ia64-libunwind-tdep.h: Fix indentation.
 * ia64-linux-nat.c: Fix indentation.
 * ia64-linux-tdep.c: Fix indentation.
 * ia64-tdep.c: Fix indentation.
 * ia64-tdep.h: Fix indentation.
 * ia64-vms-tdep.c: Fix indentation.
 * infcall.c: Fix indentation.
 * infcmd.c: Fix indentation.
 * inferior.c: Fix indentation.
 * infrun.c: Fix indentation.
 * iq2000-tdep.c: Fix indentation.
 * language.c: Fix indentation.
 * linespec.c: Fix indentation.
 * linux-fork.c: Fix indentation.
 * linux-nat.c: Fix indentation.
 * linux-tdep.c: Fix indentation.
 * linux-thread-db.c: Fix indentation.
 * lm32-tdep.c: Fix indentation.
 * m2-lang.c: Fix indentation.
 * m2-typeprint.c: Fix indentation.
 * m2-valprint.c: Fix indentation.
 * m32c-tdep.c: Fix indentation.
 * m32r-linux-tdep.c: Fix indentation.
 * m32r-tdep.c: Fix indentation.
 * m68hc11-tdep.c: Fix indentation.
 * m68k-bsd-nat.c: Fix indentation.
 * m68k-linux-nat.c: Fix indentation.
 * m68k-linux-tdep.c: Fix indentation.
 * m68k-tdep.c: Fix indentation.
 * machoread.c: Fix indentation.
 * macrocmd.c: Fix indentation.
 * macroexp.c: Fix indentation.
 * macroscope.c: Fix indentation.
 * macrotab.c: Fix indentation.
 * macrotab.h: Fix indentation.
 * main.c: Fix indentation.
 * mdebugread.c: Fix indentation.
 * mep-tdep.c: Fix indentation.
 * mi/mi-cmd-catch.c: Fix indentation.
 * mi/mi-cmd-disas.c: Fix indentation.
 * mi/mi-cmd-env.c: Fix indentation.
 * mi/mi-cmd-stack.c: Fix indentation.
 * mi/mi-cmd-var.c: Fix indentation.
 * mi/mi-cmds.c: Fix indentation.
 * mi/mi-main.c: Fix indentation.
 * mi/mi-parse.c: Fix indentation.
 * microblaze-tdep.c: Fix indentation.
 * minidebug.c: Fix indentation.
 * minsyms.c: Fix indentation.
 * mips-linux-nat.c: Fix indentation.
 * mips-linux-tdep.c: Fix indentation.
 * mips-nbsd-tdep.c: Fix indentation.
 * mips-tdep.c: Fix indentation.
 * mn10300-linux-tdep.c: Fix indentation.
 * mn10300-tdep.c: Fix indentation.
 * moxie-tdep.c: Fix indentation.
 * msp430-tdep.c: Fix indentation.
 * namespace.h: Fix indentation.
 * nat/fork-inferior.c: Fix indentation.
 * nat/gdb_ptrace.h: Fix indentation.
 * nat/linux-namespaces.c: Fix indentation.
 * nat/linux-osdata.c: Fix indentation.
 * nat/netbsd-nat.c: Fix indentation.
 * nat/x86-dregs.c: Fix indentation.
 * nbsd-nat.c: Fix indentation.
 * nbsd-tdep.c: Fix indentation.
 * nios2-linux-tdep.c: Fix indentation.
 * nios2-tdep.c: Fix indentation.
 * nto-procfs.c: Fix indentation.
 * nto-tdep.c: Fix indentation.
 * objfiles.c: Fix indentation.
 * objfiles.h: Fix indentation.
 * opencl-lang.c: Fix indentation.
 * or1k-tdep.c: Fix indentation.
 * osabi.c: Fix indentation.
 * osabi.h: Fix indentation.
 * osdata.c: Fix indentation.
 * p-lang.c: Fix indentation.
 * p-typeprint.c: Fix indentation.
 * p-valprint.c: Fix indentation.
 * parse.c: Fix indentation.
 * ppc-linux-nat.c: Fix indentation.
 * ppc-linux-tdep.c: Fix indentation.
 * ppc-nbsd-nat.c: Fix indentation.
 * ppc-nbsd-tdep.c: Fix indentation.
 * ppc-obsd-nat.c: Fix indentation.
 * ppc-ravenscar-thread.c: Fix indentation.
 * ppc-sysv-tdep.c: Fix indentation.
 * ppc64-tdep.c: Fix indentation.
 * printcmd.c: Fix indentation.
 * proc-api.c: Fix indentation.
 * producer.c: Fix indentation.
 * producer.h: Fix indentation.
 * prologue-value.c: Fix indentation.
 * prologue-value.h: Fix indentation.
 * psymtab.c: Fix indentation.
 * python/py-arch.c: Fix indentation.
 * python/py-bpevent.c: Fix indentation.
 * python/py-event.c: Fix indentation.
 * python/py-event.h: Fix indentation.
 * python/py-finishbreakpoint.c: Fix indentation.
 * python/py-frame.c: Fix indentation.
 * python/py-framefilter.c: Fix indentation.
 * python/py-inferior.c: Fix indentation.
 * python/py-infthread.c: Fix indentation.
 * python/py-objfile.c: Fix indentation.
 * python/py-prettyprint.c: Fix indentation.
 * python/py-registers.c: Fix indentation.
 * python/py-signalevent.c: Fix indentation.
 * python/py-stopevent.c: Fix indentation.
 * python/py-stopevent.h: Fix indentation.
 * python/py-threadevent.c: Fix indentation.
 * python/py-tui.c: Fix indentation.
 * python/py-unwind.c: Fix indentation.
 * python/py-value.c: Fix indentation.
 * python/py-xmethods.c: Fix indentation.
 * python/python-internal.h: Fix indentation.
 * python/python.c: Fix indentation.
 * ravenscar-thread.c: Fix indentation.
 * record-btrace.c: Fix indentation.
 * record-full.c: Fix indentation.
 * record.c: Fix indentation.
 * reggroups.c: Fix indentation.
 * regset.h: Fix indentation.
 * remote-fileio.c: Fix indentation.
 * remote.c: Fix indentation.
 * reverse.c: Fix indentation.
 * riscv-linux-tdep.c: Fix indentation.
 * riscv-ravenscar-thread.c: Fix indentation.
 * riscv-tdep.c: Fix indentation.
 * rl78-tdep.c: Fix indentation.
 * rs6000-aix-tdep.c: Fix indentation.
 * rs6000-lynx178-tdep.c: Fix indentation.
 * rs6000-nat.c: Fix indentation.
 * rs6000-tdep.c: Fix indentation.
 * rust-lang.c: Fix indentation.
 * rx-tdep.c: Fix indentation.
 * s12z-tdep.c: Fix indentation.
 * s390-linux-tdep.c: Fix indentation.
 * score-tdep.c: Fix indentation.
 * ser-base.c: Fix indentation.
 * ser-mingw.c: Fix indentation.
 * ser-uds.c: Fix indentation.
 * ser-unix.c: Fix indentation.
 * serial.c: Fix indentation.
 * sh-linux-tdep.c: Fix indentation.
 * sh-nbsd-tdep.c: Fix indentation.
 * sh-tdep.c: Fix indentation.
 * skip.c: Fix indentation.
 * sol-thread.c: Fix indentation.
 * solib-aix.c: Fix indentation.
 * solib-darwin.c: Fix indentation.
 * solib-frv.c: Fix indentation.
 * solib-svr4.c: Fix indentation.
 * solib.c: Fix indentation.
 * source.c: Fix indentation.
 * sparc-linux-tdep.c: Fix indentation.
 * sparc-nbsd-tdep.c: Fix indentation.
 * sparc-obsd-tdep.c: Fix indentation.
 * sparc-ravenscar-thread.c: Fix indentation.
 * sparc-tdep.c: Fix indentation.
 * sparc64-linux-tdep.c: Fix indentation.
 * sparc64-nbsd-tdep.c: Fix indentation.
 * sparc64-obsd-tdep.c: Fix indentation.
 * sparc64-tdep.c: Fix indentation.
 * stabsread.c: Fix indentation.
 * stack.c: Fix indentation.
 * stap-probe.c: Fix indentation.
 * stubs/ia64vms-stub.c: Fix indentation.
 * stubs/m32r-stub.c: Fix indentation.
 * stubs/m68k-stub.c: Fix indentation.
 * stubs/sh-stub.c: Fix indentation.
 * stubs/sparc-stub.c: Fix indentation.
 * symfile-mem.c: Fix indentation.
 * symfile.c: Fix indentation.
 * symfile.h: Fix indentation.
 * symmisc.c: Fix indentation.
 * symtab.c: Fix indentation.
 * symtab.h: Fix indentation.
 * target-float.c: Fix indentation.
 * target.c: Fix indentation.
 * target.h: Fix indentation.
 * tic6x-tdep.c: Fix indentation.
 * tilegx-linux-tdep.c: Fix indentation.
 * tilegx-tdep.c: Fix indentation.
 * top.c: Fix indentation.
 * tracefile-tfile.c: Fix indentation.
 * tracepoint.c: Fix indentation.
 * tui/tui-disasm.c: Fix indentation.
 * tui/tui-io.c: Fix indentation.
 * tui/tui-regs.c: Fix indentation.
 * tui/tui-stack.c: Fix indentation.
 * tui/tui-win.c: Fix indentation.
 * tui/tui-winsource.c: Fix indentation.
 * tui/tui.c: Fix indentation.
 * typeprint.c: Fix indentation.
 * ui-out.h: Fix indentation.
 * unittests/copy_bitwise-selftests.c: Fix indentation.
 * unittests/memory-map-selftests.c: Fix indentation.
 * utils.c: Fix indentation.
 * v850-tdep.c: Fix indentation.
 * valarith.c: Fix indentation.
 * valops.c: Fix indentation.
 * valprint.c: Fix indentation.
 * valprint.h: Fix indentation.
 * value.c: Fix indentation.
 * value.h: Fix indentation.
 * varobj.c: Fix indentation.
 * vax-tdep.c: Fix indentation.
 * windows-nat.c: Fix indentation.
 * windows-tdep.c: Fix indentation.
 * xcoffread.c: Fix indentation.
 * xml-syscall.c: Fix indentation.
 * xml-tdesc.c: Fix indentation.
 * xstormy16-tdep.c: Fix indentation.
 * xtensa-config.c: Fix indentation.
 * xtensa-linux-nat.c: Fix indentation.
 * xtensa-linux-tdep.c: Fix indentation.
 * xtensa-tdep.c: Fix indentation.

gdbserver/ChangeLog:

 * ax.cc: Fix indentation.
 * dll.cc: Fix indentation.
 * inferiors.h: Fix indentation.
 * linux-low.cc: Fix indentation.
 * linux-nios2-low.cc: Fix indentation.
 * linux-ppc-ipa.cc: Fix indentation.
 * linux-ppc-low.cc: Fix indentation.
 * linux-x86-low.cc: Fix indentation.
 * linux-xtensa-low.cc: Fix indentation.
 * regcache.cc: Fix indentation.
 * server.cc: Fix indentation.
 * tracepoint.cc: Fix indentation.

gdbsupport/ChangeLog:

 * common-exceptions.h: Fix indentation.
 * event-loop.cc: Fix indentation.
 * fileio.cc: Fix indentation.
 * filestuff.cc: Fix indentation.
 * gdb-dlfcn.cc: Fix indentation.
 * gdb_string_view.h: Fix indentation.
 * job-control.cc: Fix indentation.
 * signals.cc: Fix indentation.

Change-Id: I4bad7ae6be0fbe14168b8ebafb98ffe14964a695

users/simark/autoconf-warnings 2020-10-26 02:12:07 UTC
gdbserver: replace AC_TRY_COMPILE in acinclude.m4

Author: Simon Marchi
Author Date: 2020-10-26 02:00:18 UTC

gdbserver: replace AC_TRY_COMPILE in acinclude.m4

... with AC_COMPILE_IFELSE and AC_LANG_PROGRAM.

All changes in the generated configure file are insignificant
whitespace changes.

gdbserver/ChangeLog:

 * acinclude.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE +
 AC_LANG_PROGRAM.
 * configure: Re-generate.

Change-Id: Idab8b5e1a984046b5283940c02e5a22da2291d58

users/simark/arm-none-core-file 2020-10-22 01:46:18 UTC
Support for corefiles for arm-none-eabi target.

Author: Fredrik Hederstierna
Author Date: 2020-10-22 00:44:01 UTC

Support for corefiles for arm-none-eabi target.

Change-Id: I8f4c57e653ae4e0400475ea55069f0dde280babb

users/palves/runto_main 2020-10-12 00:45:51 UTC
Eliminate mi_run_to_main, introduce mi_clean_restart

Author: Pedro Alves
Author Date: 2020-10-11 20:58:31 UTC

Eliminate mi_run_to_main, introduce mi_clean_restart

Since we now have mi_runto_main which is like runto_main, eliminate
mi_run_to_main, in favor of a new MI clean_restart counterpart --
mi_clean_restart -- and mi_runto_main.

This makes MI testcases look a bit more like CLI testcases.

gdb/testsuite/ChangeLog:

 * lib/mi-support.exp (mi_clean_restart): New.
 (mi_run_to_main): Delete.
 All callers adjust to use mi_clean_restart / mi_runto_main.

Change-Id: I34920bab4fea1f23fb752928c2969c1f6ad714b6

gdb-9-branch 2020-09-13 00:00:44 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2020-09-13 00:00:44 UTC

Automatic date update in version.in

users/palves/advance-until-fixes 2020-08-22 20:37:26 UTC
Fix advance/until and multiple locations (PR gdb/26524)

Author: Pedro Alves
Author Date: 2020-08-22 20:37:26 UTC

Fix advance/until and multiple locations (PR gdb/26524)

If you do "advance LINESPEC", and LINESPEC expands to more than one
location, GDB just errors out:

   if (sals.size () != 1)
     error (_("Couldn't get information on specified line."));

For example, advancing to a line in an inlined function, inlined three
times:

 (gdb) b 21
 Breakpoint 1 at 0x55555555516f: advance.cc:21. (3 locations)
 (gdb) info breakpoints
 Num Type Disp Enb Address What
 1 breakpoint keep y <MULTIPLE>
 1.1 y 0x000055555555516f in inline_func at advance.cc:21
 1.2 y 0x000055555555517e in inline_func at advance.cc:21
 1.3 y 0x000055555555518d in inline_func at advance.cc:21
 (gdb) advance 21
 Couldn't get information on specified line.
 (gdb)

Similar issue with the "until" command, as it shares the
implementation with "advance".

Since, as the comment in gdb.base/advance.exp says, "advance <location>"
is really just syntactic sugar for "tbreak <location>;continue",
fix this by making GDB insert a breakpoint at all the resolved
locations.

A new testcase is included, which exercises both "advance" and
"until", in two different cases expanding to multiple locations:

  - inlined functions
  - C++ overloads

This also exercises the inline frames issue fixed by the previous
patch.

gdb/ChangeLog:

 PR gdb/26524
 * breakpoint.c (until_break_fsm) <location_breakpoint,
 caller_breakpoint>: Delete fields.
 <breakpoints>: New field.
 <until_break_fsm>: Adjust to save a breakpoint vector instead of
 two individual breakpoints.
 (until_break_fsm::should_stop): Loop over breakpoints in the
 breakpoint vector.
 (until_break_fsm::clean_up): Adjust to clear the breakpoints
 vector.
 (until_break_command): Handle location expanding into multiple
 sals.

gdb/testsuite/ChangeLog:

 PR gdb/26523
 PR gdb/26524
 * gdb.base/advance-until-multiple-locations.cc: New.
 * gdb.base/advance-until-multiple-locations.exp: New.

users/palves/enum-flags-rewrite 2020-08-21 14:42:32 UTC
Rewrite enum_flags, add unit tests, fix problems

Author: Pedro Alves
Author Date: 2020-08-21 14:36:37 UTC

Rewrite enum_flags, add unit tests, fix problems

This patch started by adding comprehensive unit tests for enum_flags.

For the testing part, it adds:

 - tests of normal expected uses of the API.

 - checks that _invalid_ uses of the API would fail to compile. I.e.,
   it validates that enum_flags really is a strong type, and that
   incorrect mixing of enum types would be caught at compile time. It
   pulls that off making use of SFINEA and C++11's decltype/constexpr.

This revealed many holes in the enum_flags API. For example, the f1
assignment below currently incorrectly fails to compile:

 enum_flags<flags> f1 = FLAG1;
 enum_flags<flags> f2 = FLAG2 | f1;

The unit tests also revealed that this useful use case doesn't work:

    enum flag { FLAG1 = 1, FLAG2 = 2 };
    enum_flags<flag> src = FLAG1;
    enum_flags<flag> f1 = condition ? src : FLAG2;

It fails to compile because enum_flags<flag> and flag are convertible
to each other.

Turns out that making enum_flags be implicitly convertible to the
backing raw enum type was not a good idea.

If we make it convertible to the underlying type instead, we fix that
ternary operator use case, and, we find cases throughout the codebase
that should be using the enum_flags but were using the raw backing
enum instead. So it's a good change overall.

Also, several operators were missing.

These holes and more are plugged by this patch, by reworking how the
enum_flags operators are implemented, and making use of C++11's
feature of being able to delete methods/functions.

There are cases in gdb/compile/ where we need to call a function in a
C plugin API that expects the raw enum. To address cases like that,
this adds a "raw()" method to enum_flags. This way we can keep using
the safer enum_flags to construct the value, and then be explicit when
we need to get at the raw enum.

This makes most of the enum_flags operators constexpr. Beyond
enabling more compiler optimizations and enabling the new unit tests,
this has other advantages, like making it possible to use operator|
with enum_flags values in switch cases, where only compile-time
constants are allowed:

    enum_flags<flags> f = FLAG1 | FLAG2;
    switch (f)
      {
      case FLAG1 | FLAG2:
 break;
      }

Currently that fails to compile.

It also switches to a different mechanism of enabling the global
operators. The current mechanism isn't namespace friendly, the new
one is.

It also switches to C++11-style SFINAE -- instead of wrapping the
return type in a SFINAE-friently structure, we use an unnamed template
parameter. I.e., this:

  template <typename enum_type,
     typename = is_enum_flags_enum_type_t<enum_type>>
  enum_type
  operator& (enum_type e1, enum_type e2)

instead of:

  template <typename enum_type>
  typename enum_flags_type<enum_type>::type
  operator& (enum_type e1, enum_type e2)

Note that the static_assert inside operator~() was converted to a
couple overloads (signed vs unsigned), because static_assert is too
late for SFINAE-based tests, which is important for the CHECK_VALID
unit tests.

Tested with gcc {4.8, 7.1, 9.3} and clang {5.0.2, 10.0.0}.

gdb/ChangeLog:

 * Makefile.in (SELFTESTS_SRCS): Add
 unittests/enum-flags-selftests.c.
 * btrace.c (ftrace_update_caller, ftrace_fixup_calle): Use
 btrace_function_flags instead of enum btrace_function_flag.
 * compile/compile-c-types.c (convert_qualified): Use
 enum_flags::raw.
 * compile/compile-cplus-symbols.c (convert_one_symbol)
 (convert_symbol_bmsym):
 * compile/compile-cplus-types.c (compile_cplus_convert_method)
 (compile_cplus_convert_struct_or_union_methods)
 (compile_cplus_instance::convert_qualified_base):
 * go-exp.y (parse_string_or_char): Add cast to int.
 * unittests/enum-flags-selftests.c: New file.
 * record-btrace.c (btrace_thread_flag_to_str): Change parameter's
 type to btrace_thread_flags from btrace_thread_flag.
 (record_btrace_cancel_resume, record_btrace_step_thread): Change
 local's type to btrace_thread_flags from btrace_thread_flag. Add
 cast in DEBUG call.

gdbsupport/ChangeLog:

 * common/enum-flags.h: Include "traits.h".
 (DEF_ENUM_FLAGS_TYPE): Declare a function instead of defining a
 structure.
 (enum_underlying_type): Update comment.
 (namespace enum_flags_detail): New. Move struct zero_type here.
 (EnumIsUnsigned, EnumIsSigned): New.
 (class enum_flags): Make most methods constexpr.
 (operator&=, operator|=, operator^=): Take an enum_flags instead
 of an enum_type.
 (operator enum_type()): Delete.
 (operator&, operator|, operator^, operator~): Delete, moved out of
 class.
 (raw()): New method.
 (is_enum_flags_enum_type_t): Declare.
 (ENUM_FLAGS_GEN_BINOP, ENUM_FLAGS_GEN_COMPOUND_ASSIGN)
 (ENUM_FLAGS_GEN_COMP): New. Use them to reimplement global
 operators.
 (operator~): Now constexpr and reimplemented.
 (operator<<, operator>>): New deleted functions.
 * valid-expr.h (CHECK_VALID_EXPR_5, CHECK_VALID_EXPR_6): New.

users/simark/regcache-multimap-v2 2020-08-05 19:40:21 UTC
Two-level map

Author: Simon Marchi
Author Date: 2020-07-30 18:05:03 UTC

Two-level map

Change-Id: I008ddd9a1ef773a8d17e439d24d75d37bbf1a076

users/roland/tolerant-elf_object_p 2020-07-29 18:23:33 UTC
Don't let a single unrecognized ELF section break target matching.

Author: Roland McGrath
Author Date: 2020-07-29 18:23:33 UTC

Don't let a single unrecognized ELF section break target matching.

bfd/
 * elfcode.h (elf_object_p): Ignore errors from individual
 bfd_section_from_shdr calls so a novel section type appearing in
 the input doesn't break target-matching.

users/luisgpm/aarch64-mte-v3 2020-07-16 16:09:27 UTC
Add memory tagging testcases

Author: Luis
Author Date: 2020-06-15 18:55:02 UTC

Add memory tagging testcases

Add an AArch64-specific test and a more generic memory tagging test that
other architectures can run.

Even though architectures not supporting memory tagging can run the memory
tagging tests, the runtime check will make the tests bail out early, as it
would make no sense to proceed without proper support.

It is also tricky to do any further runtime tests for memory tagging, given
we'd need to deal with tags, and those are arch-specific. Therefore the
test in gdb.base is more of a smoke test.

If an architecture wants to implement memory tagging, then it makes sense to
have tests within gdb.arch instead.

gdb/testsuite/ChangeLog:

YYYY-MM-DD Luis Machado <luis.machado@linaro.org>

 * gdb.arch/aarch64-mte.c: New file.
 * gdb.arch/aarch64-mte.exp: New test.
 * gdb.base/memtag.c: New file.
 * gdb.base/memtag.exp: New test.
 * lib/gdb.exp (supports_memtag): New function.

users/palves/pr26199-busy-loop-target-events 2020-07-09 11:13:11 UTC
Make scoped_restore_current_thread's cdtors exception free (RFC)

Author: Pedro Alves
Author Date: 2020-07-09 10:31:29 UTC

Make scoped_restore_current_thread's cdtors exception free (RFC)

If the remote target closes while we're reading registers/memory for
restoring the selected frame in scoped_restore_current_thread's dtor,
the corresponding TARGET_CLOSE_ERROR error is swallowed by the
scoped_restore_current_thread's dtor, because letting exceptions
escape from a dtor is bad. It isn't great to lose that errors like
that, though. I've been thinking about how to avoid it, and I came up
with this patch.

The idea here is to make scoped_restore_current_thread's dtor do as
little as possible, to avoid any work that might throw in the first
place. And to do that, instead of having the dtor call
restore_selected_frame, which re-finds the previously selected frame,
just record the frame_id/level of the desired selected frame, and have
get_selected_frame find the frame the next time it is called. In
effect, this implements most of Cagney's suggestion, here:

  /* On demand, create the selected frame and then return it. If the
     selected frame can not be created, this function prints then throws
     an error. When MESSAGE is non-NULL, use it for the error message,
     otherwize use a generic error message. */
  /* FIXME: cagney/2002-11-28: At present, when there is no selected
     frame, this function always returns the current (inner most) frame.
     It should instead, when a thread has previously had its frame
     selected (but not resumed) and the frame cache invalidated, find
     and then return that thread's previously selected frame. */
  extern struct frame_info *get_selected_frame (const char *message);

The only thing missing to fully implement that would be to make
reinit_frame_cache just clear selected_frame instead of calling
select_frame(NULL), and the call select_frame(NULL) explicitly in the
places where we really wanted reinit_frame_cache to go back to the
current frame too. That can done separately, though, I'm not
proposing to do that in this patch.

Note that this patch renames restore_selected_frame to
lookup_selected_frame, and adds a new restore_selected_frame function
that doesn't throw, to be paired with the also-new save_selected_frame
function.

lookup_selected_frame should really move from thread.c to frame.c, but
I didn't do that here, just to avoid churn in the patch while it
collects comments. I did make it extern and declared it in frame.h
already, preparing for the move. I will do the move as a follow up
patch if people agree with this approach.

Incidentally, this patch alone would fix the crashes fixed by the
previous patches in the series, because with this,
scoped_restore_current_thread's constructor doesn't throw either.

gdb/ChangeLog:

 * blockframe.c (block_innermost_frame): Use get_selected_frame.
 * frame.c
 (scoped_restore_selected_frame::scoped_restore_selected_frame):
 Use save_selected_frame. Save language as well.
 (scoped_restore_selected_frame::~scoped_restore_selected_frame):
 Use restore_selected_frame, and restore language as well.
 (selected_frame_id, selected_frame_level): New.
 (selected_frame): Update comments.
 (save_selected_frame, restore_selected_frame): New.
 (get_selected_frame): Use lookup_selected_frame.
 (get_selected_frame_if_set): Delete.
 (select_frame): Record selected_frame_level and selected_frame_id.
 * frame.h (scoped_restore_selected_frame) <m_level, m_lang>: New
 fields.
 (get_selected_frame_if_set): Delete declaration.
 (select_frame): Update comments.
 (save_selected_frame, restore_selected_frame)
 (lookup_selected_frame): Declare.
 * gdbthread.h (scoped_restore_current_thread) <m_lang>: New field.
 * stack.c (select_frame_command_core, frame_command_core): Use
 get_selected_frame.
 * thread.c (restore_selected_frame): Rename to ...
 (lookup_selected_frame): ... this and make extern. Select the
 current frame if the frame level is -1.
 (scoped_restore_current_thread::restore): Also restore the
 language.
 (scoped_restore_current_thread::~scoped_restore_current_thread):
 Don't try/catch.
 (scoped_restore_current_thread::scoped_restore_current_thread):
 Save the language as well. Use save_selected_frame.

users/luisgpm/aarch64-mte-v2 2020-06-25 16:23:39 UTC
Add memory tagging testcases

Author: Luis
Author Date: 2020-06-15 18:55:02 UTC

Add memory tagging testcases

Add an AArch64-specific test and a more generic memory tagging test that
other architectures can run.

Even though architectures not supporting memory tagging can run the memory
tagging tests, the runtime check will make the tests bail out early, as it
would make no sense to proceed without proper support.

gdb/testsuite/ChangeLog:

YYYY-MM-DD Luis Machado <luis.machado@linaro.org>

 * gdb.arch/aarch64-mte.c: New file.
 * gdb.arch/aarch64-mte.exp: New test.
 * gdb.base/memtag.c: New file.
 * gdb.base/memtag.exp: New test.
 * lib/gdb.exp (supports_memtag): New function.

users/luisgpm/aarch64-mte-v1 2020-06-16 12:58:33 UTC
Add memory tagging testcases

Author: Luis
Author Date: 2020-06-15 18:55:02 UTC

Add memory tagging testcases

Add an AArch64-specific test and a more generic memory tagging test that
other architectures can run.

Even though architectures not supporting memory tagging can run the memory
tagging tests, the runtime check will make the tests bail out early, as it
would make no sense to proceed without proper support.

gdb/testsuite/ChangeLog:

YYYY-MM-DD Luis Machado <luis.machado@linaro.org>

 * gdb.arch/aarch64-mte.c: New file.
 * gdb.arch/aarch64-mte.exp: New test.
 * gdb.base/memtag.c: New file.
 * gdb.base/memtag.exp: New test.
 * lib/gdb.exp (supports_memtag): New function.

1100 of 365 results
This repository contains Public information 
Everyone can see this information.