44 error (_(
"Already in reverse mode. Use '%s' or 'set exec-dir forward'."),
50 std::string reverse_command = string_printf (
"%s %s", cmd, args ? args :
"");
51 scoped_restore restore_exec_dir
121 if (bookmark_id == NULL)
122 error (_(
"target_get_bookmark failed."));
147 if (iter->number == num)
167 warning (_(
"No bookmarks."));
171 if (args == NULL || args[0] ==
'\0')
173 if (from_tty && !
query (_(
"Delete all bookmarks? ")))
185 warning (_(
"No bookmark #%d."), num);
195 const char *p = args;
197 if (args == NULL || args[0] ==
'\0')
198 error (_(
"Command requires an argument."));
200 if (startswith (args,
"start")
201 || startswith (args,
"begin")
202 || startswith (args,
"end"))
209 if (args[0] ==
'\'' || args[0] ==
'\"')
212 if (args[strlen (args) - 1] != args[0])
213 error (_(
"Unbalanced quotes: %s"), args);
222 error (_(
"goto-bookmark: invalid bookmark number '%s'."), p);
226 if (iter.number == num)
234 error (_(
"goto-bookmark: no bookmark found for '%s'."), p);
245 if (bnum == -1 || bnum == iter.number)
250 iter.opaque_data.get ());
255 if (bnum > 0 && matched == 0)
268 else if (args == NULL || *args ==
'\0')
287Step program backward until it reaches the beginning of another source line.\n\
288Argument N means do this N times (or till program stops for another reason)."));
293Step program backward, proceeding through subroutine calls.\n\
294Like the \"reverse-step\" command as long as subroutine calls do not happen;\n\
295when they do, the call is treated as one instruction.\n\
296Argument N means do this N times (or till program stops for another reason)."));
301Step backward exactly one instruction.\n\
302Argument N means do this N times (or till program stops for another reason)."));
307Step backward one instruction, but proceed through called subroutines.\n\
308Argument N means do this N times (or till program stops for another reason)."));
313Continue program being debugged but run it in reverse.\n\
314If proceeding from breakpoint, a number N may be used as an argument,\n\
315which means to set the ignore count of that breakpoint to N - 1 (so that\n\
316the breakpoint won't break until the Nth time it is reached)."));
320Execute backward until just before selected stack frame is called."));
323Set a bookmark in the program's execution history.\n\
324A bookmark represents a point in the execution history \n\
325that can be returned to at a later point in the debug session."));
327Status of user-settable bookmarks.\n\
328Bookmarks are user-settable markers representing a point in the \n\
329execution history that can be returned to later in the same debug \n\
332Delete a bookmark from the bookmark list.\n\
333Argument is a bookmark number or numbers,\n\
334 or no argument to delete all bookmarks."),
337Go to an earlier-bookmarked point in the program's execution history.\n\
338Argument is the bookmark number of a bookmark saved earlier by using \n\
339the 'bookmark' command, or the special arguments:\n\
340 start (beginning of recording)\n\
341 end (end of recording)"));
struct cmd_list_element * deletelist
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
cmd_list_element * add_com_alias(const char *name, cmd_list_element *target, command_class theclass, int abbrev_flag)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
struct cmd_list_element * add_info(const char *name, cmd_simple_func_ftype *fun, const char *doc)
int get_number(const char **pp)
struct program_space * get_frame_program_space(frame_info_ptr frame)
frame_info_ptr get_current_frame(void)
void execute_command(const char *, int)
enum exec_direction_kind execution_direction
CORE_ADDR regcache_read_pc(struct regcache *regcache)
struct regcache * get_current_regcache(void)
static void delete_bookmark_command(const char *args, int from_tty)
static void reverse_stepi(const char *args, int from_tty)
static int bookmark_1(int bnum)
static int bookmark_count
static void goto_bookmark_command(const char *args, int from_tty)
static void save_bookmark_command(const char *args, int from_tty)
static void reverse_continue(const char *args, int from_tty)
static bool delete_one_bookmark(int num)
static void reverse_next(const char *args, int from_tty)
static void reverse_nexti(const char *args, int from_tty)
static void reverse_finish(const char *args, int from_tty)
static std::vector< struct bookmark > all_bookmarks
static void reverse_step(const char *args, int from_tty)
static void delete_all_bookmarks()
void _initialize_reverse()
static void info_bookmarks_command(const char *args, int from_tty)
static void exec_reverse_once(const char *cmd, const char *args, int from_tty)
gdb::unique_xmalloc_ptr< gdb_byte > opaque_data
struct symtab_and_line sal
struct program_space * pspace
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
gdb_byte * target_get_bookmark(const char *args, int from_tty)
void target_goto_bookmark(const gdb_byte *arg, int from_tty)
bool target_can_execute_reverse()
const char * target_shortname()
int query(const char *ctlstr,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void gdb_printf(struct ui_file *stream, const char *format,...)