Index: src/debug/interface-types.h |
diff --git a/src/debug/interface-types.h b/src/debug/interface-types.h |
index 05f2179231252e9d87f975d49ba34efbc1993566..1464415117e1793c3f38af20aa67b00f9611d0f0 100644 |
--- a/src/debug/interface-types.h |
+++ b/src/debug/interface-types.h |
@@ -9,6 +9,8 @@ |
#include <string> |
#include <vector> |
+#include "include/v8-debug.h" |
+ |
namespace v8 { |
namespace debug { |
@@ -59,6 +61,91 @@ struct WasmDisassembly { |
OffsetTable offset_table; |
}; |
+enum ExceptionBreakState { |
+ NoBreakOnException = 0, |
+ BreakOnUncaughtException = 1, |
+ BreakOnAnyException = 2 |
+}; |
+ |
+/** |
+ * An event details object passed to the debug event listener. |
+ */ |
+class EventDetails : public v8::Debug::EventDetails { |
+ public: |
+ /** |
+ * Event type. |
+ */ |
+ virtual v8::DebugEvent GetEvent() const = 0; |
+ |
+ /** |
+ * Access to execution state and event data of the debug event. Don't store |
+ * these cross callbacks as their content becomes invalid. |
+ */ |
+ virtual Local<Object> GetExecutionState() const = 0; |
+ virtual Local<Object> GetEventData() const = 0; |
+ |
+ /** |
+ * Get the context active when the debug event happened. Note this is not |
+ * the current active context as the JavaScript part of the debugger is |
+ * running in its own context which is entered at this point. |
+ */ |
+ virtual Local<Context> GetEventContext() const = 0; |
+ |
+ /** |
+ * Client data passed with the corresponding callback when it was |
+ * registered. |
+ */ |
+ virtual Local<Value> GetCallbackData() const = 0; |
+ |
+ virtual ~EventDetails() {} |
+}; |
+ |
+/** |
+ * Native wrapper around v8::internal::Script object. |
+ */ |
+class Script { |
+ public: |
+ v8::Isolate* GetIsolate() const; |
+ |
+ ScriptOriginOptions OriginOptions() const; |
+ bool WasCompiled() const; |
+ int Id() const; |
+ int LineOffset() const; |
+ int ColumnOffset() const; |
+ std::vector<int> LineEnds() const; |
+ MaybeLocal<String> Name() const; |
+ MaybeLocal<String> SourceURL() const; |
+ MaybeLocal<String> SourceMappingURL() const; |
+ MaybeLocal<String> ContextData() const; |
+ MaybeLocal<String> Source() const; |
+ bool IsWasm() const; |
+ bool GetPossibleBreakpoints(const debug::Location& start, |
+ const debug::Location& end, |
+ std::vector<debug::Location>* locations) const; |
+ |
+ /** |
+ * script parameter is a wrapper v8::internal::JSObject for |
+ * v8::internal::Script. |
+ * This function gets v8::internal::Script from v8::internal::JSObject and |
+ * wraps it with DebugInterface::Script. |
+ * Returns empty local if not called with a valid wrapper of |
+ * v8::internal::Script. |
+ */ |
+ static MaybeLocal<Script> Wrap(Isolate* isolate, |
+ v8::Local<v8::Object> script); |
+ |
+ private: |
+ int GetSourcePosition(const debug::Location& location) const; |
+}; |
+ |
+enum StepAction { |
+ StepOut = 0, // Step out of the current function. |
+ StepNext = 1, // Step to the next statement in the current function. |
+ StepIn = 2, // Step into new functions invoked or the next statement |
+ // in the current function. |
+ StepFrame = 3 // Step into a new frame or return to previous frame. |
+}; |
+ |
} // namespace debug |
} // namespace v8 |