Bug 173962 - [launcher] Create a console friendly eclipse.exe
Summary: [launcher] Create a console friendly eclipse.exe
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
: 93165 169105 179860 (view as bug list)
Depends on:
Blocks: 146807
  Show dependency tree
 
Reported: 2007-02-12 21:57 EST by Pascal Rapicault CLA
Modified: 2007-05-02 22:55 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2007-02-12 21:57:31 EST
Investigate the creation of a console friendly eclipse.exe, which when started from within a console, would act like any other console app (redirect of in/out/err).
On platforms where the libraries are linked against windowing system, a new set of  library should be created unless we can dynamically load those.
Comment 1 Walter Harley CLA 2007-04-05 11:38:33 EDT
*** Bug 179860 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Niefer CLA 2007-04-05 12:09:43 EDT
Investigate for M7
Comment 3 Andrew Niefer CLA 2007-04-05 12:58:48 EDT
There are 2 ways to get a console friendlier eclipse.exe.
1) Compile eclipse.exe as a console application.  This is a single line in the make file, and the OS will then take care of allocating the console.  This is like the difference between java.exe and javaw.exe.  We wouldn't want to ship this as the default exe since you always get a console.

2) Comments 4 & 5 on bug 167310 indicate we should be able to attach to an existing console when desired.  This seems to be somewhat version (2000 vs XP) dependent, and results will likely depend on the VM being used.
Comment 4 Walter Harley CLA 2007-04-05 14:03:13 EDT
(In reply to comment #3)
> There are 2 ways to get a console friendlier eclipse.exe.
> 1) Compile eclipse.exe as a console application.  This is a single line in the
> make file, and the OS will then take care of allocating the console.  This is
> like the difference between java.exe and javaw.exe.  We wouldn't want to ship
> this as the default exe since you always get a console.

Would that in fact produce the right results?  I haven't followed the launcher changes so I don't know how many processes we have.  In the past capturing the output of eclipse.exe would not have been interesting, what we needed was to capture the output of the java process that it in turn launched.

My primary goal is to have simple instructions for customers in the field to follow to collect trace output.  Something along the lines of "drop this [debug options] file into the same directory as mybrandedeclipse.exe, and then run as 'mybrandedeclipse -debug debug.options > debug.out', and then send the resulting debug.out file to me."  Right now the best we can do is tell them to edit mybrandedeclipse.ini to change the 'javaw' to 'java', and then manually copy the contents of the resulting console and paste to a file; but that is an awful solution, because usually the buffer overflows so data is lost, there are lots of extra line breaks, and users don't know how to copy from a console window.
Comment 5 Andrew Niefer CLA 2007-04-05 14:28:38 EDT
Both (1) and (2) rely on the new behaviour that starts the vm in-process using the JNI invocation API so thatwe are only running 1 process.

When the vm is started in a separate process (bug 168775) then you would have the same behaviour as before
Comment 6 Andrew Niefer CLA 2007-04-13 10:29:44 EDT
*** Bug 169105 has been marked as a duplicate of this bug. ***
Comment 7 Andrew Niefer CLA 2007-04-13 12:53:26 EDT
I have released changes so that the launcher will reuse the existing console when launched from a dos box (when -console, -consoleLog or -debug is specified).
This only applies to XP and above.

However, even with this change, the redirect is not working:
eclipse -debug > out.txt

I'm not sure what the problem is, but it is basically bug 167310 again.  I can play with the output handles a bit and get the output from the launcher itself to redirect, but I haven't been able to redirect the java ouput.

Note that compiling eclipse as a console application fixes all these problems.
Comment 8 Andrew Niefer CLA 2007-04-26 09:43:46 EDT
*** Bug 93165 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Niefer CLA 2007-05-02 16:04:49 EDT
Starting in I20070430-0800, we now have an eclipsec.exe which is a console linked version of the launcher.  
Comment 10 Walter Harley CLA 2007-05-02 16:17:46 EDT
Andrew, can you summarize the instructions that we should give to users in the field in order to capture trace output, as mentioned in comment #4?  Thanks.
Comment 11 Andrew Niefer CLA 2007-05-02 16:58:41 EDT
You can droped a renamed eclipsec.exe:  MyBrandedc.exe along with a MyBrandedc.ini.  If no MyBrandedc.ini is found, the existing MyBranded.ini will be used.

In that MyBrandedc.ini you can specify whatever debug options you need, like -debug 
-consoleLog

Then they would launch with something like
MyBrandedc > debug.out 2>&1
The 2>&1 is redirecting the stderr in addition to the stdout.
Comment 12 Jeff McAffer CLA 2007-05-02 22:55:22 EDT
this should go on the wiki somewhere and in the various doc locations

Perhaps we should have an explict doc bug for this so it does not get forgotten