]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
4 months agoPrevent illegal memory access when checking relocs in a corrupt ELF binary.
Nick Clifton [Wed, 5 Feb 2025 14:31:10 +0000 (14:31 +0000)] 
Prevent illegal memory access when checking relocs in a corrupt ELF binary.

PR 32641

4 months agoaarch64: Add leading zeros to opcodes in aarch64-tbl.h
Yury Khrustalev [Mon, 3 Feb 2025 09:39:41 +0000 (09:39 +0000)] 
aarch64: Add leading zeros to opcodes in aarch64-tbl.h

Opcodes and bitmasks are 32-bit numbers and omitting leading
zeros might be interpreted as if they are 28-bit.

4 months agoaarch64: Clean up whitespace in aarch64-tbl.h
Yury Khrustalev [Mon, 3 Feb 2025 09:30:50 +0000 (09:30 +0000)] 
aarch64: Clean up whitespace in aarch64-tbl.h

Clean up whitespace for conforming to GNU coding standards

4 months agoPrevent an abort in the bfd linker when attempting to generate dynamic relocs for...
Nick Clifton [Wed, 5 Feb 2025 13:26:51 +0000 (13:26 +0000)] 
Prevent an abort in the bfd linker when attempting to generate dynamic relocs for a corrupt input file.

PR 32638

4 months agogdb: restrict configure error with all targets and 64 bit bfd to mips
Guinevere Larsen [Tue, 28 Jan 2025 19:09:51 +0000 (16:09 -0300)] 
gdb: restrict configure error with all targets and 64 bit bfd to mips

The recent commit b601c58034ed755fb765fc13782b6876bffd25d4 causes the
gdb configure to fail if --enable-targets=all was requested, but 64 bit
bfd was not enabled. This was due to a build failure first reported
against mips, and that I also encountered building on a 32 bit mips
system, but that looked like a general failure.

Further examination showed that this is, in fact, mips-specific (or at
least, not completely generic) as other targets like debian-i386 and
32-bit arm could build all targets just fine.

This commit restricts the new error to only trigger in mips hosts.

Approved-By: Andrew Burgess <aburgess@redhat.com>
4 months agoPrevent illegal memory access when indexing into the sym_hashes array of the elf...
Nick Clifton [Wed, 5 Feb 2025 11:15:11 +0000 (11:15 +0000)] 
Prevent illegal memory access when indexing into the sym_hashes array of the elf bfd cookie structure.

PR 32636

4 months agogas MMIX: Use more of is_... framework like is_whitespace and is_end_of_stmt
Jan Beulich [Mon, 3 Feb 2025 06:52:19 +0000 (07:52 +0100)] 
gas MMIX: Use more of is_... framework like is_whitespace and is_end_of_stmt

Convert uses of ISSPACE() and testing for specific characters into
calls to is_whitespace and is_end_of_stmt.  While doing that, also
remove some redundant tests, like ';' together with is_end_of_line[]
and is_whitespace and !is_end_of_line.

Note the invalid casts being fixed as part of moving to is_... macros;
there were (unsigned int) where there should have been (unsigned char)
applied on char as index to is_end_of_line[].

Beware that the input language changes slightly: some constructs with
whitespace characters other than space and TAB are now invalid.

4 months agoAutomatic date update in version.in
GDB Administrator [Wed, 5 Feb 2025 00:00:15 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 months ago[gdb/tui] Clean up asserts in tui_source_window_base::refresh_window
Tom de Vries [Tue, 4 Feb 2025 21:11:13 +0000 (22:11 +0100)] 
[gdb/tui] Clean up asserts in tui_source_window_base::refresh_window

Commit 1c525b0e037 ("[gdb/tui] Fix assert in
tui_source_window_base::refresh_window") added an early return in
tui_source_window_base::refresh_window.

Assert after the early return that "m_pad != nullptr", and clean up the
following asserts that allow for m_pad == nullptr.

Tested on x86_64-linux.

Reported-By: Andrew Burgess <aburgess@redhat.com>
Co-Authored-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
4 months ago[pre-commit] Require pre-commit version 3.2.0
Tom de Vries [Tue, 4 Feb 2025 21:07:22 +0000 (22:07 +0100)] 
[pre-commit] Require pre-commit version 3.2.0

Recent commit 0bd340d6704 ("pre-commit autoupdate") bumped the isort version
to 6.0.0.

Subsequently, I started running into:
...
$ SKIP=flake8,isort pre-commit run
An error has occurred: InvalidManifestError:
==> File /home/vries/.cache/pre-commit/repommstqefj/.pre-commit-hooks.yaml
==> At Hook(id='isort')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, \
  post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, \
  push but got: 'pre-commit'
Check the log at /home/vries/.cache/pre-commit/pre-commit.log
...

I found a similar PR [1], that explains that using pre-commit as a stage (as
isort 6.0.0 does) is supported starting pre-commit 3.2.0.

Add minimum_pre_commit_version 3.2.0 in .pre-commit-config.yaml, as suggested
in the PR.

After adding this, I get a more helpful message:
...
$ SKIP=flake8,isort pre-commit run
An error has occurred: InvalidConfigError:
==> File .pre-commit-config.yaml
==> At Config()
==> At key: minimum_pre_commit_version
=====> pre-commit version 3.2.0 is required but version 2.17.0 is installed. \
  Perhaps run `pip install --upgrade pre-commit`.
Check the log at /home/vries/.cache/pre-commit/pre-commit.log
...
and after doing so which upgrades pre-commit to version 4.1.0, as well as
re-installing pre-commit using:
...
$ pre-commit uninstall
$ pre-commit install
...
I have a functional setup again.

Interestingly, since pre-commit 4.1.0 runs in a python 3.11 environment, I no
longer need to skip flake8 and isort, as I needed to previously when the
system python 3.6 was used.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
[1] https://github.com/psf/black/issues/4065

4 months agopre-commit: run flake8 on more Python files
Simon Marchi [Thu, 5 Dec 2024 17:41:21 +0000 (12:41 -0500)] 
pre-commit: run flake8 on more Python files

pre-commit currently runs flake8 only on `gdb/python/**/*.py`.  There
are more files we can run it on, without running it on all the testsuite
files.  Add:

 - gdb/gdb-gdb.py.in
 - gdb/*.py
 - gdb/testsuite/*.py

Fix the new errors that popped up:

    gdb/copyright.py:29:21: W605 invalid escape sequence '\*'
    gdb/copyright.py:29:29: W605 invalid escape sequence '\*'
    gdb/copyright.py:29:38: W605 invalid escape sequence '\*'
    gdb/copyright.py:29:46: W605 invalid escape sequence '\*'
    gdb/copyright.py:34:1: F401 'datetime' imported but unused
    gdb/testsuite/analyze-racy-logs.py:150:9: E722 do not use bare 'except'

Change-Id: Ia864c22d4f170d4e18ce3beb06a86c49966654b2
Approved-By: Tom Tromey <tom@tromey.com>
4 months agoReorder gnatmake arguments in inline-section-gc.exp
Tom Tromey [Mon, 3 Feb 2025 19:12:29 +0000 (12:12 -0700)] 
Reorder gnatmake arguments in inline-section-gc.exp

inline-section-gc.exp ends up passing "-lm" to gnatmake as an "marg"
-- meaning gnatmake should process it itself.  However, the gnat-llvm
gnatmake does not know what to do with this, so the test fails.

This patch rearranges the arguments so that the (implicit) trailing
-lm ends up being passed through to the linker.

4 months agodoc: sframe: Clarify FDE/FRE function/range start address fields
Jens Remus [Tue, 4 Feb 2025 14:13:24 +0000 (15:13 +0100)] 
doc: sframe: Clarify FDE/FRE function/range start address fields

The function start address in a SFrame FDE (sfde_func_start_address)
is encoded as a signed offset to the function start address from the
SFrame section.

The PC range start address in a SFrame FRE (sfre_start_address) is
encoded as an unsigned offset to the range from the function start
address.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
4 months agogas: Skip SFrame FDE if .cfi_val_offset specifies non-default offset
Jens Remus [Tue, 4 Feb 2025 14:13:24 +0000 (15:13 +0100)] 
gas: Skip SFrame FDE if .cfi_val_offset specifies non-default offset

Unwinding of the stack pointer (SP) is performed using the assumed
default rule ".cfi_val_offset <SP-reg>, 0", so that SP unwinds as:

  SP = CFA

Warn if the CFI directive .cfi_val_offset is encountered for the
SP register with a different offset.

gas/
* gen-sframe.c (sframe_xlate_do_val_offset): Skip SFrame FDE
if non-default SP value offset.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
4 months agogas: sframe: Use appropriate struct cfi_insn_data union members
Jens Remus [Tue, 4 Feb 2025 14:13:24 +0000 (15:13 +0100)] 
gas: sframe: Use appropriate struct cfi_insn_data union members

Use the appropriate struct cfi_insn_data union members to access
fields when generating SFrame information from CFI directives.

gas/
* gen-sframe.c (sframe_xlate_do_def_cfa, sframe_xlate_do_offset,
sframe_xlate_do_val_offset): Access ri fields, as .cfi_def_cfa,
.cfi_offset, and .cfi_val_offset define a register and offset
value.
* (sframe_xlate_do_def_cfa_register): Access r field, as
.cfi_def_cfa_register defines a register.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
4 months agogdb/python: add void_type () method to gdb.Architecture object
Jan Vrany [Tue, 4 Feb 2025 13:56:49 +0000 (13:56 +0000)] 
gdb/python: add void_type () method to gdb.Architecture object

This commit adds a new method to Python architecture objects that
returns a void type for that architecture.

This will be useful later to create types for function symbols created
using Python extension code.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Andrew Burgess <aburgess@redhat.com>
4 months agogdb/python: add domain property to gdb.Symbol
Jan Vrany [Tue, 4 Feb 2025 13:56:49 +0000 (13:56 +0000)] 
gdb/python: add domain property to gdb.Symbol

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Andrew Burgess <aburgess@redhat.com>
4 months agogdb/python: add subblocks property to gdb.Block
Jan Vrany [Tue, 4 Feb 2025 13:56:49 +0000 (13:56 +0000)] 
gdb/python: add subblocks property to gdb.Block

This commit adds new propery "subblocks" to gdb.Block objects. This
allows Python to traverse block tree starting with global block.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Andrew Burgess <aburgess@redhat.com>
4 months ago[gdb/testsuite] Fix gdb.ada/big_packed_array.exp on s390x-linux
Tom de Vries [Tue, 4 Feb 2025 13:06:20 +0000 (14:06 +0100)] 
[gdb/testsuite] Fix gdb.ada/big_packed_array.exp on s390x-linux

When running test-case gdb.ada/big_packed_array.exp on s390x-linux, I run
into:
...
(gdb) print bad^M
$2 = (0 => 0 <repeats 24 times>, 1)^M
(gdb) FAIL: gdb.ada/big_packed_array.exp: scenario=minimal: print bad
...

This is with gcc 7.5.0, and this xfail should trigger:
...
           if { $have_xfail && [string is integer $last] \
                   && [expr ($last & 0xf) == 0] } {
                # gcc/101643
                setup_xfail *-*-*
            }
...
but it doesn't because $last is '1'.

Fix this by using 0xf0 as mask for big endian.

Tested on s390x-linux.

4 months ago[gdb/testsuite] Fix gdb.ada/convvar_comp.exp on s390x-linux
Tom de Vries [Tue, 4 Feb 2025 13:06:20 +0000 (14:06 +0100)] 
[gdb/testsuite] Fix gdb.ada/convvar_comp.exp on s390x-linux

When running test-case gdb.ada/convvar_comp.exp on s390x-linux, I get:
...
(gdb) run ^M
Starting program: pb16_063 ^M
^M
Breakpoint 1, pck.break_me (item=...) at pck.adb:17^M
17        function Break_Me (Item : T) return Boolean is^M
(gdb) print item.started^M
Cannot access memory at address 0x0^M
(gdb) FAIL: gdb.ada/convvar_comp.exp: print item.started
...

This happens as follows.

The parameter item is available in (DW_OP_fbreg: -168):
...
 <2><912>: Abbrev Number: 18 (DW_TAG_formal_parameter)
    <913>   DW_AT_name        : (indirect string, offset: 0x14ca): item
    <919>   DW_AT_type        : <0x929>
    <91d>   DW_AT_location    : 3 byte block: 91 d8 7e  (DW_OP_fbreg: -168)
...
and according to the rules of -O0, it's considered to be available after the
prologue, which looks like this:
...
0000000001002998 <pck__break_me>:
 1002998:       b3 c1 00 2b             ldgr    %f2,%r11
 100299c:       b3 c1 00 0f             ldgr    %f0,%r15
 10029a0:       e3 f0 ff 58 ff 71       lay     %r15,-168(%r15)
 10029a6:       b9 04 00 bf             lgr     %r11,%r15
 10029aa:       e3 20 b0 a0 00 24       stg     %r2,160(%r11)
...

To detect the prologue, gdb checks the line info, which looks like this:
...
pck.adb:
File name                Line number    Starting address    View    Stmt
pck.adb                           17           0x1002998               x
pck.adb                           17           0x1002998       1       x
pck.adb                           19           0x10029b0               x
pck.adb                           20           0x10029b8               x
pck.adb                            -           0x10029c6
...
and gdb concludes that it's an empty prologue, so we stop at 0x1002998 and
try to print parameter item, which is not available yet.

For more details, see this comment in skip_prologue_using_sal:
...
  /* For languages other than assembly, treat two consecutive line
     entries at the same address as a zero-instruction prologue.
...

The same thing happens on x86_64-linux, but it causes no problem there,
because amd64_skip_prologue decides not to trust the result:
...
      struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr);

      /* LLVM backend (Clang/Flang) always emits a line note before the
 prologue and another one after.  We trust clang and newer Intel
 compilers to emit usable line notes.  */
      if (post_prologue_pc
  && (cust != NULL
      && cust->producer () != nullptr
      && (producer_is_llvm (cust->producer ())
      || producer_is_icc_ge_19 (cust->producer ()))))
return std::max (start_pc, post_prologue_pc);
...
because the producer is GCC.

Work around this by setting a breakpoint on the first statement of
pck.break_me instead.

Tested on s390x-linux.

4 months ago[gdb/testsuite] Use c++ flag in c++ test-cases
Tom de Vries [Tue, 4 Feb 2025 12:53:20 +0000 (13:53 +0100)] 
[gdb/testsuite] Use c++ flag in c++ test-cases

In some cases, test-cases use c++, but don't add "c++" to the compilation
flags.  This can cause problems with some compilers.

Fix this in some test-cases.

Approved-By: Tom Tromey <tom@tromey.com>
PR testsuite/30380
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30380

4 months agoUpdate with latest changes to src-release.sh
Nick Clifton [Tue, 4 Feb 2025 11:50:32 +0000 (11:50 +0000)] 
Update with latest changes to src-release.sh

4 months agoRename 'binutils' to 'binutils_with_gold'. Rename 'bin_no_gold' to 'binutils'. ...
Nick Clifton [Tue, 4 Feb 2025 11:50:02 +0000 (11:50 +0000)] 
Rename 'binutils' to 'binutils_with_gold'.  Rename 'bin_no_gold' to 'binutils'.  Add 'gold'

4 months ago[gdb/testsuite] Fix gdb.base/list-dot-nodebug.exp on openSUSE
Tom de Vries [Tue, 4 Feb 2025 09:34:39 +0000 (10:34 +0100)] 
[gdb/testsuite] Fix gdb.base/list-dot-nodebug.exp on openSUSE

On openSUSE Leap 15.6 with test-case gdb.base/list-dot-nodebug.exp I run into:
...
(gdb) list .^M
warning: 1      ../sysdeps/x86_64/crtn.S: No such file or directory^M
(gdb) FAIL: $exp: debug=none: print before start
...

The intent of the debug=none case is to generate an executable with no debug
info.  However, we have quite a few CUs with debug info:
...
$ readelf -wi outputs/gdb.base/list-dot-nodebug/list-dot-nodebug-none \
    | egrep -c " @ "
431
...

This is because this code:
...
  gdb_gnu_strip_debug $executable no-debuglink
...
uses $executable, and the variable is set here:
...
set executable ${testfile}-none
...
which sets it to "list-dot-nodebug-none" and consequently
gdb_gnu_strip_debug cannot find it.

Fix this by using "[standard_output_file $executable]" instead.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
PR testsuite/31721
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31721

4 months ago[gdb/tui] Remove stale title when showing "No Source Available"
Tom de Vries [Tue, 4 Feb 2025 09:21:28 +0000 (10:21 +0100)] 
[gdb/tui] Remove stale title when showing "No Source Available"

When running test-case gdb.tui/main.exp, the last command discards the
executable file and symbol table:
...
(gdb) file
No executable file now.
Discard symbol table from `main'? (y or n) [answered Y; input not from terminal]
No symbol file now.
(gdb)
...
and we end up with this source window:
...
+-tui-layout.c----------------------------------------------------------------+
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                           [ No Source Available ]                           |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
+-----------------------------------------------------------------------------+
...

The source window title shouldn't be showing tui-layout.c.  It's the source
file containing function main for the executable that was just discarded.

Fix this by clearing the title in tui_source_window::erase_source_content.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
4 months agoelf: Store __ehdr_start hash in elf_link_hash_table
H.J. Lu [Mon, 3 Feb 2025 03:30:50 +0000 (11:30 +0800)] 
elf: Store __ehdr_start hash in elf_link_hash_table

Since

commit 97da0e2677c4a38df2406576428ec27d1da26e7c
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Jan 12 23:42:23 2022 +1030

    tweak __ehdr_start visibility and flags for check_relocs

creates __ehdr_start hash in lang_symbol_tweaks, store __ehdr_start hash
in elf_link_hash_table so that we just need to lookup it up only once.

bfd/

* elf-bfd.h (elf_link_hash_table): Add hehdr_start.
* elf.c (assign_file_positions_for_load_sections): Use
hehdr_start.

ld/

* ldelf.c (ldelf_before_allocation): Use hehdr_start for
__ehdr_start hash.
* ldlang.c (lang_symbol_tweaks): Store hehdr_start hash in
hehdr_start.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
4 months agoelflink.c: Replace bed->dynamic_sec_flags with flags
H.J. Lu [Mon, 3 Feb 2025 04:01:28 +0000 (12:01 +0800)] 
elflink.c: Replace bed->dynamic_sec_flags with flags

Since at the function entry, there is

  flags = bed->dynamic_sec_flags;

we can replace bed->dynamic_sec_flags with flags.

* elflink.c (_bfd_elf_create_got_section): Replace
bed->dynamic_sec_flags with flags.
(_bfd_elf_link_create_dynamic_sections): Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
4 months agopre-commit autoupdate
Simon Marchi [Tue, 4 Feb 2025 01:55:04 +0000 (20:55 -0500)] 
pre-commit autoupdate

Run `pre-commit autoupdate`.

This picks up a fresh Black version from 2025, and with it comes a small
but welcome formatting change.

There is a new version of isort as well, but no formatting change there.

Change-Id: Ie654a9c14c3a4096893011082668efb57c166fa4

4 months agoAutomatic date update in version.in
GDB Administrator [Tue, 4 Feb 2025 00:00:14 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 months ago[gdb/syscalls] Sync with strace v6.13
Tom de Vries [Mon, 3 Feb 2025 14:01:39 +0000 (15:01 +0100)] 
[gdb/syscalls] Sync with strace v6.13

After syncing with strace v6.13 using:
...
$ update-linux-defaults.sh ~/upstream/strace.git
...
we have a few new entries in linux-defaults.xml.in:
...
  <syscall name="getxattrat" groups="descriptor,file"/>
  <syscall name="listxattrat" groups="descriptor,file"/>
  <syscall name="removexattrat" groups="descriptor,file"/>
  <syscall name="setxattrat" groups="descriptor,file"/>
...

Regenerate most *-linux.xml.in files using:
...
$ ./update-linux-from-src.sh ~/upstream/linux-stable.git
...
updating the copyright years, and do so manually for the remaining two.

Then regenerate *-linux.xml using make, propagating the groups changes and
copyright years.

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
4 months agoZ8k: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:29:40 +0000 (12:29 +0100)] 
Z8k: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). At the same time use is_end_of_stmt() instead of an
open-coded check in adjacent code.

4 months agoZ80: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:29:29 +0000 (12:29 +0100)] 
Z80: use is_whitespace()

Replace an open-coded check and convert ISSPACE() uses.

4 months agoXtensa: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:29:10 +0000 (12:29 +0100)] 
Xtensa: use is_whitespace()

Convert an open-coded check.

4 months agoxgate: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:28:58 +0000 (12:28 +0100)] 
xgate: use is_whitespace()

Convert an open-coded check.

4 months agox86: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:28:46 +0000 (12:28 +0100)] 
x86: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agowasm32: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:28:22 +0000 (12:28 +0100)] 
wasm32: use is_whitespace()

Convert an open-coded check.

4 months agoVisium: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:26:00 +0000 (12:26 +0100)] 
Visium: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert an open-coded check.

4 months agoVAX: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:25:50 +0000 (12:25 +0100)] 
VAX: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agov850: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:25:41 +0000 (12:25 +0100)] 
v850: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks as well as ISSPACE()
uses. At the same time use is_end_of_stmt() instead of a kind-of-open-
coded check in adjacent code.

4 months agoC6x: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:25:28 +0000 (12:25 +0100)] 
C6x: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert an ISSPACE() use. At the same time use
is_end_of_stmt() instead of open-coded checks in adjacent code.

4 months agoC54x: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:25:10 +0000 (12:25 +0100)] 
C54x: use is_whitespace()

Convert ISSPACE() uses. At the same time use is_end_of_stmt() instead
of open-coded checks in adjacent code. The function also needs using in
next_line_shows_parallel().

4 months agoC4x: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:25:01 +0000 (12:25 +0100)] 
C4x: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). At the same time use is_end_of_stmt() instead of
kind-of-open-coded checks in adjacent code.

4 months agoC30: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:24:48 +0000 (12:24 +0100)] 
C30: use is_whitespace()

Convert an open-coded check.

4 months agospu: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:22:33 +0000 (12:22 +0100)] 
spu: use is_whitespace()

Convert ISSPACE() uses. At the same time use is_end_of_stmt() instead
of a kind-of-open-coded check in adjacent code.

4 months agoSparc: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:22:23 +0000 (12:22 +0100)] 
Sparc: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agoSH: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:22:10 +0000 (12:22 +0100)] 
SH: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks as well as an
ISSPACE() use. At the same time use is_end_of_stmt() instead of
(kind-of-)open-coded checks in adjacent code.

4 months agoScore: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:21:46 +0000 (12:21 +0100)] 
Score: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agoS/390: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:21:29 +0000 (12:21 +0100)] 
S/390: use is_whitespace()

Convert ISSPACE() uses. At the same time use is_end_of_stmt() instead
of kind-of-open-coded checks in adjacent code.

4 months agos12z: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:21:08 +0000 (12:21 +0100)] 
s12z: use is_whitespace()

Convert open-coded checks. At the same time use is_end_of_stmt() instead
of open-coded checks in adjacent code. This then also fixes the prior
use of a wrong cast for an array index: Plain char may, after all, be
signed.

4 months agorx: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:19:26 +0000 (12:19 +0100)] 
rx: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks as well as ISSPACE()
uses. At the same time use is_end_of_stmt() instead of an open-coded
check in adjacent code.

4 months agorl78: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:19:17 +0000 (12:19 +0100)] 
rl78: use is_whitespace()

Replace open-coded checks and convert ISSPACE() uses. At the same time
use is_end_of_stmt() instead of an open-coded check in adjacent code.

4 months agoRISC-V: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:19:05 +0000 (12:19 +0100)] 
RISC-V: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Switch places already checking for tabs to use the
macro, too.

4 months agopru: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:18:53 +0000 (12:18 +0100)] 
pru: use is_whitespace()

Convert open-coded checks as well as an ISSPACE() use.

4 months agoPPC: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:18:34 +0000 (12:18 +0100)] 
PPC: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also switch ISSPACE() uses over. At the same time
use is_end_of_stmt() instead of an open-coded nul char check.

4 months agoPicoJava: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:18:20 +0000 (12:18 +0100)] 
PicoJava: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert ISSPACE(). At the same time use
is_end_of_stmt() instead of an open-coded check in adjacent code.

4 months agoPDP11: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:18:07 +0000 (12:18 +0100)] 
PDP11: use is_whitespace()

Convert open-coded checks.

4 months agoNS32k: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:16:01 +0000 (12:16 +0100)] 
NS32k: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agonds32: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:15:48 +0000 (12:15 +0100)] 
nds32: use is_whitespace()

Convert ISSPACE() uses.

4 months agomsp430: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:15:35 +0000 (12:15 +0100)] 
msp430: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert ISSPACE() uses. At the same time use
is_end_of_stmt() instead of open-coded checking in code needing touching
anyway.

4 months agoMoxie: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:15:21 +0000 (12:15 +0100)] 
Moxie: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert ISSPACE() uses. At the same time use
is_end_of_stmt() instead of an open-coded check in adjacent code. While
at it also drop a redundant whitespace skipping loop.

4 months agomn10300: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:15:07 +0000 (12:15 +0100)] 
mn10300: use is_whitespace()

Convert open-coded checks as well as ISSPACE() uses. At the same time
use is_end_of_stmt() instead of kind-of-open-coded checks in adjacent
code.

4 months agomn10200: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:14:56 +0000 (12:14 +0100)] 
mn10200: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks as well as ISSPACE()
uses. At the same time use is_end_of_stmt() instead of kind-of-open-
coded checks in adjacent code.

4 months agoMIPS: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:07:21 +0000 (12:07 +0100)] 
MIPS: use is_whitespace()

... for consistency of recognition of what is deemed whitespace.

At the same time use is_end_of_stmt() instead of an open-coded nul char
check, and check for statement end in the first place in
parse_relocation().

4 months agoMicroBlaze: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:07:09 +0000 (12:07 +0100)] 
MicroBlaze: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert ISSPACE() uses. At the same time use
is_end_of_stmt() instead of an open-coded check in adjacent code.

4 months agometag: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:06:57 +0000 (12:06 +0100)] 
metag: use is_whitespace()

Replace the custom is_whitespace_char().

4 months agoM*Core: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:06:43 +0000 (12:06 +0100)] 
M*Core: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert ISSPACE() uses. At the same time use
is_end_of_stmt() instead of an open-coded check in adjacent code.

4 months agoM68k: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:06:34 +0000 (12:06 +0100)] 
M68k: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks where tabs were
already included. At the same time use is_end_of_stmt() instead of open-
coded checks in adjacent code.

4 months agoM68HC1x: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:06:21 +0000 (12:06 +0100)] 
M68HC1x: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks where tabs were
already included. At the same time use is_end_of_stmt() instead of an
open-coded check in adjacent code.

4 months agom32r: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:06:06 +0000 (12:06 +0100)] 
m32r: use is_whitespace()

Convert a lonely ISSPACE().

4 months agom32c: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:05:55 +0000 (12:05 +0100)] 
m32c: use is_whitespace()

Convert open-coded checks as well as the sole ISBLANK() use throughout
the gas/ tree.

4 months agoLoongArch: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:05:33 +0000 (12:05 +0100)] 
LoongArch: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agokvx: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:03:07 +0000 (12:03 +0100)] 
kvx: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks where tabs were
already included. At the same time use is_end_of_stmt() instead of open-
coded checks in adjacent code.

4 months agoHP-PA: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:02:50 +0000 (12:02 +0100)] 
HP-PA: use is_whitespace()

Convert open-coded checks. At the same time use is_end_of_stmt() instead
of an open-coded check in adjacent code.

4 months agoH8/300: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:02:38 +0000 (12:02 +0100)] 
H8/300: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). At the same time use is_end_of_stmt() instead of an
open-coded check in adjacent code.

4 months agoft32: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:02:09 +0000 (12:02 +0100)] 
ft32: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also switch ISSPACE() uses over. At the same time
use is_end_of_stmt() instead of open-coded checks in adjacent code.

4 months agofr30: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 11:01:59 +0000 (12:01 +0100)] 
fr30: use is_whitespace()

Convert open-coded checks. At the same time use is_end_of_stmt() instead
of an open-coded check in adjacent code.

4 months agoEpiphany: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:59:38 +0000 (11:59 +0100)] 
Epiphany: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agoCRx: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:59:22 +0000 (11:59 +0100)] 
CRx: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also switch ISSPACE() uses over.

4 months agocris: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:59:00 +0000 (11:59 +0100)] 
cris: use is_whitespace()

Switch ISSPACE() uses over.

Unlike many other targets, limiting whitespace checks to just blanks is
deemed okay here: Compilers wanting to use -f / #NO_APP are apparently
required to emit only blanks (without this being written down anywhere).

4 months agoCR16: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:58:49 +0000 (11:58 +0100)] 
CR16: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also switch ISSPACE() uses over.

4 months agoC-Sky: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:58:32 +0000 (11:58 +0100)] 
C-Sky: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also switch ISSPACE() uses over. At the same time
use is_end_of_stmt() instead of kind-of-open-coded checks.

4 months agodlx: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:56:25 +0000 (11:56 +0100)] 
dlx: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks where tabs were
already included.

4 months agod30v: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:56:13 +0000 (11:56 +0100)] 
d30v: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks where tabs were
already included. At the same time use is_end_of_stmt() instead of open-
coded checks in adjacent code.

4 months agod10v: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:56:04 +0000 (11:56 +0100)] 
d10v: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks where tabs were
already included. At the same time use is_end_of_stmt() instead of open-
coded checks in adjacent code.

4 months agobpf: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:55:54 +0000 (11:55 +0100)] 
bpf: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Various redundant nul char checks are also dropped,
where adjacent. At the same time use is_end_of_stmt() instead of an
open-coded nul char check.

4 months agobfin: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:55:40 +0000 (11:55 +0100)] 
bfin: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agogas/obj-*.c: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:55:23 +0000 (11:55 +0100)] 
gas/obj-*.c: use is_whitespace()

... for consistency of recognition of what is deemed whitespace.

In obj_elf_section_name() also generalize end-of-statement recognition
at the same time. Conversely drop the unused SKIP_SEMI_COLON() for COFF.

4 months agoavr: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:50:43 +0000 (11:50 +0100)] 
avr: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agoaarch64: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:50:30 +0000 (11:50 +0100)] 
aarch64: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input).

4 months agoArm: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:50:20 +0000 (11:50 +0100)] 
Arm: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). At the same time use is_end_of_stmt() instead of an
open-coded nul char check.

In parse_neon_type() be more aggressive and remove the special casing of
certain characters altogether. The original default case simply having
"break" can't have been correct.

4 months agoarc: use is_whitespace()
Jan Beulich [Mon, 3 Feb 2025 10:50:03 +0000 (11:50 +0100)] 
arc: use is_whitespace()

Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). At the same time use is_end_of_stmt() instead of
open-coded nul char checks.

4 months agoAlpha/EVAX: use is_whitespace() / is_end_of_stmt()
Jan Beulich [Mon, 3 Feb 2025 10:49:48 +0000 (11:49 +0100)] 
Alpha/EVAX: use is_whitespace() / is_end_of_stmt()

Don't open-code checking for ' ', '\t', and statement ending chars.

4 months agogas: consolidate whitespace recognition
Jan Beulich [Mon, 3 Feb 2025 10:48:55 +0000 (11:48 +0100)] 
gas: consolidate whitespace recognition

Let's extend lex_type[] to also cover whitespace, then having a simple
macro to uniformly recognize both blanks and tabs (and \r when it's not
EOL) as such.

In macro.c use sb_skip_white() as appropriate, instead of open-coding
it.

4 months agoAutomatic date update in version.in
GDB Administrator [Mon, 3 Feb 2025 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 months agoAvoid "text file busy" in dw2-using-debug-str.exp
Tom Tromey [Sat, 1 Feb 2025 23:51:42 +0000 (16:51 -0700)] 
Avoid "text file busy" in dw2-using-debug-str.exp

When I run:

    runtest dw2-using-debug-str.exp

... if I examine the gdb.log, I see:

    objcopy: unable to copy file '[...]/dw2-using-debug-str'; reason: Text file busy

This happens because the inferior is still running, and objcopy --
despite the invocation seemingly not needing this -- tries to open it
for writing.

This patch works around the objcopy oddity by having gdb exit (killing
the inferior) before the invocation.

Fixing this points out that the test does not work in the
--target_board=cc-with-gdb-index case.  This patch also arranges to
issue an "untested" here.

4 months agoAutomatic date update in version.in
GDB Administrator [Sun, 2 Feb 2025 00:00:10 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 months agoRemove obsolete test from gdb.cp/var-tag.exp
Tom Tromey [Sat, 4 Jan 2025 17:48:07 +0000 (10:48 -0700)] 
Remove obsolete test from gdb.cp/var-tag.exp

There is a test in gdb.cp/var-tag.exp that is kfail'd.  I happened
across this while working on another series and found that the PR it
referenced was closed as invalid.  On that basis I think the test
should be deleted.

Reviewed-By: Keith Seitz <keiths@redhat.com>
4 months agoShow type- and function-domain in maint print psymbols
Tom Tromey [Mon, 20 Jan 2025 18:02:51 +0000 (11:02 -0700)] 
Show type- and function-domain in maint print psymbols

I neglected to update "maint print psymbols" when adding TYPE_DOMAIN
and FUNCTION_DOMAIN.  This would have been mildly helpful when
debugging a series I am working on.  This patch corrects the
oversight.

Approved-By: Andrew Burgess <aburgess@redhat.com>
4 months agoAutomatic date update in version.in
GDB Administrator [Sat, 1 Feb 2025 00:00:14 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 months agoUse "false" when setting cli_styling
Tom Tromey [Fri, 31 Jan 2025 21:23:32 +0000 (14:23 -0700)] 
Use "false" when setting cli_styling

I noticed a spot that uses 0 where "false" is more appropriate.