[v3,2/3] Capitalize output of successful checkpoint command

Message ID 20240414195812.151224-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 April 14, 2024, 7:44 p.m. UTC
  This commit causes the output of a "checkpoint" command to be
changed from:

    checkpoint N: fork returned pid DDDD

to:

    Checkpoint N: fork returned pid DDDD

This change was made to bring the output of the "checkpoint" command in
line with that of other commands, e.g.:

    (gdb) break main
    Breakpoint 1 at ...

    (gdb) catch exec
    Catchpoint 2 (exec)

    (gdb) add-inferior
    [New inferior 2]
    Added inferior 2

The tests gdb.base/checkpoint.exp and gdb.base/kill-during-detach.exp
have been updated to accept either form of output from the
"checkpoint" command.  The test gdb.multi/checkpoint-multi.exp had
already been written with this change in mind.
---
 gdb/linux-fork.c                              | 2 +-
 gdb/testsuite/gdb.base/checkpoint.exp         | 2 +-
 gdb/testsuite/gdb.base/kill-during-detach.exp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 987c925bdbc..e686fdcb0f4 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -919,7 +919,7 @@  checkpoint_command (const char *args, int from_tty)
     {
       int parent_pid;
 
-      gdb_printf (_("checkpoint "));
+      gdb_printf (_("Checkpoint "));
       if (forks_exist_in_multiple_inferiors_p ())
 	gdb_printf ("%d.%d: ", inf->num, fp->num);
       else
diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp
index b9a1e3161db..9fcb91139de 100644
--- a/gdb/testsuite/gdb.base/checkpoint.exp
+++ b/gdb/testsuite/gdb.base/checkpoint.exp
@@ -345,7 +345,7 @@  with_test_prefix "delete checkpoint 0" {
     clean_restart $binfile
     runto_main
 
-    gdb_test "checkpoint" "checkpoint 1: fork returned pid $decimal\\."
+    gdb_test "checkpoint" "\[Cc\]heckpoint 1: fork returned pid $decimal\\."
     gdb_test "restart 1" "Switching to .*"
     gdb_test "delete checkpoint 0" "Killed process $decimal"
     gdb_test "info checkpoints" [string_to_regexp "No checkpoints."]
diff --git a/gdb/testsuite/gdb.base/kill-during-detach.exp b/gdb/testsuite/gdb.base/kill-during-detach.exp
index 68292cc3c51..d61ddedceaf 100644
--- a/gdb/testsuite/gdb.base/kill-during-detach.exp
+++ b/gdb/testsuite/gdb.base/kill-during-detach.exp
@@ -93,7 +93,7 @@  proc run_test { exit_p checkpoint_p } {
 
 	# Set the checkpoint.
 	gdb_test "checkpoint" \
-	    "checkpoint 1: fork returned pid $::decimal\\."
+	    "\[Cc\]heckpoint 1: fork returned pid $::decimal\\."
     }
 
     # Must get the PID before we resume the inferior.