Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 100206

Summary: unable to lookup java files while debugging
Product: [Eclipse Project] JDT Reporter: John Richardson <john.t.richardson>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description John Richardson CLA 2005-06-15 11:10:41 EDT
When stopping at a breakpoint, the java file cannot be found.  The editor tab
shows ClassName.methodName(Arg1 arg1) as the filename.  This only occurs with
RC2, RC1 using the same project works in this regard.

Error

internal error logged from JDI debug

com.sun.jdi.VMDisconnectedException: Got IOException from Virtual Machine
at
org.eclipse.jdi.internal.connect.PacketSendManager.sendPacket(PacketSendManager.java:78)
at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:170)
at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:192)
at
org.eclipse.jdi.internal.request.EventRequestImpl.disable(EventRequestImpl.java:193)
at
org.eclipse.jdi.internal.request.EventRequestManagerImpl.deleteEventRequest(EventRequestManagerImpl.java:324)
at
org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.removeRequests(JavaBreakpoint.java:648)
at
org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.removeFromTarget(JavaBreakpoint.java:601)
at
org.eclipse.jdt.internal.debug.core.breakpoints.JavaLineBreakpoint.removeFromTarget(JavaLineBreakpoint.java:177)
at
org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.removeAllBreakpoints(JDIDebugTarget.java:1353)
at
org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.cleanup(JDIDebugTarget.java:1311)
at
org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.shutdown(JDIDebugTarget.java:1444)
at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin.stop(JDIDebugPlugin.java:200)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$3.run(BundleContextImpl.java:1035)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:1031)
at
org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:402)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:410)
at
org.eclipse.core.runtime.internal.adaptor.BundleStopper.basicStopBundles(BundleStopper.java:83)
at
org.eclipse.core.runtime.internal.adaptor.BundleStopper.stopBundles(BundleStopper.java:73)
at
org.eclipse.core.runtime.adaptor.EclipseAdaptor.frameworkStopping(EclipseAdaptor.java:709)
at org.eclipse.osgi.framework.internal.core.Framework.shutdown(Framework.java:528)
at
org.eclipse.osgi.framework.internal.core.SystemBundle$1.run(SystemBundle.java:171)
at java.lang.Thread.run(Thread.java:595)


eclipse.buildId=I20050610-1757
java.version=1.5.0_01
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86
This is a continuation of log file
/scratch/eclipse3.1-workspace-as2/.metadata/.bak_0.log
Created Time: 2005-06-13 08:40:07.618
Comment 1 Darin Wright CLA 2005-06-15 12:37:09 EDT
The log entry does not reflect a source lookup problem. Please provide steps 
to reproduce.

When you launch Eclispe, do you use command line options to specify the 
workspace location? If so, is the location relative or absolute?
Comment 2 John Richardson CLA 2005-06-15 20:56:47 EDT
(In reply to comment #1)
> The log entry does not reflect a source lookup problem. Please provide steps 
> to reproduce.

I tried reproducing the problem with a small application also without success.  

This is a very large application.  There are tens of external jars, hundreds of
source files, and the debug connection is remote.  I can see the files in the
editor when opened via the package explorer and via the Open Type dialog
(ctrl+shift+t).  The sources are in a directory which is linked to on the file
system.



When the debugger hits a breakpoint, it opens a new editor window which has a
title "Filename.methodname() line:88".  There is red text in the editor window -
"Source not found."  If I click on the button in the editor window to change the
source lookup, I can get it so the file is displayed when I double click on the
stack in the "Debug" window.  But I don't get the green bar showing the current
debugger position.

Comment 3 John Richardson CLA 2005-06-15 23:22:41 EDT
To answer your questions... 

The workspace location isn't specified on the command line, it's done in the dialog on startup.  It is a full 
path.
Comment 4 Darin Wright CLA 2005-06-16 08:34:17 EDT
What sort of launch configuration are you using to debug your application (for 
example, "Remote Java Application", "Java Application")? If the launch config 
has a "Source Lookup" tab, how is it configured? Is a project specified on the 
launch config (from which the default source lookup path is computed)?

If you can get the session to show source without the green bar, it means the 
editor being opened by the debugger is on a file external to the workspace 
(does it have a vertical ruler for breakpoints?). 
Comment 5 John Richardson CLA 2005-06-16 10:59:08 EDT
(In reply to comment #4)
> What sort of launch configuration are you using to debug your application (for 
> example, "Remote Java Application", "Java Application")? 

Remote Java Application, socket connection.  (with my small testcase, I tried a
Remote Java Application as well as a plain Java Application, but neither
reproduced the behavior)

> If the launch config 
> has a "Source Lookup" tab, how is it configured? 

There is a "Source Lookup" tab.  It has two paths, one which I configured with
the "Edit Source Lookup Path..." button in the editor and the other which is
called "Default".  "Default" contains a directory with my project and that
directory has the sources.

If I remove the first path (the path added from the "Edit Source Lookup Path"
button) then double clicking on the stack doesn't take me to the editor anymore.

> Is a project specified on the 
> launch config (from which the default source lookup path is computed)?

I'm not sure where to find the launch config...

> 
> If you can get the session to show source without the green bar, it means the 
> editor being opened by the debugger is on a file external to the workspace 
> (does it have a vertical ruler for breakpoints?). 

That makes sense.  And no, the editor which the debugger brings up does not have
the vertical ruler for breakpoints.

It does seem weird that this exact project worked in 3.1RC1.

Comment 6 Darin Wright CLA 2005-06-20 12:11:38 EDT
Is your project in a symbolic link location? Could this be the same problem as 
bug 100807? 
Comment 7 John Richardson CLA 2005-06-29 16:35:21 EDT
I just got the 3.1 release and it does work for me.
Comment 8 Darin Wright CLA 2005-06-29 17:13:58 EDT
Closing.