Closed Bug 897594 Opened 11 years ago Closed 5 years ago

Reduce number of sourcemap lookups when setting breakpoints

Categories

(DevTools :: Debugger, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jimb, Unassigned)

References

(Blocks 1 open bug)

Details

I'm having difficulty reading it, but the code starting here:

http://hg.mozilla.org/mozilla-central/file/b3fcd828cadc/toolkit/devtools/server/actors/script.js#l680

seems to do way more work than necessary to give the correct answer. If the response from _createAndStoreBreakpoint has an actualLocation property, then that is a generated location, so we need to get its original location, and return that in the packet --- if it differs from what was given in the request.

But if there is no actualLocation property there, then there's no need to do any location mapping at all: the breakpoint was set where requested, and the location that appears in the request is correct.
"Way more" is an exaggeration. I think we can avoid an unconditional call to getOriginalLocation.

I guess it comes down to: I can't see why originalLocation, as computed here:
http://hg.mozilla.org/mozilla-central/file/b3fcd828cadc/toolkit/devtools/server/actors/script.js#l684

... is going to be meaningfully different from originalSource, originalLine, originalColumn as found in aRequest.location.
Priority: -- → P3
Summary: JS debugger: setting breakpoints does more sourcemap lookups than necessary → Reduce number of sourcemap lookups when setting breakpoints
Summary: Reduce number of sourcemap lookups when setting breakpoints → Implement a button to toggle source maps in the toolbar
Summary: Implement a button to toggle source maps in the toolbar → Reduce number of sourcemap lookups when setting breakpoints
This will be obsolete once the old debugger is removed.
Depends on: 1314057
Priority: P3 → P5
Product: Firefox → DevTools
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.