constify get_bookmark and goto_bookmark
This makes arguments to to_get_bookmark and to_goto_bookmark const and fixes the fallout. Tested by rebuilding. The only thing of note is the new split between cmd_record_goto and record_goto -- basically separating the CLI function from a new internal API, to allow const propagation. 2014-06-26 Tom Tromey <tromey@redhat.com> * record-full.c (record_full_get_bookmark): Make "args" const. (record_full_goto_bookmark): Make "raw_bookmark" const. * record.c (record_goto): New function. (cmd_record_goto): Use it. Now static. * record.h (record_goto): Declare. (cmd_record_goto): Remove declaration. * target-delegates.c: Rebuild. * target.h (struct target_ops) <to_get_bookmark, to_goto_bookmark>: Make parameter const.
This commit is contained in:
parent
9cbe5fff2b
commit
c2bcbb1d04
6 changed files with 47 additions and 23 deletions
|
@ -1703,7 +1703,8 @@ record_full_can_execute_reverse (struct target_ops *self)
|
|||
/* "to_get_bookmark" method for process record and prec over core. */
|
||||
|
||||
static gdb_byte *
|
||||
record_full_get_bookmark (struct target_ops *self, char *args, int from_tty)
|
||||
record_full_get_bookmark (struct target_ops *self, const char *args,
|
||||
int from_tty)
|
||||
{
|
||||
char *ret = NULL;
|
||||
|
||||
|
@ -1727,9 +1728,10 @@ record_full_get_bookmark (struct target_ops *self, char *args, int from_tty)
|
|||
|
||||
static void
|
||||
record_full_goto_bookmark (struct target_ops *self,
|
||||
gdb_byte *raw_bookmark, int from_tty)
|
||||
const gdb_byte *raw_bookmark, int from_tty)
|
||||
{
|
||||
char *bookmark = (char *) raw_bookmark;
|
||||
const char *bookmark = (const char *) raw_bookmark;
|
||||
struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
|
||||
|
||||
if (record_debug)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
|
@ -1737,18 +1739,20 @@ record_full_goto_bookmark (struct target_ops *self,
|
|||
|
||||
if (bookmark[0] == '\'' || bookmark[0] == '\"')
|
||||
{
|
||||
char *copy;
|
||||
|
||||
if (bookmark[strlen (bookmark) - 1] != bookmark[0])
|
||||
error (_("Unbalanced quotes: %s"), bookmark);
|
||||
|
||||
/* Strip trailing quote. */
|
||||
bookmark[strlen (bookmark) - 1] = '\0';
|
||||
/* Strip leading quote. */
|
||||
bookmark++;
|
||||
/* Pass along to cmd_record_full_goto. */
|
||||
|
||||
copy = savestring (bookmark + 1, strlen (bookmark) - 2);
|
||||
make_cleanup (xfree, copy);
|
||||
bookmark = copy;
|
||||
}
|
||||
|
||||
cmd_record_goto (bookmark, from_tty);
|
||||
return;
|
||||
record_goto (bookmark);
|
||||
|
||||
do_cleanups (cleanup);
|
||||
}
|
||||
|
||||
static enum exec_direction_kind
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue