Chromium Code Reviews| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 * Defines if VM will pause on exceptions or not. | 79 * Defines if VM will pause on exceptions or not. |
| 80 * If BreakOnAnyExceptions is set then VM will pause on caught and uncaught | 80 * If BreakOnAnyExceptions is set then VM will pause on caught and uncaught |
| 81 * exception, if BreakOnUncaughtException is set then VM will pause only on | 81 * exception, if BreakOnUncaughtException is set then VM will pause only on |
| 82 * uncaught exception, otherwise VM won't stop on any exception. | 82 * uncaught exception, otherwise VM won't stop on any exception. |
| 83 */ | 83 */ |
| 84 void ChangeBreakOnException(Isolate* isolate, ExceptionBreakState state); | 84 void ChangeBreakOnException(Isolate* isolate, ExceptionBreakState state); |
| 85 | 85 |
| 86 enum StepAction { | 86 enum StepAction { |
| 87 StepOut = 0, // Step out of the current function. | 87 StepOut = 0, // Step out of the current function. |
| 88 StepNext = 1, // Step to the next statement in the current function. | 88 StepNext = 1, // Step to the next statement in the current function. |
| 89 StepIn = 2, // Step into new functions invoked or the next statement | 89 StepIn = 2 // Step into new functions invoked or the next statement |
| 90 // in the current function. | 90 // in the current function. |
| 91 StepFrame = 3 // Step into a new frame or return to previous frame. | |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 void PrepareStep(Isolate* isolate, StepAction action); | 93 void PrepareStep(Isolate* isolate, StepAction action); |
| 95 void ClearStepping(Isolate* isolate); | |
| 96 | 94 |
| 97 /** | 95 /** |
| 98 * Out-of-memory callback function. | 96 * Out-of-memory callback function. |
| 99 * The function is invoked when the heap size is close to the hard limit. | 97 * The function is invoked when the heap size is close to the hard limit. |
| 100 * | 98 * |
| 101 * \param data the parameter provided during callback installation. | 99 * \param data the parameter provided during callback installation. |
| 102 */ | 100 */ |
| 103 typedef void (*OutOfMemoryCallback)(void* data); | 101 typedef void (*OutOfMemoryCallback)(void* data); |
| 104 void SetOutOfMemoryCallback(Isolate* isolate, OutOfMemoryCallback callback, | 102 void SetOutOfMemoryCallback(Isolate* isolate, OutOfMemoryCallback callback, |
| 105 void* data); | 103 void* data); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 119 std::vector<int> LineEnds() const; | 117 std::vector<int> LineEnds() const; |
| 120 MaybeLocal<String> Name() const; | 118 MaybeLocal<String> Name() const; |
| 121 MaybeLocal<String> SourceURL() const; | 119 MaybeLocal<String> SourceURL() const; |
| 122 MaybeLocal<String> SourceMappingURL() const; | 120 MaybeLocal<String> SourceMappingURL() const; |
| 123 MaybeLocal<Value> ContextData() const; | 121 MaybeLocal<Value> ContextData() const; |
| 124 MaybeLocal<String> Source() const; | 122 MaybeLocal<String> Source() const; |
| 125 bool IsWasm() const; | 123 bool IsWasm() const; |
| 126 bool GetPossibleBreakpoints(const debug::Location& start, | 124 bool GetPossibleBreakpoints(const debug::Location& start, |
| 127 const debug::Location& end, | 125 const debug::Location& end, |
| 128 std::vector<debug::Location>* locations) const; | 126 std::vector<debug::Location>* locations) const; |
| 127 void BlackboxStateChanged() const; | |
|
dgozman
2017/01/19 21:49:14
Does it make sense to push ranges here instead of
dgozman
2017/01/19 22:34:20
- ResetBlackboxedStateCache
- Make it a separate f
kozy
2017/01/20 02:32:36
Done.
kozy
2017/01/20 02:32:36
Acknowledged.
| |
| 129 | 128 |
| 130 private: | 129 private: |
| 131 int GetSourcePosition(const debug::Location& location) const; | 130 int GetSourcePosition(const debug::Location& location) const; |
| 132 }; | 131 }; |
| 133 | 132 |
| 134 // Specialization for wasm Scripts. | 133 // Specialization for wasm Scripts. |
| 135 class WasmScript : public Script { | 134 class WasmScript : public Script { |
| 136 public: | 135 public: |
| 137 static WasmScript* Cast(Script* script); | 136 static WasmScript* Cast(Script* script); |
| 138 | 137 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 158 v8::Local<v8::Object> exec_state, | 157 v8::Local<v8::Object> exec_state, |
| 159 v8::Local<v8::Value> break_points_hit) {} | 158 v8::Local<v8::Value> break_points_hit) {} |
| 160 virtual void ExceptionThrown(v8::Local<v8::Context> paused_context, | 159 virtual void ExceptionThrown(v8::Local<v8::Context> paused_context, |
| 161 v8::Local<v8::Object> exec_state, | 160 v8::Local<v8::Object> exec_state, |
| 162 v8::Local<v8::Value> exception, | 161 v8::Local<v8::Value> exception, |
| 163 bool is_promise_rejection, bool is_uncaught) {} | 162 bool is_promise_rejection, bool is_uncaught) {} |
| 164 }; | 163 }; |
| 165 | 164 |
| 166 void SetDebugEventListener(Isolate* isolate, DebugEventListener* listener); | 165 void SetDebugEventListener(Isolate* isolate, DebugEventListener* listener); |
| 167 | 166 |
| 167 typedef std::function<bool(v8::Local<debug::Script> script, | |
| 168 const debug::Location& start, | |
| 169 const debug::Location& end, void* data)> | |
| 170 IsBlackboxedCallback; | |
| 171 void SetIsBlackboxedCallback(Isolate* isolate, IsBlackboxedCallback callback, | |
|
dgozman
2017/01/19 21:49:14
Make this a part of DebugEventListener?
kozy
2017/01/20 02:32:37
DebugEventListener -> DebugDelegate and done.
| |
| 172 void* data); | |
| 173 | |
| 174 bool HasUserFrameOnStack(Isolate* isolate); | |
|
dgozman
2017/01/19 21:49:14
- Let's move this closer to other functions (e.g.n
kozy
2017/01/20 02:32:37
Done.
| |
| 175 | |
| 168 } // namespace debug | 176 } // namespace debug |
| 169 } // namespace v8 | 177 } // namespace v8 |
| 170 | 178 |
| 171 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 179 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
| OLD | NEW |