2010-04-01 Stan Shebs <stan@codesourcery.com>
authorStan Shebs <shebs@codesourcery.com>
Thu, 1 Apr 2010 20:30:56 +0000 (20:30 +0000)
committerStan Shebs <shebs@codesourcery.com>
Thu, 1 Apr 2010 20:30:56 +0000 (20:30 +0000)
* tracepoint.c (trace_start_command): Confirm if trace is running.
(trace_stop_command): Error if trace not running.

gdb/ChangeLog
gdb/tracepoint.c

index 814a336842714724c86b47a78f977f12d706939d..81ec47a4568918f4fbd12e4512ec3bc1e5bf39ef 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-01  Stan Shebs  <stan@codesourcery.com>
+
+       * tracepoint.c (trace_start_command): Confirm if trace is running.
+       (trace_stop_command): Error if trace not running.
+
 2010-04-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        * amd64-tdep.c (amd64_byte_names): Add "ah", "bh", "ch", "dh".
index f82e05e8c0a0d9628b27254f03bc7df14e012e5d..14fcbc58fef5b6537f3f3e8febb2a5162e9bffe9 100644 (file)
@@ -1576,6 +1576,13 @@ trace_start_command (char *args, int from_tty)
 {
   dont_repeat ();      /* Like "run", dangerous to repeat accidentally.  */
 
+  if (current_trace_status ()->running)
+    {
+      if (from_tty
+         && !query (_("A trace is running already.  Start a new run? ")))
+       error (_("New trace run not started."));
+    }
+
   start_tracing ();
 }
 
@@ -1583,6 +1590,9 @@ trace_start_command (char *args, int from_tty)
 static void
 trace_stop_command (char *args, int from_tty)
 {
+  if (!current_trace_status ()->running)
+    error (_("Trace is not running."));
+
   stop_tracing ();
 }