GDB Administrator [Fri, 23 Sep 2022 00:00:31 +0000 (00:00 +0000)]
Automatic date update in version.in
Lancelot SIX [Mon, 5 Sep 2022 17:26:06 +0000 (18:26 +0100)]
gdb/testsuite/lib/future.exp: follow dejagnu default_target_compile
GDB's testsuite can override dejagnu's default_target_compile if the
system provided dejagnu installation does not provide support to compile
languages GDB needs.
Recent version of dejagnu (1.6.3, installed on RHEL-9) includes
ba60272
"Establish a default C compiler by evaluating [find_gcc] if no other
compiler is given."[1]. This commit removed calls such as
`set_board_info compiler "[find_gcc]"` from the various baseboards
and has default_target_compile call `find_gcc` itself to find a compiler
if none was specified by the board description.
On systems with dejagnu-1.6.3, if GDB's overrides is needed to support
languages still unknown to dejagnu, we end up in the following
situation:
- The system board files do not set the C compiler anymore,
- GDB's replacement for default_target_compile assumes that the
compiler should have been set up by the board file.
In this situation, no one sets the C compiler for the board and as a
result many test are not compiled and not executed:
[...]
Running .../gdb/testsuite/gdb.base/bt-on-error-and-warning.exp ...
gdb compile failed, default_target_compile: No compiler to compile with
Running .../gdb/testsuite/gdb.base/dprintf-non-stop.exp ...
gdb compile failed, default_target_compile: No compiler to compile with
Running .../gdb/testsuite/gdb.base/structs3.exp ...
gdb compile failed, default_target_compile: No compiler to compile with
[...]
We are observing this error with ROCgdb[2], a downstream port of GDB
supporting AMD GPUs. This port needs to use GDB's override of
default_target_compile to compile HIP programs since dejagnu does not
provide support for this language yet.
This patch changes gdb_default_target_compile_1 in a similar way
default_target_compile has been updated so both implementations remain
compatible. Even if this is not strictly required by GDB just yet,
I believe keeping both implementations in sync desirable.
Using board files provided with dejagnu <=1.6.2 is still supported: if
the compiler is set by the board file, gdb_default_target_compile_1 uses
it and does not need `find_gcc`.
Patch tested on x86_64 RHEL-9 and ubuntu-20.04 on top of GDB and ROCgdb.
[1] http://git.savannah.gnu.org/gitweb/?p=dejagnu.git;a=commit;h=
ba60272a5ac6f6a7012acca03f596a6ed003f044
[2] https://github.com/ROCm-Developer-Tools/ROCgdb
Change-Id: Ibff52684d9cab8243a7c6748ecbd29f50c37e669
Christoph Müllner [Fri, 1 Jul 2022 03:01:20 +0000 (05:01 +0200)]
RISC-V: Add T-Head MemPair vendor extension
T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.
This patch adds the XTheadMemPair extension, a collection of T-Head specific
two-GP-register memory operations.
The 'th' prefix and the "XTheadMemPair" extension are documented in a PR
for the RISC-V toolchain conventions ([1]).
[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Wed, 20 Jul 2022 22:26:29 +0000 (00:26 +0200)]
RISC-V: Add support for literal instruction arguments
This patch introduces support for arbitrary literal instruction
arguments, that are not encoded in the opcode.
A typical use case for this feature would be an instruction that
applies an implicit shift by a constant value on an immediate
(that is a real operand). With this patch it is possible to make
this shift visible in the dissasembly and support such artificial
parameter as part of the asssembly code.
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Tue, 28 Jun 2022 15:45:14 +0000 (17:45 +0200)]
RISC-V: Add T-Head MemIdx vendor extension
T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.
This patch adds the XTheadMemIdx extension, a collection of T-Head specific
GPR memory access instructions.
The 'th' prefix and the "XTheadMemIdx" extension are documented in a PR
for the RISC-V toolchain conventions ([1]).
In total XTheadCmo introduces the following 44 instructions
(BU,HU,WU only for loads (zero-extend instead of sign-extend)):
* {L,S}{D,W,WU,H,HU,B,BU}{IA,IB} rd, rs1, imm5, imm2
* {L,S}R{D,W,WU,H,HU,B,BU} rd, rs1, rs2, imm2
* {L,S}UR{D,W,WU,H,HU,B,BU} rd, rs1, rs2, imm2
[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Tue, 28 Jun 2022 15:44:57 +0000 (17:44 +0200)]
RISC-V: Add T-Head FMemIdx vendor extension
T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.
This patch adds the XTheadFMemIdx extension, a collection of
T-Head-specific floating-point memory access instructions.
The 'th' prefix and the "XTheadFMemIdx" extension are documented
in a PR for the RISC-V toolchain conventions ([1]).
[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Tue, 28 Jun 2022 15:44:46 +0000 (17:44 +0200)]
RISC-V: Add T-Head MAC vendor extension
T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.
This patch adds the XTheadMac extension, a collection of
T-Head-specific multiply-accumulate instructions.
The 'th' prefix and the "XTheadMac" extension are documented
in a PR for the RISC-V toolchain conventions ([1]).
[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Tue, 28 Jun 2022 15:44:37 +0000 (17:44 +0200)]
RISC-V: Add T-Head CondMov vendor extension
T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.
This patch adds the XTheadCondMov extension, a collection of
T-Head-specific conditional move instructions.
The 'th' prefix and the "XTheadCondMov" extension are documented
in a PR for the RISC-V toolchain conventions ([1]).
[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Fri, 1 Jul 2022 03:21:01 +0000 (05:21 +0200)]
RISC-V: Add T-Head Bitmanip vendor extension
T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.
This patch adds the XThead{Ba,Bb,Bs} extensions, a collection of
T-Head-specific bitmanipulation instructions.
The 'th' prefix and the "XThead{Ba,Bb,Bs}" extension are documented
in a PR for the RISC-V toolchain conventions ([1]).
[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Tue, 28 Jun 2022 15:44:15 +0000 (17:44 +0200)]
RISC-V: Add support for arbitrary immediate encoding formats
This patch introduces support for arbitrary signed or unsigned immediate
encoding formats. The formats have the form "XsN@S" and "XuN@S" with N
being the number of bits and S the LSB position.
For example an immediate field of 5 bytes that encodes a signed value
and is stored in the bits 24-20 of the instruction word can use the
format specifier "Xs5@20".
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Tue, 28 Jun 2022 15:43:57 +0000 (17:43 +0200)]
RISC-V: Add T-Head SYNC vendor extension
T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.
This patch adds the XTheadSync extension, a collection of
T-Head-specific multi-processor synchronization instructions.
The 'th' prefix and the "XTheadSync" extension are documented in a PR
for the RISC-V toolchain conventions ([1]).
[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Tue, 28 Jun 2022 15:43:20 +0000 (17:43 +0200)]
RISC-V: Add T-Head CMO vendor extension
T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.
This patch adds the XTheadCmo extension, a collection of T-Head specific
cache management operations.
The 'th' prefix and the "XTheadCmo" extension are documented in a PR
for the RISC-V toolchain conventions ([1]).
In total XTheadCmo introduces the following 21 instructions:
* DCACHE.{C,CI,I}ALL
* DCACHE.{C,CI,I}{PA,VA,SW} rs1
* DCACHE.C{PAL1,VAL1} rs1
* ICACHE.I{ALL,ALLS}
* ICACHE.I{PA,VA} rs1
* L2CACHE.{C,CI,I}ALL
Contrary to Zicbom, the XTheadCmo instructions don't have a constant
displacement, therefore we have a different syntax for the arguments.
To clarify this is intended behaviour, there is a set of negative test
for Zicbom-style arguments in x-thead-cmo-fail.s.
[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19
v2:
- Add missing DECLARE_INSN() list
- Fix ordering
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Christoph Müllner [Tue, 28 Jun 2022 15:42:58 +0000 (17:42 +0200)]
RISC-V: Add generic support for vendor extensions
This patch introduces changes that allow the integration of vendor ISA
extensions:
* Define a list of vendor extensions (riscv_supported_vendor_x_ext)
where vendor extensions can be added
* Introduce a section with a table in the documentation where vendor
extensions can be added
To add a vendor extension that consists of instructions only,
the following things need to be done:
* Add the extension to the riscv_supported_vendor_x_ext list
* Add lookup entry in riscv_multi_subset_supports
* Documenting the extension in c-riscv.texti
* Add test cases for all instructions
* Add MATCH*/MASK* constants and DECLARE_INSN() for all instructions
* Add new instruction class to enum riscv_insn_class
* Define the instructions in riscv_opcodes
* Additional changes if necessary (depending on the instructions)
Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Tom de Vries [Thu, 22 Sep 2022 12:50:27 +0000 (14:50 +0200)]
[gdb/symtab] Add all_comp_units/all_type_units views on all_units
Add all_comp_units/all_type_units views on all_units.
Having the views allows us to:
- easily get the number of CUs or TUs in all_units, and
- easily access the nth CU or TU.
This minimizes the use of tu_stats.nr_tus.
Tested on x86_64-linux.
Tom de Vries [Thu, 22 Sep 2022 12:50:27 +0000 (14:50 +0200)]
[gdb/symtab] Rename all_comp_units to all_units
Mechanically rename all_comp_units to all_units:
...
$ sed -i 's/all_comp_units/all_units/' gdb/dwarf2/*
...
Tested on x86_64-linux.
Yoshinori Sato [Thu, 22 Sep 2022 11:40:43 +0000 (12:40 +0100)]
opcodes: SH fix bank register disassemble.
* sh-dis.c (print_insn_sh): Enforce bit7 of LDC Rm,Rn_BANK and STC
Rm_BANK,Rn is always 1.
Tsukasa OI [Mon, 12 Sep 2022 08:04:40 +0000 (08:04 +0000)]
include: Add macro to ignore -Wunused-but-set-variable
"-Wunused-but-set-variable" warning option can be helpful to track variables
that are written but not read thereafter. But it can be harmful if some of
the code is auto-generated and we have no ways to deal with it.
The particular example is Bison-generated code.
The new DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE macro can be helpful on
such cases. A typical use of this macro is to place this macro before the
end of user prologues on Bison (.y) files.
include/ChangeLog:
* diagnostics.h (DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE): New.
Tsukasa OI [Mon, 12 Sep 2022 07:07:49 +0000 (07:07 +0000)]
include: Add macro to ignore -Wuser-defined-warnings
User-defined warnings (on Clang, "-Wuser-defined-warnings") can be harmful
if we have specified "-Werror" and we have no control to disable the warning
ourself. The particular example is Gnulib.
Gnulib generates a warning if the system version of certain functions
are used (to redirect the developer to use Gnulib version). However,
it can be harmful if we cannot easily replace them (e.g. the target is in
the standard C++ library).
The new DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS macro can be helpful on such
cases. A typical use of this macro is to place this macro before including
certain system headers.
include/ChangeLog:
* diagnostics.h (DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS): New.
Andrew Burgess [Wed, 14 Sep 2022 12:51:28 +0000 (13:51 +0100)]
gdb/python: restrict the names accepted by gdb.register_window_type
I noticed that, from Python, I could register a new TUI window that
had whitespace in its name, like this:
gdb.register_window_type('my window', MyWindowType)
however, it is not possible to then use this window in a new TUI
layout, e.g.:
(gdb) tui new-layout foo my window 1 cmd 1
Unknown window "my"
(gdb) tui new-layout foo "my window" 1 cmd 1
Unknown window ""my"
(gdb) tui new-layout foo my\ window 1 cmd 1
Unknown window "my\"
GDB clearly uses the whitespace to split the incoming command line.
I could fix this by trying to add a mechanism by which we can use
whitespace within a window name, but it seems like an easier solution
if we just forbid whitespace within a window name. Not only is this
easier, but I think this is probably the better solution, identifier
names with spaces in would mean we'd need to audit all the places a
window name could be printed and ensure that the use of a space didn't
make the output ambiguous.
So, having decided to disallow whitespace, I then thought about other
special characters. We currently accept anything as a window name,
and I wondered if this was a good idea.
My concerns were about how special characters used in a window name
might cause confusion, for example, we allow '$' in window names,
which is maybe fine now, but what if one day we wanted to allow
variable expansion when creating new layouts? Or what about starting
a window name with '-'? We already support a '-horizontal' option,
what if we want to add more in the future? Or use of the special
character '{' which has special meaning within a new layout?
In the end I figured it might make sense to place some restrictive
rules in place, and then relax the rules later if/when users complain,
we can consider each relaxation as its requested.
So, I propose that window names should match this regular expression:
[a-zA-Z][-_.a-zA-Z0-9]*
There is a chance that there is user code in the wild which will break
with the addition of this change, but hopefully adapting to the new
restrictions shouldn't be too difficult.
Bruno Larsen [Wed, 20 Jul 2022 19:44:41 +0000 (16:44 -0300)]
gdb/testsuite: Add test to step through function epilogue
The testsuite implicitly tests GDB's ability to step through epilogues
in multiple tests, without doing it explicitly anywhere. This is
unfortunate, as clang does not emit epilogue information, so using clang
on our testsuite makes many tests fail. This patch adds a central,
explicit test for walking through the epilogue so we can safely remove
this from other tests and have them working with clang.
The test created attempts to step through a simple epilogue, an
epilogue that ends on another epilogue, and epilogues leading to other
function calls.
Bruno Larsen [Wed, 20 Jul 2022 19:44:40 +0000 (16:44 -0300)]
gdb.base/skip.exp: Use finish to exit functions
gdb.base/skip.exp was making use of a fixed number of step commands to
exit some functions. This caused some problems when using clang to test
GDB, as GDB would need fewer steps to reach the desired spots. For
instance, when testing in the section "step after disabling 3", the log
looks like this:
Breakpoint 4, main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:32
32 x = baz ((bar (), foo ()));
(gdb) step
bar () at binutils-gdb/gdb/testsuite/gdb.base/skip1.c:21
21 return 1;
(gdb) PASS: gdb.base/skip.exp: step after disabling 3: step 1
step
foo () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:42
42 return 0;
(gdb) PASS: gdb.base/skip.exp: step after disabling 3: step 2
step
main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:34
34 test_skip_file_and_function ();
(gdb) step
test_skip_file_and_function () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:59
59 test_skip ();
(gdb) FAIL: gdb.base/skip.exp: step after disabling 3: step 3
step
test_skip () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:48
48 }
(gdb) PASS: gdb.base/skip.exp: step after disabling 3: step 4
step
test_skip_file_and_function () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:60
60 skip1_test_skip_file_and_function ();
(gdb) FAIL: gdb.base/skip.exp: step after disabling 3: step 5
This shows that the feature is working but because the inferior lands in
a different location, it registers as a failure. Seeing as along with
this difference, there are also some differences that depend on gcc
versions (where gdb might stop back at line 32 before entering foo), it
would not be easy to test for this behavior using steps and analzing
where the inferior stops at each point. On the other hand, using
gdb_step_until is not feasible because we'd possibly gloss over stepping
into baz and rendering the whole test useless. Instead, skip.exp now
uses finish to leave functions, synchronizing through compilers and
compiler versions. Some test names were also changed to be a bit more
descriptive. The new log looks like this, independently of compiler used:
Breakpoint 4, main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:32
32 x = baz ((bar (), foo ()));
(gdb) step
bar () at binutils-gdb/gdb/testsuite/gdb.base/skip1.c:21
21 return 1;
(gdb) PASS: gdb.base/skip.exp: step after disabling 3: step into bar
finish
Run till exit from #0 bar () at binutils-gdb/gdb/testsuite/gdb.base/skip1.c:21
main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:32
32 x = baz ((bar (), foo ()));
Value returned is $2 = 1
(gdb) PASS: gdb.base/skip.exp: step after disabling 3: return from bar
step
foo () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:42
42 return 0;
(gdb) PASS: gdb.base/skip.exp: step after disabling 3: step into foo
finish
Run till exit from #0 foo () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:42
main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:32
32 x = baz ((bar (), foo ()));
Value returned is $3 = 0
(gdb) PASS: gdb.base/skip.exp: step after disabling 3: Return from foo
step
34 test_skip_file_and_function ();
(gdb) PASS: gdb.base/skip.exp: step after disabling 3: step and skip baz
Bruno Larsen [Wed, 20 Jul 2022 19:44:38 +0000 (16:44 -0300)]
fix gdb.base/jit-elf.exp when testing with clang
When using clang as the compiler for the target, gdb.base/jit-elf.exp
was failing because the filename displayed when GDB attached to the
inferior was only showing up as with a relative path, like so:
(gdb) attach
3674146
Attaching to program: /home/blarsen/Documents/gdb-build/gdb/testsuite/outputs/gdb.base/jit-elf/jit-elf-main, process
3674146
Reading symbols from /lib64/libm.so.6...
Reading symbols from .gnu_debugdata for /lib64/libm.so.6...
(No debugging symbols found in .gnu_debugdata for /lib64/libm.so.6)
Reading symbols from /lib64/libc.so.6...
(No debugging symbols found in /lib64/libc.so.6)
Reading symbols from /lib64/ld-linux-x86-64.so.2...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00000000004013ff in main (argc=3, argv=0x7fffffffd820) at ../../../common/git-repos/binutils-gdb/gdb/testsuite/gdb.base/jit-elf-main.c:118
118| WAIT_FOR_GDB; i = 0; /* gdb break here 1 */
(gdb) FAIL: gdb.base/jit-elf.exp: attach: one_jit_test-2: break here 1: attach
While gcc's output is as follows:
(gdb) attach
3592961
Attaching to program: /home/blarsen/Documents/gdb-build/gdb/testsuite/outputs/gdb.base/jit-elf/jit-elf-main, process
3592961
Reading symbols from /lib64/libm.so.6...
Reading symbols from .gnu_debugdata for /lib64/libm.so.6...
(No debugging symbols found in .gnu_debugdata for /lib64/libm.so.6)
Reading symbols from /lib64/libc.so.6...
(No debugging symbols found in /lib64/libc.so.6)
Reading symbols from /lib64/ld-linux-x86-64.so.2...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
main (argc=3, argv=0x7fffffffd860) at /home/blarsen/Documents/gdb-build/gdb/testsuite/../../../common/git-repos/binutils-gdb/gdb/testsuite/gdb.base/jit-elf-main.c:118
118| WAIT_FOR_GDB; i = 0; /* gdb break here 1 */
(gdb) PASS: gdb.base/jit-elf.exp: attach: one_jit_test-2: break here 1: attach
This difference only happens when GDB's configure is ran using a
relative path, but seeing as testing the full path is not important for
this specific test, it feels worth fixing anyway. To fix the false
positive, the regexp for checking where gdb has stopped was relaxed a
little to allow the relative path.
Bruno Larsen [Wed, 20 Jul 2022 19:44:35 +0000 (16:44 -0300)]
gdb/testsuite: fix gdb.base/msym-bp-shl when running with Clang
When trying to test gdb.base/msym-bp-shl.exp using clang, it would have
many failures because one of the version of the foo function was being
optimized away. Adding __attribute__ ((used)) to it fixed this.
Bruno Larsen [Tue, 13 Sep 2022 16:56:23 +0000 (18:56 +0200)]
gdb/testsuite: fix testing gdb.base/skip-inline.exp with clang
When testing gdb.base/skip-inline.exp using clang, we get failures
when trying to step out of functions, since clang requires one fewer
step when compared to gcc. The inferior gets increasingly out of sync
as the test continues because of this difference, which generates those
failures.
This commit fixes this by switching those hardcoded steps to
gdb_step_until, to guarantee that the inferior is always synced to what
the test expects. This approach does not work for the parts that use
step 2 or step 3, so when we identify that clang is being used, those
tests are skipped.
Bruno Larsen [Tue, 13 Sep 2022 16:47:05 +0000 (18:47 +0200)]
Change gdb.base/skip-solib.exp deal with lack of epilogue information
When running gdb.base/skip-solib.exp, the backtrace tests could fail with
compilers that associated epilogue instructions with the last statement
line of the function, instead of associating it with the closing brace,
despite the feature being fully functional. As an example, when testing
skipping the function square, the testsuite would show
Breakpoint 1, main () at (...)/binutils-gdb/gdb/testsuite/gdb.base/skip-solib-main.c:5
5 return square(0);
(gdb) step
0x00007ffff7cef560 in __libc_start_call_main () from /lib64/libc.so.6
(gdb) PASS: gdb.base/skip-solib.exp: ignoring solib file: step
bt
#0 0x00007ffff7cef560 in __libc_start_call_main () from /lib64/libc.so.6
#1 0x00007ffff7cef60c in __libc_start_main_impl () from /lib64/libc.so.6
#2 0x0000000000401065 in _start ()
(gdb) FAIL: gdb.base/skip-solib.exp: ignoring solib file: bt
Which means that the feature is working, the testsuite is just
mis-identifying it. To avoid this problem, the skipped function calls
have been sent to a line before `return`, so epilogues won't factor in.
Bruno Larsen [Wed, 20 Jul 2022 19:44:28 +0000 (16:44 -0300)]
gdb/testsuite: Add a proc to test where compiler links the epilogue
Different compilers link the epilogue of functions to different lines.
As an example, gcc links it to the closing brace of the function,
whereas clang links it to the last statement of the function. This
difference is important for the testsuite, since the where GDB will land
after a step can be wildly different. Where possible, this dependency
should be side-stepped in the testsuite, but it isn't always possible,
so this commit adds a gdb_caching_proc that is able to detect where the
epilogue is linked, so tests can react accordingly.
Clément Chigot [Wed, 14 Sep 2022 13:53:18 +0000 (15:53 +0200)]
ld/testsuite: allow to force another directory for gcc linker
Add a new variable "ld_testsuite_tmpdir" to enable manual configuration
of the -B flag added to gcc calls. This flag ensure that gcc is invoking
the linker and the assembler we want to test.
When launching the testsuite outside of the build tree, the links made
by the testsuite in tmpdir/ld will point to nothing. Thus, even with the
PATH correctly setup towards the linker directory, gcc might end up
falling back to its default linker. Hence this variable to ensure that
gcc, whatever happens, is using the linker we want.
ld/ChangeLog:
* testsuite/config/default.exp: Allow to change -B flag with
ld_testsuite_bindir variable.
Clément Chigot [Wed, 14 Sep 2022 09:27:07 +0000 (11:27 +0200)]
ld/testsuite: skip bootstrap.exp when OFILES are missing
OFILES are normally provided through an environment variable set by
Makefiles. However, when launching the testsuite directly through
runtest outside the build tree, it can be hard to retrieve them.
Thus, they can be missing.
Instead of letting tcl raise an error when trying to access this
OFILES variable, skip bootstrap.exp if it doesn't exist.
ld/ChangeLog:
* testsuite/ld-bootstrap/bootstrap.exp: Skip if OFILES is
missing
Tsukasa OI [Sun, 7 Aug 2022 06:03:28 +0000 (15:03 +0900)]
RISC-V: Remove "b" operand type from disassembler
There are a few operand types not used by any RISC-V instructions.
- Cx
- Vf
- Ve
- [
- ]
- b
But most of them has a reasoning to keep them:
- Cx : Same as "Ct" except it has a constraint to have rd == rs2
(similar to "Cw"). Although it hasn't used, its role is clear
enough to implement a new instruction with this operand type.
- Vf, Ve : Used by vector AMO instructions (not ratified and real
instructions are not upstreamed yet).
- [, ] : Unused tokenization symbols. Reserving them is not harmful
and a vendor may use this symbol for special purposes.
... except "b". I could not have found any reference to this operand type
except it works like the "s" operand type. Historically, it seems... it's
just unused from the beginning. Its role is not clear either.
On such cases, we should vacate this room for the new operand type with
much clearer roles.
opcodes/ChangeLog:
* riscv-dis.c (print_insn_args): Remove 'b' operand type.
Tsukasa OI [Sun, 7 Aug 2022 05:57:00 +0000 (14:57 +0900)]
RISC-V: Add macro-only operands to validate_riscv_insn
Although they are not (and should not be) reachable, following macro-only
operands are parsed in the `validate_riscv_insn' function and ignored.
That function also notes that they are macro-only.
- "A"
- "B"
- "I"
Following this convention, this commit adds three remaining macro-only
operands to this function. By doing this, we could instead choose to reject
those operands from appearing in regular instructions later.
- "c" (used by call, tail and jump macros)
- "VM" (used by vmsge.vx and vmsgeu.vx macros)
- "VT" (likewise)
gas/ChangeLog:
* config/tc-riscv.c (validate_riscv_insn): Add "c", "VM" and "VT"
macro-only operand types.
Vladimir Mezentsev [Wed, 21 Sep 2022 20:01:06 +0000 (13:01 -0700)]
gprofng: fix -Wduplicated-cond warning
gprofng/ChangeLog
2022-09-21 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
* src/collctrl.cc: Fix -Wduplicated-cond warning.
GDB Administrator [Thu, 22 Sep 2022 00:00:10 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Wed, 21 Sep 2022 22:18:00 +0000 (07:48 +0930)]
bfd BLD-POTFILES.in dependencies
A file that consists of a list of files doesn't depend on those files
being built. This patch came from trying to avoid a maintainer-mode
make -j bug, where the recipe for targmatch.h was being run twice in
parallel. Typical output shown below.
make[2]: Entering directory '/build/gas/all/bfd'
GEN bfdver.h
GEN elf32-target.h
GEN elf64-target.h
GEN targmatch.h
Making info in po
make[3]: Entering directory '/build/gas/all/bfd/po'
cd .. && make po/SRC-POTFILES.in
cd .. && make po/BLD-POTFILES.in
make[4]: Entering directory '/build/gas/all/bfd'
GEN elf32-aarch64.c
GEN elf64-aarch64.c
GEN elf32-ia64.c
GEN elf64-ia64.c
GEN elf32-loongarch.c
GEN elf64-loongarch.c
GEN elf32-riscv.c
GEN elf64-riscv.c
GEN peigen.c
GEN pepigen.c
GEN pex64igen.c
GEN pe-aarch64igen.c
GEN targmatch.h
make[4]: Entering directory '/build/gas/all/bfd'
CCLD doc/chew.stamp
mv: cannot stat 'targmatch.new': No such file or directory
make[4]: *** [Makefile:2325: targmatch.h] Error 1
* Makefile.am (po/BLD-POTFILES.in): Don't depend on $(BLD_POTFILES).
(po/SRC-POTFILES.in): Don't depend on $(SRC_POTFILES).
Simon Marchi [Mon, 29 Aug 2022 16:19:40 +0000 (12:19 -0400)]
gdbsupport: move fileio_errno_to_host to fileio.{h,cc} and rename
gdb_bfd.c and remote.c contain identical implementations of a
fileio_error -> errno function. Factor that out to
gdbsupport/fileio.{h,cc}.
Rename it fileio_error_to_host, for symmetry with host_to_fileio_error.
Change-Id: Ib9b8807683de2f809c94a5303e708acc2251a0df
Simon Marchi [Fri, 26 Aug 2022 19:38:26 +0000 (15:38 -0400)]
gdbsupport: convert FILEIO_* macros to an enum
Converting from free-form macros to an enum gives a bit of type-safety.
This caught places where we would assign host error numbers to what
should contain a target fileio error number, for instance in
target_fileio_pread.
I added the FILEIO_SUCCESS enumerator, because
remote.c:remote_hostio_parse_result initializes the remote_errno output
variable to 0. It seems better to have an explicit enumerator than to
assign a value for which there is no enumerator. I considered
initializing this variable to FILEIO_EUNKNOWN instead, such that if the
remote side replies with an error and omits the errno value, we'll get
an errno that represents an error instead of 0 (which reprensents no
error). But it's not clear what the consequences of that change would
be, so I prefer to err on the side of caution and just keep the existing
behavior (there is no intended change in behavior with this patch).
Note that remote_hostio_parse_resul still reads blindly what the remote
side sends as a target errno into this variable, so we can still end up
with a nonsensical value here. It's not good, but out of the scope of
this patch.
Convert host_to_fileio_error and fileio_errno_to_host to return / accept
a fileio_error instead of an int, and cascade the change in the whole
chain that uses that.
Change-Id: I454b0e3fcf0732447bc872252fa8e57d138b0e03
Simon Marchi [Fri, 26 Aug 2022 19:31:09 +0000 (15:31 -0400)]
gdbsupport: move include/gdb/fileio.h contents to fileio.h
I don't see why include/gdb/fileio.h is placed there. It's not
installed by "make install", and it's not included by anything outside
of gdb/gdbserver/gdbsupport.
Move its content back to gdbsupport/fileio.h. I have omitted the bits
inside an `#if 0`, since it's obviously not used, as well as the
"limits" constants, which are also unused.
Change-Id: I6fbc2ea10fbe4cfcf15f9f76006b31b99c20e5a9
Simon Marchi [Tue, 19 Jul 2022 14:27:41 +0000 (10:27 -0400)]
gdbsupport: change path_join parameter to array_view<const char *>
When a GDB built with -D_GLIBCXX_DEBUG=1 reads a binary with a single
character name, we hit this assertion failure:
$ ./gdb -q --data-directory=data-directory -nx ./x
/usr/include/c++/12.1.0/string_view:239: constexpr const std::basic_string_view<_CharT, _Traits>::value_type& std::basic_string_view<_CharT, _Traits>::operator[](size_type) const [with _CharT = char; _Traits = std::char_traits<char>; const_reference = const char&; size_type = long unsigned int]: Assertion '__pos < this->_M_len' failed.
The backtrace:
#3 0x00007ffff6c0f002 in std::__glibcxx_assert_fail (file=<optimized out>, line=<optimized out>, function=<optimized out>, condition=<optimized out>) at /usr/src/debug/gcc/libstdc++-v3/src/c++11/debug.cc:60
#4 0x000055555da8a864 in std::basic_string_view<char, std::char_traits<char> >::operator[] (this=0x7fffffffcc30, __pos=1) at /usr/include/c++/12.1.0/string_view:239
#5 0x00005555609dcb88 in path_join[abi:cxx11](gdb::array_view<std::basic_string_view<char, std::char_traits<char> > const>) (paths=...) at /home/simark/src/binutils-gdb/gdbsupport/pathstuff.cc:203
#6 0x000055555e0443f4 in path_join<char const*, char const*> () at /home/simark/src/binutils-gdb/gdb/../gdbsupport/pathstuff.h:84
#7 0x00005555609dc336 in gdb_realpath_keepfile[abi:cxx11](char const*) (filename=0x6060000a8d40 "/home/simark/build/binutils-gdb-one-target/gdb/./x") at /home/simark/src/binutils-gdb/gdbsupport/pathstuff.cc:122
#8 0x000055555ebd2794 in exec_file_attach (filename=0x7fffffffe0f9 "./x", from_tty=1) at /home/simark/src/binutils-gdb/gdb/exec.c:471
#9 0x000055555f2b3fb0 in catch_command_errors (command=0x55555ebd1ab6 <exec_file_attach(char const*, int)>, arg=0x7fffffffe0f9 "./x", from_tty=1, do_bp_actions=false) at /home/simark/src/binutils-gdb/gdb/main.c:513
#10 0x000055555f2b7e11 in captured_main_1 (context=0x7fffffffdb60) at /home/simark/src/binutils-gdb/gdb/main.c:1209
#11 0x000055555f2b9144 in captured_main (data=0x7fffffffdb60) at /home/simark/src/binutils-gdb/gdb/main.c:1319
#12 0x000055555f2b9226 in gdb_main (args=0x7fffffffdb60) at /home/simark/src/binutils-gdb/gdb/main.c:1344
#13 0x000055555d938c5e in main (argc=5, argv=0x7fffffffdcf8) at /home/simark/src/binutils-gdb/gdb/gdb.c:32
The problem is this line in path_join:
gdb_assert (strlen (path) == 0 || !IS_ABSOLUTE_PATH (path));
... where `path` is "x". IS_ABSOLUTE_PATH eventually calls
HAS_DRIVE_SPEC_1:
#define HAS_DRIVE_SPEC_1(dos_based, f) \
((f)[0] && ((f)[1] == ':') && (dos_based))
This macro accesses indices 0 and 1 of the input string. However, `f`
is a string_view of length 1, so it's incorrect to try to access index
1. We know that the string_view's underlying object is a null-terminated
string, so in practice there's no harm. But as far as the string_view
is concerned, index 1 is considered out of bounds.
This patch makes the easy fix, that is to change the path_join parameter
from a vector of to a vector of `const char *`. Another solution would
be to introduce a non-standard gdb::cstring_view class, which would be a
view over a null-terminated string. With that class, it would be
correct to access index 1, it would yield the NUL character. If there
is interest in having this class (it has been mentioned a few times in
the past) I can do it and use it here.
This was found by running tests such as gdb.ada/arrayidx.exp, which
produce 1-char long filenames, so adding a new test is not necessary.
Change-Id: Ia41a16c7243614636b18754fd98a41860756f7af
Simon Marchi [Wed, 21 Sep 2022 15:05:21 +0000 (11:05 -0400)]
gdb: remove TYPE_LENGTH
Remove the macro, replace all uses with calls to type::length.
Change-Id: Ib9bdc954576860b21190886534c99103d6a47afb
Simon Marchi [Sat, 30 Jul 2022 16:01:12 +0000 (12:01 -0400)]
gdb: add type::length / type::set_length
Add the `length` and `set_length` methods on `struct type`, in order to remove
the `TYPE_LENGTH` macro. In this patch, the macro is changed to use the
getter, so all the call sites of the macro that are used as a setter are
changed to use the setter method directly. The next patch will remove the
macro completely.
Change-Id: Id1090244f15c9856969b9be5006aefe8d8897ca4
Simon Marchi [Sun, 31 Jul 2022 02:43:54 +0000 (22:43 -0400)]
gdb: remove TYPE_TARGET_TYPE
Remove the macro, replace all uses by calls to type::target_type.
Change-Id: Ie51d3e1e22f94130176d6abd723255282bb6d1ed
Simon Marchi [Sat, 30 Jul 2022 16:07:39 +0000 (12:07 -0400)]
gdb: add type::target_type / type::set_target_type
Add the `target_type` and `set_target_type` methods on `struct type`, in order
to remove the `TYPE_TARGET_TYPE` macro. In this patch, the macro is changed to
use the getter, so all the call sites of the macro that are used as a setter
are changed to use the setter method directly. The next patch will remove the
macro completely.
Change-Id: I85ce24d847763badd34fdee3e14b8c8c14cb3161
Tsukasa OI [Wed, 21 Sep 2022 13:43:17 +0000 (13:43 +0000)]
RISC-V: Fix riscv_set_tso declaration
To avoid -Werror=strict-prototypes, this commit changes () to (void).
This is because "()" possibly means a function prototype with indeterminate
arguments on old C standards.
gas/ChangeLog:
* config/tc-riscv.c (riscv_set_tso): Fix declaration.
Alan Modra [Wed, 21 Sep 2022 10:04:08 +0000 (19:34 +0930)]
PR29566, objdump -p considers an empty .gnu.version_r invalid
Allow and ignore an empty section.
PR 29566
* elf.c (bfd_section_from_shdr): Don't set elf_dynverdef or
elf_dynverref for empty sections.
(_bfd_elf_slurp_version_tables): Remove now redundant tests.
Tsukasa OI [Wed, 21 Sep 2022 06:23:55 +0000 (06:23 +0000)]
RISC-V: Set EF_RISCV_TSO also on .option arch
This is a minor fix to commit
96462b012988d35ebb1137a2ad9fd0a96547d79a
("RISC-V: Implement Ztso extension"). Currently, it sets EF_RISCV_TSO ELF
flag when initial ISA string contains the 'Ztso' extension. However, GAS
has a way to update the ISA string: ".option arch".
When the architecture is updated by ".option arch", EF_RISCV_RVC ELF flag
is set when the 'C' extension is detected. Analogously, this commit sets
the EF_RISCV_TSO when the 'Ztso' extension is detected.
gas/ChangeLog:
* config/tc-riscv.c (s_riscv_option): Set TSO ELF flag if the
'Ztso' extension is specified via ".option arch" directive.
Alan Modra [Wed, 21 Sep 2022 05:24:49 +0000 (14:54 +0930)]
PR29573, addr2line doesn't display file/line for local symbols
The DWARF standard is clear that DW_AT_linkage_name is optional.
Compilers may not provide the attribute on functions and variables,
even though the language mangles names. g++ does not for local
variables and functions. Without DW_AT_linkage_name, mangled object
file symbols can't be directly matched against the source-level
DW_AT_name in DWARF info. One possibility is demangling the object
file symbols, but that comes with its own set of problems:
1) A demangler might not be available for the compiler/language.
2) Demangling doesn't give the source function name as stored in
DW_AT_name. Class and template parameters must be stripped at
least.
So this patch takes a simpler approach. A symbol matches DWARF info
if the DWARF address matches the symbol address, and if the symbol
name contains the DWARF name as a sub-string. Very likely the name
matching is entirely superfluous.
PR 29573
* dwarf.c (lookup_symbol_in_function_table): Match a symbol
containing the DWARF source name as a substring.
(lookup_symbol_in_variable_table): Likewise.
(_bfd_dwarf2_find_nearest_line_with_alt): If stash_find_line_fast
returns false, fall back to comp_unit_find_line.
Alan Modra [Wed, 21 Sep 2022 05:17:31 +0000 (14:47 +0930)]
dwarf2.c: simplify best_fit_len tests
* dwarf2.c (lookup_address_in_function_table): Simplify
best_fit_len test.
(info_hash_lookup_funcinfo): Likewise.
(lookup_symbol_in_function_table): Likewise, also reorder tests
and check "file" is set.
(lookup_symbol_in_variable_table): Reorder tests.
Alan Modra [Wed, 21 Sep 2022 05:15:44 +0000 (14:45 +0930)]
dwarf2.c: mangle_style
non_mangled incorrectly returned "true" for Ada. Correct that, and
add a few more non-mangled entries. Return a value suitable for
passing to cplus_demangle to control demangling.
* dwarf2.c: Include demangle.h.
(mangle_style): Rename from non_mangled. Return DMGL_* value
to suit lang. Adjust all callers.
Alan Modra [Wed, 21 Sep 2022 05:15:06 +0000 (14:45 +0930)]
dwarf2.c remove varinfo and funcinfo sec field
The "sec" field in these structures is only set and used in lookup
functions. It always starts off as NULL. So the only possible effect
of the field is to modify the return of the lookup, which was its
purpose back in 2005 when HJ fixed PR990. Since then we solved the
problem of relocatable object files with the fix for PR2338, so this
field is now redundant.
* dwarf.c (struct funcinfo, struct varinfo): Remove "sec" field.
(lookup_symbol_in_function_table): Don't set or test "sec".
(lookup_symbol_in_variable_table): Likewise.
(info_hash_lookup_funcinfo, info_hash_lookup_varinfo): Likewise.
Tsukasa OI [Wed, 14 Sep 2022 12:28:02 +0000 (12:28 +0000)]
configure: Pass CPPFLAGS_FOR_BUILD to subdirs
Because CPPFLAGS_FOR_BUILD is used in some subdirectories (through
bfd/warning.m4), not AC_SUBSTing the variable causes minor issues.
Fortunately, it didn't cause severe errors but error messages related to
@CPPFLAGS_FOR_BUILD@ (not AC_SUBSTed CPPFLAGS_FOR_BUILD variable passed
to subdirectories through Makefile) remain in config.log.
To avoid invalid invocation of preprocessor for build environment, we
need to set proper CPPFLAGS_FOR_BUILD (may be empty) and pass it to
subdirectories that need it. This is what this commit does.
ChangeLog:
* configure.ac: Pass CPPFLAGS_FOR_BUILD to subdirectories.
* configure: Regenerate.
Shihua [Tue, 20 Sep 2022 09:45:04 +0000 (17:45 +0800)]
RISC-V: Implement Ztso extension
This patch support ZTSO extension. It will turn on the tso flag for elf_flags
once we have enabled Ztso extension. This is intended to implement v0.1 of
the proposed specification which can be found in Chapter 25 of,
https://github.com/riscv/riscv-isa-manual/releases/download/draft-
20220723-
10eea63/riscv-spec.pdf.
bfd\ChangeLog:
* elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Set TSO flag.
* elfxx-riscv.c: Add Ztso's arch.
binutils\ChangeLog:
* readelf.c (get_machine_flags): Set TSO flag.
gas\ChangeLog:
* config/tc-riscv.c (riscv_set_tso): Ditto.
(riscv_set_arch): Ditto.
* testsuite/gas/riscv/ztso.d: New test.
include\ChangeLog:
* elf/riscv.h (EF_RISCV_TSO): Ditto.
Nelson Chu [Wed, 14 Sep 2022 02:25:44 +0000 (10:25 +0800)]
RISC-V: Always generate R_RISCV_CALL_PLT reloc for call in assembler.
Since we have the same behaviors of CALL and CALL_PLT relocs in linker for now,
https://github.com/bminor/binutils-gdb/commit/
3b1450b38c644f99aa2e211747b428b9f8d15cca
And the psabi already deprecate the CALL reloc,
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/
a0dced85018d7a0ec17023c9389cbd70b1dbc1b0
Therefore, we should always generate R_RISCV_CALL_PLT reloc for call, even if
it has @plt postfix. I believe LLVM (https://reviews.llvm.org/
D132530) already
support this, so GNU as should do the same thing.
gas/
* config/tc-riscv.c (riscv_ip): Always generate CALL_PLT reloc for
call, even if it has @plt postfix.
* testsuite/gas/riscv/no-relax-reloc.d: Updated CALL to CALL_PLT.
* testsuite/gas/riscv/relax-reloc.d: Likewise.
ld/
* testsuite/ld-riscv-elf/variant_cc-r.d: Updated CALL to CALL_PLT.
GDB Administrator [Wed, 21 Sep 2022 00:00:13 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Tue, 20 Sep 2022 23:36:29 +0000 (09:06 +0930)]
Re: PowerPC64 pcrel got relocs against local symbols
The last patch wasn't all that shiny. There are rather a lot more
relocations that can hit the assertion in md_apply_fix if the symbol
is local or absolute. Fix them all.
* config/tc-ppc.c (ppc_force_relocation): Add all relocs that
expect a symbol in md_apply_fix. Remove tls pcrel relocs
already covered in general tls match range.
Alan Modra [Mon, 19 Sep 2022 01:07:57 +0000 (10:37 +0930)]
looping in alpha_vms_slurp_relocs
The direct cause for the looping was failing to test for error return
from _bfd_vms_get_object_record inside a while(1) loop. Fix that.
Also record status of first alpha_vms_slurp_relocs call and return
that for all subsequent calls. (The object format has one set of
relocation records for all sections.) If the first call fails, all
others should too.
* vms-alpha.c (struct vms_private_data_struct): Make reloc_done
a tri-state int.
(alpha_vms_slurp_relocs): Set reloc_done to 1 on success, -1 on
failure. Return that status on subsequent calls. Check
_bfd_vms_get_object_record return status.
(alpha_vms_get_reloc_upper_bound): Return status from
alpha_vms_slurp_relocs.
(alpha_vms_write_exec): Exclude sections with contents NULL due
to previous errors from layout, and don't try to write them.
Dmitry Selyutin [Tue, 20 Sep 2022 21:26:50 +0000 (00:26 +0300)]
ppc/svp64: test setvl ms operand
Tom Tromey [Fri, 26 Aug 2022 22:48:24 +0000 (16:48 -0600)]
Make stdin_event_handler static
I noticed that stdin_event_handler is only used in event-top.c, so
this patch changes it to be 'static'.
Tom Tromey [Mon, 8 Aug 2022 17:00:50 +0000 (11:00 -0600)]
Constify some target_so_ops instances
This changes some target_so_ops instances to be const. This makes
their use a little more obvious (they can't be mutated) and also
allows for the removal of some initialization code.
Tom Tromey [Mon, 8 Aug 2022 16:41:43 +0000 (10:41 -0600)]
Move solib_ops into gdbarch
This changs solib_ops to be an ordinary gdbarch value and updates all
the uses. This removes a longstanding FIXME and makes the code
somewhat cleaner as well.
Tom Tromey [Mon, 8 Aug 2022 16:14:53 +0000 (10:14 -0600)]
Remove current_target_so_ops
current_target_so_ops is only set in a single place. It seems better
to simply remove it.
Andrew Burgess [Wed, 7 Sep 2022 11:34:00 +0000 (12:34 +0100)]
gdb/testsuite: add a debuginfod-support.exp helper library
We currently have a single test for GDB's debuginfod support, this is
gdb.debuginfod/fetch_src_and_symbols.exp, this script does all the
setup, starts debuginfod, and then does the testing.
This commit tries to split the existing script in two, there is a new
library lib/debuginfod-support.exp, which contains a helper functions
related to running debuginfod tests. All the code in the new library
is basically copied from the existing test case (which is why I
retained the copyright date range on the new library), with some minor
adjustments to try and make the code a little more generic.
One change I made, for example, is the library offers functions to
shut down debuginfod, previously we just relied on expect shutting
down debuginfod when dejagnu completed.
The existing test script is updated to make use of the new library
code, and this test is still passing for me. The only change in the
test results is a single test where I changed the name to remove the
port number from the test name - the port number can change from run
to run, so could make it hard to compare test results.
I have also done a little light house keeping on the original test
script, updating and adding new comments, and making use of
proc_with_prefix in a couple of places.
liuzhensong [Thu, 4 Aug 2022 06:49:40 +0000 (14:49 +0800)]
LoongArch: Set macro SUB_SEGMENT_ALIGN to 0.
Nick Clifton [Tue, 20 Sep 2022 10:46:32 +0000 (11:46 +0100)]
Stop strip from complaining about empty note sections when stripping a binary for a second time.
* objcopy.c (copy_object): Do not issue a warning message when
encountering empty .gnu.build.attribute sections.
Nick Clifton [Tue, 20 Sep 2022 10:33:16 +0000 (11:33 +0100)]
New Serbian translations for various binutils sub-directories.
Zeke Lu [Tue, 20 Sep 2022 10:19:06 +0000 (11:19 +0100)]
Bug 29580 - typo in warning message: .note.gnu.build-id data size is too bug
Xi Ruoyao [Tue, 20 Sep 2022 06:09:30 +0000 (14:09 +0800)]
LoongArch: Fix R_LARCH_IRELATIVE insertion after elf_link_sort_relocs
loongarch_elf_finish_dynamic_symbol is called after elf_link_sort_relocs
if -z combreloc. elf_link_sort_relocs redistributes the contents of
.rela.* sections those would be merged into .rela.dyn, so the slot for
R_LARCH_IRELATIVE may be out of relplt->contents now.
To make things worse, the boundary check
dyn < dyn + relplt->size / sizeof (*dyn)
is obviously wrong ("x + 10 < x"? :), causing the issue undetected
during the linking process and the resulted executable suddenly crashes
at runtime.
The issue was found during an attempt to add static-pie support to the
toolchain.
Fix it by iterating through the inputs of .rela.dyn to find the slot.
Xi Ruoyao [Tue, 20 Sep 2022 06:09:29 +0000 (14:09 +0800)]
LoongArch: Don't write into GOT for local ifunc
Local ifuncs are always resolved at runtime via R_LARCH_IRELATIVE, so
there is no need to write anything into GOT. And when we write the GOT
we actually trigger a heap-buffer-overflow: If a and b are different
sections, we cannot access something in b with "a->contents + (offset
from a)" because "a->contents" and "b->contents" are heap buffers
allocated separately, not slices of a large buffer.
So stop writing into GOT for local ifunc now.
GDB Administrator [Tue, 20 Sep 2022 00:00:17 +0000 (00:00 +0000)]
Automatic date update in version.in
Vladimir Mezentsev [Fri, 16 Sep 2022 20:19:38 +0000 (13:19 -0700)]
gprofng: build documentation only if BUILD_MAN is true
gprofng/ChangeLog
2022-09-16 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/29476
* gprofng/Makefile.am: Build documentation only if BUILD_MAN is true
* gprofng/Makefile.in: Rebuild.
* gprofng/configure: Rebuild.
Enze Li [Mon, 19 Sep 2022 12:43:50 +0000 (20:43 +0800)]
gdb: add ATTRIBUTE_PRINTF to gdb_bfd_error_handler
I see this error when building with clang,
CXX gdb_bfd.o
gdb_bfd.c:1180:43: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
const std::string str = string_vprintf (fmt, ap_copy);
^~~
1 error generated.
This patch adds missing ATTRIBUTE_PRINTF to fix the error.
Tested on x86_64-linux with gcc 12 and clang 14.
GDB Administrator [Mon, 19 Sep 2022 00:00:12 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 18 Sep 2022 00:00:11 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom de Vries [Sat, 17 Sep 2022 06:22:32 +0000 (08:22 +0200)]
[gdb/symtab] Fix "file index out of range" complaint
With the test-case included in this commit, we run into this FAIL:
...
(gdb) p var^M
During symbol reading: file index out of range^M
$1 = 0^M
(gdb) FAIL: gdb.dwarf2/dw2-no-code-cu.exp: p var with no complaints
...
This is a regression since commit
6d263fe46e0 ("Avoid bad breakpoints with
--gc-sections"), which contains this change in read_file_scope:
...
- handle_DW_AT_stmt_list (die, cu, fnd, lowpc);
+ if (lowpc != highpc)
+ handle_DW_AT_stmt_list (die, cu, fnd, lowpc);
...
The change intends to avoid a problem with a check in
lnp_state_machine::check_line_address, but also prevents the file and dir
tables from being read, which causes the complaint.
Fix the FAIL by reducing the scope of the "lowpc != highpc" condition to the
call to dwarf_decode_lines in handle_DW_AT_stmt_list.
Tested on x86_64-linux.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29561
GDB Administrator [Sat, 17 Sep 2022 00:00:14 +0000 (00:00 +0000)]
Automatic date update in version.in
Kevin Buettner [Fri, 16 Sep 2022 23:13:30 +0000 (16:13 -0700)]
BFD error message suppression test case
This commit adds a GDB test case which tests GDB's BFD error handler
hook for suppressing output of all but the first identical messages.
See the comment at the beginning of bfd-errors.exp for details about
this new test.
I've tested this test for both 32- and 64-bit ELF files and also
on both little endian and big endian machines. It also works for
both native and remote targets. The only major restriction is that
it only works for ELF targets.
Kevin Buettner [Fri, 16 Sep 2022 23:13:29 +0000 (16:13 -0700)]
Suppress printing of superfluous BFD error messages
This commit adds a hook to the BFD error handler for suppressing
identical messages which have been output once already.
It's motivated by this Fedora bug...
https://bugzilla.redhat.com/show_bug.cgi?id=
2083315
...in which over 900,000 BFD error messages are output when attaching
to firefox. From the bug report, the messages all say:
BFD: /usr/lib/debug/usr/lib64/firefox/libxul.so-100.0-2.fc35.x86_64.debug: attempt to load strings from a non-string section (number 38)
Since there's no (additional) context which might assist the user in
determining what's wrong, there's really no point in outputting more
than one message. Of course, if BFD should output some
other/different message, it should be output too, but all future
messages identical to those already output should be suppressed.
For the firefox problem, it turned out that there were only 37
sections, but something was referring to section #38. I haven't
investigated further to find out how this came to be.
Despite this problem, useful debugging might still be done, especially
if the user doesn't care about debugging the problematic library.
If it turns out that knowing the quantity of messages might be useful,
I've implemented the suppression mechanism by keeping a count of each
identical message. A new GDB command, perhaps a 'maintenance'
command, could be added to print out each message along with the
count. I haven't implemented this though because I'm not convinced of
its utility. Also, the BFD message printer has support for BFD-
specific format specifiers. The BFD message strings that GDB stores
in its map are sufficient for distinguishing messages from each
other, but are not identical to those output by BFD's default error
handler. So, that problem would need to be solved too.
Tom de Vries [Fri, 16 Sep 2022 15:14:34 +0000 (17:14 +0200)]
[gdb/symtab] Handle named DW_TAG_unspecified_type DIE
With the test-case included in the patch, we run into:
...
(gdb) info types -q std::nullptr_t^M
During symbol reading: unsupported tag: 'DW_TAG_unspecified_type'^M
^M
File /usr/include/c++/7/x86_64-suse-linux/bits/c++config.h:^M
2198: typedef decltype(nullptr) std::nullptr_t;^M
(gdb) FAIL: gdb.dwarf2/nullptr_t.exp: info types -q std::nullptr_t \
without complaint
...
Fix the complaint by handling DW_TAG_unspecified_type in new_symbol, and verify
in the test-case using "maint print symbols" that the symbol exists.
Tested on x86_64-linux, with gcc 7.5.0 and clang 13.0.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17271
Tom de Vries [Fri, 16 Sep 2022 14:40:56 +0000 (16:40 +0200)]
[gdb/tdep] Fix PowerPC IEEE 128-bit format arg passing
On a powerpc system with gcc 12 built to default to 128-bit IEEE long double,
I run into:
...
(gdb) print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)^M
$8 = 0 + 0i^M
(gdb) FAIL: gdb.base/varargs.exp: print \
find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)
...
This is due to incorrect handling of the argument in ppc64_sysv_abi_push_param.
Fix this and similar cases, and expand the test-case to test handling of
homogeneous aggregates.
Tested on ppc64le-linux, power 10.
Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com>
Tested-by: Carl Love <cel@us.ibm.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29543
Tom de Vries [Fri, 16 Sep 2022 14:34:13 +0000 (16:34 +0200)]
[gdb/testsuite] Fix gdb.dwarf2/dw2-dir-file-name.exp for aarch64
[ Another attempt at fixing the problem described in commit
cd919f5533c
("[gdb/testsuite] Fix gdb.dwarf2/dw2-dir-file-name.exp"). ]
When running the test-case gdb.dwarf2/dw2-dir-file-name.exp with
aarch64-linux, we run into:
...
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, compdir_missing__ldir_missing__file_basename () at \
tmp-dw2-dir-file-name.c:999^M
(gdb) FAIL: gdb.dwarf2/dw2-dir-file-name.exp: \
compdir_missing__ldir_missing__file_basename: continue to breakpoint: \
compdir_missing__ldir_missing__file_basename
...
The breakpoint set at compdir_missing__ldir_missing__file_basename_label,
address 0x400608 starts at a line entry:
...
CU: tmp-dw2-dir-file-name.c:
File name Line number Starting address View Stmt
tmp-dw2-dir-file-name.c 999 0x400608 x
tmp-dw2-dir-file-name.c 1000 0x40062c x
tmp-dw2-dir-file-name.c - 0x40062c
...
and therefore the breakpoint is printed without instruction address.
In contrast, for x86_64-linux, we have the breakpoint printed with instruction
address:
...
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, 0x004004c1 in compdir_missing__ldir_missing__file_basename () \
at tmp-dw2-dir-file-name.c:999^M
(gdb) PASS: gdb.dwarf2/dw2-dir-file-name.exp: \
compdir_missing__ldir_missing__file_basename: continue to breakpoint: \
compdir_missing__ldir_missing__file_basename
...
The breakpoint set at compdir_missing__ldir_missing__file_basename_label,
address 0x004004c1 doesn't start at a line entry:
...
CU: tmp-dw2-dir-file-name.c:
File name Line number Starting address View Stmt
tmp-dw2-dir-file-name.c 999 0x4004bd x
tmp-dw2-dir-file-name.c 1000 0x4004d3 x
tmp-dw2-dir-file-name.c - 0x4004d3
...
Fix this by:
- unifying behaviour between the archs by adding an explicit line number entry
for the address compdir_missing__ldir_missing__file_basename_label, making
the FAIL reproducible on x86_64-linux.
- expecting the breakpoint to be printed without instruction address.
Tested on x86_64-linux and aarch64-linux.
Tom de Vries [Fri, 16 Sep 2022 13:53:47 +0000 (15:53 +0200)]
[gdb] Handle pending ^C after rl_callback_read_char
In completion tests in various test-cases, we've been running into these
"clearing input line" timeouts:
...
(gdb) $cmd^GPASS: gdb.gdb/unittest.exp: tab complete "$cmd"
FAIL: gdb.gdb/unittest.exp: tab complete "$cmd" (clearing input line) (timeout)
...
where $cmd == "maintenance selftest name_that_does_not_exist".
AFAIU, the following scenario happens:
- expect sends "$cmd\t"
- gdb detects the stdin event, and calls rl_callback_read_char until it
comes to handle \t
- readline interprets the \t as completion, tries to complete, fails to do so,
outputs a bell (^G)
- expect sees the bell, and proceeds to send ^C
- readline is still in the call to rl_callback_read_char, and stores the
signal in _rl_caught_signal
- readline returns from the call to rl_callback_read_char, without having
handled _rl_caught_signal
- gdb goes to wait for the next event
- expect times out waiting for "Quit", the expected reaction for ^C
Fix this by handling pending signals after each call to rl_callback_read_char.
The fix is only available for readline 8.x, if --with-system-readline provides
an older version, then the fix is disabled due to missing function
rl_check_signals.
Tested on x86_64-linux.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27813
Alan Modra [Fri, 16 Sep 2022 08:38:44 +0000 (18:08 +0930)]
PowerPC64 pcrel got relocs against local symbols
Not that anyone would want to indirect via the GOT when an address can
be loaded directly with pla, the following:
pld 3,x@got@pcrel
x:
leads to "Internal error in md_apply_fix", because the generic parts
of assembler fixup handling convert the fx_pcrel fixup to one without
a symbol. Stop that happening.
* config/tc-ppc.c (ppc_force_relocation): Add PLT_PCREL34 and
assorted GOT_PCREL34 relocs.
Alan Modra [Thu, 15 Sep 2022 11:15:57 +0000 (20:45 +0930)]
pdb sanity check block_size
* pdb.c (pdb_get_elt_at_index): Only allow block_size to be
512, 1024, 2048, or 4096.
Nelson Chu [Fri, 16 Sep 2022 01:11:52 +0000 (09:11 +0800)]
RISC-V: Make g imply zmmul extension.
bfd/
* elfxx-riscv.c (riscv_implicit_subset): Moved entry of m after g,
so that g can imply zmmul.
gas/
* testsuite/gas/riscv/attribute-01.d: Updated.
* testsuite/gas/riscv/attribute-02.d: Likewise.
* testsuite/gas/riscv/attribute-03.d: Likewise.
* testsuite/gas/riscv/attribute-04.d: Likewise.
* testsuite/gas/riscv/attribute-05.d: Likewise.
* testsuite/gas/riscv/attribute-10.d: Likewise.
* testsuite/gas/riscv/march-imply-g.d: Likewise.
* testsuite/gas/riscv/march-imply-unsupported.d: Likewise.
GDB Administrator [Fri, 16 Sep 2022 00:00:10 +0000 (00:00 +0000)]
Automatic date update in version.in
Tsukasa OI [Thu, 15 Sep 2022 04:06:09 +0000 (04:06 +0000)]
bfd, binutils, gas: Remove/mark unused variables
Clang generates a warning on unused (technically, written but not read
thereafter) variables. By the default configuration (with "-Werror"), it
causes a build failure (unless "--disable-werror" is specified).
This commit adds ATTRIBUTE_UNUSED attribute to some of them, which means
they are *possibly* unused (can be used but no warnings occur when
unused) and removes others.
bfd/ChangeLog:
* elf32-lm32.c (lm32_elf_size_dynamic_sections): Mark unused
rgot_count variable.
* elf32-nds32.c (elf32_nds32_unify_relax_group): Remove unused
count variable.
* mmo.c (mmo_scan): Mark unused lineno variable.
binutils/ChangeLog:
* windmc.c (write_rc): Remove unused i variable.
gas/ChangeLog:
* config/tc-riscv.c (riscv_ip): Remove unused argnum variable.
ld/ChangeLog:
* pe-dll.c (generate_reloc): Remove unused bi and page_count
variables.
Vladimir Mezentsev [Wed, 14 Sep 2022 08:11:45 +0000 (01:11 -0700)]
gprofng: fix build issues on musl
gprofng/ChangeLog
2022-09-14 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/29477
* configure.ac: Set __MUSL_LIBC.
* configure: Rebuild.
* common/config.h.in: Rebuild.
* src/collector_module.h: Fix compiler errors because mmap64, open64,
pwrite64 are macros and getcontext() is absent on musl.
* libcollector/collector.c: Likewise.
* libcollector/hwprofile.c: Likewise.
* libcollector/iolib.c: Likewise.
* libcollector/libcol_util.c: Likewise.
* libcollector/linetrace.c: Likewise.
* libcollector/memmgr.c: Likewise.
* libcollector/profile.c: Likewise.
* libcollector/unwind.c: Likewise.
* libcollector/dispatcher.c: Likewise.
* src/Experiment.cc: Likewise.
* libcollector/collector.h: Use dlsym() because dlvsym() is not defined
on musl.
* libcollector/iotrace.c: Remove interposition of versioned functions.
* libcollector/mmaptrace.c: Likewise.
* libcollector/libcol_util.h: Fix -Wint-to-pointer-cast warnings.
* libcollector/jprofile.c: Likewise.
* libcollector/synctrace.c: Include "collector.h".
* src/Print.cc: Use get_basename() because basename() is not defined
on musl.
* common/hwcdrv.c: Fix -Wformat= warnings.
GDB Administrator [Thu, 15 Sep 2022 00:00:13 +0000 (00:00 +0000)]
Automatic date update in version.in
Rupesh Potharla [Wed, 14 Sep 2022 09:27:38 +0000 (10:27 +0100)]
Binutils: Readelf testcase failing with clang
* testsuite/binutils-all/readelf.exp (readelf_wi_test): Extend
regexps to allow for output genreated by the Clang compiler.
Alan Modra [Wed, 14 Sep 2022 07:27:42 +0000 (16:57 +0930)]
looping in bfd_mach_o_fat_openr_next_archived_file
mach-o.c doesn't sanity check mach-o-fat archives, making it easy for
fuzzers to create an archive with mach_o_fat_archentry headers that
point to the same offset. bfd_mach_o_fat_openr_next_archived_file
uses the previous element offset to find its header, and thus the next
element. If two offsets are the same, any tool reading the archive
will get stuck. This patch rejects such archives, and any with
overlapping elements.
* mach-o.c (overlap_previous): New function.
(bfd_mach_o_fat_archive_p): Sanity check that elements do not
overlap each other or the file and archive headers.
Alan Modra [Wed, 14 Sep 2022 05:23:21 +0000 (14:53 +0930)]
regen pofiles
Tsukasa OI [Sat, 10 Sep 2022 17:08:13 +0000 (17:08 +0000)]
bfd: Stop using -Wstack-usage=262144 when built with Clang
Some components of GNU Binutils will pass "-Wstack-usage=262144" when
"GCC >= 5.0" is detected. However, Clang does not support "-Wstack-usage",
despite that related configuration part in bfd/warning.m4 handles the latest
Clang (15.0.0 as of this writing) as "GCC >= 5.0".
The option "-Wstack-usage" was ignored when the first version of Clang is
released but even this "ignoring" behavior is removed before Clang 4.0.0.
So, if we give Clang "-Wstack-usage=262144", it generates a warning, making
the build failure.
This commit checks "__clang__" macro to prevent adding the option if the
compiler is identified as Clang.
bfd/ChangeLog:
* warning.m4: Stop appending "-Wstack-usage=262144" option when
compiled with Clang.
* configure: Regenerate.
binutils/ChangeLog:
* configure: Regenerate.
gas/ChangeLog:
* configure: Regenerate.
gold/ChangeLog:
* configure: Regenerate.
gprof/ChangeLog:
* configure: Regenerate.
ld/ChangeLog:
* configure: Regenerate.
opcodes/ChangeLog:
* configure: Regenerate.
Alan Modra [Tue, 13 Sep 2022 22:30:07 +0000 (08:00 +0930)]
Modify ld-ctf test files to suit ARM
The "@" char starts a comment on ARM.
* testsuite/ld-ctf/diag-ctf-version-0.s: Replace @progbits with
%progbits.
* testsuite/ld-ctf/diag-ctf-version-2-unsupported-feature.s: Likewise.
* testsuite/ld-ctf/diag-ctf-version-f.s: Likewise.
* testsuite/ld-ctf/diag-cttname-invalid.s: Likewise.
* testsuite/ld-ctf/diag-cttname-null.s: Likewise.
* testsuite/ld-ctf/diag-cuname.s: Likewise.
* testsuite/ld-ctf/diag-decompression-failure.s: Likewise.
* testsuite/ld-ctf/diag-parlabel.s: Likewise.
* testsuite/ld-ctf/diag-parname.s: Likewise.
* testsuite/ld-ctf/diag-strlen-invalid.s: Likewise.
* testsuite/ld-ctf/diag-unsupported-flag.s: Likewise.
* testsuite/ld-ctf/diag-wrong-magic-number.s: Likewise.
Alan Modra [Mon, 12 Sep 2022 09:45:01 +0000 (19:15 +0930)]
asan: som_set_reloc_info heap buffer overflow
Also a bugfix. The first time the section was read, the contents
didn't supply an addend.
* som.c (som_set_reloc_info): Sanity check offset. Do process
contents after reading. Tidy section->contents after freeing.
Alan Modra [Mon, 12 Sep 2022 09:28:53 +0000 (18:58 +0930)]
ubsan: som_is_space null dereference
On objcopy of fuzzed file.
* som.c (som_write_fixups): Exit loop if space sections all
processed.
Alan Modra [Mon, 12 Sep 2022 09:20:53 +0000 (18:50 +0930)]
msan: vms-alpha use-of-uninitialized-value in dst_retrieve_location
* vms-alpha.c (dst_define_location): Init any unused entries.
Alan Modra [Mon, 12 Sep 2022 08:39:24 +0000 (18:09 +0930)]
ubsan: arm-dis.c index out of bounds
We are way off in the weeds with this one, and will be printing
<UNPREDICTABLE> for S > 10.
* arm-dis.c (print_insn_cde): Wrap 'T' value.
Alan Modra [Sat, 10 Sep 2022 03:28:44 +0000 (12:58 +0930)]
PR29540, R_PPC64_NONE in .rela.dyn when linking Linux vdso
PR 29540
* elf64-ppc.c (allocate_dynrelocs): Don't alloc space for relocs
against discarded sections.
(ppc64_elf_size_dynamic_sections): Use standard test for discarded
sections.
* elf32-ppc.c (allocate_dynrelocs): Don't alloc space for relocs
against discarded sections.
(ppc_elf_size_dynamic_sections): Use standard test for discarded
sections.
GDB Administrator [Wed, 14 Sep 2022 00:00:17 +0000 (00:00 +0000)]
Automatic date update in version.in
Aaron Merey [Mon, 12 Sep 2022 22:57:38 +0000 (18:57 -0400)]
objdump: '-S' should trigger search for separate debuginfo.
Add with_source_code to the command line options that trigger
might_need_separate_debug_info and dump_any_debugging. This helps
'objdump -S' download missing files via debuginfod without the need for
specifying extra command line options like '-L'.
Bruno Larsen [Wed, 20 Jul 2022 19:44:37 +0000 (16:44 -0300)]
gdb/testsuite: Update gdb.base/so-impl-ld.exp
gdb.base/so-impl-ld.exp was setup assuming that the compiler would add
epilogue information and that GDB would stop in the } line. This would
make clang tests fail like so:
step^M
solib_main (arg=10000) at ../../../common/git-repos/binutils-gdb/gdb/testsuite/gdb.base/solib1.c:7^M
7|__ return arg*arg;|__|___/* HERE */^M
(gdb) PASS: gdb.base/so-impl-ld.exp: step into solib call
next^M
main () at ../../../common/git-repos/binutils-gdb/gdb/testsuite/gdb.base/so-impl-ld.c:22^M
22|_ return 0;^M
(gdb) FAIL: gdb.base/so-impl-ld.exp: step in solib call
next^M
0x00007ffff7cef560 in __libc_start_call_main () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.base/so-impl-ld.exp: step out of solib call
This patch changes it so solib_main has 2 lines where GDB can stop
regardless of compiler choices, and updates the exp file to
generically deal with unknown number of steps until leaving that
function.
Bruno Larsen [Wed, 20 Jul 2022 19:44:26 +0000 (16:44 -0300)]
gdb/testsuite: introduce gdb_step_until
Currently, GDB's testsuite uses a set amount of step commands to exit
functions. This is a problem if a compiler emits different epilogue
information from gcc, or emits no epilogue information at all. It was
most noticeable if Clang was used to test GDB.
To fix this unreliability, this commit introduces a new proc that will
step the inferior until it is stopped at a line that matches the given
regexp, or until it steps too many times - defined as an optional
argument. If the line is found, it shows up as a single PASS in the
test, and if the line is not found, a single FAIL is emitted.
This patch only introduces this proc, but does not add it to any
existing tests, these will be introduced in the following commit.