How does GDB/MI give the current frame

Andrew Cagney cagney@gnu.org
Sun Jun 27 02:12:00 GMT 2004


> Daniel Jacobowitz writes:
> DJ> 
> DJ> Why not use -stack-info-frame?
> 
> Because AFAIK this MI command has not been implemented (yet).
> 
> Andrew Cagney writes:
> 
> AC> When the user does "up", "down", the debugger should generate a selected 
> AC> CLI frame changed event (it currently doesn't).  If the GUI so chooses, 
> AC> it can track the users "selected" frame, by responding to these events.
> 
> I don't know what a selected CLI frame changed event is but up, down, and
> frame generate MI output, so I imagine its just a case of hooking
> -stack-info-frame and -stack-select-frame to that output. I will try to do
> this if you think it's appropriate.

For the CLI, something like this:

-> -interpreter cli "up"
<- ~"info on new frame..."
<- *select-frame,<frame-info>...
<- done

with similar for -stack-select-frame:

-> -stack-select-frame 1
<- *select-frame,<frame-info>,....
<- done

Where, yes, <frame-info> would be constructed by calling frame code.

-stack-info-frame would just be just:

-> -stack-info-frame
<- done,<frame-info>

The important thing is that, in both cases, the GUI is being driven by 
the select-frame event.

Andrew

PS: Better / more consistent event name welcome.




More information about the Gdb mailing list