void Debugger::stepIntoStatement() { if (!m_isPaused) return; m_pauseOnNextStatement = true; setSteppingMode(SteppingModeEnabled); notifyDoneProcessingDebuggerEvents(); }
void Debugger::stepOverStatement() { if (!m_isPaused) return; m_pauseOnCallFrame = m_currentCallFrame; setSteppingMode(SteppingModeEnabled); notifyDoneProcessingDebuggerEvents(); }
void Debugger::didReachBreakpoint(CallFrame* callFrame) { if (m_isPaused) return; PauseReasonDeclaration reason(*this, PausedForDebuggerStatement); m_pauseOnNextStatement = true; setSteppingMode(SteppingModeEnabled); updateCallFrameAndPauseIfNeeded(callFrame); }
void Debugger::didReachBreakpoint(CallFrame* callFrame) { if (m_isPaused) return; PauseReasonDeclaration reason(*this, PausedForDebuggerStatement); m_pauseAtNextOpportunity = true; setSteppingMode(SteppingModeEnabled); updateCallFrame(callFrame, AttemptPause); }
void Debugger::breakProgram() { if (m_isPaused) return; m_pauseOnNextStatement = true; setSteppingMode(SteppingModeEnabled); m_currentCallFrame = m_vm->topCallFrame; ASSERT(m_currentCallFrame); pauseIfNeeded(m_currentCallFrame); }
void Debugger::stepOutOfFunction() { if (!m_isPaused) return; VMEntryFrame* topVMEntryFrame = m_vm.topVMEntryFrame; m_pauseOnCallFrame = m_currentCallFrame ? m_currentCallFrame->callerFrame(topVMEntryFrame) : nullptr; m_pauseOnStepOut = true; setSteppingMode(SteppingModeEnabled); notifyDoneProcessingDebuggerEvents(); }
void Debugger::pauseIfNeeded(CallFrame* callFrame) { if (m_isPaused) return; if (m_suppressAllPauses) return; JSGlobalObject* vmEntryGlobalObject = callFrame->vmEntryGlobalObject(); if (!needPauseHandling(vmEntryGlobalObject)) return; Breakpoint breakpoint; bool didHitBreakpoint = false; bool pauseNow = m_pauseOnNextStatement; pauseNow |= (m_pauseOnCallFrame == m_currentCallFrame); DebuggerPausedScope debuggerPausedScope(*this); intptr_t sourceID = DebuggerCallFrame::sourceIDForCallFrame(m_currentCallFrame); TextPosition position = DebuggerCallFrame::positionForCallFrame(m_currentCallFrame); pauseNow |= didHitBreakpoint = hasBreakpoint(sourceID, position, &breakpoint); m_lastExecutedLine = position.m_line.zeroBasedInt(); if (!pauseNow) return; // Make sure we are not going to pause again on breakpoint actions by // reseting the pause state before executing any breakpoint actions. TemporaryPausedState pausedState(*this); m_pauseOnCallFrame = 0; m_pauseOnNextStatement = false; if (didHitBreakpoint) { handleBreakpointHit(vmEntryGlobalObject, breakpoint); // Note that the actions can potentially stop the debugger, so we need to check that // we still have a current call frame when we get back. if (breakpoint.autoContinue || !m_currentCallFrame) return; m_pausingBreakpointID = breakpoint.id; } { PauseReasonDeclaration reason(*this, didHitBreakpoint ? PausedForBreakpoint : m_reasonForPause); handlePause(vmEntryGlobalObject, m_reasonForPause); RELEASE_ASSERT(!callFrame->hadException()); } m_pausingBreakpointID = noBreakpointID; if (!m_pauseOnNextStatement && !m_pauseOnCallFrame) { setSteppingMode(SteppingModeDisabled); m_currentCallFrame = nullptr; } }
void Debugger::breakProgram() { if (m_isPaused) return; if (!m_vm.topCallFrame) return; m_pauseAtNextOpportunity = true; setSteppingMode(SteppingModeEnabled); m_currentCallFrame = m_vm.topCallFrame; pauseIfNeeded(m_currentCallFrame); }
void Debugger::exception(CallFrame* callFrame, JSValue exception, bool hasHandler) { if (m_isPaused) return; PauseReasonDeclaration reason(*this, PausedForException); if (m_pauseOnExceptionsState == PauseOnAllExceptions || (m_pauseOnExceptionsState == PauseOnUncaughtExceptions && !hasHandler)) { m_pauseOnNextStatement = true; setSteppingMode(SteppingModeEnabled); } m_hasHandlerForExceptionCallback = true; m_currentException = exception; updateCallFrameAndPauseIfNeeded(callFrame); m_currentException = JSValue(); m_hasHandlerForExceptionCallback = false; }
void Debugger::setPauseOnNextStatement(bool pause) { m_pauseOnNextStatement = pause; if (pause) setSteppingMode(SteppingModeEnabled); }