Bug 1274193 part 5 - Use GO_THROUGH_SAVED for remaining debugger frame iters. r=shu

This commit is contained in:
Jan de Mooij 2016-05-24 08:15:55 +02:00
parent e0971c9d87
commit dd01db72ae
2 changed files with 9 additions and 6 deletions

View File

@ -1481,7 +1481,7 @@ Debugger::fireDebuggerStatement(JSContext* cx, MutableHandleValue vp)
Maybe<AutoCompartment> ac;
ac.emplace(cx, object);
ScriptFrameIter iter(cx, FrameIter::STOP_AT_SAVED);
ScriptFrameIter iter(cx, FrameIter::GO_THROUGH_SAVED);
RootedValue scriptFrame(cx);
if (!getScriptFrame(cx, iter, &scriptFrame))
return handleUncaughtException(ac, false);
@ -1510,7 +1510,7 @@ Debugger::fireExceptionUnwind(JSContext* cx, MutableHandleValue vp)
RootedValue scriptFrame(cx);
RootedValue wrappedExc(cx, exc);
ScriptFrameIter iter(cx, FrameIter::STOP_AT_SAVED);
ScriptFrameIter iter(cx, FrameIter::GO_THROUGH_SAVED);
if (!getScriptFrame(cx, iter, &scriptFrame) || !wrapDebuggeeValue(cx, &wrappedExc))
return handleUncaughtException(ac, false);
@ -1682,7 +1682,7 @@ Debugger::slowPathOnNewWasmModule(JSContext* cx, Handle<WasmModuleObject*> wasmM
/* static */ JSTrapStatus
Debugger::onTrap(JSContext* cx, MutableHandleValue vp)
{
ScriptFrameIter iter(cx, FrameIter::STOP_AT_SAVED);
ScriptFrameIter iter(cx, FrameIter::GO_THROUGH_SAVED);
RootedScript script(cx, iter.script());
MOZ_ASSERT(script->isDebuggee());
Rooted<GlobalObject*> scriptGlobal(cx, &script->global());
@ -1746,7 +1746,7 @@ Debugger::onTrap(JSContext* cx, MutableHandleValue vp)
/* static */ JSTrapStatus
Debugger::onSingleStep(JSContext* cx, MutableHandleValue vp)
{
ScriptFrameIter iter(cx, FrameIter::STOP_AT_SAVED);
ScriptFrameIter iter(cx, FrameIter::GO_THROUGH_SAVED);
/*
* We may be stepping over a JSOP_EXCEPTION, that pushes the context's

View File

@ -591,8 +591,11 @@ InvokeInterruptCallback(JSContext* cx)
// Debugger treats invoking the interrupt callback as a "step", so
// invoke the onStep handler.
if (cx->compartment()->isDebuggee()) {
ScriptFrameIter iter(cx, FrameIter::STOP_AT_SAVED);
if (!iter.done() && iter.script()->stepModeEnabled()) {
ScriptFrameIter iter(cx, FrameIter::GO_THROUGH_SAVED);
if (!iter.done() &&
cx->compartment() == iter.compartment() &&
iter.script()->stepModeEnabled())
{
RootedValue rval(cx);
switch (Debugger::onSingleStep(cx, &rval)) {
case JSTRAP_ERROR: