Bug 10041 - Orphaned MI output when doing core-file debugging with -c option
Summary: Orphaned MI output when doing core-file debugging with -c option
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: mi (show other bugs)
Version: 6.8
: P2 minor
Target Milestone: 6.8
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-07 19:03 UTC by Marc Khouzam
Modified: 2011-01-07 18:39 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2011-01-07 18:39:03


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam 2009-04-07 19:03:57 UTC
In HEAD and 6.8 (didn't try earlier), when using the -c option

on the command-line to specify the core file, when in MI mode,

there is a 'orphaned' frame output that is output on the first

MI command. In the session below you can see that my first

command is "-gdb-set confirm" and it has a frame as part

of its output.  I ran the same command right after and got

the proper output.



> gdb -i mi -c core.32141 a.out 

~"GNU gdb 6.8\n"

~"Copyright (C) 2008 Free Software Foundation, Inc.\n"

~"License GPLv3+: GNU GPL version 3 or later

<http://gnu.org/licenses/gpl.html>\n"

~"This is free software: you are free to change and redistribute it.\n"

~"There is NO WARRANTY, to the extent permitted by law.  Type \"show

copying\"\n"

~"and \"show warranty\" for details.\n"

~"This GDB was configured as \"i686-pc-linux-gnu\"...\n"

&"\nwarning: "

&"Can't read pathname for load map: Input/output error.\n"

~"Reading symbols from /usr/lib/libstdc++.so.6..."

~"done.\n"

~"Loaded symbols for /usr/lib/libstdc++.so.6\n"

~"Reading symbols from /lib/libm.so.6..."

~"done.\n"

~"Loaded symbols for /lib/libm.so.6\n"

~"Reading symbols from /lib/libgcc_s.so.1..."

~"done.\n"

~"Loaded symbols for /lib/libgcc_s.so.1\n"

~"Reading symbols from /lib/libc.so.6..."

~"done.\n"

~"Loaded symbols for /lib/libc.so.6\n"

~"Reading symbols from /lib/ld-linux.so.2..."

~"done.\n"

~"Loaded symbols for /lib/ld-linux.so.2\n"

&"Failed to read a valid object file image from memory.\n"

~"Core was generated by `/local/home/lmckhou/testing/a.out'.\n"

~"Program terminated with signal 5, Trace/breakpoint trap.\n"

~"[New process 32141]\n"

(gdb) 

-gdb-set confirm

^done,frame={level="0",addr="0x080484eb",func="main",args=[],file="b.cc"

,fullname="/local/home/lmckhou/testing/b.cc",line="17"}

(gdb) 

-gdb-set confirm

^done

(gdb)
Comment 1 Tom Tromey 2011-01-07 18:39:03 UTC
The immediate cause is that core_open calls print_stack_frame.
Offhand I am not sure if we should try to suppress this somehow,
or if just flushing the MI output stream is appropriate.