This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: MI problem
- From: Daniel Jacobowitz <drow at false dot org>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: GDB List <gdb at sources dot redhat dot com>
- Date: Wed, 16 Nov 2005 23:20:08 -0500
- Subject: Re: MI problem
- References: <4378DDB4.3020702@st.com>
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