diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/debugger/Debugger.h | |
parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/debugger/Debugger.h')
-rw-r--r-- | Source/JavaScriptCore/debugger/Debugger.h | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/Source/JavaScriptCore/debugger/Debugger.h b/Source/JavaScriptCore/debugger/Debugger.h index d70f3b76f..f7b734f37 100644 --- a/Source/JavaScriptCore/debugger/Debugger.h +++ b/Source/JavaScriptCore/debugger/Debugger.h @@ -29,12 +29,11 @@ #include <wtf/HashMap.h> #include <wtf/HashSet.h> #include <wtf/RefPtr.h> +#include <wtf/Vector.h> #include <wtf/text/TextPosition.h> namespace JSC { -class CodeBlock; -class Exception; class ExecState; class JSGlobalObject; class SourceProvider; @@ -61,13 +60,12 @@ public: bool needsExceptionCallbacks() const { return m_pauseOnExceptionsState != DontPauseOnExceptions; } + void attach(JSGlobalObject*); enum ReasonForDetach { TerminatingDebuggingSession, GlobalObjectIsDestructing }; - void attach(JSGlobalObject*); - void detach(JSGlobalObject*, ReasonForDetach); - bool isAttached(JSGlobalObject*); + virtual void detach(JSGlobalObject*, ReasonForDetach); BreakpointID setBreakpoint(Breakpoint, unsigned& actualLine, unsigned& actualColumn); void removeBreakpoint(BreakpointID); @@ -84,20 +82,6 @@ public: 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(); @@ -105,12 +89,12 @@ public: void stepOverStatement(); void stepOutOfFunction(); - bool isPaused() const { return m_isPaused; } + bool isPaused() { 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 hasCatchHandler); + void exception(CallFrame*, JSValue exceptionValue, bool hasHandler); void atStatement(CallFrame*); void callEvent(CallFrame*); void returnEvent(CallFrame*); @@ -124,15 +108,28 @@ public: protected: virtual bool needPauseHandling(JSGlobalObject*) { return false; } - virtual void handleBreakpointHit(JSGlobalObject*, const Breakpoint&) { } - virtual void handleExceptionInBreakpointCondition(ExecState*, Exception*) const { } - virtual void handlePause(JSGlobalObject*, ReasonForPause) { } + 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 notifyDoneProcessingDebuggerEvents() { } private: typedef HashMap<BreakpointID, Breakpoint*> BreakpointIDToBreakpointMap; - typedef HashMap<unsigned, RefPtr<BreakpointsList>, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>> LineToBreakpointsMap; + typedef Vector<Breakpoint> BreakpointsInLine; + typedef HashMap<unsigned, BreakpointsInLine, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>> LineToBreakpointsMap; typedef HashMap<SourceID, LineToBreakpointsMap, WTF::IntHash<SourceID>, WTF::UnsignedWithZeroKeyHashTraits<SourceID>> SourceIDToBreakpointsMap; class ClearCodeBlockDebuggerRequestsFunctor; @@ -185,8 +182,6 @@ private: void clearDebuggerRequests(JSGlobalObject*); - template<typename Functor> inline void forEachCodeBlock(Functor&); - VM* m_vm; HashSet<JSGlobalObject*> m_globalObjects; @@ -196,7 +191,7 @@ private: bool m_breakpointsActivated : 1; bool m_hasHandlerForExceptionCallback : 1; bool m_isInWorkerThread : 1; - unsigned m_steppingMode : 1; // SteppingMode + SteppingMode m_steppingMode : 1; ReasonForPause m_reasonForPause; JSValue m_currentException; @@ -206,13 +201,12 @@ private: SourceID m_lastExecutedSourceID; BreakpointID m_topBreakpointID; - BreakpointID m_pausingBreakpointID; BreakpointIDToBreakpointMap m_breakpointIDToBreakpoint; SourceIDToBreakpointsMap m_sourceIDToBreakpoints; RefPtr<JSC::DebuggerCallFrame> m_currentDebuggerCallFrame; - friend class DebuggerPausedScope; + friend class DebuggerCallFrameScope; friend class TemporaryPausedState; friend class LLIntOffsetsExtractor; }; |