Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Target stream output is not written to console on linux

Hi,
 
Are you using a custom launch configuration?  You need to create a new Process to be the 'debugeeProcess' for the launch. This will tie the target's output to a Console.  Something like this should do the trick:
 
<... Set configuration ...>
//Process created for I/O console
     Process process = target.getProcess();
     IProcess iprocess = null;
     if (process != null) {
      iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(exeFileInfo.getPath().toFile().getName()));
     }
     
   CDIDebugModel.newDebugTarget(launch, projectInfo,
        dtargets[i],
        renderTargetLabel(debugConfig), iprocess,
        exeFileInfo, true, true, stopSymbol, false); 
...
     
James


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Shaiju P Nair
Sent: 14 August 2007 10:23
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Target stream output is not written to console on linux

Hello
  When I debug applications on emulation hardware the application's output  are missing  on the console in linux cdt.   But in the case of   windows this works perfectly  fine .  Has any body else faced this problem ?
 
 When I debugged  the cdt code what I found is that  these target output stream are processed as  out of band records and send to the  console  through  the PipedOutput stream. The following code in RxThread does this
---------------------------
if (stream instanceof MITargetStreamOutput) {
            OutputStream target = session.getMIInferior().getPipedOutputStream();
            if (target != null) {
                MITargetStreamOutput out = (MITargetStreamOutput) stream;
                String str = out.getString();
                if (str != null) {
                    try {
                        target.write(str.getBytes());
                        target.flush();
                    } catch (IOException e) {
                    }
                }
            }
            // Accumulate the Target Stream Output response for parsing.
            // Some commands, e.g. 'monitor' will put valuable info  in the Console Stream.
            // This fixes bug 119370.
            oobList.add(stream);
        }
----------------------------------------------------
 
In the case of linux I  found that
OutputStream target = session.getMIInferior().getPipedOutputStream();  comes null  since target is null it is never written .  In case of windows the target is valid and it writes and the output  is appearing .
 
I understand that there  is difference in the way in which MIInferior object created in Linux and windows.  
 
Any idea how to approach this  problem ?
 
Thanks
Shaiju.P
 

Back to the top