Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Created August 5, 2019 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonLaster/fdb9673ad596817a063fe8ed53fb4a1e to your computer and use it in GitHub Desktop.
Save jasonLaster/fdb9673ad596817a063fe8ed53fb4a1e to your computer and use it in GitHub Desktop.
diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js
index 0545314b2d54..2441947e4863 100644
--- a/devtools/server/actors/thread.js
+++ b/devtools/server/actors/thread.js
@@ -488,6 +488,8 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
},
removeBreakpoint(location) {
+
+
const actor = this.breakpointActorMap.getOrCreateBreakpointActor(location);
actor.delete();
},
@@ -1842,8 +1844,9 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
*/
onDebuggerStatement: function(frame) {
const location = this.sources.getFrameLocation(frame);
- const url = location.sourceActor.url;
+ const sourceUrl = location.sourceActor.url;
+ console.log('> at debugger statment', { url })
// Don't pause if
// 1. the debugger is in the same position
// 2. breakpoints are disabled
@@ -1851,9 +1854,13 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
if (
!this.hasMoved(location, "debuggerStatement") ||
this.skipBreakpoints ||
- this.sources.isBlackBoxed(url)
+ this.breakpointActorMap.get({ sourceUrl, ...location }) ||
+ this.sources.isBlackBoxed(sourceUrl)
) {
+ console.log('> found a bp')
return undefined;
+ } else {
+ console.log('> no found a bp')
}
return this._pauseAndRespond(frame, { type: "debuggerStatement" });
diff --git a/devtools/server/actors/utils/breakpoint-actor-map.js b/devtools/server/actors/utils/breakpoint-actor-map.js
index a0ad07517680..11d4f016f642 100644
--- a/devtools/server/actors/utils/breakpoint-actor-map.js
+++ b/devtools/server/actors/utils/breakpoint-actor-map.js
@@ -53,6 +53,12 @@ BreakpointActorMap.prototype = {
return this._actors[key];
},
+ get(location) {
+ const key = this._locationKey(location);
+ console.log(`> get location ${key}`, Object.keys(this._actors))
+ this._actors[key]
+ },
+
/**
* Delete the BreakpointActor from the given location in this
* BreakpointActorMap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment