gdb, record: rephrase the 'not recording' error message
authorMarkus Metzger <markus.t.metzger@intel.com>
Thu, 3 Dec 2020 16:04:29 +0000 (17:04 +0100)
committerMarkus Metzger <markus.t.metzger@intel.com>
Mon, 21 Dec 2020 07:56:26 +0000 (08:56 +0100)
When trying to use one of the record commands without having enabled
recording first, GDB gives the error message:

    (gdb) record function-call-history
    No record target is currently active.
    Use one of the "target record-<TAB><TAB>" commands first.

In the record help, however, we say:

    (gdb) help record
    record, rec
    Start recording.

    List of record subcommands:

    record btrace, record b -- Start branch trace recording.
    record delete, record del, record d -- Delete the rest of execution log and start recording it anew.
    record full -- Start full execution recording.
    record function-call-history -- Prints the execution history at function granularity.
    record goto -- Restore the program to its state at instruction number N.
    record instruction-history -- Print disassembled instructions stored in the execution log.
    record save -- Save the execution log to a file.
    record stop, record s -- Stop the record/replay target.

Change the above error message to

    (gdb) record function-call-history
    No recording is currently active.
    Use the "record full" or "record btrace" command first.

to align with the help text.

gdb/ChangeLog:
2020-12-03  Markus Metzger  <markus.t.metzger@intel.com>

* record.c (require_record_target): Rephrase error message.
(info_record_command): Likewise.

gdb/testsuite/ChangeLog:
2020-12-03  Markus Metzger  <markus.t.metzger@intel.com>

* gdb.btrace/enable.exp: Update error message.
* gdb.btrace/multi-inferior.exp: Likewise.
* gdb.btrace/reconnect.exp: Likewise.
* gdb.python/py-record-btrace.exp: Likewise.
* gdb.python/py-record-full.exp: Likewise.

gdb/ChangeLog
gdb/record.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.btrace/enable.exp
gdb/testsuite/gdb.btrace/multi-inferior.exp
gdb/testsuite/gdb.btrace/reconnect.exp
gdb/testsuite/gdb.python/py-record-btrace.exp
gdb/testsuite/gdb.python/py-record-full.exp

index b379fcf24d5e617ac5c81be139e58cf595a06a4a..6e0c8be81bcc6380c34f7262729e6ae1704488db 100644 (file)
@@ -1,3 +1,8 @@
+2020-12-21  Markus Metzger  <markus.t.metzger@intel.com>
+
+       * record.c (require_record_target): Rephrase error message.
+       (info_record_command): Likewise.
+
 2020-12-19  Hannes Domani  <ssbssa@yahoo.de>
 
        PR exp/27070
index f91411927794b6d73f075820a54bf27100cd4aa4..204bda0a4244e8536f292fca1c50714ee1a2b369 100644 (file)
@@ -74,8 +74,8 @@ require_record_target (void)
 
   t = find_record_target ();
   if (t == NULL)
-    error (_("No record target is currently active.\n"
-            "Use one of the \"target record-<TAB><TAB>\" commands first."));
+    error (_("No recording is currently active.\n"
+            "Use the \"record full\" or \"record btrace\" command first."));
 
   return t;
 }
@@ -325,7 +325,7 @@ info_record_command (const char *args, int from_tty)
   t = find_record_target ();
   if (t == NULL)
     {
-      printf_filtered (_("No record target is currently active.\n"));
+      printf_filtered (_("No recording is currently active.\n"));
       return;
     }
 
index af6638d482db8885de3ad8ad1c231196ff28611a..63f7279ac04ed54b227e87bd3ae1743c3cfd6183 100644 (file)
@@ -1,3 +1,11 @@
+2020-12-21  Markus Metzger  <markus.t.metzger@intel.com>
+
+       * gdb.btrace/enable.exp: Update error message.
+       * gdb.btrace/multi-inferior.exp: Likewise.
+       * gdb.btrace/reconnect.exp: Likewise.
+       * gdb.python/py-record-btrace.exp: Likewise.
+       * gdb.python/py-record-full.exp: Likewise.
+
 2020-12-20  Tom de Vries  <tdevries@suse.de>
 
        * lib/gdb.exp (save_target_board_info): New proc.
index a968d410384dca60d936994dfec9272ff2cb9b6c..8ce1dab076f346b737a6e890bf08900930fa7d88 100644 (file)
@@ -27,15 +27,15 @@ gdb_exit
 gdb_start
 
 # record cannot be stopped, if it was never active
-gdb_test "record stop" "No record target is currently active\\..*" "record stop without target"
+gdb_test "record stop" "No recording is currently active\\..*" "record stop without target"
 
 # btrace cannot be enabled without a running inferior
 gdb_test "record btrace" "The program is not being run\\." "record btrace without running program"
 
 # no function and no instruction history without btrace enabled
-gdb_test "record function-call-history" "No record target is currently active\\..*" "record function-call-history without target"
-gdb_test "record instruction-history" "No record target is currently active\\..*" "record instruction-history without target"
-gdb_test "info record" "No record target is currently active\\." "info record without target"
+gdb_test "record function-call-history" "No recording is currently active\\..*" "record function-call-history without target"
+gdb_test "record instruction-history" "No recording is currently active\\..*" "record instruction-history without target"
+gdb_test "info record" "No recording is currently active\\." "info record without target"
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
@@ -65,7 +65,7 @@ Recorded 0 instructions in 0 functions \\\(0 gaps\\\) for thread 1.*\\." "info r
 
 # stop btrace record
 gdb_test "record stop" "Process record is stopped and all execution logs are deleted\\."
-gdb_test "record stop" "No record target is currently active\\..*" "record stop the second time"
+gdb_test "record stop" "No recording is currently active\\..*" "record stop the second time"
 
 # enable btrace again
 gdb_test_no_output "record btrace" "record btrace re-enable"
index fdf889f5ed82410c7e40f48b7d569ffa171e2454..23bc852c56558b9e4c7e6d1e3da452f5988974a7 100644 (file)
@@ -55,7 +55,7 @@ with_test_prefix "inferior 2" {
 with_test_prefix "inferior 1" {
     gdb_test "inferior 1" "Switching to inferior 1.*"
 
-    gdb_test "info record" "No record target is currently active\\."
+    gdb_test "info record" "No recording is currently active\\."
     gdb_test_no_output "record btrace" "record btrace"
 }
 
@@ -69,6 +69,6 @@ with_test_prefix "inferior 3" {
        return -1
     }
 
-    gdb_test "info record" "No record target is currently active\\."
+    gdb_test "info record" "No recording is currently active\\."
     gdb_test_no_output "record btrace" "record btrace"
 }
index 26d04c38a9e51906b407447486bb0665580621f7..baec86f8aa384bad82d391c3675a5c850ec8dbef 100644 (file)
@@ -81,5 +81,5 @@ with_test_prefix "second" {
 
 # Test that recording is now off.
 with_test_prefix "third" {
-  gdb_test "info record" "No record target is currently active."
+  gdb_test "info record" "No recording is currently active."
 }
index bdfb2e3b1252aefba591e620ab1a713ac526b198..3a84cbe7ac4d86ad734c51d86a57efa087017869 100644 (file)
@@ -47,7 +47,7 @@ with_test_prefix "no or double record" {
     gdb_test "python gdb.start_recording(\"btrace\")" ".*gdb\.error: The process is already being recorded\..*"
 
     gdb_test_no_output "python gdb.stop_recording()" "first"
-    gdb_test "python gdb.stop_recording()" ".*gdb\.error: No record target is currently active\..*" "second"
+    gdb_test "python gdb.stop_recording()" ".*gdb\.error: No recording is currently active\..*" "second"
 }
 
 with_test_prefix "preopened record btrace" {
index c823bc2c74cb40515f32833ba7b3310f97b6a4a6..a1f24a3634f40cb5e6aac8bfe411e3733ed6a62d 100644 (file)
@@ -47,7 +47,7 @@ with_test_prefix "no or double record" {
     gdb_test "python gdb.start_recording(\"full\")" ".*gdb\.error: The process is already being recorded\..*"
 
     gdb_test_no_output "python gdb.stop_recording()" "first"
-    gdb_test "python gdb.stop_recording()" ".*gdb\.error: No record target is currently active\..*" "second"
+    gdb_test "python gdb.stop_recording()" ".*gdb\.error: No recording is currently active\..*" "second"
 }
 
 with_test_prefix "preopened record full" {
This page took 0.043845 seconds and 4 git commands to generate.