Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 205862 - Debugger should display stdout from program
Summary: Debugger should display stdout from program
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Debug SDM (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 4.0   Edit
Assignee: Greg Watson CLA
QA Contact: clement chu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-09 15:41 EDT by Feiyi Wang CLA
Modified: 2011-01-31 07:50 EST (History)
0 users

See Also:


Attachments
patch to register target stream callback (849 bytes, patch)
2007-10-09 15:42 EDT, Feiyi Wang CLA
g.watson: iplog+
Details | Diff
pseduo terminal (1001 bytes, text/x-csrc)
2007-10-09 15:44 EDT, Feiyi Wang CLA
no flags Details
patch to invoke gdb with pseduo terminal, and select listen for output (2.57 KB, patch)
2007-10-09 15:47 EDT, Feiyi Wang CLA
g.watson: iplog+
Details | Diff
patch to include MIPty.c into the build (623 bytes, patch)
2007-10-09 15:50 EDT, Feiyi Wang CLA
g.watson: iplog+
Details | Diff
patch orte proxy to register io forwarding (3.80 KB, patch)
2007-10-09 15:59 EDT, Feiyi Wang CLA
g.watson: iplog+
Details | Diff
add copyright notice (1.32 KB, text/x-csrc)
2007-10-19 15:36 EDT, Feiyi Wang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Feiyi Wang CLA 2007-10-09 15:41:45 EDT
In debug launch mode, right now user can't see program stdout in anyway. This is due to (1) there is no proper IO forwarding registered. (2) GDB MI doesn't write output to target stream when not run remotely. 

The proposed fix is to open a pair of pseduo terminal devices, and utilize --tty option with GDB to establish the communication channel between master terminal and slave terminal. That way, whatever output GDB writes to the slave terminal can be read from the master device. 

The attached patch file is very preliminary, there are a few things I think there should be better way of handling. For example, the iof_debug_callback() is largely a duplicate of iof_callback(), the only difference is how to locate the job. A extra flag, for example, would be better. Since this will involve changing a API, I will leave this to the reviewer to decide what's best.

Also note that in the current patch form, you can see program output in the console window if the patch I previously submitted is applied. However, I can't click on individual process to view their output - the menu item is simply not there - probably a bug or my particular environment setup.
Comment 1 Feiyi Wang CLA 2007-10-09 15:42:38 EDT
Created attachment 79985 [details]
patch to register target stream callback
Comment 2 Feiyi Wang CLA 2007-10-09 15:44:44 EDT
Created attachment 79986 [details]
pseduo terminal 

for creating master and slave pseduo terminal.
Comment 3 Feiyi Wang CLA 2007-10-09 15:47:43 EDT
Created attachment 79987 [details]
patch to invoke gdb with pseduo terminal, and select listen for output
Comment 4 Feiyi Wang CLA 2007-10-09 15:50:23 EDT
Created attachment 79988 [details]
patch to include MIPty.c into the build
Comment 5 Feiyi Wang CLA 2007-10-09 15:52:39 EDT
Note: I haven't reviewed the comments Greg gave to my previous patch very closely yet. I know some stuff is nonconforming - such as header notice etc. I will fix that when the logic/correctness been oked. thanks
Comment 6 Feiyi Wang CLA 2007-10-09 15:59:11 EDT
Created attachment 79993 [details]
patch orte proxy to register io forwarding
Comment 7 Greg Watson CLA 2007-10-19 15:23:36 EDT
MIPty.c needs to have a license statement added before it can be accepted.
Comment 8 Feiyi Wang CLA 2007-10-19 15:36:36 EDT
Created attachment 80795 [details]
add copyright notice
Comment 9 Greg Watson CLA 2010-03-08 14:29:41 EST
This is now fixed in head.