48 char *reverse_command;
53 error (
_(
"Already in reverse mode. Use '%s' or 'set exec-dir forward'."),
59 reverse_command =
xstrprintf (
"%s %s", cmd, args ? args :
"");
116 #define ALL_BOOKMARKS(B) for ((B) = bookmark_chain; (B); (B) = (B)->next)
118 #define ALL_BOOKMARKS_SAFE(B,TMP) \
119 for ((B) = bookmark_chain; \
120 (B) ? ((TMP) = (B)->next, 1) : 0; \
141 if (bookmark_id == NULL)
142 error (
_(
"target_get_bookmark failed."));
183 if (b == bookmark_chain)
184 bookmark_chain = b->
next;
213 bookmark_chain = NULL;
222 if (bookmark_chain == NULL)
228 if (args == NULL || args[0] ==
'\0')
230 if (from_tty && !
query (
_(
"Delete all bookmarks? ")))
242 warning (
_(
"No bookmark #%d."), num);
255 if (args == NULL || args[0] ==
'\0')
256 error (
_(
"Command requires an argument."));
267 if (args[0] ==
'\'' || args[0] ==
'\"')
270 if (args[strlen (args) - 1] != args[0])
271 error (
_(
"Unbalanced quotes: %s"), args);
280 error (
_(
"goto-bookmark: invalid bookmark number '%s'."), p);
293 error (
_(
"goto-bookmark: no bookmark found for '%s'."), p);
305 if (bnum == -1 || bnum == b->
number)
315 if (bnum > 0 && matched == 0)
330 else if (args == NULL || *args ==
'\0')
353 Step program backward until it reaches the beginning of another source line.\n\
354 Argument N means do this N times (or till program stops for another reason).")
359 Step program backward, proceeding through subroutine calls.\n\
360 Like the \"reverse-step\" command as long as subroutine calls do not happen;\n\
361 when they do, the call is treated as one instruction.\n\
362 Argument N means do this N times (or till program stops for another reason).")
367 Step backward exactly one instruction.\n\
368 Argument N means do this N times (or till program stops for another reason).")
373 Step backward one instruction, but proceed through called subroutines.\n\
374 Argument N means do this N times (or till program stops for another reason).")
379 Continue program being debugged but run it in reverse.\n\
380 If proceeding from breakpoint, a number N may be used as an argument,\n\
381 which means to set the ignore count of that breakpoint to N - 1 (so that\n\
382 the breakpoint won't break until the Nth time it is reached)."));
386 Execute backward until just before selected stack frame is called."));
389 Set a bookmark in the program's execution history.\n\
390 A bookmark represents a point in the execution history \n\
391 that can be returned to at a later point in the debug session."));
393 Status of user-settable bookmarks.\n\
394 Bookmarks are user-settable markers representing a point in the \n\
395 execution history that can be returned to later in the same debug \n\
398 Delete a bookmark from the bookmark list.\n\
399 Argument is a bookmark number or numbers,\n\
400 or no argument to delete all bookmarks.\n"),
403 Go to an earlier-bookmarked point in the program's execution history.\n\
404 Argument is the bookmark number of a bookmark saved earlier by using \n\
405 the 'bookmark' command, or the special arguments:\n\
406 start (beginning of recording)\n\
407 end (end of recording)\n"));
#define target_can_execute_reverse
#define target_get_bookmark(ARGS, FROM_TTY)
struct frame_info * get_current_frame(void)
static void bookmarks_info(char *args, int from_tty)
static void delete_all_bookmarks(void)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
void warning(const char *fmt,...)
int query(const char *ctlstr,...)
void init_sal(struct symtab_and_line *sal)
struct cmd_list_element * deletelist
static void delete_bookmark_command(char *args, int from_tty)
void execute_command(char *, int)
int get_number(char **pp)
static struct bookmark * bookmark_chain
struct regcache * get_current_regcache(void)
void printf_filtered(const char *format,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static int bookmark_count
initialize_file_ftype _initialize_reverse
static void reverse_finish(char *args, int from_tty)
void initialize_file_ftype(void)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
static void reverse_step(char *args, int from_tty)
static void reverse_nexti(char *args, int from_tty)
struct cmd_list_element * add_com_alias(const char *name, const char *oldname, enum command_class theclass, int abbrev_flag)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct symtab_and_line sal
static void reverse_next(char *args, int from_tty)
struct cmd_list_element * add_info(const char *name, cmd_cfunc_ftype *fun, const char *doc)
static int delete_one_bookmark(int num)
static int startswith(const char *string, const char *pattern)
char * xstrprintf(const char *format,...)
static void reverse_stepi(char *args, int from_tty)
static void goto_bookmark_command(char *args, int from_tty)
static void reverse_continue(char *args, int from_tty)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
struct program_space * pspace
#define ALL_BOOKMARKS_SAFE(B, TMP)
static void exec_direction_default(void *notused)
static int bookmark_1(int bnum)
int get_number_or_range(struct get_number_or_range_state *state)
#define target_goto_bookmark(ARG, FROM_TTY)
PTR xcalloc(size_t number, size_t size)
struct program_space * get_frame_program_space(struct frame_info *frame)
static void save_bookmark_command(char *args, int from_tty)
void error(const char *fmt,...)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc)
void init_number_or_range(struct get_number_or_range_state *state, const char *string)
void do_cleanups(struct cleanup *old_chain)
static void exec_reverse_once(char *cmd, char *args, int from_tty)