Clear any previous stepping hooks on a plain resumption (bug 832234); r=rcampbell

This commit is contained in:
Panos Astithas 2013-07-18 12:45:17 +03:00
parent 2f3ef31459
commit 6277ba7fbb
3 changed files with 29 additions and 27 deletions

View File

@ -54,35 +54,33 @@ function test() {
cmd("dbg step out", function() {
is(output.value, "step out", "debugger stepped out");
cmd("dbg continue", function() {
cmd("dbg continue", function() {
is(output.value, "dbg continue", "debugger continued");
is(output.value, "dbg continue", "debugger continued");
function closeDebugger(cb) {
helpers.audit(options, [{
setup: "dbg close",
completed: false,
exec: { output: "" }
}]);
function closeDebugger(cb) {
helpers.audit(options, [{
setup: "dbg close",
completed: false,
exec: { output: "" }
}]);
let toolbox = gDevTools.getToolbox(options.target);
if (!toolbox) {
let toolbox = gDevTools.getToolbox(options.target);
if (!toolbox) {
ok(true, "Debugger was closed.");
cb();
} else {
toolbox.on("destroyed", function () {
ok(true, "Debugger was closed.");
cb();
} else {
toolbox.on("destroyed", function () {
ok(true, "Debugger was closed.");
cb();
});
}
});
}
}
// We're closing the debugger twice to make sure
// 'dbg close' doesn't error when toolbox is already
// closed. See bug 884638 for more info.
// We're closing the debugger twice to make sure
// 'dbg close' doesn't error when toolbox is already
// closed. See bug 884638 for more info.
closeDebugger(() => {
closeDebugger(() => deferred.resolve());
});
closeDebugger(() => {
closeDebugger(() => deferred.resolve());
});
});
});

View File

@ -413,6 +413,14 @@ ThreadActor.prototype = {
stepFrame.onPop = onPop;
}
}
} else {
// Clear any previous stepping hooks on a plain resumption.
let frame = this.youngestFrame;
while (frame) {
frame.onStep = undefined;
frame.onPop = undefined;
frame = frame.older;
}
}
if (aRequest) {

View File

@ -151,11 +151,7 @@ function runTest(aOnSteppedLocation, aOnDebuggerStatementFrames, aFinishedCallba
do_check_eq(aPacket.why.type, "debuggerStatement");
gThreadClient.getFrames(0, 100, function ({frames}) {
aOnDebuggerStatementFrames(frames);
// We hit the breakpoint once more on the way out
gClient.addOneTimeListener("paused", function () {
gThreadClient.resume(aFinishedCallback);
});
gThreadClient.resume();
gThreadClient.resume(aFinishedCallback);
});
});
gThreadClient.resume();