Bug 23292 - Must restart Eclipse after debug of source in .zip is updated
Summary: Must restart Eclipse after debug of source in .zip is updated
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0.1   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-07 00:58 EDT by Rob Tulloh CLA
Modified: 2002-09-19 09:30 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Tulloh CLA 2002-09-07 00:58:05 EDT
It seems that Eclipse caches the contents of source files that
are used during debug  sessions. I have an environment set up as follows:

Project A - Simple Project usings an external ANT builder
Project B - Java Project containing JUnit tests

I create a test case in B and then use the Debug perspective to find
out why a test may be failing. I then switch to the Resource Perspective
where I edit/compile/build my project. This creates some JAR files
and a source.zip file so that Eclipse can attach source for JAR files
I created (BTW, why does Eclipse insist on a JAR or ZIP file for attaching
source? Why can't a filesystem or workspace path be used as well?).

Once I go back to Debug Perspective to verify my changes, I get an old
copy of the source files I have just edited that don't align with the
debugged JAR files. I have to close all perspectives and restart Eclipse
to get back to a state where I can debug. Note that just closing the 
perspective or all perspectives does not help. Upon reopen, they still have
knowledge of the outdated source files.

This is a painful problem because stopping/restarting Eclipse is
not enjoyable. Also, closing all the perspectives and having to recustomize
them on restart is painful. I guess I could avoid this by saving my
customizations to a new custom perspective, but I am lazy :-)

Thanks for listening,

Rob
Comment 1 Darin Wright CLA 2002-09-10 09:07:29 EDT
Source attachments are maintained by the "java model" (JDT CORE). It sounds 
like your compile/build/debug process includes the creation of a new jar, with 
a new source attachment. How is this jar used/referenced at runtime? A 
reproduceable test case would help explain this problem. 
Comment 2 Rob Tulloh CLA 2002-09-10 10:05:33 EDT
Project J (the Java project) depends on jar files and sources
from Project S (the Simple Project). Project S is maintained
by an Ant build configuration that generates a jar file (wbem.jar)
and a source file (wbemsrc.jar). The latter jar file is created
purely to satisfy Eclipse's desire for a jar or zip file for source
attachment. Project J contains JUnit test cases for Project S. 
I often debug problems within the Debug perspective when Project
J turns up a test case failure. The problem occurs when I fix a problem
in Project S and re-run the build. This causes the wbem.jar and
wbemsrc.jar files to be updated. When I go back to the Debug Perspective,
it somehow retains a pointer to the previous source files and the debug
sessions are mismatched with the source. The only solution is to close
all perspectives and restart Eclipse. Eclipse will then re-read the
environment and start with fresh pointers to the wbem.jar and wbemsrc.jar
files.

If you wanted to create a test for this problem, try importing the
wbemservices SDK as a simple project in Eclipse. Use it's already
provided ant_build.bat file to build the project. Create a separate
project in the Java perspective that uses the wbem.jar and parser.jar
file from the wbemservices build. Debug a test case against some API
in the wbemservices jar file. Make any change you like to the wbemservices
sources and rebuild them. When you debug again, you will find the mismatched
sources problem and I see no way to convince Eclipse to discard the pointer
to the old file and read it fresh from the wbemsrc.jar.

Hope this helps. Thanks for listening,

Rob
Comment 3 Darin Wright CLA 2002-09-10 10:11:24 EDT
Moving to JCORE. Sounds like the problem is that when the jar is updated, the 
source attachment is not updated.
Comment 4 Jerome Lanneluc CLA 2002-09-12 05:34:21 EDT
DeltaProcessor was not handling changes in source attachment.
Fixed.

Rob, note that you have to refresh the simple project S as you modify the 
wbemsrc.jar file using an external tool and Eclipse is not capable of 
discovering the change without a refresh.
Comment 5 Rob Tulloh CLA 2002-09-12 11:15:21 EDT
I think I have tried refreshing and don't remember that helping. I will try 
this again today to be sure though. Thanks for the idea.

ROb
Comment 6 Rob Tulloh CLA 2002-09-13 19:12:47 EDT
Refresh all projects. Re-entered Debug. Old sources still!
Comment 7 Jerome Lanneluc CLA 2002-09-17 09:36:25 EDT
Rob, unless you're running a nightly build, I don't think you have the fix yet. 
It was released on 09/12 and should be included in today's integration build 
(09/17).
Comment 8 Philipe Mulet CLA 2002-09-17 11:51:50 EDT
Marked as fixed. Please reopen if symptoms persist beyond today's integration 
build.
Comment 9 David Audel CLA 2002-09-19 09:30:32 EDT
Verified.