This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Different output from -gdb-show than show
On Tuesday 31 August 2010 20:10:15, Michael Snyder wrote:
> >> I did try this patch, and after failing to set "reverse", it
> >> still shows "Forward".
> >>
> >> What am I missing?
> >
> > That "-gdb-show exec-direction" reads from exec_direction. See
> > Marc's original bug report upthread. :-)
> >
>
> I don't see how, since it's a static variable and I've looked at
> every local reference to it.
A pointer to it is passed to add_setshow_enum_cmd:
add_setshow_enum_cmd ("exec-direction", class_run, exec_direction_names,
&exec_direction, _("Set direction of execution.\n\
Options are 'forward' or 'reverse'."),
_("Show direction of execution (forward/reverse)."),
_("Tells gdb whether to execute forward or backward."),
set_exec_direction_func, show_exec_direction_func,
&setlist, &showlist);
"-gdb-show exec-direction" does not call the set callback, it prints the command's
control enum value directly.
(gdb) show exec-direction
Forward.
(gdb) interpreter-exec mi "-gdb-show exec-direction"
^done,value="forward"
(gdb)
Note "Forward." vs "forward".
> 2010-08-31 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
>
> * infrun.c (set_exec_direction_func): Error out if target does not
> support reverse execution.
Okay.
--
Pedro Alves