summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/debugger/Debugger.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/debugger/Debugger.h
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/debugger/Debugger.h')
-rw-r--r--Source/JavaScriptCore/debugger/Debugger.h82
1 files changed, 28 insertions, 54 deletions
diff --git a/Source/JavaScriptCore/debugger/Debugger.h b/Source/JavaScriptCore/debugger/Debugger.h
index 2e91aafbe..f7b734f37 100644
--- a/Source/JavaScriptCore/debugger/Debugger.h
+++ b/Source/JavaScriptCore/debugger/Debugger.h
@@ -23,19 +23,17 @@
#define Debugger_h
#include "Breakpoint.h"
-#include "CallData.h"
#include "DebuggerCallFrame.h"
#include "DebuggerPrimitives.h"
#include "JSCJSValue.h"
#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;
@@ -45,11 +43,9 @@ typedef ExecState CallFrame;
class JS_EXPORT_PRIVATE Debugger {
public:
- Debugger(VM&);
+ Debugger(bool isInWorkerThread = false);
virtual ~Debugger();
- VM& vm() { return m_vm; }
-
JSC::DebuggerCallFrame* currentDebuggerCallFrame() const;
bool hasHandlerForExceptionCallback() const
{
@@ -64,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);
@@ -87,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();
@@ -108,15 +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; }
- bool suppressAllPauses() const { return m_suppressAllPauses; }
- void setSuppressAllPauses(bool suppress) { m_suppressAllPauses = suppress; }
-
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,35 +102,34 @@ public:
void didExecuteProgram(CallFrame*);
void didReachBreakpoint(CallFrame*);
- virtual void recompileAllJSFunctions();
+ void recompileAllJSFunctions(VM*);
void registerCodeBlock(CodeBlock*);
- class ProfilingClient {
- public:
- virtual ~ProfilingClient() { }
- virtual bool isAlreadyProfiling() const = 0;
- virtual double willEvaluateScript() = 0;
- virtual void didEvaluateScript(double startTime, ProfilingReason) = 0;
- };
-
- void setProfilingClient(ProfilingClient*);
- bool hasProfilingClient() const { return m_profilingClient != nullptr; }
- bool isAlreadyProfiling() const { return m_profilingClient && m_profilingClient->isAlreadyProfiling(); }
- double willEvaluateScript();
- void didEvaluateScript(double startTime, ProfilingReason);
-
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;
@@ -205,7 +182,7 @@ private:
void clearDebuggerRequests(JSGlobalObject*);
- VM& m_vm;
+ VM* m_vm;
HashSet<JSGlobalObject*> m_globalObjects;
PauseOnExceptionsState m_pauseOnExceptionsState;
@@ -213,8 +190,8 @@ private:
bool m_isPaused : 1;
bool m_breakpointsActivated : 1;
bool m_hasHandlerForExceptionCallback : 1;
- bool m_suppressAllPauses : 1;
- unsigned m_steppingMode : 1; // SteppingMode
+ bool m_isInWorkerThread : 1;
+ SteppingMode m_steppingMode : 1;
ReasonForPause m_reasonForPause;
JSValue m_currentException;
@@ -224,15 +201,12 @@ private:
SourceID m_lastExecutedSourceID;
BreakpointID m_topBreakpointID;
- BreakpointID m_pausingBreakpointID;
BreakpointIDToBreakpointMap m_breakpointIDToBreakpoint;
SourceIDToBreakpointsMap m_sourceIDToBreakpoints;
RefPtr<JSC::DebuggerCallFrame> m_currentDebuggerCallFrame;
- ProfilingClient* m_profilingClient { nullptr };
-
- friend class DebuggerPausedScope;
+ friend class DebuggerCallFrameScope;
friend class TemporaryPausedState;
friend class LLIntOffsetsExtractor;
};