MI problem
Daniel Jacobowitz
drow@false.org
Thu Nov 17 04:20:00 GMT 2005
On Mon, Nov 14, 2005 at 06:55:48PM +0000, Andrew STUBBS wrote:
> Hi all,
>
> When I run GDB with -i=mi1 I get a segmentation fault while running the
> 'load' command. (-i=mi2 works fine.)
>
> The fault occurs in ui_file_put() due to 'file' having no useful value.
> This value is taken from uiout.data->buffer (MI version of data).
>
> I have traced the 'source' of this rogue data to cli_interpreter_exec()
> which passes cli_uiout to safe_execute_command() which calls
> exceptions_state_mc_init() which changes the global uiout.
>
> The MI seems to be calling the CLI to interpret the 'load' command, but
> the CLI then clashes with the MI I/O routines causing the fault, in this
> case under generic_load().
>
> Here is a backtrace from where the uiout gets switched:
The interesting question isn't where it gets switched, but where we're
expecting the wrong contents. If we're accessing uiout.data->buffer
then we must have reached mi_out_put. So where from, and how did we
get there without switching the global uiout back to MI's?
mi_cmd_interpreter_exec ought to be doing that on the way out.
--
Daniel Jacobowitz
CodeSourcery, LLC
More information about the Gdb
mailing list