This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: GDB MI Reverse Commands added [1 of 3]


> > > +/* continue in reverse direction:
> > > +   XXX: code duplicated from reverse.c */
> > > +
> > > +static void
> > > +exec_direction_default (void *notused)
> > > +{
> > > +  /* Return execution direction to default state.  */
> > > +  execution_direction = EXEC_FORWARD;
> > > +}
> >
> > It should be straight-forward to make the function in reverse.c globally
> > visible, and remove this copy-paste.

I just updated my cvs tree, and it seems that the main reverse function has changed its name.  As far as I can tell (I did  not do all of this code myself, rather I have to blame some colleagues), the current reversing function that we want to call is:

static void
exec_reverse_once (char *cmd, char *args, int from_tty)
{
...
}

From 

void
mi_cmd_exec_continue (char *command, char **argv, int argc)
{
  if (argc > 0 && strcmp (argv[0], "--reverse") == 0)
    exec_reverse_continue (argv + 1, argc - 1);
  else
    exec_continue (argv, argc);
}

Where exec_reverse_continue() should be replaced with exec_reverse_once().

Can someone familiar with the main reverse code illuminate me on how to call into the reverse code in teh right way?  It seems that the reverse.c code has already changed from the code that was (bad style) copied into mi-main.c...  which is exactly what we want to avoid in the first place. 

Or is the logical thing to do from MI to just call

static void
reverse_continue (char *args, int from_tty)
{
  exec_reverse_once ("continue", args, from_tty);
}

As the implementation of reverse continue?  This does looks like the we submitted has rotted since the patch was submitted... 

/jakob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]