[Breakpoints] can't set breakpoint in prettified source
I tried the test case in bug 1327713. After prettifying the source, when I try to set a breakpoint, the breakpoint briefly appears, and then disappears.
I don't see an stack trace in the console, but enabling pause-on-exception shows an exception coming from addBreakpoint saying: "query object's 'line' property is neither undefined nor an integer".
STR 1:
- Open attached "testcase 1"
- Open debugger, prettify script containing word "click"
- Set breaking on "click" event, click on the page
- Keep clicking "Step in" button until line "console.log(123);" is executed
TEST PAGE TEST PAGE 2 (w/ only the hex lines)
AR: When debugger steps into a function, then, if the first token in that function is "function", debugger jumps to line 1. That line becomes highlighted with green; caret is displayed in that line
ER: When debugger steps into a function, some sensible line inside that function should be selected. In other words, debugger should select lines in the very same sequence as in STR_2 (see below).
STR_2:
- Open attached "testcase 1"
- Set breaking on "wheel" event, hover mouse over the page, rotate mouse wheel down once
- Keep clicking "Step in" button until line "console.log(123);" is executed
AR: Everything's OK
Here's the testcase 1:
<script src="data:text/javascript,
(function(){
var A = {};
window.A = A;
A.F = function(){
A.G();
},
A.G = function(){
function _G(){};
A.H();
},
A.H = function(){
A.I()
},
A.I = function(){
function _I(){};
A.J();
};
A.J = function(){
function _J(){};
A.K();
};
A.K = function(){
console.log(123);
};
addEventListener('click',A.F,false);
})()
//.js"></script>
<!-- a bit confusing -->
<script src="data:text/javascript,
(function () {
%0A var A = {
%0A };
%0A window.A = A;
%0A A.F = function () {
%0A A.G();
%0A },
%0A A.G = function () {
%0A function _G() {
%0A };
%0A A.H();
%0A },
%0A A.H = function () {
%0A A.I()
%0A },
%0A A.I = function () {
%0A function _I() {
%0A };
%0A A.J();
%0A };
%0A A.J = function () {
%0A function _J() {
%0A };
%0A A.K();
%0A };
%0A A.K = function () {
%0A console.log(123);
%0A };
%0A addEventListener('wheel', A.F, false);
%0A}) () //.js
%0A"></script>
Just tried this again and it still seems to be an issue.
/claim
Thanks for claiming the issue! :wave:
!!! Please check your email and confirm the invitation
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
@NickMalt did some great research in #4902 and started a mochitest
I think we've narrowed the problem down to how we create the URLs
After some debugging I think that I caught this bug:
-
Here we send correct parameters but got
{ line: null, column: null }. Which is why breakpoint flashing. https://github.com/devtools-html/debugger.html/blob/223d35a570d4762000c736e00e5a16b09c9ae8c6/src/utils/source-maps.js#L17-L20 -
Here we handle this request in source-map worker. But _findSourceIndex return
-1as if this source did not exist. ļæ¼

-
The problem is in property
sourceUrlmismatch. This one we send to worker:
This one we have in worker:
And we have this mismatch because of path normalization in worker

-
And if we add this patch to normalize function, everything works ok.

Before/After

@jasonLaster The question is, how to properly change normalize function? Iām probably miss something, because do not see the whole picture.
And how should I continue this? I mean how to contibute to mozila-central?
Hey @NickMalt how's your schedule these days?
@NickMalt if you're free these days claim it. Otherwise, this is now open for anyone to claim
I'm moving the issue to the icebox. We will re-prioritize the issues in the icebox at the beginning of the next release in 6 weeks.