aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>2010-03-18 01:09:26 +0000
committerStan Shebs <shebs@codesourcery.com>2010-03-18 01:09:26 +0000
commit573cda036ad9f4f8bfe70199cca46106a9583153 (patch)
treea1a9d302ac04aff351f226da7b90a3213eddb35a /gdb/infcmd.c
parentd5041980353873354218b8b18babc5a2847ba342 (diff)
downloadgdb-573cda036ad9f4f8bfe70199cca46106a9583153.zip
gdb-573cda036ad9f4f8bfe70199cca46106a9583153.tar.gz
gdb-573cda036ad9f4f8bfe70199cca46106a9583153.tar.bz2
2010-03-17 Stan Shebs <stan@codesourcery.com>
* infcall.c: Include tracepoint.h. (call_function_by_hand): Disallow calls in tfind mode. * infcmd.c: Include tracepoint.h. (ensure_not_tfind_mode): New function. (continue_1): Call it. (step_1) Ditto. (jump_command): Ditto. (signal_command): Ditto. (advance_command): Ditto. (until_command): Ditto. (finish_command): Ditto. * tracepoint.h (disconnect_or_stop_tracing): Declare.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 29cf427..8cc516d 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -54,8 +54,7 @@
#include "gdbthread.h"
#include "valprint.h"
#include "inline-frame.h"
-
-extern void disconnect_or_stop_tracing (int from_tty);
+#include "tracepoint.h"
/* Functions exported for general use, in inferior.h: */
@@ -648,10 +647,23 @@ ensure_valid_thread (void)
Cannot execute this command without a live selected thread."));
}
+/* If the user is looking at trace frames, any resumption of execution
+ is likely to mix up recorded and live target data. So simply
+ disallow those commands. */
+
+void
+ensure_not_tfind_mode (void)
+{
+ if (get_traceframe_number () >= 0)
+ error (_("\
+Cannot execute this command while looking at trace frames."));
+}
+
void
continue_1 (int all_threads)
{
ERROR_NO_INFERIOR;
+ ensure_not_tfind_mode ();
if (non_stop && all_threads)
{
@@ -825,6 +837,7 @@ step_1 (int skip_subroutines, int single_inst, char *count_string)
int thread = -1;
ERROR_NO_INFERIOR;
+ ensure_not_tfind_mode ();
ensure_valid_thread ();
ensure_not_running ();
@@ -1046,6 +1059,7 @@ jump_command (char *arg, int from_tty)
int async_exec = 0;
ERROR_NO_INFERIOR;
+ ensure_not_tfind_mode ();
ensure_valid_thread ();
ensure_not_running ();
@@ -1148,6 +1162,7 @@ signal_command (char *signum_exp, int from_tty)
dont_repeat (); /* Too dangerous. */
ERROR_NO_INFERIOR;
+ ensure_not_tfind_mode ();
ensure_valid_thread ();
ensure_not_running ();
@@ -1262,6 +1277,8 @@ until_command (char *arg, int from_tty)
if (!target_has_execution)
error (_("The program is not running."));
+ ensure_not_tfind_mode ();
+
/* Find out whether we must run in the background. */
if (arg != NULL)
async_exec = strip_bg_char (&arg);
@@ -1293,6 +1310,8 @@ advance_command (char *arg, int from_tty)
if (!target_has_execution)
error (_("The program is not running."));
+ ensure_not_tfind_mode ();
+
if (arg == NULL)
error_no_arg (_("a location"));
@@ -1546,6 +1565,8 @@ finish_command (char *arg, int from_tty)
int async_exec = 0;
+ ensure_not_tfind_mode ();
+
/* Find out whether we must run in the background. */
if (arg != NULL)
async_exec = strip_bg_char (&arg);