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-5 and finished taking 10 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-2 and finished taking 10 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 8 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 11 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-2 and finished taking 8 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-2 and finished taking 6 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 7 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-2 and finished taking 6 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-2 and finished taking 7 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 9 minutes — see the log

Branches

Name Last Modified Last Commit
master 2024-10-04 12:46:49 UTC
gdb segv in elfread.c:elf_rel_plt_read

Author: Alan Modra
Author Date: 2024-10-03 22:17:05 UTC

gdb segv in elfread.c:elf_rel_plt_read

After commit 68bbe1183379, ELF symbols read via bfd_canonicalize_symtab
and similar functions which have bad st_name fields will have NULL in
the name rather than "(null)". gdb.base/bfd-errors.exp deliberately
creates a faulty shared library with st_name pointing outside of
.dynsym for some symbols, and thus now results in NULL symbol names.
This triggers a segv on string_buffer.assign(name). Fix that.

binutils-2_43-branch 2024-10-04 00:00:40 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2024-10-04 00:00:40 UTC

Automatic date update in version.in

gdb-15-branch 2024-10-04 00:00:27 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2024-10-04 00:00:27 UTC

Automatic date update in version.in

users/mnabipoor/poke-gdb 2024-09-25 10:05:09 UTC
WIP Fix poke_command to reset lexical cuckolding after error

Author: Mohammad-Reza Nabipoor
Author Date: 2024-09-25 10:05:09 UTC

WIP Fix poke_command to reset lexical cuckolding after error

users/fche/try-xxhash-plus 2024-09-20 20:23:48 UTC
binutils testsuite: canonicalize subtest names in libctf

Author: Frank Ch. Eigler
Author Date: 2024-09-20 20:23:48 UTC

binutils testsuite: canonicalize subtest names in libctf

Previous code included the full $srcdir pathnames in the individual
subtest PASS/FAIL names, which makes it difficult to compute
comparisons or regressions between test runs on different machines.
This version switches to the basename only, which are common.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>

users/mmetzger/pr19340 2024-09-13 10:25:28 UTC
gdb, btrace, infrun: per-inferior run-control

Author: Markus Metzger
Author Date: 2024-02-21 14:53:59 UTC

gdb, btrace, infrun: per-inferior run-control

While recording is already per inferior, run-control isn't. As soon as
any thread in any inferior is replaying, no other inferior can be resumed.

This is controlled by many calls to record_is_replaying(minus_one_ptid).
Instead of minus_one_ptid, pass the ptid of the inferior to be checked.

users/mmetzger/pr31353 2024-09-13 10:06:40 UTC
gdb, infrun: fix multi-threaded reverse stepping

Author: Markus Metzger
Author Date: 2021-02-26 08:04:41 UTC

gdb, infrun: fix multi-threaded reverse stepping

When reverse-stepping a thread that has a pending breakpoint event, the
thread is not resumed as part of the infcmd function. A first resume
notices the event and returns without resuming the target.

If the corresponding breakpoint has been deleted, event processing results
in a second resume that performs the intended stepping action. That
resume happens after the infcmd function returned and the temporarily
modified execution direction was restored. We end up resuming in the
wrong direction.

Store the direction in a thread's control state and change most of
infrun to take it from there rather than using the global variable.

Reviewed-By: Guinevere Larsen <blarsen@redhat.com>

users/simark/try-cxx-hash-table 2024-08-23 18:41:49 UTC
Convert dwarf2_per_objfile::die_type_hash to new hash table

Author: Simon Marchi
Author Date: 2024-08-22 18:01:58 UTC

Convert dwarf2_per_objfile::die_type_hash to new hash table

Convert dwarf2_per_objfile::die_type_hash, which maps debug info
offsets to `type *`, to gdb::unordered_map.

Change-Id: I5c174af64ee46d38a465008090e812acf03704ec

users/roland/riscv64-elf-shared 2024-08-16 02:09:14 UTC
ld: Don't disable -shared / -pie support for riscv*-elf

Author: Roland McGrath
Author Date: 2024-08-16 02:09:14 UTC

ld: Don't disable -shared / -pie support for riscv*-elf

Other *-elf targets support -shared and -pie modes. There is no
reason to presuppose that riscv64-elf is used for "embedded", nor
for that matter that "embedded" is mutually exclusive with
wanting -shared and -pie functionality available in the linker.

binutils-2_35-branch 2024-08-02 12:54:40 UTC
libctf: fix ref leak of names of newly-inserted non-root-visible types

Author: Nick Alcock
Author Date: 2024-07-29 11:45:09 UTC

libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was. This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
 * ctf-create.c (ctf_dtd_delete): Remove refs for all types
 with names, not just root-visible ones.

binutils-2_36-branch 2024-08-02 11:44:27 UTC
libctf: fix ref leak of names of newly-inserted non-root-visible types

Author: Nick Alcock
Author Date: 2024-07-29 11:45:09 UTC

libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was. This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
 * ctf-create.c (ctf_dtd_delete): Remove refs for all types
 with names, not just root-visible ones.

binutils-2_37-branch 2024-08-02 10:56:42 UTC
libctf: fix ref leak of names of newly-inserted non-root-visible types

Author: Nick Alcock
Author Date: 2024-07-29 11:45:09 UTC

libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was. This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
 * ctf-create.c (ctf_dtd_delete): Remove refs for all types
 with names, not just root-visible ones.

binutils-2_38-branch 2024-08-01 20:14:13 UTC
libctf: fix ref leak of names of newly-inserted non-root-visible types

Author: Nick Alcock
Author Date: 2024-07-29 11:45:09 UTC

libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was. This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
 * ctf-create.c (ctf_dtd_delete): Remove refs for all types
 with names, not just root-visible ones.

binutils-2_39-branch 2024-08-01 19:39:28 UTC
libctf: fix ref leak of names of newly-inserted non-root-visible types

Author: Nick Alcock
Author Date: 2024-07-29 11:45:09 UTC

libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was. This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
 * ctf-create.c (ctf_dtd_delete): Remove refs for all types
 with names, not just root-visible ones.

binutils-2_40-branch 2024-08-01 19:09:15 UTC
libctf: fix ref leak of names of newly-inserted non-root-visible types

Author: Nick Alcock
Author Date: 2024-07-29 11:45:09 UTC

libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was. This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
 * ctf-create.c (ctf_dtd_delete): Remove refs for all types
 with names, not just root-visible ones.

binutils-2_41-branch 2024-08-01 18:08:18 UTC
libctf: fix ref leak of names of newly-inserted non-root-visible types

Author: Nick Alcock
Author Date: 2024-07-29 11:45:09 UTC

libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was. This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
 * ctf-create.c (ctf_dtd_delete): Remove refs for all types
 with names, not just root-visible ones.

binutils-2_42-branch 2024-08-01 14:46:03 UTC
libctf: fix ref leak of names of newly-inserted non-root-visible types

Author: Nick Alcock
Author Date: 2024-07-29 11:45:09 UTC

libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was. This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
 * ctf-create.c (ctf_dtd_delete): Remove refs for all types
 with names, not just root-visible ones.

users/simark/try-remove-vlas-2 2024-07-31 18:02:07 UTC
gdb, gdbserver, gdbsupport: remove -Wno-vla-cxx-extension

Author: Simon Marchi
Author Date: 2024-04-23 14:43:27 UTC

gdb, gdbserver, gdbsupport: remove -Wno-vla-cxx-extension

Now that all known uses of VLAs within GDB are removed, remove the
`-Wno-vla-cxx-extension` (which was used to silence clang warnings) and
add `-Wvla`, such that any use of a VLA will trigger a warning.

Change-Id: I69a8d7f93f973743165b0ba46f9c2ea8adb89025

users/simark/try-remove-vlas 2024-07-31 17:07:49 UTC
gdb, gdbserver, gdbsupport: remove -Wno-vla-cxx-extension

Author: Simon Marchi
Author Date: 2024-04-23 14:43:27 UTC

gdb, gdbserver, gdbsupport: remove -Wno-vla-cxx-extension

Now that all known uses of VLAs within GDB are removed, remove the
`-Wno-vla-cxx-extension` (which was used to silence clang warnings) and
add `-Wvla`, such that any use of a VLA will trigger a warning.

Change-Id: I69a8d7f93f973743165b0ba46f9c2ea8adb89025

users/nalcock/try-enum-reloosening 2024-07-30 11:28:04 UTC
libctf: fix ctf_archive_count return value on big-endian

Author: Nick Alcock
Author Date: 2024-07-30 11:28:04 UTC

libctf: fix ctf_archive_count return value on big-endian

This failed to properly byteswap its return value.

The ctf_archive format predates the idea of "just write natively and
flip on open", and byteswaps all over the place. It's too easy to
forget one. The next revision of the archive format (not versioned,
so we just tweak the magic number instead) should be native-endianned
like the dicts inside it are.

libctf/
 * ctf-archive.c (ctf_archive_count): Byteswap return value.

users/ibhagat/try-scfi-aarch64-v5 2024-07-13 05:48:11 UTC
gas: aarch64: testsuite: add new tests for SCFI

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

gas: aarch64: testsuite: add new tests for SCFI

[Changes in V5]
 - Rename the previously added testcase scfi-diag-3 for SVE memory op to
   scfi-unsupported-2. This will help keep track of the work to be done
   in near future.
 - Add new testcase scfi-diag-3 where the insn " b symbol+1" leads to an
   error:
      "Error: SCFI: 0x14000000 op with non-zero addend to sym not supported"
 - Add "stg sp, [sp, 32]!" and "ldpsw x8, x15, [sp, -256]" to ginsn-ldst-1.
 - Add prfm, irg, addg ops to ginsn-misc-1.
 - Add ldrsw, ldpsw ops to ginsn-misc-1.
 - Adjust ginsn-ldst-1 as now S and W register loads and stores are
   skipped.
 - Added a new testcase scfi-ldstnap-1 which includes some insns from
   iclass ldstnapair_offs.
[End of changes in V5]

[Changes in V4]
 - New testcases for FP callee-saved registers.
   scfi-callee-saved-fp-1.s uses D registers, scfi-callee-saved-fp-2.s
   uses Q registers and is run with -mbig-endian.
 - Added new ops (movk, prfm) to ginsn-misc-1. These ops are not
   relevant for SCFI correctness; this testcase merely
   ensures graceful handling of ginsn creation for such insns.
 - Fixed ginsn-ldst-1 as it included some load / store ops with D
   registers, which we now handle. Also added some insns using W and S
   registers.
 - Added a new test scfi-diag-3 where SCFI machinery reports the
   following error when it sees an SVE memory op with callee-saved
   register:
    "Error: SCFI: unhandled op 0xe5e0e000 may cause incorrect CFI"
[End of changes in V4]

[No changes in V3]

[Changes in V2]
 - new testcase scfi-cfg-4.s for the changes in cmp_scfi_state.
 - new testcase ginsn-arith-1.s for ginsn creation for various add sub insns.
 - removed redundant insns from ginsn-misc-1.s, some of those insns are
   now in ginsn-arith-1.s.
 - added more ld st opts in ginsn-ldst-1.s testcase.
[End of changes in V2]

Similar to the x86_64 testcases, some .s files contain the corresponding
CFI directives. This helps in validating the synthesized CFI by running
those tests with and without the --scfi=experimental command line
option.

GAS issues some diagnostics, enabled by default, with
--scfi=experimental. The diagnostics have been added with an intent to
help user correct inadvertent errors in their hand-written asm. An
error is issued when GAS finds that input asm is not amenable to
accurate CFI synthesis. The existing scfi-diag-*.s tests in the
gas/testsuite/gas/scfi/x86_64 directory test some SCFI diagnostics
already:

      - (#1) "Warning: SCFI: Asymetrical register restore"
      - (#2) "Error: SCFI: usage of REG_FP as scratch not supported"
      - (#3) "Error: SCFI: unsupported stack manipulation pattern"
      - (#4) "Error: untraceable control flow for func 'XXX'"

In the newly added aarch64 testsuite, further tests for additional
diagnostics have been added:
 - scfi-diag-1.s in this patch highlights an aarch64-specific diagnostic:
   (#5) "Warning: SCFI: ignored probable save/restore op with reg offset"

Additionally, some testcases are added to showcase the (currently)
unsupported patterns, e.g., scfi-unsupported-1.s
        mov x16, 4384
        sub sp, sp, x16

gas/testsuite/:
 * gas/scfi/README: Update comment to include aarch64.
 * gas/scfi/aarch64/scfi-aarch64.exp: New file.
 * gas/scfi/aarch64/ginsn-arith-1.l: New test.
 * gas/scfi/aarch64/ginsn-arith-1.s: New test.
 * gas/scfi/aarch64/ginsn-cofi-1.l: New test.
 * gas/scfi/aarch64/ginsn-cofi-1.s: New test.
 * gas/scfi/aarch64/ginsn-ldst-1.l: New test.
 * gas/scfi/aarch64/ginsn-ldst-1.s: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-1.d: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-1.l: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-1.s: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-2.d: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-2.l: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-2.s: New test.
 * gas/scfi/aarch64/scfi-cb-1.d: New test.
 * gas/scfi/aarch64/scfi-cb-1.l: New test.
 * gas/scfi/aarch64/scfi-cb-1.s: New test.
 * gas/scfi/aarch64/scfi-cfg-1.d: New test.
 * gas/scfi/aarch64/scfi-cfg-1.l: New test.
 * gas/scfi/aarch64/scfi-cfg-1.s: New test.
 * gas/scfi/aarch64/scfi-cfg-2.d: New test.
 * gas/scfi/aarch64/scfi-cfg-2.l: New test.
 * gas/scfi/aarch64/scfi-cfg-2.s: New test.
 * gas/scfi/aarch64/scfi-cfg-3.d: New test.
 * gas/scfi/aarch64/scfi-cfg-3.l: New test.
 * gas/scfi/aarch64/scfi-cfg-3.s: New test.
 * gas/scfi/aarch64/scfi-cfg-4.l: New test.
 * gas/scfi/aarch64/scfi-cfg-4.s: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.d: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.l: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.s: New test.
 * gas/scfi/aarch64/scfi-diag-1.l: New test.
 * gas/scfi/aarch64/scfi-diag-1.s: New test.
 * gas/scfi/aarch64/scfi-diag-2.l: New test.
 * gas/scfi/aarch64/scfi-diag-2.s: New test.
 * gas/scfi/aarch64/scfi-diag-3.l: New test.
 * gas/scfi/aarch64/scfi-diag-3.s: New test.
 * 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-ldstnap-1.d: New test.
 * gas/scfi/aarch64/scfi-ldstnap-1.l: New test.
 * gas/scfi/aarch64/scfi-ldstnap-1.s: New test.
 * gas/scfi/aarch64/scfi-strp-1.d: New test.
 * gas/scfi/aarch64/scfi-strp-1.l: New test.
 * gas/scfi/aarch64/scfi-strp-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.
 * gas/scfi/aarch64/scfi-unsupported-1.l: New test.
 * gas/scfi/aarch64/scfi-unsupported-1.s: New test.
 * gas/scfi/aarch64/scfi-unsupported-2.l: New test.
 * gas/scfi/aarch64/scfi-unsupported-2.s: New test.

users/ibhagat/try-scfi-aarch64-v4 2024-06-30 18:39:27 UTC
gas: aarch64: testsuite: add new tests for SCFI

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

gas: aarch64: testsuite: add new tests for SCFI

[Changes in V4]
 - New testcases for FP callee-saved registers.
   scfi-callee-saved-fp-1.s uses D registers, scfi-callee-saved-fp-2.s
   uses Q registers and is run with -mbig-endian.
 - Added new ops (movk, prfm) to ginsn-misc-1. These ops are not
   relevant for SCFI correctness; this testcase merely
   ensures graceful handling of ginsn creation for such insns.
 - Fixed ginsn-ldst-1 as it included some load / store ops with D
   registers, which we now handle. Also added some insns using W and S
   registers.
 - Added a new test scfi-diag-3 where SCFI machinery reports the
   following error when it sees an SVE memory op with callee-saved
   register:
    "Error: SCFI: unhandled op 0xe5e0e000 may cause incorrect CFI"
[End of changes in V4]

[No changes in V3]

[Changes in V2]
 - new testcase scfi-cfg-4.s for the changes in cmp_scfi_state.
 - new testcase ginsn-arith-1.s for ginsn creation for various add sub insns.
 - removed redundant insns from ginsn-misc-1.s, some of those insns are
   now in ginsn-arith-1.s.
 - added more ld st opts in ginsn-ldst-1.s testcase.
[End of changes in V2]

Similar to the x86_64 testcases, some .s files contain the corresponding
CFI directives. This helps in validating the synthesized CFI by running
those tests with and without the --scfi=experimental command line
option.

GAS issues some diagnostics, enabled by default, with
--scfi=experimental. The diagnostics have been added with an intent to
help user correct inadvertent errors in their hand-written asm. An
error is issued when GAS finds that input asm is not amenable to
accurate CFI synthesis. The existing scfi-diag-*.s tests in the
gas/testsuite/gas/scfi/x86_64 directory test some SCFI diagnostics
already:

      - (#1) "Warning: SCFI: Asymetrical register restore"
      - (#2) "Error: SCFI: usage of REG_FP as scratch not supported"
      - (#3) "Error: SCFI: unsupported stack manipulation pattern"
      - (#4) "Error: untraceable control flow for func 'XXX'"

In the newly added aarch64 testsuite, further tests for additional
diagnostics have been added:
 - scfi-diag-1.s in this patch highlights an aarch64-specific diagnostic:
   (#5) "Warning: SCFI: ignored probable save/restore op with reg offset"

Additionally, some testcases are added to showcase the (currently)
unsupported patterns, e.g., scfi-unsupported-1.s
        mov x16, 4384
        sub sp, sp, x16

gas/testsuite/:
 * gas/scfi/README: Update comment to include aarch64.
 * gas/scfi/aarch64/scfi-aarch64.exp: New file.
 * gas/scfi/aarch64/ginsn-arith-1.l: New test.
 * gas/scfi/aarch64/ginsn-arith-1.s: New test.
 * gas/scfi/aarch64/ginsn-cofi-1.l: New test.
 * gas/scfi/aarch64/ginsn-cofi-1.s: New test.
 * gas/scfi/aarch64/ginsn-ldst-1.l: New test.
 * gas/scfi/aarch64/ginsn-ldst-1.s: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-1.d: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-1.l: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-1.s: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-2.d: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-2.l: New test.
 * gas/scfi/aarch64/scfi-callee-saved-fp-2.s: New test.
 * gas/scfi/aarch64/scfi-cb-1.d: New test.
 * gas/scfi/aarch64/scfi-cb-1.l: New test.
 * gas/scfi/aarch64/scfi-cb-1.s: New test.
 * gas/scfi/aarch64/scfi-cfg-1.d: New test.
 * gas/scfi/aarch64/scfi-cfg-1.l: New test.
 * gas/scfi/aarch64/scfi-cfg-1.s: New test.
 * gas/scfi/aarch64/scfi-cfg-2.d: New test.
 * gas/scfi/aarch64/scfi-cfg-2.l: New test.
 * gas/scfi/aarch64/scfi-cfg-2.s: New test.
 * gas/scfi/aarch64/scfi-cfg-3.d: New test.
 * gas/scfi/aarch64/scfi-cfg-3.l: New test.
 * gas/scfi/aarch64/scfi-cfg-3.s: New test.
 * gas/scfi/aarch64/scfi-cfg-4.l: New test.
 * gas/scfi/aarch64/scfi-cfg-4.s: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.d: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.l: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.s: New test.
 * gas/scfi/aarch64/scfi-diag-1.l: New test.
 * gas/scfi/aarch64/scfi-diag-1.s: New test.
 * gas/scfi/aarch64/scfi-diag-2.l: New test.
 * gas/scfi/aarch64/scfi-diag-2.s: New test.
 * gas/scfi/aarch64/scfi-diag-3.l: New test.
 * gas/scfi/aarch64/scfi-diag-3.s: New test.
 * 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-strp-1.d: New test.
 * gas/scfi/aarch64/scfi-strp-1.l: New test.
 * gas/scfi/aarch64/scfi-strp-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.
 * gas/scfi/aarch64/scfi-unsupported-1.l: New test.
 * gas/scfi/aarch64/scfi-unsupported-1.s: New test.

users/ibhagat/try-sframe-scfi-next 2024-06-25 17:10:06 UTC
gas: scfi: make gen_scfi_ops more readable

Author: Indu Bhagat
Author Date: 2024-06-11 00:26:46 UTC

gas: scfi: make gen_scfi_ops more readable

Replace the scattered and repeated uses of verbose expressions with
variables:
  ginsn_get_src_reg (src1) -> src1_reg
  ginsn_get_src_type (src1) -> src1_type
etc.

This hopefully makes the logic more readable. While at it, make some of
the checks more precise:
  - When getting imm value, ensure the src type is GINSN_SRC_IMM,
  - When getting reg, ensure the src type is checked too (GINSN_SRC_REG
    or GINSN_SRC_INDIRECT as appropriate).

ChangeLog:

        * gas/scfi.c (gen_scfi_ops): Add new local vars and reuse them.
 Make some conditionals more precise.

users/aburgess/try-fix-i386-tdesc-issue 2024-06-21 10:43:58 UTC
gdb/i386: fix tdesc rejection issue for targets without PTRACE_GETREGSET

Author: Andrew Burgess
Author Date: 2024-06-21 10:43:58 UTC

gdb/i386: fix tdesc rejection issue for targets without PTRACE_GETREGSET

After the x86 target description changes that I committed recently,
the first commit in the series being:

  commit 8a29222b85f28a2201db50a34ac4144f961311db
  Date: Sat Jan 27 10:40:35 2024 +0000

      gdb/gdbserver: share I386_LINUX_XSAVE_XCR0_OFFSET definition

and the last commit in the series being:

  commit 646d754d14c2fe70a492a893506a74b0463b6ae8
  Author: Andrew Burgess <aburgess@redhat.com>
  Date: Tue Jan 30 15:37:23 2024 +0000

      gdb/gdbserver: share x86/linux tdesc caching

The sourceware buildbot highlighted a regression on i386. On the GDB
side we'd see this:

  Remote debugging using :54321
  warning: Architecture rejected target-supplied description
  Remote connection closed
  (gdb)

while on the gdbserver side we'd see this:

  $ ./gdbserver/gdbserver --once :54321 ~/empty
  Process /srv/aburgess/empty created; pid = 31406
  Listening on port 54321
  Remote debugging from host ::1, port 39488
  ../../src/gdbserver/regcache.cc:272: A problem internal to GDBserver has been detected.
  Unknown register st0 requested
  Aborted (core dumped)

When I tried to reproduce this regression on my local i386 VM the
issue would not reproduce.

I eventually tracked the problem down to x86_linux_tdesc_for_tid in
gdb/nat/x86-linux-tdesc.c. In this function we have this line:

  /* Check if PTRACE_GETREGSET works. */
  if (ptrace (PTRACE_GETREGSET, tid,
              (unsigned int) NT_X86_XSTATE, &iov) < 0)
    {
      ... handle failure ...
    }
  else
    {
      ... handle success ...
    }

The problem is that on my VM the PTRACE_GETREGSET feature is
supported, while on sourceware's buildbot machine this feature is not
supported.

I did a quick search and it seems like the 'xsave' feature in
/proc/cpuinfo might be the indicator for whether PTRACE_GETREGSET is
supported or not, and indeed my machine has the 'xsave' feature while
the sourceware machine does not.

The point of divergence then is this ptrace call, on my machine the
call succeeds and we extract the xcr0 value from the iov vector, while
on the sourceware machine the ptrace call fails and we use a default
xcr0 value of 0.

This xcr0 value is then passed to i386_linux_read_description at the
end of x86_linux_tdesc_for_tid.

In gdb/arch/i386-linux-tdesc.c we find i386_linux_read_description
which does some caching but calls i386_create_target_description to
actually create the target descriptions when needed. The xcr0 value
is masked to only the bits that are interesting, but given a value of
0 we'll just pass 0 through to i386_create_target_description.

In gdb/arch/i386.c we find i386_create_target_description which checks
the xcr0 bits and builds the target description. What we can see is
that if no bits are set in the xcr0 value then no features will be
added to the created target description. This featureless target
description is then transmitted back to GDB, which is then rejected
due to lack of essential core registers.

So, how did things work prior to the above commit series? There are
three places of interest, on the GDB side there is
x86_linux_nat_target::read_description and
i386_linux_core_read_description. Then on the gdbserver side there is
x86_linux_read_description.

All of these locations have a call to i386_linux_read_description
followed by a check if the return value was nullptr. If we do get
back nullptr then we perform another call to
i386_linux_read_description with a default xcr0 value.

Looking in i386_linux_read_description we see a specific check for
xcr0 being 0 in which case we return nullptr.

And so, prior to the above series, if xcr0 was 0 due to
PTRACE_GETREGSET being unavailable we'd use a default xcr0 value.

After the above series this is no longer the case, the 'xcr0 == 0'
check has been removed from i386_linux_read_description and the
calling code is streamlined to remove the use of default xcr0 values.

The fix I propose here is to setup the default xcr0 value at the point
where we find that PTRACE_GETREGSET is unavailable. The default value
used is X86_XSTATE_SSE_MASK. This is the default used in
x86_linux_nat_target::read_description (for GDB) and in
x86_linux_read_description (for gdbserver). The above commit series
already fixed i386_linux_core_read_description to ensure that the
correct default xcr0 value was used, this case is a little special in
that it uses different defaults depending on which sections are
present in the core file, so that case always needed to be handled
differently.

The choice of X86_XSTATE_SSE_MASK corresponds to the default used for
i386 before the above series was committed. This mask includes the
X87 and SSE bits only, neither of these bits are checked for on amd64
or x32, so this default doesn't change the behaviour on these targets.

By setting the default xcr0 value at this early stage we ensure that
the cached xcr0 value on the gdbserver side is correct. This is
critical as this cached xcr0 value is passed through to the in process
agent (IPA). If we leave the cached xcr0 value as 0 and apply the
defaults later in the series we also have to encode the knowledge of
the default into the IPA, this just means we have the default encoded
in multiple locations, which seems like a bad idea. The approach used
in this patch means the default is present in just one location.

This commit should fix the i386 regressions seen on the sourceware
buildbot.

users/ibhagat/try-scfi-aarch64-v2 2024-06-01 00:07:47 UTC
gas: aarch64: testsuite: add new tests for SCFI

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

gas: aarch64: testsuite: add new tests for SCFI

[Changes from V1]
 - new testcase scfi-cfg-4.s for the changes in cmp_scfi_state.
 - new testcase ginsn-arith-1.s for ginsn creation for various add sub insns.
 - removed redundant insns from ginsn-misc-1.s, some of those insns are
   now in ginsn-arith-1.s.
[End of changes from V1]

Similar to the x86_64 testcases, some .s files contain the corresponding
CFI directives. This helps in validating the synthesized CFI by running
those tests with and without the --scfi=experimental command line
option.

GAS issues some diagnostics, enabled by default, with
--scfi=experimental. The diagnostics have been added with an intent to
help user correct inadvertent errors in their hand-written asm. An
error is issued when GAS finds that input asm is not amenable to
accurate CFI synthesis. The existing scfi-diag-*.s tests in the
gas/testsuite/gas/scfi/x86_64 directory test some SCFI diagnostics
already:

      - (#1) "Warning: SCFI: Asymetrical register restore"
      - (#2) "Error: SCFI: usage of REG_FP as scratch not supported"
      - (#3) "Error: SCFI: unsupported stack manipulation pattern"
      - (#4) "Error: untraceable control flow for func 'XXX'"

In the newly added aarch64 testsuite, further tests for additional
diagnostics have been added:
 - scfi-diag-1.s in this patch highlights an aarch64-specific diagnostic:
   (#5) "Warning: SCFI: ignored probable save/restore op with reg offset"

Additionally, some testcases are added to showcase the (currently)
unsupported patterns, e.g., scfi-unsupported-1.s
        mov x16, 4384
        sub sp, sp, x16

gas/testsuite/:
 * gas/scfi/README: Update comment to include aarch64.
 * gas/scfi/aarch64/scfi-aarch64.exp: New file.
 * gas/scfi/aarch64/ginsn-arith-1.l: New test.
 * gas/scfi/aarch64/ginsn-arith-1.s: New test.
 * gas/scfi/aarch64/ginsn-cofi-1.l: New test.
 * gas/scfi/aarch64/ginsn-cofi-1.s: New test.
 * gas/scfi/aarch64/ginsn-ldst-1.l: New test.
 * gas/scfi/aarch64/ginsn-ldst-1.s: New test.
 * gas/scfi/aarch64/scfi-cb-1.d: New test.
 * gas/scfi/aarch64/scfi-cb-1.l: New test.
 * gas/scfi/aarch64/scfi-cb-1.s: New test.
 * gas/scfi/aarch64/scfi-cfg-1.d: New test.
 * gas/scfi/aarch64/scfi-cfg-1.l: New test.
 * gas/scfi/aarch64/scfi-cfg-1.s: New test.
 * gas/scfi/aarch64/scfi-cfg-2.d: New test.
 * gas/scfi/aarch64/scfi-cfg-2.l: New test.
 * gas/scfi/aarch64/scfi-cfg-2.s: New test.
 * gas/scfi/aarch64/scfi-cfg-3.d: New test.
 * gas/scfi/aarch64/scfi-cfg-3.l: New test.
 * gas/scfi/aarch64/scfi-cfg-3.s: New test.
 * gas/scfi/aarch64/scfi-cfg-4.l: New test.
 * gas/scfi/aarch64/scfi-cfg-4.s: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.d: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.l: New test.
 * gas/scfi/aarch64/scfi-cond-br-1.s: New test.
 * gas/scfi/aarch64/scfi-diag-1.l: New test.
 * gas/scfi/aarch64/scfi-diag-1.s: New test.
 * gas/scfi/aarch64/scfi-diag-2.l: New test.
 * gas/scfi/aarch64/scfi-diag-2.s: New test.
 * 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-strp-1.d: New test.
 * gas/scfi/aarch64/scfi-strp-1.l: New test.
 * gas/scfi/aarch64/scfi-strp-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.
 * gas/scfi/aarch64/scfi-unsupported-1.l: New test.
 * gas/scfi/aarch64/scfi-unsupported-1.s: New test.

users/simark/try-remove-unused-includes-tui 2024-05-30 20:25:23 UTC
gdb: cleanup includes in tui/

Author: Simon Marchi
Author Date: 2024-05-30 20:25:23 UTC

gdb: cleanup includes in tui/

Remove includes reported as unused by clangd. Then, add any includes
necessary to get rid of errors (includes possibly relying on previous
includes)..

I didn't remove the includes of gdb-safe-ctypes.h, because it appears to
do some some preprocessor magic. I'm afraid that removing these
includes could change the behavior unintentionally.

Change-Id: I4c5b652355c3bbce022fe0d447a72dc4e1d17d34

gdb-14-branch 2024-05-26 00:00:38 UTC
Automatic date update in version.in

Author: GDB Administrator
Author Date: 2024-05-26 00:00:38 UTC

Automatic date update in version.in

users/palves/windows-non-stop 2024-05-17 19:21:48 UTC
Fix process-dies-after-detach

Author: Pedro Alves
Author Date: 2024-05-17 19:09:18 UTC

Fix process-dies-after-detach

 - Need to flush pending kernel-side events

 - I realized that while we're detaching, we want to pass exceptions
   down to the inferior with DBG_EXCEPTION_NOT_HANDLED, instead of
   losing them. I ended up reusing a bit of code from the Linux
   target.

Change-Id: Ifaa96b4a41bb83d868079af4d47633715c0e1940

users/jremus/sframe-stacktracer-testsuite-s390x 2024-05-16 12:01:59 UTC
s390: Initial support for s390x

Author: Jens Remus
Author Date: 2024-05-16 11:55:44 UTC

s390: Initial support for s390x

Signed-off-by: Jens Remus <jremus@linux.ibm.com>

users/ibhagat/sframe-stacktracer-testsuite 2024-04-30 22:09:37 UTC
testsuite: libsframest: more renames

Author: Indu Bhagat
Author Date: 2024-04-29 22:57:21 UTC

testsuite: libsframest: more renames

and fixing some formatting issues.

ChangeLog:
 * include/sframe-stacktrace-api.h
 * sframe-stacktrace.c
 * sframe-state.c
 * sframe-state.h

users/simark/try-remove-vla 2024-04-23 20:52:54 UTC
gdb, gdbserver, gdbsupport: remove -Wno-vla-cxx-extension

Author: Simon Marchi
Author Date: 2024-04-23 14:43:27 UTC

gdb, gdbserver, gdbsupport: remove -Wno-vla-cxx-extension

Now that all known uses of VLAs within GDB are removed, remove the
`-Wno-vla-cxx-extension` (which was used to silence clang warnings) and
add `-Wvla`, such that any use of a VLA will trigger a warning.

Change-Id: I69a8d7f93f973743165b0ba46f9c2ea8adb89025

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/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/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

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/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

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.

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)

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.

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