namespace JSC {
+class CodeBlock;
+class Exception;
class ExecState;
class JSGlobalObject;
class SourceProvider;
bool needsExceptionCallbacks() const { return m_pauseOnExceptionsState != DontPauseOnExceptions; }
- void attach(JSGlobalObject*);
enum ReasonForDetach {
TerminatingDebuggingSession,
GlobalObjectIsDestructing
};
- virtual void detach(JSGlobalObject*, ReasonForDetach);
+ void attach(JSGlobalObject*);
+ void detach(JSGlobalObject*, ReasonForDetach);
+ bool isAttached(JSGlobalObject*);
BreakpointID setBreakpoint(Breakpoint, unsigned& actualLine, unsigned& actualColumn);
void removeBreakpoint(BreakpointID);
PauseOnExceptionsState pauseOnExceptionsState() const { return m_pauseOnExceptionsState; }
void setPauseOnExceptionsState(PauseOnExceptionsState);
+ enum ReasonForPause {
+ NotPaused,
+ PausedForException,
+ PausedAtStatement,
+ PausedAfterCall,
+ PausedBeforeReturn,
+ PausedAtStartOfProgram,
+ PausedAtEndOfProgram,
+ PausedForBreakpoint,
+ PausedForDebuggerStatement,
+ };
+ ReasonForPause reasonForPause() const { return m_reasonForPause; }
+ BreakpointID pausingBreakpointID() const { return m_pausingBreakpointID; }
+
void setPauseOnNextStatement(bool);
void breakProgram();
void continueProgram();
void stepOverStatement();
void stepOutOfFunction();
- bool isPaused() { return m_isPaused; }
+ bool isPaused() const { return m_isPaused; }
bool isStepping() const { return m_steppingMode == SteppingModeEnabled; }
virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const WTF::String& errorMessage) = 0;
- void exception(CallFrame*, JSValue exceptionValue, bool hasHandler);
+ void exception(CallFrame*, JSValue exceptionValue, bool hasCatchHandler);
void atStatement(CallFrame*);
void callEvent(CallFrame*);
void returnEvent(CallFrame*);
protected:
virtual bool needPauseHandling(JSGlobalObject*) { return false; }
- virtual void handleBreakpointHit(const Breakpoint&) { }
- virtual void handleExceptionInBreakpointCondition(ExecState*, JSValue exception) const { UNUSED_PARAM(exception); }
-
- enum ReasonForPause {
- NotPaused,
- PausedForException,
- PausedAtStatement,
- PausedAfterCall,
- PausedBeforeReturn,
- PausedAtStartOfProgram,
- PausedAtEndOfProgram,
- PausedForBreakpoint
- };
-
- virtual void handlePause(ReasonForPause, JSGlobalObject*) { }
+ virtual void handleBreakpointHit(JSGlobalObject*, const Breakpoint&) { }
+ virtual void handleExceptionInBreakpointCondition(ExecState*, Exception*) const { }
+ virtual void handlePause(JSGlobalObject*, ReasonForPause) { }
virtual void notifyDoneProcessingDebuggerEvents() { }
private:
bool m_breakpointsActivated : 1;
bool m_hasHandlerForExceptionCallback : 1;
bool m_isInWorkerThread : 1;
- SteppingMode m_steppingMode : 1;
+ unsigned m_steppingMode : 1; // SteppingMode
ReasonForPause m_reasonForPause;
JSValue m_currentException;
SourceID m_lastExecutedSourceID;
BreakpointID m_topBreakpointID;
+ BreakpointID m_pausingBreakpointID;
BreakpointIDToBreakpointMap m_breakpointIDToBreakpoint;
SourceIDToBreakpointsMap m_sourceIDToBreakpoints;
RefPtr<JSC::DebuggerCallFrame> m_currentDebuggerCallFrame;
- friend class DebuggerCallFrameScope;
+ friend class DebuggerPausedScope;
friend class TemporaryPausedState;
friend class LLIntOffsetsExtractor;
};