Compare commits

...

232 Commits

Author SHA1 Message Date
GDB Administrator
214bb42ce0 Automatic date update in version.in 2025-09-06 00:01:16 +00:00
GDB Administrator
5866e4523e Automatic date update in version.in 2025-09-05 00:02:14 +00:00
GDB Administrator
3a967d947d Automatic date update in version.in 2025-09-04 00:02:20 +00:00
GDB Administrator
a2dc516de9 Automatic date update in version.in 2025-09-03 00:02:27 +00:00
GDB Administrator
e044c5ae18 Automatic date update in version.in 2025-09-02 00:02:36 +00:00
GDB Administrator
b740f36e42 Automatic date update in version.in 2025-09-01 00:02:17 +00:00
GDB Administrator
9534cad2b6 Automatic date update in version.in 2025-08-31 00:02:42 +00:00
GDB Administrator
3409a88ed9 Automatic date update in version.in 2025-08-30 00:03:29 +00:00
GDB Administrator
d9c3a2512b Automatic date update in version.in 2025-08-29 00:02:30 +00:00
GDB Administrator
f2e6d61a05 Automatic date update in version.in 2025-08-28 00:02:42 +00:00
GDB Administrator
402d0ae4ab Automatic date update in version.in 2025-08-27 00:03:43 +00:00
GDB Administrator
e2a1000a0c Automatic date update in version.in 2025-08-26 00:02:29 +00:00
GDB Administrator
8a90a503f2 Automatic date update in version.in 2025-08-25 00:01:00 +00:00
GDB Administrator
39d612432e Automatic date update in version.in 2025-08-24 00:03:29 +00:00
GDB Administrator
5e05a2f2b5 Automatic date update in version.in 2025-08-23 00:02:11 +00:00
GDB Administrator
0125e7b31e Automatic date update in version.in 2025-08-22 00:01:47 +00:00
GDB Administrator
21cf778006 Automatic date update in version.in 2025-08-21 00:02:45 +00:00
GDB Administrator
6b8e4373e1 Automatic date update in version.in 2025-08-20 00:02:06 +00:00
GDB Administrator
cdcd82da0c Automatic date update in version.in 2025-08-19 00:01:07 +00:00
GDB Administrator
135a2f6e70 Automatic date update in version.in 2025-08-18 00:02:09 +00:00
GDB Administrator
32c968de66 Automatic date update in version.in 2025-08-17 00:01:45 +00:00
GDB Administrator
0b2e92eafb Automatic date update in version.in 2025-08-16 00:00:35 +00:00
GDB Administrator
32e514add6 Automatic date update in version.in 2025-08-15 00:02:03 +00:00
GDB Administrator
1200265f4c Automatic date update in version.in 2025-08-14 00:01:56 +00:00
GDB Administrator
a7f05e8c4e Automatic date update in version.in 2025-08-13 00:02:28 +00:00
GDB Administrator
9f2e428537 Automatic date update in version.in 2025-08-12 00:01:26 +00:00
GDB Administrator
026fb9b036 Automatic date update in version.in 2025-08-11 00:02:18 +00:00
GDB Administrator
3ea83958a6 Automatic date update in version.in 2025-08-10 00:00:32 +00:00
GDB Administrator
b85a45377b Automatic date update in version.in 2025-08-09 00:01:46 +00:00
GDB Administrator
f5f3e8e6e5 Automatic date update in version.in 2025-08-08 00:00:40 +00:00
GDB Administrator
ecffec858a Automatic date update in version.in 2025-08-07 00:00:45 +00:00
GDB Administrator
d4d7f13580 Automatic date update in version.in 2025-08-06 00:02:07 +00:00
GDB Administrator
66771ce25e Automatic date update in version.in 2025-08-05 00:01:16 +00:00
GDB Administrator
f7b0e43421 Automatic date update in version.in 2025-08-04 00:01:38 +00:00
GDB Administrator
ab19fb83cb Automatic date update in version.in 2025-08-03 00:01:37 +00:00
GDB Administrator
67d651192e Automatic date update in version.in 2025-08-02 00:01:43 +00:00
GDB Administrator
53df0d2cd6 Automatic date update in version.in 2025-08-01 00:04:57 +00:00
GDB Administrator
08ae1ac0be Automatic date update in version.in 2025-07-31 00:02:49 +00:00
GDB Administrator
9ef91d0ff0 Automatic date update in version.in 2025-07-30 00:02:55 +00:00
GDB Administrator
6524ddd668 Automatic date update in version.in 2025-07-29 00:03:19 +00:00
GDB Administrator
ccdedd93a5 Automatic date update in version.in 2025-07-28 00:00:44 +00:00
GDB Administrator
7c7478dc0f Automatic date update in version.in 2025-07-27 00:02:24 +00:00
GDB Administrator
327b332a69 Automatic date update in version.in 2025-07-26 00:02:26 +00:00
GDB Administrator
c8d2f00428 Automatic date update in version.in 2025-07-25 00:02:29 +00:00
GDB Administrator
05d9b0d126 Automatic date update in version.in 2025-07-24 00:05:58 +00:00
GDB Administrator
e964bb559d Automatic date update in version.in 2025-07-23 00:03:29 +00:00
GDB Administrator
ff67b86d3c Automatic date update in version.in 2025-07-22 00:03:17 +00:00
GDB Administrator
d69e6841ba Automatic date update in version.in 2025-07-21 00:02:15 +00:00
GDB Administrator
5cc6287a6b Automatic date update in version.in 2025-07-20 00:02:26 +00:00
GDB Administrator
9664890deb Automatic date update in version.in 2025-07-19 00:02:24 +00:00
GDB Administrator
37fcff05e7 Automatic date update in version.in 2025-07-18 00:02:25 +00:00
GDB Administrator
3c9f85512f Automatic date update in version.in 2025-07-17 00:02:53 +00:00
GDB Administrator
11e4b92b66 Automatic date update in version.in 2025-07-16 00:01:04 +00:00
GDB Administrator
3eb81ecd26 Automatic date update in version.in 2025-07-15 00:02:07 +00:00
GDB Administrator
638640e8a3 Automatic date update in version.in 2025-07-14 00:01:24 +00:00
GDB Administrator
502e3ae85d Automatic date update in version.in 2025-07-13 00:04:29 +00:00
GDB Administrator
72137dc7c2 Automatic date update in version.in 2025-07-12 00:02:34 +00:00
GDB Administrator
30b99373d4 Automatic date update in version.in 2025-07-11 00:02:28 +00:00
GDB Administrator
3d1c31c697 Automatic date update in version.in 2025-07-10 00:03:01 +00:00
GDB Administrator
579cda63cf Automatic date update in version.in 2025-07-09 00:02:37 +00:00
GDB Administrator
c3bf2cc517 Automatic date update in version.in 2025-07-08 00:02:28 +00:00
GDB Administrator
6ea944aafa Automatic date update in version.in 2025-07-07 00:02:23 +00:00
GDB Administrator
31a77ce7ea Automatic date update in version.in 2025-07-06 00:01:56 +00:00
GDB Administrator
6430b5a51a Automatic date update in version.in 2025-07-05 00:01:34 +00:00
GDB Administrator
83064bb78e Automatic date update in version.in 2025-07-04 00:01:37 +00:00
GDB Administrator
1e4e7bf6e4 Automatic date update in version.in 2025-07-03 00:01:38 +00:00
GDB Administrator
0f8f7018e5 Automatic date update in version.in 2025-07-02 00:02:46 +00:00
GDB Administrator
60047116c6 Automatic date update in version.in 2025-07-01 00:03:10 +00:00
GDB Administrator
545765e4b4 Automatic date update in version.in 2025-06-30 00:02:32 +00:00
GDB Administrator
250ac01baf Automatic date update in version.in 2025-06-29 00:00:49 +00:00
GDB Administrator
e3b31d6715 Automatic date update in version.in 2025-06-28 00:04:16 +00:00
GDB Administrator
69957b1aa7 Automatic date update in version.in 2025-06-27 00:01:59 +00:00
GDB Administrator
a80a9e0bc9 Automatic date update in version.in 2025-06-26 00:03:33 +00:00
GDB Administrator
4f7b25cab8 Automatic date update in version.in 2025-06-25 00:03:03 +00:00
GDB Administrator
978c80bbbc Automatic date update in version.in 2025-06-24 00:01:53 +00:00
GDB Administrator
65a3b3aaba Automatic date update in version.in 2025-06-23 00:02:53 +00:00
GDB Administrator
59cb561d36 Automatic date update in version.in 2025-06-22 00:01:28 +00:00
GDB Administrator
9e772df10d Automatic date update in version.in 2025-06-21 00:01:09 +00:00
GDB Administrator
bf61209828 Automatic date update in version.in 2025-06-20 00:03:24 +00:00
GDB Administrator
5b113fcbc0 Automatic date update in version.in 2025-06-19 00:01:42 +00:00
GDB Administrator
0348fc87a3 Automatic date update in version.in 2025-06-18 00:03:54 +00:00
GDB Administrator
57dac6a958 Automatic date update in version.in 2025-06-17 00:00:52 +00:00
GDB Administrator
83572bc1c6 Automatic date update in version.in 2025-06-16 00:01:45 +00:00
GDB Administrator
a763011c43 Automatic date update in version.in 2025-06-15 00:01:50 +00:00
GDB Administrator
a1af2f4283 Automatic date update in version.in 2025-06-14 00:01:26 +00:00
GDB Administrator
72c0f1aad1 Automatic date update in version.in 2025-06-13 00:02:07 +00:00
GDB Administrator
18a5fb513d Automatic date update in version.in 2025-06-12 00:01:11 +00:00
GDB Administrator
8bb548c545 Automatic date update in version.in 2025-06-11 00:02:23 +00:00
Chris Packham
800169229d readline/tcap.h: Update definitions for C23
C23 changes how function definitions like int `int tputs ()` are
interpreted. In older standards this meant that the function arguments
are unknown. In C23 this is interpreted as `int tputs (void)` so now
when we compile with GCC15 (which defaults to -std=gnu23) we get an
error such as

  readline/display.c:2839:17: error: too many arguments to function 'tputs'; expected 0, have 3

Add the function arguments for tgetent(), tgetflag(), tgetnum(),
tgetstr(), tputs() and tgoto().

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Approved-By: Tom Tromey <tom@tromey.com>
(cherry picked from commit 5c87b330e9)
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33071
2025-06-10 07:02:46 -06:00
GDB Administrator
6545ef453a Automatic date update in version.in 2025-06-10 00:02:06 +00:00
GDB Administrator
787f2011fb Automatic date update in version.in 2025-06-09 00:01:38 +00:00
GDB Administrator
90ed4538b5 Automatic date update in version.in 2025-06-08 00:00:54 +00:00
GDB Administrator
87b88ef572 Automatic date update in version.in 2025-06-07 00:02:29 +00:00
GDB Administrator
6e2a29c8b4 Automatic date update in version.in 2025-06-06 00:01:03 +00:00
GDB Administrator
caba09fb40 Automatic date update in version.in 2025-06-05 00:01:30 +00:00
GDB Administrator
1577fd4ea3 Automatic date update in version.in 2025-06-04 00:01:22 +00:00
GDB Administrator
fbad216c6f Automatic date update in version.in 2025-06-03 00:01:36 +00:00
GDB Administrator
23adf9579b Automatic date update in version.in 2025-06-02 00:01:27 +00:00
GDB Administrator
20d1308485 Automatic date update in version.in 2025-06-01 00:00:44 +00:00
GDB Administrator
75ac69e2f6 Automatic date update in version.in 2025-05-31 00:00:43 +00:00
GDB Administrator
6bf3dce450 Automatic date update in version.in 2025-05-30 00:00:28 +00:00
GDB Administrator
e28f184b87 Automatic date update in version.in 2025-05-29 00:00:50 +00:00
GDB Administrator
a4dec47ea4 Automatic date update in version.in 2025-05-28 00:00:49 +00:00
GDB Administrator
5df179ed1f Automatic date update in version.in 2025-05-27 00:00:55 +00:00
GDB Administrator
c91e464a69 Automatic date update in version.in 2025-05-26 00:00:53 +00:00
GDB Administrator
d7d487fce4 Automatic date update in version.in 2025-05-25 00:01:27 +00:00
GDB Administrator
6afaca3a98 Automatic date update in version.in 2025-05-24 00:00:34 +00:00
GDB Administrator
387256e049 Automatic date update in version.in 2025-05-23 00:01:28 +00:00
GDB Administrator
d3513cdc85 Automatic date update in version.in 2025-05-22 00:00:23 +00:00
GDB Administrator
e6f6f897df Automatic date update in version.in 2025-05-21 00:01:10 +00:00
GDB Administrator
916d66b6ad Automatic date update in version.in 2025-05-20 00:00:35 +00:00
GDB Administrator
534b1ffbc9 Automatic date update in version.in 2025-05-19 00:00:39 +00:00
GDB Administrator
43b40dea00 Automatic date update in version.in 2025-05-18 00:01:09 +00:00
GDB Administrator
758bb50ed8 Automatic date update in version.in 2025-05-17 00:00:32 +00:00
GDB Administrator
09ff24347f Automatic date update in version.in 2025-05-16 00:01:06 +00:00
GDB Administrator
f18b1dbb08 Automatic date update in version.in 2025-05-15 00:01:14 +00:00
GDB Administrator
72f25be7b4 Automatic date update in version.in 2025-05-14 00:01:11 +00:00
GDB Administrator
66e96ab870 Automatic date update in version.in 2025-05-13 00:00:36 +00:00
GDB Administrator
39ea500ff4 Automatic date update in version.in 2025-05-12 00:00:40 +00:00
GDB Administrator
d8923b122e Automatic date update in version.in 2025-05-11 00:00:31 +00:00
GDB Administrator
b3aa399aba Automatic date update in version.in 2025-05-10 00:01:13 +00:00
GDB Administrator
63b7565333 Automatic date update in version.in 2025-05-09 00:01:20 +00:00
GDB Administrator
ba02e24633 Automatic date update in version.in 2025-05-08 00:00:36 +00:00
GDB Administrator
7175ef17b4 Automatic date update in version.in 2025-05-07 00:01:21 +00:00
GDB Administrator
dc68fdb380 Automatic date update in version.in 2025-05-06 00:00:40 +00:00
GDB Administrator
ad893b8495 Automatic date update in version.in 2025-05-05 00:00:38 +00:00
GDB Administrator
fb0225c44a Automatic date update in version.in 2025-05-04 00:01:15 +00:00
GDB Administrator
12f8e5acbd Automatic date update in version.in 2025-05-03 00:00:31 +00:00
GDB Administrator
37054a00ef Automatic date update in version.in 2025-05-02 00:01:21 +00:00
GDB Administrator
079d51740f Automatic date update in version.in 2025-05-01 00:00:27 +00:00
GDB Administrator
76f2d9137d Automatic date update in version.in 2025-04-30 00:02:13 +00:00
GDB Administrator
ddeed725f4 Automatic date update in version.in 2025-04-29 00:01:24 +00:00
GDB Administrator
51022359f6 Automatic date update in version.in 2025-04-28 00:01:33 +00:00
GDB Administrator
bcc9f06180 Automatic date update in version.in 2025-04-27 00:01:03 +00:00
GDB Administrator
3ab6c4ad58 Automatic date update in version.in 2025-04-26 00:00:31 +00:00
GDB Administrator
71d3b6c657 Automatic date update in version.in 2025-04-25 00:00:49 +00:00
GDB Administrator
daa8e5b06d Automatic date update in version.in 2025-04-24 00:00:28 +00:00
GDB Administrator
ac023117a2 Automatic date update in version.in 2025-04-23 00:02:08 +00:00
GDB Administrator
2594e6acd3 Automatic date update in version.in 2025-04-22 00:02:09 +00:00
GDB Administrator
dc2257b9cc Automatic date update in version.in 2025-04-21 00:00:42 +00:00
Joel Brobecker
052e83f0e3 Bump GDB's version number to 16.3.90.DATE-git.
This commit changes gdb/version.in to 16.3.90.DATE-git.

This commit also makes the following changes in gdb/testsuite:

	* gdb.base/default.exp: Change $_gdb_minor to 4.
2025-04-20 10:39:23 -07:00
Joel Brobecker
140ba011c0 Set GDB version number to 16.3.
This commit changes gdb/version.in to 16.3.
2025-04-20 10:22:06 -07:00
GDB Administrator
788edd470b Automatic date update in version.in 2025-04-20 00:01:45 +00:00
GDB Administrator
ec46e2ce7a Automatic date update in version.in 2025-04-19 00:01:13 +00:00
GDB Administrator
a74df132e3 Automatic date update in version.in 2025-04-18 00:01:40 +00:00
GDB Administrator
6c82a55780 Automatic date update in version.in 2025-04-17 00:00:43 +00:00
GDB Administrator
055279c914 Automatic date update in version.in 2025-04-16 00:01:15 +00:00
GDB Administrator
f92a904726 Automatic date update in version.in 2025-04-15 00:01:28 +00:00
GDB Administrator
3c2c00c32a Automatic date update in version.in 2025-04-14 00:00:41 +00:00
GDB Administrator
5eed5758ae Automatic date update in version.in 2025-04-13 00:00:38 +00:00
GDB Administrator
ebf7dd0ed8 Automatic date update in version.in 2025-04-12 00:00:43 +00:00
GDB Administrator
1936dc6a64 Automatic date update in version.in 2025-04-11 00:01:08 +00:00
GDB Administrator
6ce88ba61e Automatic date update in version.in 2025-04-10 00:01:13 +00:00
GDB Administrator
1549d0525b Automatic date update in version.in 2025-04-09 00:00:42 +00:00
GDB Administrator
565ad7474c Automatic date update in version.in 2025-04-08 00:01:17 +00:00
Keith Seitz
a7abbebc6d gstack: [downstream regression] Output file names and line numbers
With commit fb2ded33c1, I added
Fedora's gstack script to gdb.  Some issues have arisen since
then, and this patch addresses those issues:

. As Sam James recently noted[1], PKGVERSION and VERSION
  need to be quoted.
. A Fedora user reported the misuse of --readnever, which
  causes gstack to omit filename and line number information in the
  backtrace[Red Hat BZ 2354997].

[1] https://inbox.sourceware.org/gdb-patches/d19d6bc17e0a160ce27fc572079f11a587c0e168.1742424869.git.sam@gentoo.org/
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2354997
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32828
2025-04-07 08:40:56 -07:00
Luis Machado
4ffff8e30b Fix build failure for gdbserver's raw_compare self test
Commit 5c89e5539a addressed a SVE/SME gdbserver
crash on gdbserver and added a gdbserver-side self test for a register cache
raw_compare function.

For the GDB 16 branch though, gdbserver's regcache doesn't yet have a
constructor taking a target description, so we need to explicitly initialize
the register cache before the self test can take place.

Also, the self tests are only built if we explicitly pass --enable-unit-tests
to configure. This build error should not manifest on a default build that
doesn't enable self tests.

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

Reviewed-By: Keith Seitz <keiths@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-04-07 15:18:43 +01:00
GDB Administrator
0a363b10a1 Automatic date update in version.in 2025-04-07 00:00:52 +00:00
GDB Administrator
3348e9233b Automatic date update in version.in 2025-04-06 00:00:42 +00:00
GDB Administrator
b61f17e695 Automatic date update in version.in 2025-04-05 00:00:52 +00:00
GDB Administrator
d195670d47 Automatic date update in version.in 2025-04-04 00:00:48 +00:00
GDB Administrator
da5c8de5b0 Automatic date update in version.in 2025-04-03 00:00:34 +00:00
Luis Machado
5c89e5539a Fix gdbserver crashes on SVE/SME-enabled systems
Commit 51e6b8cfd6 fixed a
regression for SVE/SME registers on gdb's side by using a <= comparison for
regcache's raw_compare assertion check. We seem to have failed to do the same
for gdbserver's raw_compare counterpart.

With the code as it is, I'm seeing a lot of crashes for gdbserver on a machine
with SVE enabled. For instance, with the following invocation:

make check-gdb RUNTESTFLAGS="--target_board=native-gdbserver" TESTS=gdb.base/break.exp

Running /work/builds/binutils-gdb/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.base/break.exp ...
FAIL: gdb.base/break.exp: test_break: run until function breakpoint
FAIL: gdb.base/break.exp: test_break: run until breakpoint set at a line number (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: run until file:function(6) breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: run until file:function(5) breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: run until file:function(4) breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: run until file:function(3) breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: run until file:function(2) breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: run until file:function(1) breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: run until quoted breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: run until file:linenum breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: breakpoint offset +1
FAIL: gdb.base/break.exp: test_break: step onto breakpoint (the program is no longer running)
FAIL: gdb.base/break.exp: test_break: setting breakpoint at }
FAIL: gdb.base/break.exp: test_break: continue to breakpoint at } (the program is no longer running)
FAIL: gdb.base/break.exp: test_no_break_on_catchpoint: runto: run to main
FAIL: gdb.base/break.exp: test_break_nonexistent_line: runto: run to main
FAIL: gdb.base/break.exp: test_break_default: runto: run to main
FAIL: gdb.base/break.exp: test_break_silent_and_more: runto: run to main
FAIL: gdb.base/break.exp: test_break_line_convenience_var: runto: run to main
FAIL: gdb.base/break.exp: test_break_user_call: runto: run to main
FAIL: gdb.base/break.exp: test_finish_arguments: runto: run to main
FAIL: gdb.base/break.exp: test_next_with_recursion: kill program
FAIL: gdb.base/break.exp: test_next_with_recursion: run to factorial(6)
FAIL: gdb.base/break.exp: test_next_with_recursion: continue to factorial(5) (the program is no longer running)
FAIL: gdb.base/break.exp: test_next_with_recursion: backtrace from factorial(5)
FAIL: gdb.base/break.exp: test_next_with_recursion: next to recursive call (the program is no longer running)
FAIL: gdb.base/break.exp: test_next_with_recursion: next over recursive call (the program is no longer running)
FAIL: gdb.base/break.exp: test_next_with_recursion: backtrace from factorial(5.1)
FAIL: gdb.base/break.exp: test_next_with_recursion: continue until exit at recursive next test (the program is no longer running)
FAIL: gdb.base/break.exp: test_break_optimized_prologue: run until function breakpoint, optimized file
FAIL: gdb.base/break.exp: test_break_optimized_prologue: run until breakpoint set at small function, optimized file (the program is no longer running)
FAIL: gdb.base/break.exp: test_rbreak_shlib: rbreak junk

Adjusting the regcache raw_compare assertion check to use <= fixes
the problem on aarch64-linux on a SVE-capable system.

This patch also adds a simple selftest to gdbserver that validates this
particular case by simulating a raw_compare operation.

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

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-04-02 17:07:14 +01:00
Andrew Burgess
a2c8f78df5 gdb: allow selecting default fg/bg colors in tui mode
This commit fixes PR gdb/32797, and pulls in just part of commit:

  commit 6447969d0a
  Date:   Sat Oct 5 22:27:44 2024 +0300

    Add an option with a color type.

to the gdb-16-branch.

This commit allows the escape sequences \x1b[39m and \x1b[49m, which
select the default foreground and background colours respectively, to
work correctly.

This fix is just a small part of the above commit.  Only these two
changes are required to fix this bug.  As we are currently preparing
for a 16.3 release, I don't think we should be pulling in the whole of
the above commit.

You can test this commit using:

  export TERM=xterm-256color
  gdb -q -tui -ex 'py print("normal\n\x1b[39mforeground default\n\x1b[0mnormal\n\x1b[49mbackground default\n\x1b[0mnormal\n")'

All of the output text should use the default foreground and
background colors.

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

Approved-By: Tom Tromey <tom@tromey.com>
2025-04-02 16:11:24 +01:00
GDB Administrator
bc997150d8 Automatic date update in version.in 2025-04-02 00:00:39 +00:00
GDB Administrator
27d7403d46 Automatic date update in version.in 2025-04-01 00:01:06 +00:00
GDB Administrator
f3ecdb73cd Automatic date update in version.in 2025-03-31 00:00:46 +00:00
GDB Administrator
9c3d1bb4c8 Automatic date update in version.in 2025-03-30 00:00:26 +00:00
GDB Administrator
24c91baf98 Automatic date update in version.in 2025-03-29 00:01:30 +00:00
Craig Blackmore
c295d55246 gdb: Fix assertion failure when inline frame #0 is duplicated
Modifying inline-frame-cycle-unwind.exp to use `bt -no-filters` produces
the following incorrect backtrace:

  #0  inline_func () at .../gdb/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.c:49
  #1  normal_func () at .../gdb/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.c:32
  #2  0x000055555555517f in inline_func () at .../gdb/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.c:50
  #3  normal_func () at .../gdb/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.c:32
  Backtrace stopped: previous frame identical to this frame (corrupt stack?)
  (gdb) FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 1: backtrace when the unwind is broken at frame 1

The expected output, which we get with `bt`, is:

  #0  inline_func () at .../gdb/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.c:49
  #1  normal_func () at .../gdb/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.c:32
  Backtrace stopped: previous frame identical to this frame (corrupt stack?)
  (gdb) PASS: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 1: backtrace when the unwind is broken at frame 1

The cycle checking in `get_prev_frame_maybe_check_cycle` relies on newer
frame ids having already been computed and stashed.  Unlike other
frames, frame #0's id does not get computed immediately.

The test passes with `bt` because when applying python frame filters,
the call to `bootstrap_python_frame_filters` happens to compute the id
of frame #0.  When `get_prev_frame_maybe_check_cycle` later tries to
stash frame #2's id, the cycle is detected.

The test fails with `bt -no-filters` because frame #0's id has not been
stashed by the time `get_prev_frame_maybe_check_cycle` tries to stash
frame #2's id which succeeds and the cycle is only detected later when
trying to stash frame #4's id.  Doing `stepi` after the incorrect
backtrace would then trigger an assertion failure when trying to stash
frame #0's id because it is a duplicate of #2's already stashed id.

In `get_prev_frame_always_1`, if this_frame is inline frame 0, then
compute and stash its frame id before returning the previous frame.
This ensures that the id of inline frame 0 has been stashed before
`get_prev_frame_maybe_check_cycle` is called on older frames.

The test case has been updated to run both `bt` and `bt -no-filters`.

Co-authored-by: Andrew Burgess <aburgess@redhat.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32757
2025-03-28 09:57:18 +00:00
GDB Administrator
66150ea536 Automatic date update in version.in 2025-03-28 00:00:37 +00:00
GDB Administrator
0c09aa22ee Automatic date update in version.in 2025-03-27 00:00:33 +00:00
GDB Administrator
b9a7fda110 Automatic date update in version.in 2025-03-26 00:00:51 +00:00
GDB Administrator
21c21807a3 Automatic date update in version.in 2025-03-25 00:00:36 +00:00
GDB Administrator
67e9e439f7 Automatic date update in version.in 2025-03-24 00:01:22 +00:00
GDB Administrator
dcf6d684ce Automatic date update in version.in 2025-03-23 00:01:09 +00:00
GDB Administrator
639b6f1055 Automatic date update in version.in 2025-03-22 00:01:34 +00:00
GDB Administrator
a1bcf87a5f Automatic date update in version.in 2025-03-21 00:01:18 +00:00
GDB Administrator
883f7d18d1 Automatic date update in version.in 2025-03-20 00:00:59 +00:00
GDB Administrator
b4b7d9f112 Automatic date update in version.in 2025-03-19 00:01:50 +00:00
GDB Administrator
f45379953a Automatic date update in version.in 2025-03-18 00:01:12 +00:00
GDB Administrator
d6e18cff1d Automatic date update in version.in 2025-03-17 00:01:53 +00:00
GDB Administrator
3ee680f9eb Automatic date update in version.in 2025-03-16 00:01:13 +00:00
Tom de Vries
5bc76dc8d4 [gdb/tdep] Rewrite i386_canonicalize_syscall
On openSUSE Tumbleweed x86_64, with target board unix/-m32 and test-case
gdb.reverse/recvmsg-reverse.exp, I run into:
...
(gdb) continue^M
Continuing.^M
Process record and replay target doesn't support syscall number 360^M
Process record: failed to record execution log.^M
^M
Program stopped.^M
0xf7fc5575 in __kernel_vsyscall ()^M
(gdb) FAIL: $exp: continue to breakpoint: marker2
...

The syscall number 360 in i386 is for syscall socketpair, as we can see in
arch/x86/entry/syscalls/syscall_32.tbl:
...
<number>  <abi>  <name>      <entry point>
360       i386   socketpair  sys_socketpair
...

Function i386_canonicalize_syscall assumes that any syscall below 500 maps to
an identically valued enum in enum gdb_syscall:
...
static enum gdb_syscall
i386_canonicalize_syscall (int syscall)
{
  enum { i386_syscall_max = 499 };

  if (syscall <= i386_syscall_max)
    return (enum gdb_syscall) syscall;
  else
    return gdb_sys_no_syscall;
}
...

However, that's not the case.  The value of gdb_sys_socketpair is not 360,
but 512:
...
enum gdb_syscall {
  ...
  gdb_sys_getrandom = 355,
  gdb_sys_statx = 383,
  ...
  gdb_sys_socketpair = 512,
...

Consequently, when record_linux_system_call is called with
syscall == i386_canonicalize_syscall (360), we hit the default case here:
....
  switch (syscall)
    {
    ...
    default:
      gdb_printf (gdb_stderr,
                  _("Process record and replay target doesn't "
                    "support syscall number %d\n"), syscall);
      return -1;
      break;
    }
...
rather than hitting the case for gdb_sys_socketpair.

I initially wrote a trivial fix for this, changing the value of
gdb_sys_socketpair to 360.  However, Andreas Schwab pointed out that there are
other functions (ppc_canonicalize_syscall and s390_canonicalize_syscall) that
make assumptions about specific values of enum gdb_syscall, and fixing this
for i386 may break things for ppc or s390.

So instead, I decided to rewrite i386_canonicalize_syscall to match the
approach taken in aarch64_canonicalize_syscall, which allows
gdb_sys_socketpair to keep the same value.

So, fix this by:
- adding a new table file gdb/i386-syscalls.def, using a SYSCALL entry for
  each syscall, generated from arch/x86/entry/syscalls/syscall_32.tbl,
- using gdb/i386-syscalls.def to define enum i386_syscall, and
- using macros SYSCALL_MAP, SYSCALL_MAP_RENAME and UNSUPPORTED_SYSCALL_MAP to
  define the mapping from enum i386_syscall to enum gdb_syscall in
  i386_canonicalize_syscall.

I've created the mapping as follows:
- I used arch/x86/entry/syscalls/syscall_32.tbl to generate an initial mapping
  using SYSCALL_MAP for each syscall,
- I attempted to compile this and used the compilation errors about
  non-existing gdb_sys_ values to change those entries to
  UNSUPPORTED_SYSCALL_MAP, which got me a compiling version,
- I reviewed the UNSUPPORTED_SYSCALL_MAP entries, changing to
  SYSCALL_MAP_RENAME where necessary,
- I then reviewed syscalls below 500 that mapped to a gdb_syscall value below
  500, but not the same, and fixed those using SYSCALL_MAP_RENAME, and
- reviewed the mapping for gdb_syscall entries >= 500.

On the resulting mapping, I was able to do the following sanity check:
...
  for (int i = 0; i < 500; ++i)
    {
      int res = i386_canonicalize_syscall (i);
      if (res == i)
	continue;
      if (res == -1)
	continue;
      if (res >= 500)
	continue;
      gdb_assert_not_reached ("");
    }
}
...
to make sure that any syscall below 500 either:
- maps to the same number,
- is unsupported, or
- maps to a number >= 500.

Coming back to our original problem, the socket pair syscall is addressed by
an entry:
...
      SYSCALL_MAP (socketpair);
...
which maps i386_sys_socketpair (360) to gdb_sys_socketpair (512).

Tested on x86_64-linux with target board unix/-m32.

Approved-By: Guinevere Larsen <guinevere@redhat.com>

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

(cherry picked from commit fbfb29b304)
2025-03-15 13:17:36 +01:00
GDB Administrator
0230950c6e Automatic date update in version.in 2025-03-15 00:01:04 +00:00
GDB Administrator
7a6ff0051f Automatic date update in version.in 2025-03-14 00:01:23 +00:00
Tom de Vries
55b7a56b1f [gdb/record] Fix out-of-bounds write in aarch64_record_asimd_load_store
After compiling gdb with -fstack-protector-all, and running test-case
gdb.reverse/getrandom.exp on aarch64-linux, we run into
"Stack smashing detected" in function aarch64_record_asimd_load_store.

This is reported in PR record/32784.

This happens due to an out-of-bounds write to local array record_buf_mem:
...
  uint64_t record_buf_mem[24];
...
when recording insn:
...
B+>0xfffff7ff4d10  st1     {v0.16b-v3.16b}, [x0]
...

We can fix this by increasing the array size to 128, but rather than again
hardcoding a size, reimplement record_buf_mem as std::vector.

Tested on aarch64-linux.

Approved-By: Guinevere Larsen <guinevere@redhat.com>

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32784
(cherry picked from commit 51729ea090)
2025-03-13 11:15:05 +01:00
GDB Administrator
465465ce9c Automatic date update in version.in 2025-03-13 00:00:41 +00:00
GDB Administrator
b4d832ef2b Automatic date update in version.in 2025-03-12 00:01:24 +00:00
GDB Administrator
5f2f9d4dcc Automatic date update in version.in 2025-03-11 00:01:15 +00:00
Simon Marchi
4996027dbf gdb/dwarf: save DWARF version in dwarf2_loclist_baton, remove it from dwarf2_per_cu
When running:

    $ make check TESTS="gdb.cp/cpexprs-debug-types.exp" RUNTESTFLAGS="--target_board=fission"

I get:

    (gdb) break -qualified main
    /home/smarchi/src/binutils-gdb/gdb/dwarf2/read.h:295: internal-error: version: Assertion `m_dwarf_version != 0' failed.

The problem is that dwarf2_per_cu objects created in the
read_cutu_die_from_dwo code path never have their DWARF version set.  A
seemingly obvious solution would be to add a call to
dwarf2_per_cu::set_version in there (there's a patch in the referenced
PR that does that).  However, this comment in
read_comp_units_from_section is a bit scary:

      /* Init this asap, to avoid a data race in the set_version in
	 cutu_reader::cutu_reader (which may be run in parallel for the cooked
	 index case).  */
      this_cu->set_version (cu_header.version);

I don't know if a DWO file can be read while the cooked indexer runs, so
if it would be a problem here, but I prefer to be safe than sorry.  This
patch side-steps the problem by deleting the DWARF version from
dwarf2_per_cu.

The only users of dwarf2_per_cu::version are the loclists callbacks in
`loc.c`.  Add the DWARF version to dwarf2_loclist_baton and modify those
callbacks to get the version from there instead.  Initialize that new
field in fill_in_loclist_baton.

I like this approach because there is no version field that is possibly
unset now.

I wasn't keen on doing this at first because I thought it would waste
space, but the dwarf2_loclist_baton has 7 bytes of padding at the end
anyway, so we might as well use that.

Cc: Ricky Zhou <ricky@rzhou.org>
Cc: Tom de Vries <tdevries@suse.de>
Cc: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32309
Change-Id: I30d4ede7d67da5d80ff65c6122f5868e1098ec52
Approved-By: Tom Tromey <tom@tromey.com>
(cherry picked from commit f62cf22157)
2025-03-10 16:24:47 -04:00
GDB Administrator
fbc36742f7 Automatic date update in version.in 2025-03-10 00:00:42 +00:00
Brandon Belew
ebb9d77f35 Fix segfault if target_fileio_read_alloc fails
Check for target_fileio_read_alloc failure in linux_fill_prpsinfo
before dereferencing buffer. This fixes a segfault in the 'gcore'
command when attached to certain remote targets.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32441
Approved-By: Andrew Burgess <aburgess@redhat.com>
(cherry picked from commit cbc6950a66)
2025-03-09 08:17:55 +04:00
GDB Administrator
94f97a3cdd Automatic date update in version.in 2025-03-09 00:01:12 +00:00
GDB Administrator
96f3f01d9d Automatic date update in version.in 2025-03-08 00:00:36 +00:00
GDB Administrator
8bdaecde02 Automatic date update in version.in 2025-03-07 00:00:49 +00:00
GDB Administrator
fa315f8c30 Automatic date update in version.in 2025-03-06 00:01:03 +00:00
GDB Administrator
a5bfad18c4 Automatic date update in version.in 2025-03-05 00:01:28 +00:00
GDB Administrator
de2c17ad1d Automatic date update in version.in 2025-03-04 00:01:35 +00:00
GDB Administrator
fdf8666844 Automatic date update in version.in 2025-03-03 00:01:14 +00:00
GDB Administrator
7aef96f044 Automatic date update in version.in 2025-03-02 00:00:57 +00:00
GDB Administrator
26f7f82058 Automatic date update in version.in 2025-03-01 00:00:41 +00:00
GDB Administrator
56e453742e Automatic date update in version.in 2025-02-28 00:00:28 +00:00
GDB Administrator
0674100e37 Automatic date update in version.in 2025-02-27 00:01:38 +00:00
GDB Administrator
636e85837a Automatic date update in version.in 2025-02-26 00:00:45 +00:00
GDB Administrator
09774db4f0 Automatic date update in version.in 2025-02-25 00:00:45 +00:00
GDB Administrator
7ea5b42758 Automatic date update in version.in 2025-02-24 00:00:42 +00:00
GDB Administrator
db69753580 Automatic date update in version.in 2025-02-23 00:01:45 +00:00
GDB Administrator
15672434ec Automatic date update in version.in 2025-02-22 00:01:08 +00:00
GDB Administrator
de09906181 Automatic date update in version.in 2025-02-21 00:01:32 +00:00
GDB Administrator
397f62b9d9 Automatic date update in version.in 2025-02-20 00:01:26 +00:00
GDB Administrator
e4ec026513 Automatic date update in version.in 2025-02-19 00:00:48 +00:00
GDB Administrator
bd6f05164f Automatic date update in version.in 2025-02-18 00:01:32 +00:00
GDB Administrator
6d52d7b146 Automatic date update in version.in 2025-02-17 00:00:34 +00:00
GDB Administrator
398b42317e Automatic date update in version.in 2025-02-16 00:01:03 +00:00
GDB Administrator
5429f87550 Automatic date update in version.in 2025-02-15 00:00:40 +00:00
GDB Administrator
944e553674 Automatic date update in version.in 2025-02-14 00:00:47 +00:00
GDB Administrator
d6762792f7 Automatic date update in version.in 2025-02-13 00:01:19 +00:00
GDB Administrator
5baddddfbe Automatic date update in version.in 2025-02-12 00:00:36 +00:00
GDB Administrator
9ef9fb511f Automatic date update in version.in 2025-02-11 00:00:46 +00:00
GDB Administrator
6e3384d4cc Automatic date update in version.in 2025-02-10 00:01:05 +00:00
GDB Administrator
5a14f9e79a Automatic date update in version.in 2025-02-09 00:00:39 +00:00
Andrew Burgess
2b646bb876 gdb/tui: use wrefresh if output is not surpressed
Recent work in the TUI has improved GDB's use of the curses
wnoutrefresh and doupdate mechanism, which improves performance by
batching together updates and then doing a single set of writes to the
screen when doupdate is finally called.

The tui_batch_rendering type is a RAII class which, in its destructor,
calls doupdate to send the batched updates to the screen.

However, if there is no tui_batch_rendering active on the call stack
then any wnoutrefresh calls will remain batched but undisplayed until
the next time doupdate happens to be called.

This problem can be seen in PR gdb/32623.  When an inferior is started
the 'Starting program' message is not immediately displayed to the
user.

The 'Starting program' message originates from run_command_1 in
infcmd.c, the message is sent to the current_uiout, which will be the
TUI ui_out.  After the message is sent, ui_out::flush() is called,
here's the backtrace when that happens:

  #0  tui_file::flush (this=0x36e4ab0) at ../../src/gdb/tui/tui-file.c:42
  #1  0x0000000001004f4b in pager_file::flush (this=0x36d35f0) at ../../src/gdb/utils.c:1531
  #2  0x0000000001004f71 in gdb_flush (stream=0x36d35f0) at ../../src/gdb/utils.c:1539
  #3  0x00000000006975ab in cli_ui_out::do_flush (this=0x35a50b0) at ../../src/gdb/cli-out.c:250
  #4  0x00000000009fd1f9 in ui_out::flush (this=0x35a50b0) at ../../src/gdb/ui-out.h:263
  #5  0x00000000009f56ad in run_command_1 (args=0x0, from_tty=1, run_how=RUN_NORMAL) at ../../src/gdb/infcmd.c:449
  #6  0x00000000009f599a in run_command (args=0x0, from_tty=1) at ../../src/gdb/infcmd.c:511

And if we check out tui_file::flush (tui-file.c) we can see that this
just calls tui_win_info::refresh_window(), which in turn, just uses
wnoutrefresh to batch any pending output.

The problem is that, in the above backtrace, there is no
tui_batch_rendering active, and so there will be no doupdate call to
flush the output to the screen.

We could add a tui_batch_rendering into tui_file::flush.  And
tui_file::write.  And tui_file::puts .....

... but that all seems a bit unnecessary.  Instead, I propose that
tui_win_info::refresh_window() should be changed.  If suppress_output
is true (i.e. a tui_batch_rendering is active) then we should continue
to call wnoutrefresh().  But if suppress_output is false, meaning that
no tui_batch_rendering is in place, then we should call wrefresh(),
which immediately writes the output to the screen.

Testing but PR gdb/32623 was a little involved.  We need to 'run' the
inferior and check for the 'Starting program' message.  But DejaGNUU
can only check for the message once it knows the message should have
appeared.  But, as the bug is that output is not displayed, we don't
have any output hints that the inferior is started yet...

In the end, I have the inferior create a file in the test's output
directory.  Now DejaGNU can send the 'run' command, and wait for the
file to appear.  Once that happens, we know that the 'Starting
program' message should have appeared.

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

Approved-By: Tom Tromey <tom@tromey.com>
2025-02-08 19:49:07 +00:00
GDB Administrator
655703fa8d Automatic date update in version.in 2025-02-08 00:00:20 +00:00
Tom de Vries
2fc5610642 [gdb/corefiles] Fix segfault in core_target_open
On x86_64-freebsd, with test-case gdb.arch/i386-biarch-core.exp I run into a
segfault here in corelow.c:core_target_open:
...
    {
      gdb::unique_xmalloc_ptr<char> failing_command = make_unique_xstrdup
        (bfd_core_file_failing_command (current_program_space->core_bfd ()));
      if (failing_command != nullptr)
        gdb_printf (_("Core was generated by `%s'.\n"),
                    failing_command.get ());
    }
...
where bfd_core_file_failing_command returns nullptr, so the segfault happens
somewhere during "strdup (nullptr)".

There doesn't seem to be a need to make a copy of the string, so fix this by
dropping the make_unique_xstrdup.

Tested on x86_64-linux.
Tested the test-case on x86_64-freebsd.

Approved-By: Tom Tromey <tom@tromey.com>

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

(cherry picked from commit 9dd3d66b79)
2025-02-07 17:06:30 +01:00
GDB Administrator
8d4e87af56 Automatic date update in version.in 2025-02-07 00:00:39 +00:00
GDB Administrator
74023881d2 Automatic date update in version.in 2025-02-06 00:01:00 +00:00
GDB Administrator
3dd94eccf6 Automatic date update in version.in 2025-02-05 00:00:34 +00:00
GDB Administrator
e649750353 Automatic date update in version.in 2025-02-04 00:01:22 +00:00
GDB Administrator
1c3834732b Automatic date update in version.in 2025-02-03 00:01:20 +00:00
GDB Administrator
82874bd707 Automatic date update in version.in 2025-02-02 00:01:13 +00:00
Joel Brobecker
39330efedd Bump GDB's version number to 16.2.90.DATE-git.
This commit changes gdb/version.in to 16.2.90.DATE-git.

This commit also makes the following changes in gdb/testsuite:

	* gdb.base/default.exp: Change $_gdb_minor to 3.
2025-02-01 14:28:15 +04:00
23 changed files with 1276 additions and 146 deletions

View File

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

View File

@@ -5200,9 +5200,9 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r)
CORE_ADDR address;
uint64_t addr_offset = 0;
uint32_t record_buf[24];
uint64_t record_buf_mem[24];
std::vector<uint64_t> record_buf_mem;
uint32_t reg_rn, reg_rt;
uint32_t reg_index = 0, mem_index = 0;
uint32_t reg_index = 0;
uint8_t opcode_bits, size_bits;
reg_rt = bits (aarch64_insn_r->aarch64_insn, 0, 4);
@@ -5265,8 +5265,8 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r)
record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM;
else
{
record_buf_mem[mem_index++] = esize / 8;
record_buf_mem[mem_index++] = address + addr_offset;
record_buf_mem.push_back (esize / 8);
record_buf_mem.push_back (address + addr_offset);
}
addr_offset = addr_offset + (esize / 8);
reg_rt = (reg_rt + 1) % 32;
@@ -5337,8 +5337,8 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r)
record_buf[reg_index++] = reg_tt + AARCH64_V0_REGNUM;
else
{
record_buf_mem[mem_index++] = esize / 8;
record_buf_mem[mem_index++] = address + addr_offset;
record_buf_mem.push_back (esize / 8);
record_buf_mem.push_back (address + addr_offset);
}
addr_offset = addr_offset + (esize / 8);
reg_tt = (reg_tt + 1) % 32;
@@ -5350,9 +5350,9 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r)
record_buf[reg_index++] = reg_rn;
aarch64_insn_r->reg_rec_count = reg_index;
aarch64_insn_r->mem_rec_count = mem_index / 2;
aarch64_insn_r->mem_rec_count = record_buf_mem.size () / 2;
MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count,
record_buf_mem);
record_buf_mem.data ());
REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count,
record_buf);
return AARCH64_RECORD_SUCCESS;

View File

@@ -1188,11 +1188,11 @@ core_target_open (const char *arg, int from_tty)
}
else
{
gdb::unique_xmalloc_ptr<char> failing_command = make_unique_xstrdup
(bfd_core_file_failing_command (current_program_space->core_bfd ()));
const char *failing_command
= bfd_core_file_failing_command (current_program_space->core_bfd ());
if (failing_command != nullptr)
gdb_printf (_("Core was generated by `%s'.\n"),
failing_command.get ());
failing_command);
}
/* Clearing any previous state of convenience variables. */

View File

@@ -388,12 +388,12 @@ dwarf2_find_location_expression (const dwarf2_loclist_baton *baton,
enum debug_loc_kind kind;
const gdb_byte *new_ptr = NULL; /* init for gcc -Wall */
if (baton->per_cu->version () < 5 && baton->from_dwo)
if (baton->dwarf_version < 5 && baton->from_dwo)
kind = decode_debug_loc_dwo_addresses (baton->per_cu,
baton->per_objfile,
loc_ptr, buf_end, &new_ptr,
&low, &high, byte_order);
else if (baton->per_cu->version () < 5)
else if (baton->dwarf_version < 5)
kind = decode_debug_loc_addresses (loc_ptr, buf_end, &new_ptr,
&low, &high,
byte_order, addr_size,
@@ -444,7 +444,7 @@ dwarf2_find_location_expression (const dwarf2_loclist_baton *baton,
high = (unrelocated_addr) ((CORE_ADDR) high + (CORE_ADDR) base_address);
}
if (baton->per_cu->version () < 5)
if (baton->dwarf_version < 5)
{
length = extract_unsigned_integer (loc_ptr, 2, byte_order);
loc_ptr += 2;
@@ -3977,12 +3977,12 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
enum debug_loc_kind kind;
const gdb_byte *new_ptr = NULL; /* init for gcc -Wall */
if (dlbaton->per_cu->version () < 5 && dlbaton->from_dwo)
if (dlbaton->dwarf_version < 5 && dlbaton->from_dwo)
kind = decode_debug_loc_dwo_addresses (dlbaton->per_cu,
per_objfile,
loc_ptr, buf_end, &new_ptr,
&low, &high, byte_order);
else if (dlbaton->per_cu->version () < 5)
else if (dlbaton->dwarf_version < 5)
kind = decode_debug_loc_addresses (loc_ptr, buf_end, &new_ptr,
&low, &high,
byte_order, addr_size,
@@ -4032,7 +4032,7 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
CORE_ADDR low_reloc = per_objfile->relocate (low);
CORE_ADDR high_reloc = per_objfile->relocate (high);
if (dlbaton->per_cu->version () < 5)
if (dlbaton->dwarf_version < 5)
{
length = extract_unsigned_integer (loc_ptr, 2, byte_order);
loc_ptr += 2;

View File

@@ -197,6 +197,9 @@ struct dwarf2_loclist_baton
/* Non-zero if the location list lives in .debug_loc.dwo.
The format of entries in this section are different. */
unsigned char from_dwo;
/* The version of DWARF this loclist comes from. */
unsigned char dwarf_version;
};
/* The baton used when a dynamic property is an offset to a parent

View File

@@ -4103,8 +4103,6 @@ cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
/* Establish the type offset that can be used to lookup the type. */
sig_type->type_offset_in_section =
this_cu->sect_off + to_underlying (sig_type->type_offset_in_tu);
this_cu->set_version (cu->header.version);
}
else
{
@@ -4115,7 +4113,6 @@ cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
gdb_assert (this_cu->sect_off == cu->header.sect_off);
this_cu->set_length (cu->header.get_length_with_initial ());
this_cu->set_version (cu->header.version);
}
}
@@ -5129,10 +5126,6 @@ read_comp_units_from_section (dwarf2_per_objfile *per_objfile,
this_cu->set_length (cu_header.get_length_with_initial ());
this_cu->is_dwz = is_dwz;
this_cu->section = section;
/* Init this asap, to avoid a data race in the set_version in
cutu_reader::cutu_reader (which may be run in parallel for the cooked
index case). */
this_cu->set_version (cu_header.version);
info_ptr = info_ptr + this_cu->length ();
per_objfile->per_bfd->all_units.push_back (std::move (this_cu));
@@ -9237,7 +9230,7 @@ open_and_init_dwo_file (dwarf2_cu *cu, const char *dwo_name,
create_cus_hash_table (per_objfile, cu, *dwo_file, dwo_file->sections.info,
dwo_file->cus);
if (cu->per_cu->version () < 5)
if (cu->header.version < 5)
{
create_debug_types_hash_table (per_objfile, dwo_file.get (),
dwo_file->sections.types, dwo_file->tus);
@@ -14800,8 +14793,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
if (type->code () == TYPE_CODE_VOID
&& !type->is_stub ()
&& die->child == nullptr
&& (cu->per_cu->version () == 2
|| producer_is_gas_2_39 (cu)))
&& (cu->header.version == 2 || producer_is_gas_2_39 (cu)))
{
/* Work around PR gas/29517, pretend we have an DW_TAG_unspecified_type
return type. */
@@ -21693,6 +21685,7 @@ fill_in_loclist_baton (struct dwarf2_cu *cu,
else
baton->base_address = {};
baton->from_dwo = cu->dwo_unit != NULL;
baton->dwarf_version = cu->header.version;
}
static void

View File

@@ -120,9 +120,6 @@ struct dwarf2_per_cu_data
private:
unsigned int m_length = 0;
/* DWARF standard version this data has been read from (such as 4 or 5). */
unsigned char m_dwarf_version = 0;
public:
/* Non-zero if this CU is from .debug_types.
Struct dwarf2_per_cu_data is contained in struct signatured_type iff
@@ -281,24 +278,6 @@ public:
gdb_assert (m_length == length);
}
/* Return DWARF version number of this CU. */
short version () const
{
/* Make sure it's set already. */
gdb_assert (m_dwarf_version != 0);
return m_dwarf_version;
}
void set_version (short version)
{
if (m_dwarf_version == 0)
/* Set if not set already. */
m_dwarf_version = version;
else
/* If already set, verify that it's the same value. */
gdb_assert (m_dwarf_version == version);
}
dwarf_unit_type unit_type (bool strict_p = true) const
{
dwarf_unit_type ut = m_unit_type.load ();

View File

@@ -2325,7 +2325,22 @@ get_prev_frame_always_1 (const frame_info_ptr &this_frame)
until we have unwound all the way down to the previous non-inline
frame. */
if (get_frame_type (this_frame) == INLINE_FRAME)
return get_prev_frame_maybe_check_cycle (this_frame);
{
frame_info_ptr fi = get_prev_frame_maybe_check_cycle (this_frame);
/* If this_frame is the current frame, then compute and stash its frame
id so that the cycle check in get_prev_frame_maybe_check_cycle works
correctly in the case where inline frame 0 has been duplicated.
The this_id.p check is required to avoid recursion as computing the
frame id results in a call to inline_frame_this_id which calls back
into get_prev_frame_always. */
if (this_frame->level == 0
&& this_frame->this_id.p != frame_id_status::COMPUTING)
get_frame_id (this_frame);
return fi;
}
/* If this_frame is the current frame, then compute and stash its
frame id prior to fetching and computing the frame id of the

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Copyright (C) 2024 Free Software Foundation, Inc.
# Copyright (C) 2024-2025 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,8 +22,8 @@
GDB=${GDB:-$(command -v gdb)}
GDBARGS=${GDBARGS:-}
AWK=${AWK:-}
PKGVERSION=@PKGVERSION@
VERSION=@VERSION@
PKGVERSION="@PKGVERSION@"
VERSION="@VERSION@"
# Find an appropriate awk interpreter if one was not specified
# via the environment.
@@ -132,7 +132,7 @@ EOF
)
# Run GDB and remove some unwanted noise.
"$GDB" --quiet -nx --readnever $GDBARGS <<EOF |
"$GDB" --quiet -nx $GDBARGS <<EOF |
set width 0
set height 0
set pagination no

View File

@@ -370,6 +370,16 @@ i386_all_but_ip_registers_record (struct regcache *regcache)
return 0;
}
enum i386_syscall
{
#define SYSCALL(NUMBER,NAME) \
i386_sys_ ## NAME = NUMBER,
#include "gdb/i386-syscalls.def"
#undef SYSCALL
};
/* i386_canonicalize_syscall maps from the native i386 Linux set
of syscall ids into a canonical set of syscall ids used by
process record (a mostly trivial mapping, since the canonical
@@ -378,12 +388,486 @@ i386_all_but_ip_registers_record (struct regcache *regcache)
static enum gdb_syscall
i386_canonicalize_syscall (int syscall)
{
enum { i386_syscall_max = 499 };
switch ((enum i386_syscall) syscall)
{
#define SYSCALL_MAP(SYSCALL) \
case i386_sys_ ## SYSCALL: \
return gdb_sys_ ## SYSCALL
if (syscall <= i386_syscall_max)
return (enum gdb_syscall) syscall;
else
#define SYSCALL_MAP_RENAME(SYSCALL,GDB_SYSCALL) \
case i386_sys_##SYSCALL: \
return GDB_SYSCALL;
#define UNSUPPORTED_SYSCALL_MAP(SYSCALL) \
case i386_sys_ ## SYSCALL: \
return gdb_sys_no_syscall;
SYSCALL_MAP (restart_syscall);
SYSCALL_MAP (exit);
SYSCALL_MAP (fork);
SYSCALL_MAP (read);
SYSCALL_MAP (write);
SYSCALL_MAP (open);
SYSCALL_MAP (close);
SYSCALL_MAP (waitpid);
SYSCALL_MAP (creat);
SYSCALL_MAP (link);
SYSCALL_MAP (unlink);
SYSCALL_MAP (execve);
SYSCALL_MAP (chdir);
SYSCALL_MAP (time);
SYSCALL_MAP (mknod);
SYSCALL_MAP (chmod);
SYSCALL_MAP_RENAME (lchown, gdb_sys_lchown16);
SYSCALL_MAP_RENAME (break, gdb_sys_ni_syscall17);
SYSCALL_MAP_RENAME (oldstat, gdb_sys_stat);
SYSCALL_MAP (lseek);
SYSCALL_MAP (getpid);
SYSCALL_MAP (mount);
SYSCALL_MAP_RENAME (umount, gdb_sys_oldumount);
SYSCALL_MAP_RENAME (setuid, gdb_sys_setuid16);
SYSCALL_MAP_RENAME (getuid, gdb_sys_getuid16);
SYSCALL_MAP (stime);
SYSCALL_MAP (ptrace);
SYSCALL_MAP (alarm);
SYSCALL_MAP_RENAME (oldfstat, gdb_sys_fstat);
SYSCALL_MAP (pause);
SYSCALL_MAP (utime);
SYSCALL_MAP_RENAME (stty, gdb_sys_ni_syscall31);
SYSCALL_MAP_RENAME (gtty, gdb_sys_ni_syscall32);
SYSCALL_MAP (access);
SYSCALL_MAP (nice);
SYSCALL_MAP_RENAME (ftime, gdb_sys_ni_syscall35);
SYSCALL_MAP (sync);
SYSCALL_MAP (kill);
SYSCALL_MAP (rename);
SYSCALL_MAP (mkdir);
SYSCALL_MAP (rmdir);
SYSCALL_MAP (dup);
SYSCALL_MAP (pipe);
SYSCALL_MAP (times);
SYSCALL_MAP_RENAME (prof, gdb_sys_ni_syscall44);
SYSCALL_MAP (brk);
SYSCALL_MAP_RENAME (setgid, gdb_sys_setgid16);
SYSCALL_MAP_RENAME (getgid, gdb_sys_getgid16);
SYSCALL_MAP (signal);
SYSCALL_MAP_RENAME (geteuid, gdb_sys_geteuid16);
SYSCALL_MAP_RENAME (getegid, gdb_sys_getegid16);
SYSCALL_MAP (acct);
SYSCALL_MAP_RENAME (umount2, gdb_sys_umount);
SYSCALL_MAP_RENAME (lock, gdb_sys_ni_syscall53);
SYSCALL_MAP (ioctl);
SYSCALL_MAP (fcntl);
SYSCALL_MAP_RENAME (mpx, gdb_sys_ni_syscall56);
SYSCALL_MAP (setpgid);
SYSCALL_MAP_RENAME (ulimit, gdb_sys_ni_syscall58);
SYSCALL_MAP_RENAME (oldolduname, gdb_sys_olduname);
SYSCALL_MAP (umask);
SYSCALL_MAP (chroot);
SYSCALL_MAP (ustat);
SYSCALL_MAP (dup2);
SYSCALL_MAP (getppid);
SYSCALL_MAP (getpgrp);
SYSCALL_MAP (setsid);
SYSCALL_MAP (sigaction);
SYSCALL_MAP (sgetmask);
SYSCALL_MAP (ssetmask);
SYSCALL_MAP_RENAME (setreuid, gdb_sys_setreuid16);
SYSCALL_MAP_RENAME (setregid, gdb_sys_setregid16);
SYSCALL_MAP (sigsuspend);
SYSCALL_MAP (sigpending);
SYSCALL_MAP (sethostname);
SYSCALL_MAP (setrlimit);
SYSCALL_MAP_RENAME (getrlimit, gdb_sys_old_getrlimit);
SYSCALL_MAP (getrusage);
SYSCALL_MAP (gettimeofday);
SYSCALL_MAP (settimeofday);
SYSCALL_MAP_RENAME (getgroups, gdb_sys_getgroups16);
SYSCALL_MAP_RENAME (setgroups, gdb_sys_setgroups16);
SYSCALL_MAP_RENAME (select, gdb_old_select);
SYSCALL_MAP (symlink);
SYSCALL_MAP_RENAME (oldlstat, gdb_sys_lstat);
SYSCALL_MAP (readlink);
SYSCALL_MAP (uselib);
SYSCALL_MAP (swapon);
SYSCALL_MAP (reboot);
SYSCALL_MAP_RENAME (readdir, gdb_old_readdir);
SYSCALL_MAP_RENAME (mmap, gdb_old_mmap);
SYSCALL_MAP (munmap);
SYSCALL_MAP (truncate);
SYSCALL_MAP (ftruncate);
SYSCALL_MAP (fchmod);
SYSCALL_MAP_RENAME (fchown, gdb_sys_fchown16);
SYSCALL_MAP (getpriority);
SYSCALL_MAP (setpriority);
SYSCALL_MAP_RENAME (profil, gdb_sys_ni_syscall98);
SYSCALL_MAP (statfs);
SYSCALL_MAP (fstatfs);
SYSCALL_MAP (ioperm);
SYSCALL_MAP (socketcall);
SYSCALL_MAP (syslog);
SYSCALL_MAP (setitimer);
SYSCALL_MAP (getitimer);
SYSCALL_MAP_RENAME (stat, gdb_sys_newstat);
SYSCALL_MAP_RENAME (lstat, gdb_sys_newlstat);
SYSCALL_MAP_RENAME (fstat, gdb_sys_newfstat);
SYSCALL_MAP_RENAME (olduname, gdb_sys_uname);
SYSCALL_MAP (iopl);
SYSCALL_MAP (vhangup);
SYSCALL_MAP_RENAME (idle, gdb_sys_ni_syscall112);
SYSCALL_MAP (vm86old);
SYSCALL_MAP (wait4);
SYSCALL_MAP (swapoff);
SYSCALL_MAP (sysinfo);
SYSCALL_MAP (ipc);
SYSCALL_MAP (fsync);
SYSCALL_MAP (sigreturn);
SYSCALL_MAP (clone);
SYSCALL_MAP (setdomainname);
SYSCALL_MAP_RENAME (uname, gdb_sys_newuname);
SYSCALL_MAP (modify_ldt);
SYSCALL_MAP (adjtimex);
SYSCALL_MAP (mprotect);
SYSCALL_MAP (sigprocmask);
SYSCALL_MAP_RENAME (create_module, gdb_sys_ni_syscall127);
SYSCALL_MAP (init_module);
SYSCALL_MAP (delete_module);
SYSCALL_MAP_RENAME (get_kernel_syms, gdb_sys_ni_syscall130);
SYSCALL_MAP (quotactl);
SYSCALL_MAP (getpgid);
SYSCALL_MAP (fchdir);
SYSCALL_MAP (bdflush);
SYSCALL_MAP (sysfs);
SYSCALL_MAP (personality);
SYSCALL_MAP_RENAME (afs_syscall, gdb_sys_ni_syscall137);
SYSCALL_MAP_RENAME (setfsuid, gdb_sys_setfsuid16);
SYSCALL_MAP_RENAME (setfsgid, gdb_sys_setfsgid16);
SYSCALL_MAP_RENAME (_llseek, gdb_sys_llseek);
SYSCALL_MAP (getdents);
SYSCALL_MAP_RENAME (_newselect, gdb_sys_select);
SYSCALL_MAP (flock);
SYSCALL_MAP (msync);
SYSCALL_MAP (readv);
SYSCALL_MAP (writev);
SYSCALL_MAP (getsid);
SYSCALL_MAP (fdatasync);
SYSCALL_MAP_RENAME (_sysctl, gdb_sys_sysctl);
SYSCALL_MAP (mlock);
SYSCALL_MAP (munlock);
SYSCALL_MAP (mlockall);
SYSCALL_MAP (munlockall);
SYSCALL_MAP (sched_setparam);
SYSCALL_MAP (sched_getparam);
SYSCALL_MAP (sched_setscheduler);
SYSCALL_MAP (sched_getscheduler);
SYSCALL_MAP (sched_yield);
SYSCALL_MAP (sched_get_priority_max);
SYSCALL_MAP (sched_get_priority_min);
SYSCALL_MAP (sched_rr_get_interval);
SYSCALL_MAP (nanosleep);
SYSCALL_MAP (mremap);
SYSCALL_MAP_RENAME (setresuid, gdb_sys_setresuid16);
SYSCALL_MAP_RENAME (getresuid, gdb_sys_getresuid16);
SYSCALL_MAP (vm86);
SYSCALL_MAP_RENAME (query_module, gdb_sys_ni_syscall167);
SYSCALL_MAP (poll);
SYSCALL_MAP (nfsservctl);
SYSCALL_MAP_RENAME (setresgid, gdb_sys_setresgid16);
SYSCALL_MAP_RENAME (getresgid, gdb_sys_getresgid16);
SYSCALL_MAP (prctl);
SYSCALL_MAP (rt_sigreturn);
SYSCALL_MAP (rt_sigaction);
SYSCALL_MAP (rt_sigprocmask);
SYSCALL_MAP (rt_sigpending);
SYSCALL_MAP (rt_sigtimedwait);
SYSCALL_MAP (rt_sigqueueinfo);
SYSCALL_MAP (rt_sigsuspend);
SYSCALL_MAP (pread64);
SYSCALL_MAP (pwrite64);
SYSCALL_MAP_RENAME (chown, gdb_sys_chown16);
SYSCALL_MAP (getcwd);
SYSCALL_MAP (capget);
SYSCALL_MAP (capset);
SYSCALL_MAP (sigaltstack);
SYSCALL_MAP (sendfile);
SYSCALL_MAP_RENAME (getpmsg, gdb_sys_ni_syscall188);
SYSCALL_MAP_RENAME (putpmsg, gdb_sys_ni_syscall189);
SYSCALL_MAP (vfork);
SYSCALL_MAP_RENAME (ugetrlimit, gdb_sys_getrlimit);
SYSCALL_MAP (mmap2);
SYSCALL_MAP (truncate64);
SYSCALL_MAP (ftruncate64);
SYSCALL_MAP (stat64);
SYSCALL_MAP (lstat64);
SYSCALL_MAP (fstat64);
SYSCALL_MAP_RENAME (lchown32, gdb_sys_lchown);
SYSCALL_MAP_RENAME (getuid32, gdb_sys_getuid);
SYSCALL_MAP_RENAME (getgid32, gdb_sys_getgid);
SYSCALL_MAP_RENAME (geteuid32, gdb_sys_geteuid);
SYSCALL_MAP_RENAME (getegid32, gdb_sys_getegid);
SYSCALL_MAP_RENAME (setreuid32, gdb_sys_setreuid);
SYSCALL_MAP_RENAME (setregid32, gdb_sys_setregid);
SYSCALL_MAP_RENAME (getgroups32, gdb_sys_getgroups);
SYSCALL_MAP_RENAME (setgroups32, gdb_sys_setgroups);
SYSCALL_MAP_RENAME (fchown32, gdb_sys_fchown);
SYSCALL_MAP_RENAME (setresuid32, gdb_sys_setresuid);
SYSCALL_MAP_RENAME (getresuid32, gdb_sys_getresuid);
SYSCALL_MAP_RENAME (setresgid32, gdb_sys_setresgid);
SYSCALL_MAP_RENAME (getresgid32, gdb_sys_getresgid);
SYSCALL_MAP_RENAME (chown32, gdb_sys_chown);
SYSCALL_MAP_RENAME (setuid32, gdb_sys_setuid);
SYSCALL_MAP_RENAME (setgid32, gdb_sys_setgid);
SYSCALL_MAP_RENAME (setfsuid32, gdb_sys_setfsuid);
SYSCALL_MAP_RENAME (setfsgid32, gdb_sys_setfsgid);
SYSCALL_MAP (pivot_root);
SYSCALL_MAP (mincore);
SYSCALL_MAP (madvise);
SYSCALL_MAP (getdents64);
SYSCALL_MAP (fcntl64);
SYSCALL_MAP (gettid);
SYSCALL_MAP (readahead);
SYSCALL_MAP (setxattr);
SYSCALL_MAP (lsetxattr);
SYSCALL_MAP (fsetxattr);
SYSCALL_MAP (getxattr);
SYSCALL_MAP (lgetxattr);
SYSCALL_MAP (fgetxattr);
SYSCALL_MAP (listxattr);
SYSCALL_MAP (llistxattr);
SYSCALL_MAP (flistxattr);
SYSCALL_MAP (removexattr);
SYSCALL_MAP (lremovexattr);
SYSCALL_MAP (fremovexattr);
SYSCALL_MAP (tkill);
SYSCALL_MAP (sendfile64);
SYSCALL_MAP (futex);
SYSCALL_MAP (sched_setaffinity);
SYSCALL_MAP (sched_getaffinity);
SYSCALL_MAP (set_thread_area);
SYSCALL_MAP (get_thread_area);
SYSCALL_MAP (io_setup);
SYSCALL_MAP (io_destroy);
SYSCALL_MAP (io_getevents);
SYSCALL_MAP (io_submit);
SYSCALL_MAP (io_cancel);
SYSCALL_MAP (fadvise64);
SYSCALL_MAP (exit_group);
SYSCALL_MAP (lookup_dcookie);
SYSCALL_MAP (epoll_create);
SYSCALL_MAP (epoll_ctl);
SYSCALL_MAP (epoll_wait);
SYSCALL_MAP (remap_file_pages);
SYSCALL_MAP (set_tid_address);
SYSCALL_MAP (timer_create);
SYSCALL_MAP (timer_settime);
SYSCALL_MAP (timer_gettime);
SYSCALL_MAP (timer_getoverrun);
SYSCALL_MAP (timer_delete);
SYSCALL_MAP (clock_settime);
SYSCALL_MAP (clock_gettime);
SYSCALL_MAP (clock_getres);
SYSCALL_MAP (clock_nanosleep);
SYSCALL_MAP (statfs64);
SYSCALL_MAP (fstatfs64);
SYSCALL_MAP (tgkill);
SYSCALL_MAP (utimes);
SYSCALL_MAP (fadvise64_64);
SYSCALL_MAP_RENAME (vserver, gdb_sys_ni_syscall273);
SYSCALL_MAP (mbind);
SYSCALL_MAP (get_mempolicy);
SYSCALL_MAP (set_mempolicy);
SYSCALL_MAP (mq_open);
SYSCALL_MAP (mq_unlink);
SYSCALL_MAP (mq_timedsend);
SYSCALL_MAP (mq_timedreceive);
SYSCALL_MAP (mq_notify);
SYSCALL_MAP (mq_getsetattr);
SYSCALL_MAP (kexec_load);
SYSCALL_MAP (waitid);
SYSCALL_MAP (add_key);
SYSCALL_MAP (request_key);
SYSCALL_MAP (keyctl);
SYSCALL_MAP (ioprio_set);
SYSCALL_MAP (ioprio_get);
SYSCALL_MAP (inotify_init);
SYSCALL_MAP (inotify_add_watch);
SYSCALL_MAP (inotify_rm_watch);
SYSCALL_MAP (migrate_pages);
SYSCALL_MAP (openat);
SYSCALL_MAP (mkdirat);
SYSCALL_MAP (mknodat);
SYSCALL_MAP (fchownat);
SYSCALL_MAP (futimesat);
SYSCALL_MAP (fstatat64);
SYSCALL_MAP (unlinkat);
SYSCALL_MAP (renameat);
SYSCALL_MAP (linkat);
SYSCALL_MAP (symlinkat);
SYSCALL_MAP (readlinkat);
SYSCALL_MAP (fchmodat);
SYSCALL_MAP (faccessat);
SYSCALL_MAP (pselect6);
SYSCALL_MAP (ppoll);
SYSCALL_MAP (unshare);
SYSCALL_MAP (set_robust_list);
SYSCALL_MAP (get_robust_list);
SYSCALL_MAP (splice);
SYSCALL_MAP (sync_file_range);
SYSCALL_MAP (tee);
SYSCALL_MAP (vmsplice);
SYSCALL_MAP (move_pages);
SYSCALL_MAP (getcpu);
SYSCALL_MAP (epoll_pwait);
UNSUPPORTED_SYSCALL_MAP (utimensat);
UNSUPPORTED_SYSCALL_MAP (signalfd);
UNSUPPORTED_SYSCALL_MAP (timerfd_create);
UNSUPPORTED_SYSCALL_MAP (eventfd);
SYSCALL_MAP (fallocate);
UNSUPPORTED_SYSCALL_MAP (timerfd_settime);
UNSUPPORTED_SYSCALL_MAP (timerfd_gettime);
UNSUPPORTED_SYSCALL_MAP (signalfd4);
SYSCALL_MAP (eventfd2);
SYSCALL_MAP (epoll_create1);
SYSCALL_MAP (dup3);
SYSCALL_MAP (pipe2);
SYSCALL_MAP (inotify_init1);
UNSUPPORTED_SYSCALL_MAP (preadv);
UNSUPPORTED_SYSCALL_MAP (pwritev);
UNSUPPORTED_SYSCALL_MAP (rt_tgsigqueueinfo);
UNSUPPORTED_SYSCALL_MAP (perf_event_open);
UNSUPPORTED_SYSCALL_MAP (recvmmsg);
UNSUPPORTED_SYSCALL_MAP (fanotify_init);
UNSUPPORTED_SYSCALL_MAP (fanotify_mark);
UNSUPPORTED_SYSCALL_MAP (prlimit64);
UNSUPPORTED_SYSCALL_MAP (name_to_handle_at);
UNSUPPORTED_SYSCALL_MAP (open_by_handle_at);
UNSUPPORTED_SYSCALL_MAP (clock_adjtime);
UNSUPPORTED_SYSCALL_MAP (syncfs);
UNSUPPORTED_SYSCALL_MAP (sendmmsg);
UNSUPPORTED_SYSCALL_MAP (setns);
UNSUPPORTED_SYSCALL_MAP (process_vm_readv);
UNSUPPORTED_SYSCALL_MAP (process_vm_writev);
UNSUPPORTED_SYSCALL_MAP (kcmp);
UNSUPPORTED_SYSCALL_MAP (finit_module);
UNSUPPORTED_SYSCALL_MAP (sched_setattr);
UNSUPPORTED_SYSCALL_MAP (sched_getattr);
UNSUPPORTED_SYSCALL_MAP (renameat2);
UNSUPPORTED_SYSCALL_MAP (seccomp);
SYSCALL_MAP (getrandom);
UNSUPPORTED_SYSCALL_MAP (memfd_create);
UNSUPPORTED_SYSCALL_MAP (bpf);
UNSUPPORTED_SYSCALL_MAP (execveat);
SYSCALL_MAP (socket);
SYSCALL_MAP (socketpair);
SYSCALL_MAP (bind);
SYSCALL_MAP (connect);
SYSCALL_MAP (listen);
UNSUPPORTED_SYSCALL_MAP (accept4);
SYSCALL_MAP (getsockopt);
SYSCALL_MAP (setsockopt);
SYSCALL_MAP (getsockname);
SYSCALL_MAP (getpeername);
SYSCALL_MAP (sendto);
SYSCALL_MAP (sendmsg);
SYSCALL_MAP (recvfrom);
SYSCALL_MAP (recvmsg);
SYSCALL_MAP (shutdown);
UNSUPPORTED_SYSCALL_MAP (userfaultfd);
UNSUPPORTED_SYSCALL_MAP (membarrier);
UNSUPPORTED_SYSCALL_MAP (mlock2);
UNSUPPORTED_SYSCALL_MAP (copy_file_range);
UNSUPPORTED_SYSCALL_MAP (preadv2);
UNSUPPORTED_SYSCALL_MAP (pwritev2);
UNSUPPORTED_SYSCALL_MAP (pkey_mprotect);
UNSUPPORTED_SYSCALL_MAP (pkey_alloc);
UNSUPPORTED_SYSCALL_MAP (pkey_free);
SYSCALL_MAP (statx);
UNSUPPORTED_SYSCALL_MAP (arch_prctl);
UNSUPPORTED_SYSCALL_MAP (io_pgetevents);
UNSUPPORTED_SYSCALL_MAP (rseq);
SYSCALL_MAP (semget);
SYSCALL_MAP (semctl);
SYSCALL_MAP (shmget);
SYSCALL_MAP (shmctl);
SYSCALL_MAP (shmat);
SYSCALL_MAP (shmdt);
SYSCALL_MAP (msgget);
SYSCALL_MAP (msgsnd);
SYSCALL_MAP (msgrcv);
SYSCALL_MAP (msgctl);
SYSCALL_MAP (clock_gettime64);
UNSUPPORTED_SYSCALL_MAP (clock_settime64);
UNSUPPORTED_SYSCALL_MAP (clock_adjtime64);
UNSUPPORTED_SYSCALL_MAP (clock_getres_time64);
UNSUPPORTED_SYSCALL_MAP (clock_nanosleep_time64);
UNSUPPORTED_SYSCALL_MAP (timer_gettime64);
UNSUPPORTED_SYSCALL_MAP (timer_settime64);
UNSUPPORTED_SYSCALL_MAP (timerfd_gettime64);
UNSUPPORTED_SYSCALL_MAP (timerfd_settime64);
UNSUPPORTED_SYSCALL_MAP (utimensat_time64);
UNSUPPORTED_SYSCALL_MAP (pselect6_time64);
UNSUPPORTED_SYSCALL_MAP (ppoll_time64);
UNSUPPORTED_SYSCALL_MAP (io_pgetevents_time64);
UNSUPPORTED_SYSCALL_MAP (recvmmsg_time64);
UNSUPPORTED_SYSCALL_MAP (mq_timedsend_time64);
UNSUPPORTED_SYSCALL_MAP (mq_timedreceive_time64);
SYSCALL_MAP_RENAME (semtimedop_time64, gdb_sys_semtimedop);
UNSUPPORTED_SYSCALL_MAP (rt_sigtimedwait_time64);
UNSUPPORTED_SYSCALL_MAP (futex_time64);
UNSUPPORTED_SYSCALL_MAP (sched_rr_get_interval_time64);
UNSUPPORTED_SYSCALL_MAP (pidfd_send_signal);
UNSUPPORTED_SYSCALL_MAP (io_uring_setup);
UNSUPPORTED_SYSCALL_MAP (io_uring_enter);
UNSUPPORTED_SYSCALL_MAP (io_uring_register);
UNSUPPORTED_SYSCALL_MAP (open_tree);
UNSUPPORTED_SYSCALL_MAP (move_mount);
UNSUPPORTED_SYSCALL_MAP (fsopen);
UNSUPPORTED_SYSCALL_MAP (fsconfig);
UNSUPPORTED_SYSCALL_MAP (fsmount);
UNSUPPORTED_SYSCALL_MAP (fspick);
UNSUPPORTED_SYSCALL_MAP (pidfd_open);
UNSUPPORTED_SYSCALL_MAP (clone3);
UNSUPPORTED_SYSCALL_MAP (close_range);
UNSUPPORTED_SYSCALL_MAP (openat2);
UNSUPPORTED_SYSCALL_MAP (pidfd_getfd);
UNSUPPORTED_SYSCALL_MAP (faccessat2);
UNSUPPORTED_SYSCALL_MAP (process_madvise);
UNSUPPORTED_SYSCALL_MAP (epoll_pwait2);
UNSUPPORTED_SYSCALL_MAP (mount_setattr);
UNSUPPORTED_SYSCALL_MAP (quotactl_fd);
UNSUPPORTED_SYSCALL_MAP (landlock_create_ruleset);
UNSUPPORTED_SYSCALL_MAP (landlock_add_rule);
UNSUPPORTED_SYSCALL_MAP (landlock_restrict_self);
UNSUPPORTED_SYSCALL_MAP (memfd_secret);
UNSUPPORTED_SYSCALL_MAP (process_mrelease);
UNSUPPORTED_SYSCALL_MAP (futex_waitv);
UNSUPPORTED_SYSCALL_MAP (set_mempolicy_home_node);
UNSUPPORTED_SYSCALL_MAP (cachestat);
UNSUPPORTED_SYSCALL_MAP (fchmodat2);
UNSUPPORTED_SYSCALL_MAP (map_shadow_stack);
UNSUPPORTED_SYSCALL_MAP (futex_wake);
UNSUPPORTED_SYSCALL_MAP (futex_wait);
UNSUPPORTED_SYSCALL_MAP (futex_requeue);
UNSUPPORTED_SYSCALL_MAP (statmount);
UNSUPPORTED_SYSCALL_MAP (listmount);
UNSUPPORTED_SYSCALL_MAP (lsm_get_self_attr);
UNSUPPORTED_SYSCALL_MAP (lsm_set_self_attr);
UNSUPPORTED_SYSCALL_MAP (lsm_list_modules);
UNSUPPORTED_SYSCALL_MAP (mseal);
UNSUPPORTED_SYSCALL_MAP (setxattrat);
UNSUPPORTED_SYSCALL_MAP (getxattrat);
UNSUPPORTED_SYSCALL_MAP (listxattrat);
UNSUPPORTED_SYSCALL_MAP (removexattrat);
#undef SYSCALL_MAP
#undef SYSCALL_MAP_RENAME
#undef UNSUPPORTED_SYSCALL_MAP
default:
return gdb_sys_no_syscall;
}
}
/* Value of the sigcode in case of a boundary fault. */

479
gdb/i386-syscalls.def Normal file
View File

@@ -0,0 +1,479 @@
/* Copyright (C) 2025 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Generated using linux v6.13 and command:
$ egrep -v "^#.*" ./arch/x86/entry/syscalls/syscall_32.tbl \
| awk '{printf "SYSCALL (%s, %s)\n", $1, $3}'
*/
SYSCALL (0, restart_syscall)
SYSCALL (1, exit)
SYSCALL (2, fork)
SYSCALL (3, read)
SYSCALL (4, write)
SYSCALL (5, open)
SYSCALL (6, close)
SYSCALL (7, waitpid)
SYSCALL (8, creat)
SYSCALL (9, link)
SYSCALL (10, unlink)
SYSCALL (11, execve)
SYSCALL (12, chdir)
SYSCALL (13, time)
SYSCALL (14, mknod)
SYSCALL (15, chmod)
SYSCALL (16, lchown)
SYSCALL (17, break)
SYSCALL (18, oldstat)
SYSCALL (19, lseek)
SYSCALL (20, getpid)
SYSCALL (21, mount)
SYSCALL (22, umount)
SYSCALL (23, setuid)
SYSCALL (24, getuid)
SYSCALL (25, stime)
SYSCALL (26, ptrace)
SYSCALL (27, alarm)
SYSCALL (28, oldfstat)
SYSCALL (29, pause)
SYSCALL (30, utime)
SYSCALL (31, stty)
SYSCALL (32, gtty)
SYSCALL (33, access)
SYSCALL (34, nice)
SYSCALL (35, ftime)
SYSCALL (36, sync)
SYSCALL (37, kill)
SYSCALL (38, rename)
SYSCALL (39, mkdir)
SYSCALL (40, rmdir)
SYSCALL (41, dup)
SYSCALL (42, pipe)
SYSCALL (43, times)
SYSCALL (44, prof)
SYSCALL (45, brk)
SYSCALL (46, setgid)
SYSCALL (47, getgid)
SYSCALL (48, signal)
SYSCALL (49, geteuid)
SYSCALL (50, getegid)
SYSCALL (51, acct)
SYSCALL (52, umount2)
SYSCALL (53, lock)
SYSCALL (54, ioctl)
SYSCALL (55, fcntl)
SYSCALL (56, mpx)
SYSCALL (57, setpgid)
SYSCALL (58, ulimit)
SYSCALL (59, oldolduname)
SYSCALL (60, umask)
SYSCALL (61, chroot)
SYSCALL (62, ustat)
SYSCALL (63, dup2)
SYSCALL (64, getppid)
SYSCALL (65, getpgrp)
SYSCALL (66, setsid)
SYSCALL (67, sigaction)
SYSCALL (68, sgetmask)
SYSCALL (69, ssetmask)
SYSCALL (70, setreuid)
SYSCALL (71, setregid)
SYSCALL (72, sigsuspend)
SYSCALL (73, sigpending)
SYSCALL (74, sethostname)
SYSCALL (75, setrlimit)
SYSCALL (76, getrlimit)
SYSCALL (77, getrusage)
SYSCALL (78, gettimeofday)
SYSCALL (79, settimeofday)
SYSCALL (80, getgroups)
SYSCALL (81, setgroups)
SYSCALL (82, select)
SYSCALL (83, symlink)
SYSCALL (84, oldlstat)
SYSCALL (85, readlink)
SYSCALL (86, uselib)
SYSCALL (87, swapon)
SYSCALL (88, reboot)
SYSCALL (89, readdir)
SYSCALL (90, mmap)
SYSCALL (91, munmap)
SYSCALL (92, truncate)
SYSCALL (93, ftruncate)
SYSCALL (94, fchmod)
SYSCALL (95, fchown)
SYSCALL (96, getpriority)
SYSCALL (97, setpriority)
SYSCALL (98, profil)
SYSCALL (99, statfs)
SYSCALL (100, fstatfs)
SYSCALL (101, ioperm)
SYSCALL (102, socketcall)
SYSCALL (103, syslog)
SYSCALL (104, setitimer)
SYSCALL (105, getitimer)
SYSCALL (106, stat)
SYSCALL (107, lstat)
SYSCALL (108, fstat)
SYSCALL (109, olduname)
SYSCALL (110, iopl)
SYSCALL (111, vhangup)
SYSCALL (112, idle)
SYSCALL (113, vm86old)
SYSCALL (114, wait4)
SYSCALL (115, swapoff)
SYSCALL (116, sysinfo)
SYSCALL (117, ipc)
SYSCALL (118, fsync)
SYSCALL (119, sigreturn)
SYSCALL (120, clone)
SYSCALL (121, setdomainname)
SYSCALL (122, uname)
SYSCALL (123, modify_ldt)
SYSCALL (124, adjtimex)
SYSCALL (125, mprotect)
SYSCALL (126, sigprocmask)
SYSCALL (127, create_module)
SYSCALL (128, init_module)
SYSCALL (129, delete_module)
SYSCALL (130, get_kernel_syms)
SYSCALL (131, quotactl)
SYSCALL (132, getpgid)
SYSCALL (133, fchdir)
SYSCALL (134, bdflush)
SYSCALL (135, sysfs)
SYSCALL (136, personality)
SYSCALL (137, afs_syscall)
SYSCALL (138, setfsuid)
SYSCALL (139, setfsgid)
SYSCALL (140, _llseek)
SYSCALL (141, getdents)
SYSCALL (142, _newselect)
SYSCALL (143, flock)
SYSCALL (144, msync)
SYSCALL (145, readv)
SYSCALL (146, writev)
SYSCALL (147, getsid)
SYSCALL (148, fdatasync)
SYSCALL (149, _sysctl)
SYSCALL (150, mlock)
SYSCALL (151, munlock)
SYSCALL (152, mlockall)
SYSCALL (153, munlockall)
SYSCALL (154, sched_setparam)
SYSCALL (155, sched_getparam)
SYSCALL (156, sched_setscheduler)
SYSCALL (157, sched_getscheduler)
SYSCALL (158, sched_yield)
SYSCALL (159, sched_get_priority_max)
SYSCALL (160, sched_get_priority_min)
SYSCALL (161, sched_rr_get_interval)
SYSCALL (162, nanosleep)
SYSCALL (163, mremap)
SYSCALL (164, setresuid)
SYSCALL (165, getresuid)
SYSCALL (166, vm86)
SYSCALL (167, query_module)
SYSCALL (168, poll)
SYSCALL (169, nfsservctl)
SYSCALL (170, setresgid)
SYSCALL (171, getresgid)
SYSCALL (172, prctl)
SYSCALL (173, rt_sigreturn)
SYSCALL (174, rt_sigaction)
SYSCALL (175, rt_sigprocmask)
SYSCALL (176, rt_sigpending)
SYSCALL (177, rt_sigtimedwait)
SYSCALL (178, rt_sigqueueinfo)
SYSCALL (179, rt_sigsuspend)
SYSCALL (180, pread64)
SYSCALL (181, pwrite64)
SYSCALL (182, chown)
SYSCALL (183, getcwd)
SYSCALL (184, capget)
SYSCALL (185, capset)
SYSCALL (186, sigaltstack)
SYSCALL (187, sendfile)
SYSCALL (188, getpmsg)
SYSCALL (189, putpmsg)
SYSCALL (190, vfork)
SYSCALL (191, ugetrlimit)
SYSCALL (192, mmap2)
SYSCALL (193, truncate64)
SYSCALL (194, ftruncate64)
SYSCALL (195, stat64)
SYSCALL (196, lstat64)
SYSCALL (197, fstat64)
SYSCALL (198, lchown32)
SYSCALL (199, getuid32)
SYSCALL (200, getgid32)
SYSCALL (201, geteuid32)
SYSCALL (202, getegid32)
SYSCALL (203, setreuid32)
SYSCALL (204, setregid32)
SYSCALL (205, getgroups32)
SYSCALL (206, setgroups32)
SYSCALL (207, fchown32)
SYSCALL (208, setresuid32)
SYSCALL (209, getresuid32)
SYSCALL (210, setresgid32)
SYSCALL (211, getresgid32)
SYSCALL (212, chown32)
SYSCALL (213, setuid32)
SYSCALL (214, setgid32)
SYSCALL (215, setfsuid32)
SYSCALL (216, setfsgid32)
SYSCALL (217, pivot_root)
SYSCALL (218, mincore)
SYSCALL (219, madvise)
SYSCALL (220, getdents64)
SYSCALL (221, fcntl64)
SYSCALL (224, gettid)
SYSCALL (225, readahead)
SYSCALL (226, setxattr)
SYSCALL (227, lsetxattr)
SYSCALL (228, fsetxattr)
SYSCALL (229, getxattr)
SYSCALL (230, lgetxattr)
SYSCALL (231, fgetxattr)
SYSCALL (232, listxattr)
SYSCALL (233, llistxattr)
SYSCALL (234, flistxattr)
SYSCALL (235, removexattr)
SYSCALL (236, lremovexattr)
SYSCALL (237, fremovexattr)
SYSCALL (238, tkill)
SYSCALL (239, sendfile64)
SYSCALL (240, futex)
SYSCALL (241, sched_setaffinity)
SYSCALL (242, sched_getaffinity)
SYSCALL (243, set_thread_area)
SYSCALL (244, get_thread_area)
SYSCALL (245, io_setup)
SYSCALL (246, io_destroy)
SYSCALL (247, io_getevents)
SYSCALL (248, io_submit)
SYSCALL (249, io_cancel)
SYSCALL (250, fadvise64)
SYSCALL (252, exit_group)
SYSCALL (253, lookup_dcookie)
SYSCALL (254, epoll_create)
SYSCALL (255, epoll_ctl)
SYSCALL (256, epoll_wait)
SYSCALL (257, remap_file_pages)
SYSCALL (258, set_tid_address)
SYSCALL (259, timer_create)
SYSCALL (260, timer_settime)
SYSCALL (261, timer_gettime)
SYSCALL (262, timer_getoverrun)
SYSCALL (263, timer_delete)
SYSCALL (264, clock_settime)
SYSCALL (265, clock_gettime)
SYSCALL (266, clock_getres)
SYSCALL (267, clock_nanosleep)
SYSCALL (268, statfs64)
SYSCALL (269, fstatfs64)
SYSCALL (270, tgkill)
SYSCALL (271, utimes)
SYSCALL (272, fadvise64_64)
SYSCALL (273, vserver)
SYSCALL (274, mbind)
SYSCALL (275, get_mempolicy)
SYSCALL (276, set_mempolicy)
SYSCALL (277, mq_open)
SYSCALL (278, mq_unlink)
SYSCALL (279, mq_timedsend)
SYSCALL (280, mq_timedreceive)
SYSCALL (281, mq_notify)
SYSCALL (282, mq_getsetattr)
SYSCALL (283, kexec_load)
SYSCALL (284, waitid)
SYSCALL (286, add_key)
SYSCALL (287, request_key)
SYSCALL (288, keyctl)
SYSCALL (289, ioprio_set)
SYSCALL (290, ioprio_get)
SYSCALL (291, inotify_init)
SYSCALL (292, inotify_add_watch)
SYSCALL (293, inotify_rm_watch)
SYSCALL (294, migrate_pages)
SYSCALL (295, openat)
SYSCALL (296, mkdirat)
SYSCALL (297, mknodat)
SYSCALL (298, fchownat)
SYSCALL (299, futimesat)
SYSCALL (300, fstatat64)
SYSCALL (301, unlinkat)
SYSCALL (302, renameat)
SYSCALL (303, linkat)
SYSCALL (304, symlinkat)
SYSCALL (305, readlinkat)
SYSCALL (306, fchmodat)
SYSCALL (307, faccessat)
SYSCALL (308, pselect6)
SYSCALL (309, ppoll)
SYSCALL (310, unshare)
SYSCALL (311, set_robust_list)
SYSCALL (312, get_robust_list)
SYSCALL (313, splice)
SYSCALL (314, sync_file_range)
SYSCALL (315, tee)
SYSCALL (316, vmsplice)
SYSCALL (317, move_pages)
SYSCALL (318, getcpu)
SYSCALL (319, epoll_pwait)
SYSCALL (320, utimensat)
SYSCALL (321, signalfd)
SYSCALL (322, timerfd_create)
SYSCALL (323, eventfd)
SYSCALL (324, fallocate)
SYSCALL (325, timerfd_settime)
SYSCALL (326, timerfd_gettime)
SYSCALL (327, signalfd4)
SYSCALL (328, eventfd2)
SYSCALL (329, epoll_create1)
SYSCALL (330, dup3)
SYSCALL (331, pipe2)
SYSCALL (332, inotify_init1)
SYSCALL (333, preadv)
SYSCALL (334, pwritev)
SYSCALL (335, rt_tgsigqueueinfo)
SYSCALL (336, perf_event_open)
SYSCALL (337, recvmmsg)
SYSCALL (338, fanotify_init)
SYSCALL (339, fanotify_mark)
SYSCALL (340, prlimit64)
SYSCALL (341, name_to_handle_at)
SYSCALL (342, open_by_handle_at)
SYSCALL (343, clock_adjtime)
SYSCALL (344, syncfs)
SYSCALL (345, sendmmsg)
SYSCALL (346, setns)
SYSCALL (347, process_vm_readv)
SYSCALL (348, process_vm_writev)
SYSCALL (349, kcmp)
SYSCALL (350, finit_module)
SYSCALL (351, sched_setattr)
SYSCALL (352, sched_getattr)
SYSCALL (353, renameat2)
SYSCALL (354, seccomp)
SYSCALL (355, getrandom)
SYSCALL (356, memfd_create)
SYSCALL (357, bpf)
SYSCALL (358, execveat)
SYSCALL (359, socket)
SYSCALL (360, socketpair)
SYSCALL (361, bind)
SYSCALL (362, connect)
SYSCALL (363, listen)
SYSCALL (364, accept4)
SYSCALL (365, getsockopt)
SYSCALL (366, setsockopt)
SYSCALL (367, getsockname)
SYSCALL (368, getpeername)
SYSCALL (369, sendto)
SYSCALL (370, sendmsg)
SYSCALL (371, recvfrom)
SYSCALL (372, recvmsg)
SYSCALL (373, shutdown)
SYSCALL (374, userfaultfd)
SYSCALL (375, membarrier)
SYSCALL (376, mlock2)
SYSCALL (377, copy_file_range)
SYSCALL (378, preadv2)
SYSCALL (379, pwritev2)
SYSCALL (380, pkey_mprotect)
SYSCALL (381, pkey_alloc)
SYSCALL (382, pkey_free)
SYSCALL (383, statx)
SYSCALL (384, arch_prctl)
SYSCALL (385, io_pgetevents)
SYSCALL (386, rseq)
SYSCALL (393, semget)
SYSCALL (394, semctl)
SYSCALL (395, shmget)
SYSCALL (396, shmctl)
SYSCALL (397, shmat)
SYSCALL (398, shmdt)
SYSCALL (399, msgget)
SYSCALL (400, msgsnd)
SYSCALL (401, msgrcv)
SYSCALL (402, msgctl)
SYSCALL (403, clock_gettime64)
SYSCALL (404, clock_settime64)
SYSCALL (405, clock_adjtime64)
SYSCALL (406, clock_getres_time64)
SYSCALL (407, clock_nanosleep_time64)
SYSCALL (408, timer_gettime64)
SYSCALL (409, timer_settime64)
SYSCALL (410, timerfd_gettime64)
SYSCALL (411, timerfd_settime64)
SYSCALL (412, utimensat_time64)
SYSCALL (413, pselect6_time64)
SYSCALL (414, ppoll_time64)
SYSCALL (416, io_pgetevents_time64)
SYSCALL (417, recvmmsg_time64)
SYSCALL (418, mq_timedsend_time64)
SYSCALL (419, mq_timedreceive_time64)
SYSCALL (420, semtimedop_time64)
SYSCALL (421, rt_sigtimedwait_time64)
SYSCALL (422, futex_time64)
SYSCALL (423, sched_rr_get_interval_time64)
SYSCALL (424, pidfd_send_signal)
SYSCALL (425, io_uring_setup)
SYSCALL (426, io_uring_enter)
SYSCALL (427, io_uring_register)
SYSCALL (428, open_tree)
SYSCALL (429, move_mount)
SYSCALL (430, fsopen)
SYSCALL (431, fsconfig)
SYSCALL (432, fsmount)
SYSCALL (433, fspick)
SYSCALL (434, pidfd_open)
SYSCALL (435, clone3)
SYSCALL (436, close_range)
SYSCALL (437, openat2)
SYSCALL (438, pidfd_getfd)
SYSCALL (439, faccessat2)
SYSCALL (440, process_madvise)
SYSCALL (441, epoll_pwait2)
SYSCALL (442, mount_setattr)
SYSCALL (443, quotactl_fd)
SYSCALL (444, landlock_create_ruleset)
SYSCALL (445, landlock_add_rule)
SYSCALL (446, landlock_restrict_self)
SYSCALL (447, memfd_secret)
SYSCALL (448, process_mrelease)
SYSCALL (449, futex_waitv)
SYSCALL (450, set_mempolicy_home_node)
SYSCALL (451, cachestat)
SYSCALL (452, fchmodat2)
SYSCALL (453, map_shadow_stack)
SYSCALL (454, futex_wake)
SYSCALL (455, futex_wait)
SYSCALL (456, futex_requeue)
SYSCALL (457, statmount)
SYSCALL (458, listmount)
SYSCALL (459, lsm_get_self_attr)
SYSCALL (460, lsm_set_self_attr)
SYSCALL (461, lsm_list_modules)
SYSCALL (462, mseal)
SYSCALL (463, setxattrat)
SYSCALL (464, getxattrat)
SYSCALL (465, listxattrat)
SYSCALL (466, removexattrat)

View File

@@ -854,7 +854,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args,
{
xsnprintf (filename, sizeof filename, "/proc/%ld/cmdline", pid);
gdb_byte *buffer;
ssize_t len = target_fileio_read_alloc (NULL, filename, &buffer);
LONGEST len = target_fileio_read_alloc (nullptr, filename, &buffer);
if (len > 0)
{
@@ -2180,17 +2180,17 @@ linux_fill_prpsinfo (struct elf_internal_linux_prpsinfo *p)
/* The number of fields read by `sscanf'. */
int n_fields = 0;
gdb_assert (p != NULL);
gdb_assert (p != nullptr);
/* Obtaining PID and filename. */
pid = inferior_ptid.pid ();
xsnprintf (filename, sizeof (filename), "/proc/%d/cmdline", (int) pid);
/* The full name of the program which generated the corefile. */
gdb_byte *buf = NULL;
size_t buf_len = target_fileio_read_alloc (NULL, filename, &buf);
gdb_byte *buf = nullptr;
LONGEST buf_len = target_fileio_read_alloc (nullptr, filename, &buf);
gdb::unique_xmalloc_ptr<char> fname ((char *)buf);
if (buf_len < 1 || fname.get ()[0] == '\0')
if (buf_len < 1 || fname.get () == nullptr || fname.get ()[0] == '\0')
{
/* No program name was read, so we won't be able to retrieve more
information about the process. */

View File

@@ -692,7 +692,7 @@ set show_conv_list \
{$_gdb_setting_str = <internal function _gdb_setting_str>} \
{$_gdb_setting = <internal function _gdb_setting>} \
{$_gdb_major = 16} \
{$_gdb_minor = 2} \
{$_gdb_minor = 4} \
{$_shell_exitsignal = void} \
{$_shell_exitcode = 0} \
}

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2024 Free Software Foundation, Inc.
# Copyright (C) 2024-2025 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -60,8 +60,10 @@ if { ![gdb_assert { ![expr {$res < 0 || $res == ""}] } $test] } {
set test "got backtrace"
set saw_backtrace false
set no_awk false
set location_re ${srcfile}:${decimal}
gdb_test_multiple "" $test {
-i "$res" -re "#0 +(0x\[0-9a-f\]+ in )?main \(\).*\r\nGSTACK-END\r\n\$" {
-i "$res" -re "#0 +(0x\[0-9a-f\]+ in )?main \(\).*$location_re.*\r\nGSTACK-END\r\n\$" {
set saw_backtrace true
pass $test
exp_continue

View File

@@ -72,8 +72,12 @@ gdb_continue_to_breakpoint "stop at test breakpoint"
gdb_test_no_output "source ${pyfile}"\
"import python scripts"
# Check the unbroken stack.
gdb_test_sequence "bt" "backtrace when the unwind is left unbroken" {
# Test with and without filters.
foreach bt_cmd { "bt" "bt -no-filters" } {
with_test_prefix "$bt_cmd" {
# Check the unbroken stack.
gdb_test_sequence "$bt_cmd" "backtrace when the unwind is left unbroken" {
"\\r\\n#0 \[^\r\n\]* inline_func \\(\\) at "
"\\r\\n#1 \[^\r\n\]* normal_func \\(\\) at "
"\\r\\n#2 \[^\r\n\]* inline_func \\(\\) at "
@@ -81,14 +85,14 @@ gdb_test_sequence "bt" "backtrace when the unwind is left unbroken" {
"\\r\\n#4 \[^\r\n\]* inline_func \\(\\) at "
"\\r\\n#5 \[^\r\n\]* normal_func \\(\\) at "
"\\r\\n#6 \[^\r\n\]* main \\(\\) at "
}
}
with_test_prefix "cycle at level 5" {
with_test_prefix "cycle at level 5" {
# Arrange to introduce a stack cycle at frame 5.
gdb_test_no_output "python stop_at_level=5"
gdb_test "maint flush register-cache" \
"Register cache flushed\\."
gdb_test_lines "bt" "backtrace when the unwind is broken at frame 5" \
gdb_test_lines "$bt_cmd" "backtrace when the unwind is broken at frame 5" \
[multi_line \
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
@@ -97,42 +101,42 @@ with_test_prefix "cycle at level 5" {
"#4 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
"#5 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
}
}
with_test_prefix "cycle at level 3" {
with_test_prefix "cycle at level 3" {
# Arrange to introduce a stack cycle at frame 3.
gdb_test_no_output "python stop_at_level=3"
gdb_test "maint flush register-cache" \
"Register cache flushed\\."
gdb_test_lines "bt" "backtrace when the unwind is broken at frame 3" \
gdb_test_lines "$bt_cmd" "backtrace when the unwind is broken at frame 3" \
[multi_line \
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
"#2 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
"#3 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
}
}
with_test_prefix "cycle at level 1" {
with_test_prefix "cycle at level 1" {
# Arrange to introduce a stack cycle at frame 1.
gdb_test_no_output "python stop_at_level=1"
gdb_test "maint flush register-cache" \
"Register cache flushed\\."
gdb_test_lines "bt" "backtrace when the unwind is broken at frame 1" \
gdb_test_lines "$bt_cmd" "backtrace when the unwind is broken at frame 1" \
[multi_line \
"#0 \[^\r\n\]* inline_func \\(\\) at \[^\r\n\]+" \
"#1 \[^\r\n\]* normal_func \\(\\) at \[^\r\n\]+" \
"Backtrace stopped: previous frame identical to this frame \\(corrupt stack\\?\\)"]
}
}
# Flush the register cache (which also flushes the frame cache) so we
# get a full backtrace again, then switch on frame debugging and try
# to back trace. At one point this triggered an assertion.
gdb_test "maint flush register-cache" \
# Flush the register cache (which also flushes the frame cache) so we
# get a full backtrace again, then switch on frame debugging and try
# to back trace. At one point this triggered an assertion.
gdb_test "maint flush register-cache" \
"Register cache flushed\\." ""
gdb_test_no_output "set debug frame 1"
set ok 1
gdb_test_multiple "bt" "backtrace with debugging on" {
gdb_test_no_output "set debug frame 1"
set ok 1
gdb_test_multiple "$bt_cmd" "backtrace with debugging on" {
-re "^$gdb_prompt $" {
gdb_assert { $ok } $gdb_test_name
}
@@ -143,6 +147,14 @@ gdb_test_multiple "bt" "backtrace with debugging on" {
-re "\[^\r\n\]+\r\n" {
exp_continue
}
}
gdb_test "p 1 + 2 + 3" " = 6" \
}
gdb_test "p 1 + 2 + 3" " = 6" \
"ensure GDB is still alive"
# Prepare for the next iteration of the test loop
gdb_test_no_output "set debug frame 0"
gdb_test_no_output "python stop_at_level=None"
gdb_test "maint flush register-cache" \
"Register cache flushed\\." "maint flush register-cache at (loop end)"
}
}

View File

@@ -0,0 +1,54 @@
/* This testcase is part of GDB, the GNU debugger.
Copyright 2025 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdio.h>
int
main (int argc, char *argv[])
{
/* Don't let this test stay alive forever. */
alarm (300);
if (argc != 2)
abort ();
/* Check the file doesn't already exist. */
const char *filename = argv[1];
struct stat buf;
if (stat (filename, &buf) == 0 || errno != ENOENT)
abort ();
/* Create the file, and write something into it. */
FILE *out = fopen (filename, "w");
if (out == NULL)
abort ();
fprintf (out, "Hello World\n");
if (fclose (out) != 0)
abort ();
/* Spin until the marker file is deleted. */
while (stat (filename, &buf) == 0)
sleep (1);
return 0;
}

View File

@@ -0,0 +1,66 @@
# Copyright 2025 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check that the 'Starting program' message is correctly flushed to
# the TUI terminal as soon as it is available.
require allow_tui_tests
require target_can_use_run_cmd
tuiterm_env
standard_testfile
if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
return -1
}
Term::clean_restart 24 80 $testfile
if {![Term::enter_tui]} {
unsupported "TUI not supported"
return
}
# Pick a name for a marker file, and ensure it doesn't exist.
set marker_file [standard_output_file "marker"]
file delete $marker_file
# Run the inferior, which will create MARKER_FILE.
send_gdb "run \"$marker_file\"\n"
# Spin until MARKER_FILE appears.
while { ! [file exists $marker_file] } {
sleep 1
}
# We now know that the inferior has started, and that the 'Starting
# program: ' string should have been printed to the terminal. Don't
# use Term::wait_for here as there will be no prompt after the
# 'Starting program' message.
gdb_assert {[Term::wait_for_region_contents 0 16 80 7 "Starting program: "]} \
"starting program message has appeared"
# Delete MARKER_FILE. This will cause the inferior to exit.
file delete $marker_file
# Now wait for the prompt, and check that the inferior exited message
# appeared.
gdb_assert {[Term::wait_for ""]} \
"wait for prompt after inferior exits"
Term::check_region_contents \
"check for inferior exited message" \
0 16 80 8 \
"\\\[Inferior $decimal \[^\r\n\]+ exited normally\\\]"

View File

@@ -56,7 +56,12 @@ void
tui_win_info::refresh_window ()
{
if (handle != NULL)
{
if (suppress_output)
wnoutrefresh (handle.get ());
else
wrefresh (handle.get ());
}
}
/* Draw a border around the window. */

View File

@@ -315,9 +315,11 @@ ui_file_style::parse (const char *buf, size_t *n_read)
case 35:
case 36:
case 37:
m_foreground = color (value - 30);
break;
/* Note: not 38. */
case 39:
m_foreground = color (value - 30);
m_foreground = NONE;
break;
case 40:
@@ -328,9 +330,11 @@ ui_file_style::parse (const char *buf, size_t *n_read)
case 45:
case 46:
case 47:
m_background = color (value - 40);
break;
/* Note: not 48. */
case 49:
m_background = color (value - 40);
m_background = NONE;
break;
case 90:

View File

@@ -1 +1 @@
16.2
16.3.90.DATE-git

View File

@@ -543,7 +543,7 @@ regcache::raw_compare (int regnum, const void *buf, int offset) const
gdb_assert (buf != NULL);
gdb::array_view<const gdb_byte> regbuf = register_data (this, regnum);
gdb_assert (offset < regbuf.size ());
gdb_assert (offset <= regbuf.size ());
regbuf = regbuf.slice (offset);
return memcmp (buf, regbuf.data (), regbuf.size ()) == 0;

View File

@@ -4092,6 +4092,38 @@ test_memory_tagging_functions (void)
&& tags.size () == 5);
}
/* Exercise the behavior of doing a 0-length comparison for a register in a
register buffer, which should return true. */
static void test_registers_raw_compare_zero_length ()
{
/* Start off with a dummy target description. */
target_desc dummy_tdesc;
/* Make it 8 bytes long. */
dummy_tdesc.registers_size = 8;
/* Add a couple dummy 32-bit registers. */
dummy_tdesc.reg_defs.emplace_back ("r0", 0, 32);
dummy_tdesc.reg_defs.emplace_back ("r1", 32, 32);
/* Create a dummy buffer that will serve as the register buffer for our
dummy regcache. */
gdb_byte dummy_register_buffer[8];
/* Create our dummy register cache so we can invoke the raw_compare method
we want to validate. */
regcache dummy_regcache;
init_register_cache (&dummy_regcache, &dummy_tdesc, dummy_register_buffer);
/* Create a dummy byte buffer we can pass to the raw_compare method. */
gdb_byte dummy_buffer[8];
/* Validate the 0-length comparison (due to the comparison offset being
equal to the length of the register) returns true. */
SELF_CHECK (dummy_regcache.raw_compare (0, dummy_buffer, 4));
}
} // namespace selftests
#endif /* GDB_SELF_TEST */
@@ -4115,6 +4147,8 @@ captured_main (int argc, char *argv[])
selftests::register_test ("remote_memory_tagging",
selftests::test_memory_tagging_functions);
selftests::register_test ("test_registers_raw_compare_zero_length",
selftests::test_registers_raw_compare_zero_length);
#endif
current_directory = getcwd (NULL, 0);

View File

@@ -46,14 +46,14 @@ extern char *UP, *BC;
extern short ospeed;
extern int tgetent ();
extern int tgetflag ();
extern int tgetnum ();
extern char *tgetstr ();
extern int tgetent (char *bp, const char *name);
extern int tgetflag (char *id);
extern int tgetnum (char *id);
extern char *tgetstr (char *id, char **area);
extern int tputs ();
extern int tputs (const char *str, int affcnt, int (*putc)(int));
extern char *tgoto ();
extern char *tgoto (const char *cap, int col, int row);
#endif /* HAVE_TERMCAP_H */