Re: How does GDB/MI give the current frame

Andrew Cagney
2004-06-25T15:12:31Z

> Changing the frame with a CLI command (up, down, frame) using annotations
> (level 1 or 2), GDB returns an annotation giving the new current frame.
> In contrast, the MI command is -stack-select-frame is silent.
>
> Assuming that future front ends shouldn't use CLI commands, how do you
> get the current frame using MI only?
>
> Nick
>
>
> Context: gdb-ui.el can have a window showing the call stack from which a stack
> frame can be made current by selection with the mouse. The displayed source
> updates automatically. I don't see how I can do this with gdb-mi.el without
> using the CLI

When the user does "up", "down", the debugger should generate a selected
CLI frame changed event (it currently doesn't). If the GUI so chooses,
it can track the users "selected" frame, by responding to these events.

-stack-select-frame, assuming that it changes the CLI's selected frame,
should generate that same event. Since the event is identical, the GUI
can use common event driven code to track both the CLI selected, and GUI
selected, frames.

One additional note, look at ``Navigating [a]Way'':
http://sources.redhat.com/gdb/papers/multi-arch/real-multi-arch/index.html#SEC25
It should be possible for the GUI to extract frame information from the
inferior without altering the selected-frame (or selected-thread). I
suspect that that currently isn't possible, I also suspect that right
now you don't need it :-)

Andrew