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

Bug 313010

Summary: Only breakpoints set during a debug session do actually break
Product: [WebTools] JSDT Reporter: Michael Schneider <michschn>
Component: DebugAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact: Simon Kaegi <simon_kaegi>
Severity: normal    
Priority: P3 CC: david_williams, Michael_Rennie, thatnitind
Version: 3.2Flags: david_williams: pmc_approved+
Michael_Rennie: review+
thatnitind: review+
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard: PMC_approved
Attachments:
Description Flags
proposed patch none

Description Michael Schneider CLA 2010-05-15 07:32:20 EDT
a video tells more than a thousand words :)
http://www.poshnet.ch/jing/2010-05-15_1325.swf

The breakpoints are only active when I set them during a debug session. However, as shown in the video, I'm positive that the filename I provide to rhino when compiling scripts can actually be mapped back to a workspace file. I use filenames like:
{"Bundle-SymbolicName":"com.ibm.team.apt.web.ui.tests", "path":"\\resources\\gridviewer", "name":"GridViewerUpdateTest.js"}
The line number I specify is 1.

This happens on the latest version from CVS
Comment 1 Simon Kaegi CLA 2010-05-17 11:28:36 EDT
I was able to reproduce this fairly easily as part of today's test pass. We need to investigate a fix this for RC2.
Comment 2 Simon Kaegi CLA 2010-05-19 14:38:06 EDT
Created attachment 169179 [details]
proposed patch
Comment 3 Michael Rennie CLA 2010-05-19 16:16:10 EDT
+1 perfect.
Comment 4 Simon Kaegi CLA 2010-05-19 17:21:17 EDT
As it stands the mapping between workspace resources and script uris is broken and this prevent breakpoints from working in mainline cases. As a result any breakpoints set in the workspace before a script is loaded by the vm being debugger are being ignored.

The breakage occured because the code path where we were requesting the breakpoint set were different based on whether the script was already loaded before the breakpoint was set or vice-versa.

This patch corrects workspace relative path usage so that all script paths are valid URIs that either map perfectly to a workspace resource or else are treated as external source. The same codepath is now used for both breakpoints set before and after the debugger loads a script.
Comment 5 David Williams CLA 2010-05-19 20:20:55 EDT
pretty large change, but I agree, mainline case that deserves to work right. 

Thanks.
Comment 6 Simon Kaegi CLA 2010-05-19 21:56:21 EDT
Fixed in HEAD

Thanks all.
Comment 7 Simon Kaegi CLA 2010-05-19 21:56:42 EDT
.
Comment 8 Michael Schneider CLA 2010-05-20 11:37:55 EDT
this seems to work now, however the JavaScript load breakpoints are acting weired now. I do not know if this is an issue with my setup or not. Do script load breakpoints still work for you?
Comment 9 Simon Kaegi CLA 2010-05-20 13:33:06 EDT
(In reply to comment #8)
> Do script load breakpoints still work for you?

Thanks and sorry I missed this in my tests. Absolute URIs do work, but the more typical workspace one's do not as I missed this one. I've opened bug 313782 for RC3 and attached a patch and this now works for me.