[Converted from Gnats 1654] The textual output from a target/inferior is not contained/formatted in a target output stream when using the MI2 interpreter. Sample program: #include <stdio.h> int main() { printf("Hello, world.\n"); return(0); } Release: gdb 6.0 & 6.1 Environment: i686-pc-linux-gnu How-To-Repeat: nick@socrates gdbtest $ gcc -g test.c -o test nick@socrates gdbtest $ gdb --interpreter mi2 ~"GNU gdb 6.1\n" ~"Copyright 2004 Free Software Foundation, Inc.\n" ~"GDB is free software, covered by the GNU General Public License, and you are\n" ~"welcome to change it and/or distribute copies of it under certain conditions.\n" ~"Type \"show copying\" to see the conditions.\n" ~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n" ~"This GDB was configured as \"i686-pc-linux-gnu\"." ~"\n" (gdb) -file-exec-and-symbols test ~"Using host libthread_db library \"/lib/libthread_db.so.1\".\n" ^done (gdb) -break-insert main ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048394",func="main",file="test.c",line="5",times="0"} (gdb) -exec-run ^running (gdb) *stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048394",func="main",args=[],file="test.c",line="5"} (gdb) -exec-next ^running (gdb) Hello, world. *stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="test.c",line="7"} (gdb)
From: Daniel Jacobowitz <drow@false.org> To: nicknospam@optonline.net Cc: gdb-gnats@sources.redhat.com Subject: Re: mi/1654: Textual output from target not contained in target output stream Date: Mon, 17 May 2004 22:15:04 -0400 On Mon, May 17, 2004 at 05:25:46PM -0000, nicknospam@optonline.net wrote: > The textual output from a target/inferior is not contained/formatted > in a target output stream when using the MI2 interpreter. This is also PR gdb/623. It's not clear what the right thing to do is. What if the inferior is a curses application and tries to draw to the screen, for instance? -- Daniel Jacobowitz
From: Nick Gianakas <gianakas@optonline.net> To: gdb-gnats@sources.redhat.com Cc: Subject: Re: mi/1654: Textual output from target not contained in target output stream Date: Mon, 17 May 2004 22:38:33 -0400 According to the GDB manual: "@" string-output The target output stream contains any textual output from the running target. So the proper output from this example program is: @"Hello, world.\n" At this point, nothing defines output from the inferior. As a result, it's impossible to determine/realize such output definitely. Needless to say, this behavior (or lack thereof) practically voids the purpose of MI2. I can't imagine the change being difficult since the result is the same as the console output stream except with a '@' prefix instead of '~'.
From: Salvador Eduardo Tropea <salvador@inti.gov.ar> To: gdb-gnats@sources.redhat.com, nick@optonline.net Cc: Subject: Re: mi/1654: Textual output from target not contained in target output stream Date: Wed, 25 Aug 2004 17:58:35 -0300 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=3Dview audit-trail The change isn=B4t that easy, go and take a look at the gdb code. At leas= t=20 the gdb versions I analyzed doesn=B4t process the output of the target at= =20 all. You get it directly from the target program. And this behavior doesn=B4t "voids the purpose of MI2". My frontend uses a separated terminal for the target, that=B4s all you=20 need to avoid the mix of messages. Take a look at libmigdb project at Source Forge. SET
Dup. *** This bug has been marked as a duplicate of bug 7728 ***