Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Fix some unexplained breakpoints behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Geffner committed Mar 2, 2018
1 parent 505751c commit 3b7ddbd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/chrome/chromeDebugAdapter.ts
Expand Up @@ -98,6 +98,7 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
private _frameHandles: Handles<Crdp.Debugger.CallFrame>;
private _variableHandles: variables.VariableHandles;
private _breakpointIdHandles: utils.ReverseHandles<Crdp.Debugger.BreakpointId>;
private _unboundBreakpointIdHandles: utils.ReverseHandles<Crdp.Debugger.BreakpointId>;
private _sourceHandles: utils.ReverseHandles<ISourceContainer>;

private _scriptsById: Map<Crdp.Runtime.ScriptId, CrdpScript>;
Expand Down Expand Up @@ -148,6 +149,7 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
this._frameHandles = new Handles<Crdp.Debugger.CallFrame>();
this._variableHandles = new variables.VariableHandles();
this._breakpointIdHandles = new utils.ReverseHandles<Crdp.Debugger.BreakpointId>();
this._unboundBreakpointIdHandles = new utils.ReverseHandles<Crdp.Debugger.BreakpointId>();
this._sourceHandles = new utils.ReverseHandles<ISourceContainer>();
this._pendingBreakpointsByUrl = new Map<string, IPendingBreakpoint>();
this._hitConditionBreakpointsById = new Map<Crdp.Debugger.BreakpointId, IHitConditionBreakpoint>();
Expand Down Expand Up @@ -1200,7 +1202,7 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
line: bp.line,
column: bp.column,
message,
id: this._breakpointIdHandles.create(this._nextUnboundBreakpointId++ + '')
id: this._unboundBreakpointIdHandles.create(this._nextUnboundBreakpointId++ + '')
};
});

Expand Down Expand Up @@ -1338,15 +1340,16 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter {
// response.breakpointId is undefined when no target BP is backing this BP, e.g. it's at the same location
// as another BP
const responseBpId = response.breakpointId || (this._nextUnboundBreakpointId++ + '');
const breakpointIdHandlesForThisBpId = response.breakpointId ? this._breakpointIdHandles : this._unboundBreakpointIdHandles;

let bpId: number;
if (ids && ids[i]) {
// IDs passed in for previously unverified BPs
bpId = ids[i];
this._breakpointIdHandles.set(bpId, responseBpId);
breakpointIdHandlesForThisBpId.set(bpId, responseBpId);
} else {
bpId = this._breakpointIdHandles.lookup(responseBpId) ||
this._breakpointIdHandles.create(responseBpId);
bpId = breakpointIdHandlesForThisBpId.lookup(responseBpId) ||
breakpointIdHandlesForThisBpId.create(responseBpId);
}

if (!response.actualLocation) {
Expand Down

0 comments on commit 3b7ddbd

Please sign in to comment.