Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313782 - Resource based ScriptLoad Breakpoints do not work
Summary: Resource based ScriptLoad Breakpoints do not work
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC3   Edit
Assignee: Simon Kaegi CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 13:23 EDT by Simon Kaegi CLA
Modified: 2010-05-27 17:36 EDT (History)
3 users (show)

See Also:
david_williams: pmc_approved+
thatnitind: pmc_approved? (raghunathan.srinivasan)
thatnitind: pmc_approved? (naci.dai)
thatnitind: pmc_approved? (deboer)
neil.hauge: pmc_approved+
thatnitind: pmc_approved? (kaloyan)
thatnitind: review+


Attachments
proposed patch (1.13 KB, patch)
2010-05-20 13:28 EDT, Simon Kaegi CLA
no flags Details | Diff
proposed patch (6.78 KB, patch)
2010-05-24 14:38 EDT, Simon Kaegi CLA
no flags Details | Diff
proposed patch (6.83 KB, patch)
2010-05-24 15:22 EDT, Simon Kaegi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Kaegi CLA 2010-05-20 13:23:41 EDT
The fix in bug 313010 missed one case where the script path was not being made relative. This unfortunately prevents a match when the script loads and subsequently ScriptLoad Breakpoints added in the UI do not work.
Comment 1 Simon Kaegi CLA 2010-05-20 13:28:41 EDT
Created attachment 169383 [details]
proposed patch

This patch makes the resources script path a relative uri and allows proper matching.
Comment 2 Simon Kaegi CLA 2010-05-20 14:35:23 EDT
This patch is not sufficient. I seem to be breaking globally on every script now and need to investigate further.
Comment 3 Simon Kaegi CLA 2010-05-24 14:38:18 EDT
Created attachment 169707 [details]
proposed patch

Script loads were incorrectly breaking on any scriptload breakpoint because we were not calling "JavaScriptBreakPoint.scriptPathMatches" and so by default were matching every script. 

This patch has code to do both the relativization of the script path loaded from the ui as well as ensuring we do a script path match when the global script load breakpoint is not set.
Comment 4 Simon Kaegi CLA 2010-05-24 15:22:31 EDT
Created attachment 169715 [details]
proposed patch

This patch is a slightly more conservative version of the previous patch and will only set the global scriptload breakpoint's "script path" label when checking the global scriptload breakpoint.
Comment 5 Simon Kaegi CLA 2010-05-24 15:56:40 EDT
This bug should be considered for RC3 since at the moment scriptload
breakpoints are broken and this is a fundamentalc feature of a JavaScript
debugger. 

Currently when any scriptload breakpoints are set the global script load
breakpoint will be triggered on any script load. There unfortunately is no
workaround and "functionally" this limits the usefulness of script load
breakpoints particularly for large projects that load many scripts. In addition
the UI provides the feature but it does not currently work correctly and
provides no feedback to indicate otherwise.

The patch provides two fixes:
1) It corrects the creation of an absolute URI as a script path that should be
"relative" URIs when creating scriptload breakpoints for workspace resources
2) It provides one spot where the logic to determine when a scriptload
breakpoint is the global scriptload breakpoint or if the script path of the
breakpoint matches the script being loaded.

This patch has been tested as part of a manual test suite. We are working on a
core debug test suite similar to JDT debug to do more of this testing
automatically however it is not ready.

This is a non-api change and localized to the non-global scriptload breakpoint
code path. If there is a problem it will be localized to workspace based
scriptload breakpoints which at the moment are broken.
Comment 6 Neil Hauge CLA 2010-05-24 17:00:31 EDT
Seems like a fairly serious loss of functionality.  Appears there is some risk here, but given Nitin's review and approval, I approve.
Comment 7 Simon Kaegi CLA 2010-05-24 21:10:00 EDT
Fixed in HEAD. Patch released for RC3