Index: infcall.c =================================================================== RCS file: /cvs/src/src/gdb/infcall.c,v retrieving revision 1.127 diff -p -r1.127 infcall.c *** infcall.c 28 Feb 2010 17:56:36 -0000 1.127 --- infcall.c 17 Mar 2010 01:34:00 -0000 *************** *** 21,26 **** --- 21,27 ---- #include "defs.h" #include "breakpoint.h" + #include "tracepoint.h" #include "target.h" #include "regcache.h" #include "inferior.h" *************** call_function_by_hand (struct value *fun *** 453,458 **** --- 454,462 ---- if (!target_has_execution) noprocess (); + if (get_traceframe_number () >= 0) + error (_("May not call functions while looking at trace frames.")); + frame = get_current_frame (); gdbarch = get_frame_arch (frame); Index: infcmd.c =================================================================== RCS file: /cvs/src/src/gdb/infcmd.c,v retrieving revision 1.259 diff -p -r1.259 infcmd.c *** infcmd.c 16 Feb 2010 21:18:46 -0000 1.259 --- infcmd.c 17 Mar 2010 01:34:00 -0000 *************** *** 56,61 **** --- 56,62 ---- #include "inline-frame.h" extern void disconnect_or_stop_tracing (int from_tty); + extern int get_traceframe_number (void); /* Functions exported for general use, in inferior.h: */ *************** ensure_valid_thread (void) *** 648,657 **** --- 649,671 ---- 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) { *************** step_1 (int skip_subroutines, int single *** 825,830 **** --- 839,845 ---- int thread = -1; ERROR_NO_INFERIOR; + ensure_not_tfind_mode (); ensure_valid_thread (); ensure_not_running (); *************** jump_command (char *arg, int from_tty) *** 1046,1051 **** --- 1061,1067 ---- int async_exec = 0; ERROR_NO_INFERIOR; + ensure_not_tfind_mode (); ensure_valid_thread (); ensure_not_running (); *************** signal_command (char *signum_exp, int fr *** 1148,1153 **** --- 1164,1170 ---- dont_repeat (); /* Too dangerous. */ ERROR_NO_INFERIOR; + ensure_not_tfind_mode (); ensure_valid_thread (); ensure_not_running (); *************** until_command (char *arg, int from_tty) *** 1262,1267 **** --- 1279,1286 ---- 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); *************** finish_command (char *arg, int from_tty) *** 1546,1551 **** --- 1565,1572 ---- 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);