@@ -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);
@@ -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.*"