How to connect the debug console to my debugger ??? [message #326392] |
Tue, 18 March 2008 13:31  |
Eclipse User |
|
|
|
Hello,
I have written a debugger for my language and the only trouble I have is
the message printing location.
The DebugPlugin seams to create a console for a new process but it does
not redirect the process' streams to this console...
In the launch delagate :
KBasicProcess basicProcess = new KBasicProcess( kermetaUnit, _requestPort,
_eventPort );
KProcess process = (KProcess) DebugPlugin.newProcess(launch, basicProcess,
"Debugger");
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
IDebugTarget target = new KDebugTarget(launch, process, _requestPort,
_eventPort);
launch.addDebugTarget(target);
}
In the basic process :
@Override
public InputStream getErrorStream() {
return System.in;
}
@Override
public InputStream getInputStream() {
return System.in;
}
@Override
public OutputStream getOutputStream() {
return System.out;
}
I am certainly doing something wrong here, but I can't figure it out.
Need help please :)
François
|
|
|
Re: How to connect the debug console to my debugger ??? [message #326397 is a reply to message #326392] |
Tue, 18 March 2008 14:22  |
Eclipse User |
|
|
|
Maybe these lines will give you hints:
process.getStreamsProxy().getErrorStreamMonitor().addListene r(toConsole);
process.getStreamsProxy().getOutputStreamMonitor().addListen er(toConsole);
In toConsole.streamAppended() I write to my console.
John
François wrote:
> Hello,
>
> I have written a debugger for my language and the only trouble I have is
> the message printing location.
>
> The DebugPlugin seams to create a console for a new process but it does
> not redirect the process' streams to this console...
>
> In the launch delagate :
> KBasicProcess basicProcess = new KBasicProcess( kermetaUnit,
> _requestPort, _eventPort );
> KProcess process = (KProcess) DebugPlugin.newProcess(launch,
> basicProcess, "Debugger");
> if (mode.equals(ILaunchManager.DEBUG_MODE)) {
> IDebugTarget target = new KDebugTarget(launch, process,
> _requestPort, _eventPort);
> launch.addDebugTarget(target);
> }
>
> In the basic process :
> @Override
> public InputStream getErrorStream() {
> return System.in;
> }
>
> @Override
> public InputStream getInputStream() {
> return System.in;
> }
>
> @Override
> public OutputStream getOutputStream() {
> return System.out;
> }
>
> I am certainly doing something wrong here, but I can't figure it out.
> Need help please :)
>
> François
>
|
|
|
Powered by
FUDForum. Page generated in 0.03723 seconds