Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 27263 - Unable to find source in workspace
Summary: Unable to find source in workspace
Status: RESOLVED DUPLICATE of bug 24793
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P2 critical (vote)
Target Milestone: ---   Edit
Assignee: Joe Szurszewski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-27 13:26 EST by Veronika Irvine CLA
Modified: 2003-01-23 13:02 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Veronika Irvine CLA 2002-11-27 13:26:23 EST
Eclipse 200211261143

I am debugging Eclipse walking through some code that I have in my workspace.  
I come to a method that is not in my workspace.  I step into it.  I get a 
dialog saying it can find the source and I click on cancel.  I step out of this 
method back into code that is in my workspace.  However, suddenly the debugger 
can't find the source anymore.  Even though it was just recently in that code.
Comment 1 Andre Weinand CLA 2002-11-27 13:55:48 EST
Does this happen on MacOS X? (Platform says PC, OS is MacOS X)
Comment 2 Veronika Irvine CLA 2002-11-27 13:58:03 EST
Currently I am developing on the Mac - I have changed the Platform field 
accordingly.  This may happen on other platforms, I have not had time to check.
Comment 3 Darin Wright CLA 2002-11-28 10:11:49 EST
Clarification: Do you mean that changing the "Platform" field has fixed the 
problem?

I tried a scienario, debugging VectorTest (JUnit), on Windows with the IBM1.3.1 
JRE. I stopped at a breakpoint in a tests case, and then selected the following 
stack frame (for which there is no source):

java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) line: not 
available [native method]

I was prompted to find source, but I simply pressed, OK. Then I selected a 
frame that had source, and source was found as expected.
Comment 4 Veronika Irvine CLA 2002-12-02 17:58:53 EST
By "platform" I am referring to the Platform field in Bugzilla.  Yes it is 
still a problem.  I have tried a similar thing on Windows and the problem did 
not occur. I did not press OK but rather Cancel because none of the source 
locations was suitable.  The key is that there was no source for the code I 
stepped into (even after the dialog came up because I hit cancel) but when I 
stepped back out into code that did have source, the source could no longer be 
found.
Comment 5 Darin Wright CLA 2003-01-20 10:25:07 EST
Joe, please try to reproduce on the Mac.
Comment 6 Joe Szurszewski CLA 2003-01-20 15:36:43 EST
Test case:

OSX 10.2
Eclipse 20030115

Create HelloWorld program.
Create launch config for HelloWorld and remove JRE from source lookup
Set breakpoint on printline.
Debug.
At breakpoint, step into println.
The attach source dialog appears.  Hit Cancel.
Dialog disappears, and source window for PrintStream appears with message that 
source cannot be found.
Hit F7 to step out of println method, or hit F6 multiple times.
Excecution returns to HelloWorld at next line, and all appears well.

Veronika, when you say you step into a method not in your workspace, do you mean a 
method in an external jar, or something else?
Comment 7 Veronika Irvine CLA 2003-01-21 08:32:52 EST
In my workspace, I only have the org.eclipse.swt and org.eclipse.swt.carbon 
plugins.  Since the SWT plugins do not rely on any other plugins, I have no 
other plugins loaded and the classpath does not reference any external jars.  
When I launch eclipse for debugging, I go to the Debug... dialog.  In the 
plugins and fragments tab I select "Choose plugins and fragments to launch from 
list" and I select the swt plugins from the Workspace plugins and all the rest 
of the plugins from the External plugins.  Thus I do not have any source for 
the other plugins in my workspace.

While debugging, I may step into something like an event handler which is not 
implemented in SWT code but rather in something like the UI workbench code.  
That is when I get the problem.  The workbench code can not be found and when I 
step out of the workbench code back into SWT code, the SWT "source" can not be 
found either (even though I was just there a few steps ago).

I have also had this happen occasionally on Windows.
Comment 8 Joe Szurszewski CLA 2003-01-22 12:39:02 EST
Veronika, I understand your setup now, but can you suggest someplace in SWT to 
set a breakpoint so I can step out of SWT and back in?  Thanks.
Comment 9 Veronika Irvine CLA 2003-01-22 12:53:43 EST
EventTable.sendEvent (around line 77) is a good place.
Comment 10 Joe Szurszewski CLA 2003-01-22 16:01:08 EST
What VM are you using to reproduce this behaviour?  I haven't been able to reproduce it 
using JDK 1.3.1.

Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-root_1.3.1_020714-
12:46)
Java HotSpot(TM) Client VM (build 1.3.1_03-69, mixed mode)
Comment 11 Joe Szurszewski CLA 2003-01-22 16:14:03 EST
OK, I can reliably reproduce this now using the 1.3.1 VM, but the way I reproduce it is to 
hit "OK" in the first source attach dialog instead of 'Cancel'.  Hitting Cancel nevers seems 
to cause the problem.  Hitting OK would seem to be semantically equivalent to hitting 
Cancel because nothing is selected in the source attach dialog.
Comment 12 Jed Anderson CLA 2003-01-22 16:19:28 EST
I tried this with jdk1.4.1 and Eclipse build 20030121 on windows 2k.  I see the 
same results if I use Joe's O.K. button trick.

Suggest marking as OS-ALL.
Comment 13 Jed Anderson CLA 2003-01-22 16:22:37 EST
Tried turning off the "re-use editors" preference.  This had no effect on the 
source lookup.
Comment 14 Joe Szurszewski CLA 2003-01-22 17:23:35 EST
It appears that source attachment in general is broken.  Jed & I have determined that the 
culprit is a change made for bug 23408.  Specifically, the call to 
JavaUISourceLocator.this.initializeDefaults(configuration); in the method 
JavaUISourceLocator.showDebugSourcePage().  This call appears to reset the source 
lookup path to be JRE-related entries, WITHOUT the project(s).  Thus, source lookup fails 
any time the user clicks OK in the attach source dialog.  Darin, can you confirm this 
analysis?  If this is correct, what is the best course of action?
Comment 15 Darin Wright CLA 2003-01-22 21:09:13 EST
I know there is a problem when OK is pressed - that is a known PDE bug. PDE is 
using our source lookup dialog, which re-sets their source lookup path to only 
contain JRE entries (since they are not using the standard java source lookup 
attributes on their launch config) - see bug 24793. This also sets the source 
lookup path for the rest of the debug session.

However, Veronika's report says she pressed the CANCEL button. I have been able 
to reproduce that problem. We need a final verification...

Veronika - if you start a new debug session, hit a breakpoint, step into code 
that you do not have, and press CANCEL when the dialog appears, do you still 
exhibit the "source not found" problem when you step back into SWT source?
Comment 16 Joe Szurszewski CLA 2003-01-23 11:07:42 EST
Just to be clear, neither Jed nor I could reproduce the problem hitting CANCEL, 
despite numerous attempts.
Comment 17 Veronika Irvine CLA 2003-01-23 11:15:46 EST
I will try CANCEL versus OK as soon as I get a chance.
Comment 18 Darin Wright CLA 2003-01-23 11:52:38 EST
Veronika, can we mark this as a duplicate of bug 24793 ?
Comment 19 Veronika Irvine CLA 2003-01-23 12:06:05 EST
Yes - I think this is a duplicate of 24793.  I tried OK versus Cancel and I get 
the same result as you do.
Comment 20 Darin Wright CLA 2003-01-23 13:02:43 EST

*** This bug has been marked as a duplicate of 24793 ***