Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Lines disappearing from console view
Lines disappearing from console view [message #281905] Mon, 28 February 2005 06:37 Go to next message
Eclipse UserFriend
Originally posted by: mathiasb.diku.dk

Hello

I have a problem.

I have a commandline interpreter that i call from inside Eclipse with a
launchconfiguation. When the interpreter is called normally on a
commandline, the output is something like this:

listening on port 16104 3ee8, epoch 42112 a480
....any error messages and the like...
....input/output from interpreted program...

But when i call it from inside eclipse, and the output comes up in the
console view, the first line is missing and it looks like this:

....any error messages and the like...
....input/output from interpreted program...

Everything else is working fine. Just that one line missing?!?
Btw. when i run it in Eclipse i do it like this:

String[] commandLine = new String[] { "path/to/program", "arg1", "arg2" };
Process process = DebugPlugin.exec(commandLine, null, environment);
IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
launch.addProcess(p);

Hope anybody has any ideas...

Thanks in advance!

--
Regards
Mathias Bertelsen
Re: Lines disappearing from console view [message #281913 is a reply to message #281905] Mon, 28 February 2005 11:24 Go to previous messageGo to next message
Eclipse UserFriend
What stream do you write the first line to? The ProcessConsole listens
the standard streams. Nothing written to those streams should be lost.
If you want to spend time debugging this yourself I'd recommend
ProcessConsole (in org.eclipse.debug.ui plugin) as a good place to start.
It would also be a good idea to file a bug report against Platform-Debug
(and attach a test case if that's possible).
What build are you using?

Mathias Bertelsen wrote:
> Hello
>
> I have a problem.
>
> I have a commandline interpreter that i call from inside Eclipse with a
> launchconfiguation. When the interpreter is called normally on a
> commandline, the output is something like this:
>
> listening on port 16104 3ee8, epoch 42112 a480
> ...any error messages and the like...
> ...input/output from interpreted program...
>
> But when i call it from inside eclipse, and the output comes up in the
> console view, the first line is missing and it looks like this:
>
> ...any error messages and the like...
> ...input/output from interpreted program...
>
> Everything else is working fine. Just that one line missing?!?
> Btw. when i run it in Eclipse i do it like this:
>
> String[] commandLine = new String[] { "path/to/program", "arg1", "arg2" };
> Process process = DebugPlugin.exec(commandLine, null, environment);
> IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
> launch.addProcess(p);
>
> Hope anybody has any ideas...
>
> Thanks in advance!
>
> --
> Regards
> Mathias Bertelsen
Re: Lines disappearing from console view [message #281941 is a reply to message #281913] Tue, 01 March 2005 03:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mathiasb.diku.dk

The first line is a simple printf in a c program - that is, stdout. The same
as the other ones. That's why it's so strange...

Eclipse is version 3.0.1 buildid 200409161125 as far as i can tell.

I'll try out this ProcessConsole, but looking at it it's not clear to me how
to get started using it. Could you give me a quick example? I already have
the IProcess required to instantiate the ProcessConsole. What do i do now
the i have created the ProcessConsole? I have something like this:

String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"};
Process process = DebugPlugin.exec(commandLine, null, environment);
IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
ProcessConsole pr = new ProcessConsole(p);
//launch.addProcess(p);


Now what?

--
Regards
Mathias Bertelsen

Kevin Barnes wrote:
>
> What stream do you write the first line to? The ProcessConsole listens
> the standard streams. Nothing written to those streams should be lost.
> If you want to spend time debugging this yourself I'd recommend
> ProcessConsole (in org.eclipse.debug.ui plugin) as a good place to start.
> It would also be a good idea to file a bug report against Platform-Debug
> (and attach a test case if that's possible).
> What build are you using?
>
> Mathias Bertelsen wrote:
>> Hello
>>
>> I have a problem.
>>
>> I have a commandline interpreter that i call from inside Eclipse with a
>> launchconfiguation. When the interpreter is called normally on a
>> commandline, the output is something like this:
>>
>> listening on port 16104 3ee8, epoch 42112 a480
>> ...any error messages and the like...
>> ...input/output from interpreted program...
>>
>> But when i call it from inside eclipse, and the output comes up in the
>> console view, the first line is missing and it looks like this:
>>
>> ...any error messages and the like...
>> ...input/output from interpreted program...
>>
>> Everything else is working fine. Just that one line missing?!?
>> Btw. when i run it in Eclipse i do it like this:
>>
>> String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"
>> }; Process process = DebugPlugin.exec(commandLine, null, environment);
>> IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
>> launch.addProcess(p);
>>
>> Hope anybody has any ideas...
>>
>> Thanks in advance!
>>
>> --
>> Regards
>> Mathias Bertelsen
Re: Lines disappearing from console view [message #281948 is a reply to message #281941] Tue, 01 March 2005 07:58 Go to previous messageGo to next message
Eclipse UserFriend
I am not working with PlugIns, but just reading your mails (you said only
the first line isn't seen, eclipse people answered everything to stdout is
shown), please take in account of this possibility (processes
synchronization):
Maybe your Process print to stdout before eclipse start to listen to
stdout !?

Try to make some syncs between them, but you can see if that is the
problem just waiting a while in your Process before to print first line...

Regards,
Tiberiu

Mathias Bertelsen wrote:

> The first line is a simple printf in a c program - that is, stdout. The same
> as the other ones. That's why it's so strange...

> Eclipse is version 3.0.1 buildid 200409161125 as far as i can tell.

> I'll try out this ProcessConsole, but looking at it it's not clear to me how
> to get started using it. Could you give me a quick example? I already have
> the IProcess required to instantiate the ProcessConsole. What do i do now
> the i have created the ProcessConsole? I have something like this:

> String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"};
> Process process = DebugPlugin.exec(commandLine, null, environment);
> IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
> ProcessConsole pr = new ProcessConsole(p);
> //launch.addProcess(p);


> Now what?

> --
> Regards
> Mathias Bertelsen

> Kevin Barnes wrote:
>>
>> What stream do you write the first line to? The ProcessConsole listens
>> the standard streams. Nothing written to those streams should be lost.
>> If you want to spend time debugging this yourself I'd recommend
>> ProcessConsole (in org.eclipse.debug.ui plugin) as a good place to start.
>> It would also be a good idea to file a bug report against Platform-Debug
>> (and attach a test case if that's possible).
>> What build are you using?
>>
>> Mathias Bertelsen wrote:
>>> Hello
>>>
>>> I have a problem.
>>>
>>> I have a commandline interpreter that i call from inside Eclipse with a
>>> launchconfiguation. When the interpreter is called normally on a
>>> commandline, the output is something like this:
>>>
>>> listening on port 16104 3ee8, epoch 42112 a480
>>> ...any error messages and the like...
>>> ...input/output from interpreted program...
>>>
>>> But when i call it from inside eclipse, and the output comes up in the
>>> console view, the first line is missing and it looks like this:
>>>
>>> ...any error messages and the like...
>>> ...input/output from interpreted program...
>>>
>>> Everything else is working fine. Just that one line missing?!?
>>> Btw. when i run it in Eclipse i do it like this:
>>>
>>> String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"
>>> }; Process process = DebugPlugin.exec(commandLine, null, environment);
>>> IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
>>> launch.addProcess(p);
>>>
>>> Hope anybody has any ideas...
>>>
>>> Thanks in advance!
>>>
>>> --
>>> Regards
>>> Mathias Bertelsen
Re: Lines disappearing from console view [message #281970 is a reply to message #281941] Tue, 01 March 2005 16:39 Go to previous messageGo to next message
Eclipse UserFriend
Unless the CDT people have their own console, you are already using
ProcessConsole when you launch your application. The launching framework
will create it for you.
You may want to post to a CDT newsgroup as well. I'm only familiar with
the console framework as provided by the platform. CDT may be doing
something with the framework that I'm not aware of.


Mathias Bertelsen wrote:
> The first line is a simple printf in a c program - that is, stdout. The same
> as the other ones. That's why it's so strange...
>
> Eclipse is version 3.0.1 buildid 200409161125 as far as i can tell.
>
> I'll try out this ProcessConsole, but looking at it it's not clear to me how
> to get started using it. Could you give me a quick example? I already have
> the IProcess required to instantiate the ProcessConsole. What do i do now
> the i have created the ProcessConsole? I have something like this:
>
> String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"};
> Process process = DebugPlugin.exec(commandLine, null, environment);
> IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
> ProcessConsole pr = new ProcessConsole(p);
> //launch.addProcess(p);
>
>
> Now what?
>
> --
> Regards
> Mathias Bertelsen
>
> Kevin Barnes wrote:
>
>>What stream do you write the first line to? The ProcessConsole listens
>>the standard streams. Nothing written to those streams should be lost.
>>If you want to spend time debugging this yourself I'd recommend
>>ProcessConsole (in org.eclipse.debug.ui plugin) as a good place to start.
>>It would also be a good idea to file a bug report against Platform-Debug
>>(and attach a test case if that's possible).
>>What build are you using?
>>
>>Mathias Bertelsen wrote:
>>
>>>Hello
>>>
>>>I have a problem.
>>>
>>>I have a commandline interpreter that i call from inside Eclipse with a
>>>launchconfiguation. When the interpreter is called normally on a
>>>commandline, the output is something like this:
>>>
>>>listening on port 16104 3ee8, epoch 42112 a480
>>>...any error messages and the like...
>>>...input/output from interpreted program...
>>>
>>>But when i call it from inside eclipse, and the output comes up in the
>>>console view, the first line is missing and it looks like this:
>>>
>>>...any error messages and the like...
>>>...input/output from interpreted program...
>>>
>>>Everything else is working fine. Just that one line missing?!?
>>>Btw. when i run it in Eclipse i do it like this:
>>>
>>>String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"
>>>}; Process process = DebugPlugin.exec(commandLine, null, environment);
>>>IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
>>>launch.addProcess(p);
>>>
>>>Hope anybody has any ideas...
>>>
>>>Thanks in advance!
>>>
>>>--
>>>Regards
>>> Mathias Bertelsen
>
>
Re: Lines disappearing from console view [message #282029 is a reply to message #281970] Thu, 03 March 2005 04:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mathiasb.diku.dk

Kevin Barnes wrote:

>
> Unless the CDT people have their own console, you are already using
> ProcessConsole when you launch your application. The launching framework
> will create it for you.

Ok. I am using the ProcessConsole then, as i am not using CDT. I am building
a plugin that is supporting a programming language called emerald. As a
part of that plugin i have a launch configuration that can launch the
emerald interpreter in the ProcessConsole. The interpreter is written in C,
thats why i mentioned that the line getting lost is a printf in a C
program. So i am not using CDT for this.

Now, is it possible, somewhat like Tiberiu mentioned, that the line is being
printed after i run DebugPlugin.exec() but before i attach it to the
ProcessConsole by calling launch.addProcess? (look at the following lines
of code, for a clearer description)

String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"};
Process process = DebugPlugin.exec(commandLine, null, environment);
--> Maybe the lines get printed somewhere here where the command is executed
--> but not yet attached to the ProcessConsole?
IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
launch.addProcess(p);

--
Regards
Mathias Bertelsen

> You may want to post to a CDT newsgroup as well. I'm only familiar with
> the console framework as provided by the platform. CDT may be doing
> something with the framework that I'm not aware of.
>
>
> Mathias Bertelsen wrote:
>> The first line is a simple printf in a c program - that is, stdout. The
>> same as the other ones. That's why it's so strange...
>>
>> Eclipse is version 3.0.1 buildid 200409161125 as far as i can tell.
>>
>> I'll try out this ProcessConsole, but looking at it it's not clear to me
>> how to get started using it. Could you give me a quick example? I already
>> have the IProcess required to instantiate the ProcessConsole. What do i
>> do now the i have created the ProcessConsole? I have something like this:
>>
>> String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"};
>> Process process = DebugPlugin.exec(commandLine, null, environment);
>> IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
>> ProcessConsole pr = new ProcessConsole(p);
>> //launch.addProcess(p);
>>
>>
>> Now what?
>>
>> --
>> Regards
>> Mathias Bertelsen
>>
>> Kevin Barnes wrote:
>>
>>>What stream do you write the first line to? The ProcessConsole listens
>>>the standard streams. Nothing written to those streams should be lost.
>>>If you want to spend time debugging this yourself I'd recommend
>>>ProcessConsole (in org.eclipse.debug.ui plugin) as a good place to start.
>>>It would also be a good idea to file a bug report against Platform-Debug
>>>(and attach a test case if that's possible).
>>>What build are you using?
>>>
>>>Mathias Bertelsen wrote:
>>>
>>>>Hello
>>>>
>>>>I have a problem.
>>>>
>>>>I have a commandline interpreter that i call from inside Eclipse with a
>>>>launchconfiguation. When the interpreter is called normally on a
>>>>commandline, the output is something like this:
>>>>
>>>>listening on port 16104 3ee8, epoch 42112 a480
>>>>...any error messages and the like...
>>>>...input/output from interpreted program...
>>>>
>>>>But when i call it from inside eclipse, and the output comes up in the
>>>>console view, the first line is missing and it looks like this:
>>>>
>>>>...any error messages and the like...
>>>>...input/output from interpreted program...
>>>>
>>>>Everything else is working fine. Just that one line missing?!?
>>>>Btw. when i run it in Eclipse i do it like this:
>>>>
>>>>String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"
>>>>}; Process process = DebugPlugin.exec(commandLine, null, environment);
>>>>IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
>>>>launch.addProcess(p);
>>>>
>>>>Hope anybody has any ideas...
>>>>
>>>>Thanks in advance!
>>>>
>>>>--
>>>>Regards
>>>> Mathias Bertelsen
>>
>>
Re: Lines disappearing from console view [message #282508 is a reply to message #282029] Tue, 15 March 2005 07:27 Go to previous message
Eclipse UserFriend
Originally posted by: mathiasb.diku.dk

Ok, adding to the weirdness... inside the program the printline normally
looks like this:

fprintf(stdout,"Emerald listening on port %d %x, epoch %d %x\n", myid.port,
myid.port, myid.epoch, myid.epoch);

but as i have told earlier this line is not shown in the ProcessConsole.
Now, if i change this line to

fprintf(stderr,"Emerald listening on port %d %x, epoch %d %x\n", myid.port,
myid.port, myid.epoch, myid.epoch);

instead and print on standard error i have this result when i run the
program normally on the commandline (it runs a program that prints out the
numbers 1-10):

Emerald listening on port 16104 3ee8, epoch 24874 612a
1 2 3 4 5 6 7 8 9 10

If i run this in eclipse, as described below, i get this instead:

1 2 3 4 5 6 7 8 9 10
Emerald listening on port 16104 3ee8, epoch 45900 b34c

where the "Emerald lis.." line is red because it's on stderr.

Why is the output switched around??

--
Regards
Mathias Bertelsen


Mathias Bertelsen wrote:

> Kevin Barnes wrote:
>
>>
>> Unless the CDT people have their own console, you are already using
>> ProcessConsole when you launch your application. The launching framework
>> will create it for you.
>
> Ok. I am using the ProcessConsole then, as i am not using CDT. I am
> building a plugin that is supporting a programming language called
> emerald. As a part of that plugin i have a launch configuration that can
> launch the emerald interpreter in the ProcessConsole. The interpreter is
> written in C, thats why i mentioned that the line getting lost is a printf
> in a C program. So i am not using CDT for this.
>
> Now, is it possible, somewhat like Tiberiu mentioned, that the line is
> being printed after i run DebugPlugin.exec() but before i attach it to the
> ProcessConsole by calling launch.addProcess? (look at the following lines
> of code, for a clearer description)
>
> String[] commandLine = new String[] { "path/to/program", "arg1", "arg2"};
> Process process = DebugPlugin.exec(commandLine, null, environment);
> --> Maybe the lines get printed somewhere here where the command is
> executed --> but not yet attached to the ProcessConsole?
> IProcess p = DebugPlugin.newProcess(launch, process, "name of launch");
> launch.addProcess(p);
>
> --
> Regards
> Mathias Bertelsen
>
Previous Topic:CVS interface question
Next Topic:SWT action event
Goto Forum:
  


Current Time: Wed Sep 17 15:23:58 EDT 2025

Powered by FUDForum. Page generated in 0.03835 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top