This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MI problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]