| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ | 5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ |
| 6 #define V8_DEBUG_DEBUG_INTERFACE_H_ | 6 #define V8_DEBUG_DEBUG_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "include/v8-debug.h" | 10 #include "include/v8-debug.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 * Out-of-memory callback function. | 100 * Out-of-memory callback function. |
| 101 * The function is invoked when the heap size is close to the hard limit. | 101 * The function is invoked when the heap size is close to the hard limit. |
| 102 * | 102 * |
| 103 * \param data the parameter provided during callback installation. | 103 * \param data the parameter provided during callback installation. |
| 104 */ | 104 */ |
| 105 typedef void (*OutOfMemoryCallback)(void* data); | 105 typedef void (*OutOfMemoryCallback)(void* data); |
| 106 void SetOutOfMemoryCallback(Isolate* isolate, OutOfMemoryCallback callback, | 106 void SetOutOfMemoryCallback(Isolate* isolate, OutOfMemoryCallback callback, |
| 107 void* data); | 107 void* data); |
| 108 | 108 |
| 109 /** | 109 /** |
| 110 * Native wrapper around v8::internal::BreakPoint object. |
| 111 */ |
| 112 class BreakPoint { |
| 113 public: |
| 114 static Local<BreakPoint> New(Isolate* isolate, Local<String> condition, |
| 115 Local<Value> data); |
| 116 static MaybeLocal<BreakPoint> Cast(Isolate* isolate, |
| 117 v8::Local<v8::Value> break_point); |
| 118 |
| 119 v8::Local<v8::Value> Data() const; |
| 120 }; |
| 121 |
| 122 /** |
| 110 * Native wrapper around v8::internal::Script object. | 123 * Native wrapper around v8::internal::Script object. |
| 111 */ | 124 */ |
| 112 class Script { | 125 class Script { |
| 113 public: | 126 public: |
| 114 v8::Isolate* GetIsolate() const; | 127 v8::Isolate* GetIsolate() const; |
| 115 | 128 |
| 116 ScriptOriginOptions OriginOptions() const; | 129 ScriptOriginOptions OriginOptions() const; |
| 117 bool WasCompiled() const; | 130 bool WasCompiled() const; |
| 118 int Id() const; | 131 int Id() const; |
| 119 int LineOffset() const; | 132 int LineOffset() const; |
| 120 int ColumnOffset() const; | 133 int ColumnOffset() const; |
| 121 std::vector<int> LineEnds() const; | 134 std::vector<int> LineEnds() const; |
| 122 MaybeLocal<String> Name() const; | 135 MaybeLocal<String> Name() const; |
| 123 MaybeLocal<String> SourceURL() const; | 136 MaybeLocal<String> SourceURL() const; |
| 124 MaybeLocal<String> SourceMappingURL() const; | 137 MaybeLocal<String> SourceMappingURL() const; |
| 125 MaybeLocal<Value> ContextData() const; | 138 MaybeLocal<Value> ContextData() const; |
| 126 MaybeLocal<String> Source() const; | 139 MaybeLocal<String> Source() const; |
| 127 bool IsWasm() const; | 140 bool IsWasm() const; |
| 128 bool IsModule() const; | 141 bool IsModule() const; |
| 129 bool GetPossibleBreakpoints(const debug::Location& start, | 142 bool GetPossibleBreakpoints(const debug::Location& start, |
| 130 const debug::Location& end, | 143 const debug::Location& end, |
| 131 std::vector<debug::Location>* locations) const; | 144 std::vector<debug::Location>* locations) const; |
| 145 debug::Location SetBreakPoint(const debug::Location& position, |
| 146 Local<debug::BreakPoint> break_point) const; |
| 132 | 147 |
| 133 private: | 148 private: |
| 134 int GetSourcePosition(const debug::Location& location) const; | 149 int GetSourcePosition(const debug::Location& location) const; |
| 135 }; | 150 }; |
| 136 | 151 |
| 152 void ClearBreakPoint(v8::Isolate* isolate, Local<BreakPoint> break_point); |
| 153 |
| 137 // Specialization for wasm Scripts. | 154 // Specialization for wasm Scripts. |
| 138 class WasmScript : public Script { | 155 class WasmScript : public Script { |
| 139 public: | 156 public: |
| 140 static WasmScript* Cast(Script* script); | 157 static WasmScript* Cast(Script* script); |
| 141 | 158 |
| 142 int NumFunctions() const; | 159 int NumFunctions() const; |
| 143 int NumImportedFunctions() const; | 160 int NumImportedFunctions() const; |
| 144 | 161 |
| 145 std::pair<int, int> GetFunctionRange(int function_index) const; | 162 std::pair<int, int> GetFunctionRange(int function_index) const; |
| 146 | 163 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 debug::Location SuspendedLocation(); | 212 debug::Location SuspendedLocation(); |
| 196 bool IsSuspended(); | 213 bool IsSuspended(); |
| 197 | 214 |
| 198 static v8::Local<debug::GeneratorObject> Cast(v8::Local<v8::Value> value); | 215 static v8::Local<debug::GeneratorObject> Cast(v8::Local<v8::Value> value); |
| 199 }; | 216 }; |
| 200 | 217 |
| 201 } // namespace debug | 218 } // namespace debug |
| 202 } // namespace v8 | 219 } // namespace v8 |
| 203 | 220 |
| 204 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 221 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
| OLD | NEW |