Bug 8759 - Textual output from target not contained in target output stream
Summary: Textual output from target not contained in target output stream
Status: RESOLVED DUPLICATE of bug 7728
Alias: None
Product: gdb
Classification: Unclassified
Component: mi (show other bugs)
Version: 6.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-17 17:28 UTC by nicknospam
Modified: 2024-01-13 19:34 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicknospam 2004-05-17 17:28:00 UTC
[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)
Comment 1 drow@false.org 2004-05-18 02:15:04 UTC
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

Comment 2 gianakas 2004-05-18 02:38:33 UTC
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 '~'.
 
 

Comment 3 salvador 2004-08-25 20:58:35 UTC
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
Comment 4 Hannes Domani 2024-01-13 19:34:14 UTC
Dup.

*** This bug has been marked as a duplicate of bug 7728 ***