Closed
Bug 1237593
Opened 9 years ago
Closed 2 years ago
Breakpoints for source maps with sections are not hit
Categories
(DevTools :: Debugger, enhancement, P3)
Tracking
(firefox107 fixed)
RESOLVED
FIXED
107 Branch
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: tiddolangerak, Assigned: bomsy)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files, 1 obsolete file)
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20151210112415
Steps to reproduce:
1. I created a javascript file with sourcemaps, where the actual mappings are put in the `sections` field of the source map
2. I placed a breakpoint in the file with the dev tools
3. Dev tools did not stop on the breakpoint
Additional info:
- The breakpoint was hit in the dev tools for Chrome, which make me believe the sourcemap is correct.
- A functionally identical sourcemap without sections does work properly in Firefox.
- Firefox did seem to parse the sourcemap correctly: checking "Pause on Exceptions" does cause the dev tool to halt on the correct line with thrown exceptions.
Attached is a tar with 4 files:
- index_sections.js: a javascript file with the sourcemap mappings in the sections field. This script contains a small loop that logs a line and throws an exception. On this file breakpoints do not work.
- index_nosections.js: identical to `index_sections.js`, but now with sourcemaps without the sections field. On this file breakpoints do work
- sections.html: HTML file that loads the index_sections.js
- nosections.html: HTML file that loads the index_nosections.js
The sourcemaps in both files are inlined. Their decoded versions are as followed:
With sections:
```
{
"version": 3,
"file": "out/index.js",
"sections": [
{
"offset": {
"line": 0,
"column": 0
},
"map": {
"version": 3,
"sources": [
"index.js"
],
"names": [],
"mappings": ";;AAAA,WAAW,CAAC,YAAK;AAChB,QAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC9B,OAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;CACzB,EAAE,IAAI,CAAC,CAAC",
"file": "out/index.js",
"sourceRoot": "src",
"sourcesContent": [
"setInterval(() =>{\n\tconsole.log(\"about to throw\");\n\tthrow new Error('error');\n}, 1000);\n"
]
}
}
]
}
```
Without sections:
```
{
"version": 3,
"sources": [
"index.js"
],
"names": [],
"mappings": ";;AAAA,WAAW,CAAC,YAAK;AAChB,QAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC9B,OAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;CACzB,EAAE,IAAI,CAAC,CAAC",
"file": "out/index.js",
"sourceRoot": "src",
"sourcesContent": [
"setInterval(() =>{\n\tconsole.log(\"about to throw\");\n\tthrow new Error('error');\n}, 1000);\n"
]
}
```
Actual results:
Debugger did not pause on the breakpoint
Expected results:
Debugger should have paused on the breakpoint
Reporter | ||
Updated•9 years ago
|
Version: 41 Branch → 43 Branch
Reporter | ||
Comment 1•9 years ago
|
||
Previous one was not the version I posted the sourcemaps for
Attachment #8705105 -
Attachment is obsolete: true
Reporter | ||
Updated•9 years ago
|
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Updated•9 years ago
|
Component: Untriaged → Developer Tools: Debugger
:fitzgen, any idea if this is a known issue?
Flags: needinfo?(nfitzgerald)
Comment 3•9 years ago
|
||
AFAIK, we don't have any other bugs on file for this.
Blocks: dbg-sourcemap
Flags: needinfo?(nfitzgerald)
Comment 4•8 years ago
|
||
This seems to affect Webpack generated source maps for me, e.g. where multiple files are compiled into one bundle.
I wrote a tool to merge sourcemaps in concatenated javascript files and I've noticed in Firefox 50 (Fedora 25) that I simply cannot set breakpoints in the debugger, while chrome/chromium has no issues with it. The file has an inline sourcemap instead of referencing an external file, I'll go ahead and attach it as an example.
Comment 7•8 years ago
|
||
See https://github.com/mozilla/source-map/issues/16 for the upstream bug.
Updated•8 years ago
|
Blocks: source-maps
Priority: -- → P3
Comment 9•8 years ago
|
||
The original test case works for me with a recent build.
Stefan, I don't know what to do with the code you attached.
What would be most helpful would be a simple, complete test showing the problem.
One way is a tar or zip file like the original test case, that is, including
a .html file and whatever built files are needed.
Flags: needinfo?(stefan)
Comment 10•7 years ago
|
||
Looking upstream again, I think the remaining bug here is that the "url"
style of indexed source map does not work. The source-maps library never
implemented the proposed API for fetching this data.
Flags: needinfo?(stefan)
Updated•7 years ago
|
Product: Firefox → DevTools
Comment 12•6 years ago
|
||
moving to enhancement because sections is still experimental
Type: defect → enhancement
Assignee | ||
Comment 13•2 years ago
|
||
Updated•2 years ago
|
Assignee: nobody → hmanilla
Attachment #9296782 -
Attachment description: Bug 1237593 - [devtools] Testing breakpoints on sources generated from source maps with sections → Bug 1237593 - [devtools] Test breakpoints on sources generated from source map with sections r=ochameau
Status: NEW → ASSIGNED
Assignee | ||
Comment 14•2 years ago
|
||
This seems to be fixed, so lets a test to cover it.
Comment 15•2 years ago
|
||
Julien, was that an issue with the profiler codebase?
It is fixed now?
The related issue in the upstream source-map package was:
https://github.com/mozilla/source-map/issues/16
But there is a followup issue, still unresolved:
https://github.com/mozilla/source-map/issues/437
Flags: needinfo?(felash)
Comment 16•2 years ago
|
||
I tried to set some breakpoints on the profiler codebase, both with webpack in development mode or in a production build. In both cases the breakpoint worked.
But of course our webpack version is now v5 while it probably was v3 back when I found this issue.
I would still mark it fixed and file a new bug if new problems arise.
Flags: needinfo?(felash)
Comment 17•2 years ago
|
||
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2ceae3cbc35f
[devtools] Test breakpoints on sources generated from source map with sections r=ochameau
Updated•2 years ago
|
Severity: normal → S3
Comment 18•2 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox107:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•