Breakpoint doesn't pause in file during page load
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(firefox-esr60 unaffected, firefox67 wontfix, firefox68 fixed, firefox69 fixed)
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox67 | --- | wontfix |
firefox68 | --- | fixed |
firefox69 | --- | fixed |
People
(Reporter: piotrpalek, Assigned: jlast)
References
(Blocks 1 open bug)
Details
(Keywords: regression, Whiteboard: [debugger-mvp])
Attachments
(2 files, 1 obsolete file)
(deleted),
image/png
|
Details | |
(deleted),
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Firefox/68.0
Steps to reproduce:
Set a breakpoint, reloaded my app
Actual results:
The app loaded and didn't stop at the breakpoint
Expected results:
It should pause at the breakpoint
I should note the source maps don't load for a few seconds after the app loads.
Assignee | ||
Comment 1•6 years ago
|
||
hmm, this should work because we save the breakpoint's generated (bundle) location in the server. Can you give us some more details so that we can test it?
I can confirm this, it is happening since the betas for Firefox 67 started, on version 66 everything seems fine.
For me it is happening with SAP UI5 Fiori applications I am developing. As my apps are all restricted within our company's network I can't give you those as examples to reproduce.
However I could find a demo app from SAP to demonstrate the issue.
The URL is:
https://sapui5.hana.ondemand.com/test-resources/sap/ui/demoapps/demokit/rta/fiori-elements/test/index.html#masterDetail-display
After loading open the debugger. Open the file CustomFilter.controller.js from the path test-resources/sap -> ui/demoapps/demokit/rta/fiori-elements -> ext/controller
Set a breakpoint in line 12 (return sap.ui.controller...) and reload the page. The breakpoint should trigger, but it doesn't.
If you reproduce these steps in Chromium-Browsers or in Firefox v66 the breakpoint triggers.
The file is generated from the file Component-preload.js. The generated file seems to be not available when the code line is processed.
Assignee | ||
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Thank you trefzerd, this SAP demo is great for testing – I was able to easily reproduce the issue.
Assignee | ||
Comment 4•5 years ago
|
||
Hmm, it works on line 120 for me.
Assignee | ||
Comment 5•5 years ago
|
||
Updated•5 years ago
|
Comment 6•5 years ago
|
||
This is AMD, not source maps.
Comment 7•5 years ago
|
||
Is that a recent regression? If it is, do we have a regression range? Is ESR affected? Thanks
Comment 8•5 years ago
|
||
ESR is unaffected.
Assignee | ||
Comment 9•5 years ago
|
||
I dug a bit more into this and it looks like the source is coming from an eval:
The full URL is (https://sapui5.hana.ondemand.com/test-resources/sap/ui/demoapps/demokit/rta/fiori-elements/ext/controller/CustomFilter.controller.js?eval
)
And it is being initialized with SAP's custom module system in Component-preload.js
line 3
sap.ui.predefine(
"sap/ui/demoapps/rta/freestyle/ext/controller/CustomFilter.controller",
[
"sap/ui/model/Filter",
"sap/m/Token",
"sap/m/RatingIndicator",
"sap/m/ComboBox",
"sap/m/MultiInput",
"sap/ui/comp/smartfilterbar/SmartFilterBar",
],
function(F, T, R, C, M, S) {
return sap.ui.controller(
"sap.ui.demoapps.rta.fiorielements.ext.controller.CustomFilter"
// stuff
);
}
);
Assignee | ||
Comment 10•5 years ago
|
||
Okay - a couple more pieces of information
- SAP uses this function
execModule
eval the module into existence. It is basically a glorifiedeval
with content + sourceURL. I stepped through the code and it adds the sourceURL correctly which is why the tab appears in debugger correctly.
function execModule(sModuleName,bAsync){var oModule=mModules[sModuleName],oShim=mShims[sModuleName],bLoggable=log.isLoggable(),sOldPrefix,sScript,vAMD,oMatch,bOldForceSyncDefines;if(oModule&&oModule.state===LOADED&&typeof oModule.data!=="undefined"){vAMD=(oShim===true||(oShim&&oShim.amd))&&typeof __global.define==="function"&&__global.define.amd;bOldForceSyncDefines=bForceSyncDefines;try{if(vAMD){delete __global.define.amd;}bForceSyncDefines=!bAsync;if(bLoggable){log.debug(sLogPrefix+"executing '"+sModuleName+"'");sOldPrefix=sLogPrefix;sLogPrefix=sLogPrefix+": ";}oModule.state=EXECUTING;_execStack.push({name:sModuleName,used:false});if(typeof oModule.data==="function"){oModule.data.call(__global);}else if(Array.isArray(oModule.data)){ui5Define.apply(null,oModule.data);}else{sScript=oModule.data;if(sScript){oMatch=/\/\/[#@] source(Mapping)?URL=(.*)$/.exec(sScript);if(oMatch&&oMatch[1]&&/^[^/]+\.js\.map$/.test(oMatch[2])){sScript=sScript.slice(0,oMatch.index)+oMatch[0].slice(0,-oMatch[2].length)+resolveURL(oMatch[2],oModule.url);}if(!oMatch||oMatch[1]){sScript+="\n//# sourceURL="+resolveURL(oModule.url)+"?eval";}}if(typeof translate==="function"){sScript=translate(sScript,sModuleName);}if(__global.execScript&&(!oModule.data||oModule.data.length<MAX_EXEC_SCRIPT_LENGTH)){try{oModule.data&&__global.execScript(sScript);}catch(e){_execStack.pop();eval(oModule.data);throw e;}}else{__global.eval(sScript);}}_execStack.pop();queue.process(oModule);if(bLoggable){sLogPrefix=sOldPrefix;log.debug(sLogPrefix+"finished executing '"+sModuleName+"'");}}catch(err){if(bLoggable){sLogPrefix=sOldPrefix;}oModule.data=undefined;oModule.fail(err);}finally{if(vAMD){__global.define.amd=vAMD;}bForceSyncDefines=bOldForceSyncDefines;}}}
For some reason, the URL in addSource is still the URL of the eval though https://sapui5.hana.ondemand.com/resources/sap-ui-core.js
.
Assignee | ||
Comment 11•5 years ago
|
||
Okay, I found the regression. In addSource we should be asking the sourceActor for the URL as opposed to the raw source.
Assignee | ||
Comment 12•5 years ago
|
||
Updated•5 years ago
|
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
bugherder |
Comment 15•5 years ago
|
||
Want to request uplift to beta?
Updated•5 years ago
|
Assignee | ||
Comment 16•5 years ago
|
||
Good idea. It should be easy to land as well.
Assignee | ||
Comment 17•5 years ago
|
||
Beta/Release Uplift Approval Request
- User impact if declined: breakpoints associated with a source url pragma will not hit on reload
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): it only affects the debugger
- String changes made/needed:
Assignee | ||
Updated•5 years ago
|
Comment 18•5 years ago
|
||
Comment 19•5 years ago
|
||
Comment on attachment 9066745 [details]
Bug 1552453 - Breakpoint doesnt pause in file during page load. r=loganfsmyth
debugger fix, approved for 68.0b6
Comment 20•5 years ago
|
||
bugherder uplift |
Comment 21•5 years ago
|
||
Now that 68.0b6 landed I can confirm that the breakpoints in all my internal SAP applications work again as intended.
Thanks for the fast fixing!
Updated•5 years ago
|
Description
•