[2/2] Make thread_db_target::pid_to_str checkpoint-aware

Message ID 20240323203056.1793487-3-kevinb@redhat.com
State New
Headers
Series Make linux checkpoints work with multiple inferiors |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Kevin Buettner March 23, 2024, 8:27 p.m. UTC
  This commit prevents thread_db_target::pid_to_str from considering
a checkpoint as a thread.  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 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...

* 4 Thread 0x7ffff7cd3740 (LWP 134952) (main process) at 0x401199, file hello.c, line 51
  10 process 134965 at 0x401199, file hello.c, line 51
  11 process 134966 at 0x401199, file hello.c, line 51
  1 process 134957 (main process) at 0x401258, file goodbye.c, line 62
+ 6 Thread 0x7ffff7cd3740 (LWP 134961) at 0x401258, file goodbye.c, line 62
+ 7 Thread 0x7ffff7cd3740 (LWP 134962) (main process) at 0x40115c, file hangout.c, line 31
  9 process 134964 at 0x40115c, file hangout.c, line 31

With this commit in place, the output looks like this instead:

* 4 process 136679 (main process) at 0x401199, file hello.c, line 51
  10 process 136692 at 0x401199, file hello.c, line 51
  11 process 136693 at 0x401199, file hello.c, line 51
  1 process 136683 (main process) at 0x401258, file goodbye.c, line 62
+ 6 process 136688 at 0x401258, file goodbye.c, line 62
+ 7 process 136689 (main process) at 0x40115c, file hangout.c, line 31
  9 process 136691 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".
---
 gdb/linux-thread-db.c                        |   4 +-
 gdb/testsuite/gdb.multi/checkpoint-multi.exp | 334 +++++++++----------
 2 files changed, 170 insertions(+), 168 deletions(-)
  

Patch

diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 34a39899eeb..ea2eeeda198 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -49,6 +49,7 @@ 
 #include "gdbsupport/pathstuff.h"
 #include "valprint.h"
 #include "cli/cli-style.h"
+#include "linux-fork.h"
 
 /* GNU/Linux libthread_db support.
 
@@ -1658,7 +1659,8 @@  thread_db_target::pid_to_str (ptid_t ptid)
 {
   thread_info *thread_info = current_inferior ()->find_thread (ptid);
 
-  if (thread_info != NULL && thread_info->priv != NULL)
+  if (thread_info != NULL && thread_info->priv != NULL
+      && !forks_exist_p (current_inferior ()))
     {
       thread_db_thread_info *priv = get_thread_db_thread_info (thread_info);
 
diff --git a/gdb/testsuite/gdb.multi/checkpoint-multi.exp b/gdb/testsuite/gdb.multi/checkpoint-multi.exp
index 98f6e0ae933..52a2f870c3c 100644
--- a/gdb/testsuite/gdb.multi/checkpoint-multi.exp
+++ b/gdb/testsuite/gdb.multi/checkpoint-multi.exp
@@ -168,7 +168,7 @@  with_test_prefix "check continue to exit on non-checkpointed inferior" {
     gdb_test "continue" "Inferior 1.*? exited normally.*"
 }
 
-set thr_or_proc "(?:process $::decimal|Thread $::hex \\(LWP $::decimal\\))"
+set proc_re "(?:process $::decimal)"
 set main_proc "\\(main process\\)"
 set hello_c "hello\\.c"
 set goodbye_c "goodbye\\.c"
@@ -178,29 +178,29 @@  with_test_prefix "two inferiors with checkpoints" {
     start_2_inferiors_catchpoint_on_inf_2
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \
+	    "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \
 	    "info checkpoints 1"
     gdb_test "checkpoint" "checkpoint 3: fork returned pid $::decimal.*" \
 	     "checkpoint in inferior 1"
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\* 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \
+	    "\\* 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \
 	    "info checkpoints 2"
     gdb_test "restart 0" \
 	     "\\\[Switching to inferior 2.*?mailand.*?glob = 46;.*"
     gdb_test "next" "\}"
 
-    gdb_test "restart 1" "^Switching to $thr_or_proc.*?#0  main \\(\\) at.*?$goodbye_c.*mailand\\(\\);"
+    gdb_test "restart 1" "^Switching to $proc_re.*?#0  main \\(\\) at.*?$goodbye_c.*mailand\\(\\);"
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \
+	    "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \
 	    "info checkpoints 3"
 
     # Doing "info_checkpoints" twice in a row might seem pointless,
@@ -209,23 +209,23 @@  with_test_prefix "two inferiors with checkpoints" {
     # produce the same output.
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \
+	    "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \
 	    "info checkpoints 4"
 
     # Switch back to checkpoint 0; again, there should be no
     # "Switching to inferior" message.
-    gdb_test "restart 0" "^Switching to $thr_or_proc.*?#0  mailand \\(\\) at.*?$goodbye_c.*\}" \
+    gdb_test "restart 0" "^Switching to $proc_re.*?#0  mailand \\(\\) at.*?$goodbye_c.*\}" \
 	     "restart 0 #2"
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\* 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \
+	    "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\* 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \
 	    "info checkpoints 5"
 
     # Switch to checkpoint 3; this time, we should see a "Switching to
@@ -235,10 +235,10 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\* 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\* 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \
 	    "info checkpoints 6"
 
     gdb_test "restart 1" \
@@ -247,10 +247,10 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \
 	    "info checkpoints 7"
 
     gdb_test "checkpoint" "checkpoint 4: fork returned pid $::decimal.*" \
@@ -258,11 +258,11 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  4 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "  4 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 8"
 
     gdb_test "checkpoint" "checkpoint 5: fork returned pid $::decimal.*" \
@@ -270,25 +270,25 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  4 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "  4 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 9"
 
     gdb_test "continue" \
-	     "Inferior 2 \\(process $decimal\\) exited normally.*?Switching to $thr_or_proc.*?" \
+	     "Inferior 2 \\(process $decimal\\) exited normally.*?Switching to $proc_re.*?" \
 	     "continue to exit in checkpoint 1"
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  4 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 5 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  4 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 5 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 10"
 
     gdb_test "continue" \
@@ -297,10 +297,10 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 4 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 4 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 11"
 
     gdb_test "continue" \
@@ -309,8 +309,8 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" ] \
 	    "info checkpoints 12"
 
     gdb_test "checkpoint" "checkpoint 7: fork returned pid $::decimal.*" \
@@ -321,11 +321,11 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\* 6 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  7 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  8 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\* 6 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  7 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "  8 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 13"
 
     gdb_test "delete checkpoint 6" \
@@ -340,10 +340,10 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  8 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\* 7 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  8 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 14"
 
     gdb_test "delete checkpoint 8" \
@@ -351,8 +351,8 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" ] \
 	    "info checkpoints 15"
 
     gdb_test "checkpoint" "checkpoint 10: fork returned pid $::decimal.*" \
@@ -360,10 +360,10 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\* 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\* 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 16"
 
     gdb_test "inferior 1" "Switching to inferior 1.*?alarm \\(240\\);" \
@@ -371,10 +371,10 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "  2 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\* 3 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "  2 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "\\* 3 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 17"
 
     gdb_test "kill" "\\\[Inferior 1 \\(process $::decimal\\) killed\\\]" \
@@ -383,8 +383,8 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "\\+ 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 18"
 
     gdb_test "checkpoint" "The program is not being run\\." \
@@ -394,8 +394,8 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "\\+ 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 19"
 
     gdb_test "checkpoint" "checkpoint 12: fork returned pid $::decimal.*" \
@@ -403,10 +403,10 @@  with_test_prefix "two inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\* 11 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  12 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 9 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "\\* 11 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  12 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 9 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 20"
 }
 
@@ -415,8 +415,8 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?"] \
+	    "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  1 $proc_re at $::hex, file.*?$goodbye_c.*?"] \
 	    "info checkpoints 1"
 
     # Add a third inferior and exec into it.
@@ -445,10 +445,10 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  1 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 2"
 
     gdb_test "inferior 1" "Switching to inferior 1.*?alarm \\(240\\);" \
@@ -459,12 +459,12 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\* 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\* 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  1 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 3"
 
     gdb_test "restart 1" \
@@ -473,12 +473,12 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 4"
 
     gdb_test "next" "foo\\(glob\\);"
@@ -488,13 +488,13 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "  6 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 5"
 
     gdb_test "inferior 3" "Switching to inferior 3.*?alarm \\(30\\);" \
@@ -502,13 +502,13 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 2 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  3 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "  6 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 2 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  3 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 6"
 
     gdb_test "kill" "\\\[Inferior 3 \\(process $::decimal\\) killed\\\]" \
@@ -517,11 +517,11 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  0 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 1 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  0 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 1 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "  6 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 7"
 
     gdb_test "delete checkpoint 0" \
@@ -529,10 +529,10 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "\\+ 1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "  6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "\\+ 1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "  6 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 8"
 
     gdb_test "restart 6" \
@@ -540,10 +540,10 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 6 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 9"
 
     gdb_test "inferior 3" "\\\[Switching to inferior 3 \\\[<null>\\\] \\(.*?$::exec3\\)\\\]" \
@@ -551,10 +551,10 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" ] \
 	    "info checkpoints 10"
 
     gdb_test "start" "Starting program.*?hangout.*?alarm \\(30\\);"
@@ -567,13 +567,13 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  8 $thr_or_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  8 $proc_re at $::hex, file.*?$hangout_c.*?" \
+	    "  9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 11"
 
     gdb_test "delete checkpoint 8" \
@@ -581,12 +581,12 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 12"
 
     # Switch to inferior 1, add another checkpoint - so that there are
@@ -608,13 +608,13 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  5 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  5 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 13"
 
     # Check that deleting active checkpoints in other (non-current)
@@ -629,12 +629,12 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\+ 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\* 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\+ 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\* 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 14"
 
     gdb_test "inferior 1" "Switching to inferior 1.*?alarm \\(240\\);" \
@@ -642,12 +642,12 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\* 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\* 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 15"
 
     gdb_test "checkpoint" "checkpoint 11: fork returned pid $::decimal.*" \
@@ -655,13 +655,13 @@  with_test_prefix "three inferiors with checkpoints" {
 
     gdb_test "info checkpoints" \
 	[multi_line \
-	    "\\* 4 $thr_or_proc $main_proc at $::hex, file.*?$hello_c.*?" \
-	    "  10 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  11 $thr_or_proc at $::hex, file.*?$hello_c.*?" \
-	    "  1 $thr_or_proc $main_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 6 $thr_or_proc at $::hex, file.*?$goodbye_c.*?" \
-	    "\\+ 7 $thr_or_proc $main_proc at $::hex, file.*?$hangout_c.*?" \
-	    "  9 $thr_or_proc at $::hex, file.*?$hangout_c.*?" ] \
+	    "\\* 4 $proc_re $main_proc at $::hex, file.*?$hello_c.*?" \
+	    "  10 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  11 $proc_re at $::hex, file.*?$hello_c.*?" \
+	    "  1 $proc_re $main_proc at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 6 $proc_re at $::hex, file.*?$goodbye_c.*?" \
+	    "\\+ 7 $proc_re $main_proc at $::hex, file.*?$hangout_c.*?" \
+	    "  9 $proc_re at $::hex, file.*?$hangout_c.*?" ] \
 	    "info checkpoints 16"
 
     gdb_test "x/i \$pc" "=> $::hex <main.*"