Bug 308043 - Console: from console output to sysout invocation
Summary: Console: from console output to sysout invocation
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 66585 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-04 08:23 EDT by Thorbjørn Ravn Andersen CLA
Modified: 2012-10-19 04:45 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thorbjørn Ravn Andersen CLA 2010-04-04 08:23:28 EDT
Build Identifier: all

It is very frequent that I see a line of output in the Console view and would like to go to the source line that _produced_ that line of output.  Eclipse currently cannot do that, and I am aware that the Console view currently probably just hooks System.out, System.err and System.in on the child process running the program.  This would, however, be a real killer feature!

I was thinking in lines of every character sent to Console would have an exception silently saved behind the scenes, and when right-clicking a menu item could present that stack trace in the Stack Trace View allowing for full navigation!

Every single character is probably overkill, but newlines would  most likely be a very useful tradeoff.

I am aware that the separate processes probably cannot enable this, but if it could be done with dtrace behind the scenes it is most likely at least possible on OS X and Solaris. 


Reproducible: Always

Steps to Reproduce:
1. generate output to console
2. right-click any line
3. stack-trace for println does not appear :(
Comment 1 Darin Wright CLA 2010-04-05 17:20:22 EDT
This is a duplicate of bug 66585, which is marked as WONTFIX (was LATER for a long, long time).
Comment 2 Deepak Azad CLA 2012-10-19 03:37:13 EDT
I saw this neat trick today to accomplish this - http://jeeeyul.wordpress.com/2012/10/18/make-system-out-println-rocks/

I created a plugin and used IStartup to 'Activate' the 'DebugStream' on every Eclipse Launch. While I have the functionality working, I wonder if this could be supported in JDT itself. It does not look too hard, or does it?
Comment 3 Dani Megert CLA 2012-10-19 04:32:20 EDT
(In reply to comment #2)
> I saw this neat trick today to accomplish this -
> http://jeeeyul.wordpress.com/2012/10/18/make-system-out-println-rocks/
> 
> I created a plugin and used IStartup to 'Activate' the 'DebugStream' on
> every Eclipse Launch.

Do you mean when I start my IDE or when I launch from Eclipse? I would only want to support the latter and of course it has to work for simple Java Application and applet launches as well.
Comment 4 Dani Megert CLA 2012-10-19 04:33:29 EDT
*** Bug 66585 has been marked as a duplicate of this bug. ***
Comment 5 Deepak Azad CLA 2012-10-19 04:37:16 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > I saw this neat trick today to accomplish this -
> > http://jeeeyul.wordpress.com/2012/10/18/make-system-out-println-rocks/
> > 
> > I created a plugin and used IStartup to 'Activate' the 'DebugStream' on
> > every Eclipse Launch.
> 
> Do you mean when I start my IDE or when I launch from Eclipse? I would only
> want to support the latter and of course it has to work for simple Java
> Application and applet launches as well.

Yes, launch from Eclipse. Sorry about the confusion.

I just needed a plugin based solution now, hence I created a plugin. But the underlying solution as specified on the blog post would work in any situation.
Comment 6 Dani Megert CLA 2012-10-19 04:45:21 EDT
(In reply to comment #5)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > I saw this neat trick today to accomplish this -
> > > http://jeeeyul.wordpress.com/2012/10/18/make-system-out-println-rocks/
> > > 
> > > I created a plugin and used IStartup to 'Activate' the 'DebugStream' on
> > > every Eclipse Launch.
> > 
> > Do you mean when I start my IDE or when I launch from Eclipse? I would only
> > want to support the latter and of course it has to work for simple Java
> > Application and applet launches as well.
> 
> Yes, launch from Eclipse. Sorry about the confusion.
> 
> I just needed a plugin based solution now, hence I created a plugin. But the
> underlying solution as specified on the blog post would work in any
> situation.

Good. Waiting for a patch... :-)