diff options
author | Kevin Buettner <kevinb@redhat.com> | 2025-02-05 11:27:00 -0700 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2025-02-05 11:28:29 -0700 |
commit | 4df2f3f97164a6fa09e15816b33122e6f1a757e3 (patch) | |
tree | 4e1e96ac9fb6c2dc7710bfe0b1858146ccf7f5c2 /gdb/testsuite | |
parent | 5cf1b0d7353bd40e548b8ac106f92c1beaeaf552 (diff) | |
download | gdb-4df2f3f97164a6fa09e15816b33122e6f1a757e3.zip gdb-4df2f3f97164a6fa09e15816b33122e6f1a757e3.tar.gz gdb-4df2f3f97164a6fa09e15816b33122e6f1a757e3.tar.bz2 |
Print only process ptids from linux-fork.c
This commit causes a "process ptid" to be passed to all calls
of target_pid_to_str in linux-fork.c. A "process ptid" is one
in which only the pid component is set to a non-zero value;
both the lwp and tid components are zero.
The reason for doing this is that pids associated with checkpoints can
never be a thread due to the fact that checkpoints (which are
implemented by forking a process) can only (reasonably) work with
single-threaded processes.
Without this commit, many of the "info checkpoints" commands
in gdb.multi/checkpoint-multi.exp will incorrectly show some
of the checkpoints as threads. E.g...
Id Active Target Id Frame
* 1.0 y Thread 0x7ffff7cb5740 (LWP 581704) at 0x401199, file hello.c, line 51
1.2 n process 581716 at 0x401199, file hello.c, line 51
1.3 n process 581717 at 0x401199, file hello.c, line 51
2.1 n process 581708 at 0x401258, file goodbye.c, line 62
2.2 y Thread 0x7ffff7cb5740 (LWP 581712) at 0x401258, file goodbye.c, line 62
3.0 y Thread 0x7ffff7cb5740 (LWP 581713) at 0x40115c, file hangout.c, line 31
3.2 n process 581715 at 0x40115c, file hangout.c, line 31
(gdb
With this commit in place, the output looks like this instead:
Id Active Target Id Frame
* 1.0 y process 535276 at 0x401199, file hello.c, line 51
1.2 n process 535288 at 0x401199, file hello.c, line 51
1.3 n process 535289 at 0x401199, file hello.c, line 51
2.1 n process 535280 at 0x401258, file goodbye.c, line 62
2.2 y process 535284 at 0x401258, file goodbye.c, line 62
3.0 y process 535285 at 0x40115c, file hangout.c, line 31
3.2 n process 535287 at 0x40115c, file hangout.c, line 31
(For brevity, I've removed the directory elements in each of the paths
above.)
The testcase, gdb.multi/checkpoint-multi.exp, has been updated to
reflect the fact that only "process" should now appear in output
from "info checkpoints".
Reviewed-By: Tom Tromey <tom@tromey.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.multi/checkpoint-multi.exp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.multi/checkpoint-multi.exp b/gdb/testsuite/gdb.multi/checkpoint-multi.exp index 4860608..e401e5e 100644 --- a/gdb/testsuite/gdb.multi/checkpoint-multi.exp +++ b/gdb/testsuite/gdb.multi/checkpoint-multi.exp @@ -23,7 +23,7 @@ require {istarget "*-*-linux*"} require gdb_protocol_is_native set checkpoints_header_re " +Id +Active Target Id +Frame.*?" -set proc_re "(?:process $::decimal|Thread $::hex \\(LWP $::decimal\\))" +set proc_re "(?:process $::decimal)" set ckpt_re "Checkpoint" set main_proc "\\(main process\\)" set hello_c "hello\\.c" |