Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_H_ | 5 #ifndef V8_DEBUG_DEBUG_H_ |
| 6 #define V8_DEBUG_DEBUG_H_ | 6 #define V8_DEBUG_DEBUG_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
| 10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 | 58 |
| 59 enum DebugBreakType { | 59 enum DebugBreakType { |
| 60 NOT_DEBUG_BREAK, | 60 NOT_DEBUG_BREAK, |
| 61 DEBUGGER_STATEMENT, | 61 DEBUGGER_STATEMENT, |
| 62 DEBUG_BREAK_SLOT, | 62 DEBUG_BREAK_SLOT, |
| 63 DEBUG_BREAK_SLOT_AT_CALL, | 63 DEBUG_BREAK_SLOT_AT_CALL, |
| 64 DEBUG_BREAK_SLOT_AT_RETURN, | 64 DEBUG_BREAK_SLOT_AT_RETURN, |
| 65 DEBUG_BREAK_SLOT_AT_TAIL_CALL, | 65 DEBUG_BREAK_SLOT_AT_TAIL_CALL, |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 enum IgnoreBreakMode { kAllFramesBlackboxed, kTopFrameBlackboxed }; | |
|
dgozman
2017/03/09 23:04:01
kIgnoreIfAllFramesBlackboxed, kIgnoreIfTopFrameBla
kozy
2017/03/10 03:14:55
Done.
| |
| 69 | |
| 68 class BreakLocation { | 70 class BreakLocation { |
| 69 public: | 71 public: |
| 70 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, | 72 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, |
| 71 JavaScriptFrame* frame); | 73 JavaScriptFrame* frame); |
| 72 | 74 |
| 73 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, | 75 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, |
| 74 JavaScriptFrame* frame, | 76 JavaScriptFrame* frame, |
| 75 List<BreakLocation>* result_out); | 77 List<BreakLocation>* result_out); |
| 76 | 78 |
| 77 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } | 79 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 void OnThrow(Handle<Object> exception); | 271 void OnThrow(Handle<Object> exception); |
| 270 void OnPromiseReject(Handle<Object> promise, Handle<Object> value); | 272 void OnPromiseReject(Handle<Object> promise, Handle<Object> value); |
| 271 void OnCompileError(Handle<Script> script); | 273 void OnCompileError(Handle<Script> script); |
| 272 void OnAfterCompile(Handle<Script> script); | 274 void OnAfterCompile(Handle<Script> script); |
| 273 void OnAsyncTaskEvent(debug::PromiseDebugActionType type, int id, | 275 void OnAsyncTaskEvent(debug::PromiseDebugActionType type, int id, |
| 274 int parent_id); | 276 int parent_id); |
| 275 | 277 |
| 276 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<Object> fun, | 278 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<Object> fun, |
| 277 Handle<Object> data); | 279 Handle<Object> data); |
| 278 Handle<Context> GetDebugContext(); | 280 Handle<Context> GetDebugContext(); |
| 279 void HandleDebugBreak(); | 281 void HandleDebugBreak(IgnoreBreakMode ignore_break_mode); |
| 280 | 282 |
| 281 // Internal logic | 283 // Internal logic |
| 282 bool Load(); | 284 bool Load(); |
| 283 void Break(JavaScriptFrame* frame); | 285 void Break(JavaScriptFrame* frame); |
| 284 | 286 |
| 285 // Scripts handling. | 287 // Scripts handling. |
| 286 Handle<FixedArray> GetLoadedScripts(); | 288 Handle<FixedArray> GetLoadedScripts(); |
| 287 | 289 |
| 288 // Break point handling. | 290 // Break point handling. |
| 289 bool SetBreakPoint(Handle<JSFunction> function, | 291 bool SetBreakPoint(Handle<JSFunction> function, |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 // Clear code from instrumentation. | 485 // Clear code from instrumentation. |
| 484 void ClearBreakPoints(Handle<DebugInfo> debug_info); | 486 void ClearBreakPoints(Handle<DebugInfo> debug_info); |
| 485 // Clear all code from instrumentation. | 487 // Clear all code from instrumentation. |
| 486 void ClearAllBreakPoints(); | 488 void ClearAllBreakPoints(); |
| 487 // Instrument a function with one-shots. | 489 // Instrument a function with one-shots. |
| 488 void FloodWithOneShot(Handle<SharedFunctionInfo> function); | 490 void FloodWithOneShot(Handle<SharedFunctionInfo> function); |
| 489 // Clear all one-shot instrumentations, but restore break points. | 491 // Clear all one-shot instrumentations, but restore break points. |
| 490 void ClearOneShot(); | 492 void ClearOneShot(); |
| 491 | 493 |
| 492 bool IsFrameBlackboxed(JavaScriptFrame* frame); | 494 bool IsFrameBlackboxed(JavaScriptFrame* frame); |
| 495 bool IsTopFrameBlackboxed(); | |
| 493 | 496 |
| 494 void ActivateStepOut(StackFrame* frame); | 497 void ActivateStepOut(StackFrame* frame); |
| 495 void RemoveDebugInfoAndClearFromShared(Handle<DebugInfo> debug_info); | 498 void RemoveDebugInfoAndClearFromShared(Handle<DebugInfo> debug_info); |
| 496 MaybeHandle<FixedArray> CheckBreakPoints(Handle<DebugInfo> debug_info, | 499 MaybeHandle<FixedArray> CheckBreakPoints(Handle<DebugInfo> debug_info, |
| 497 BreakLocation* location, | 500 BreakLocation* location, |
| 498 bool* has_break_points = nullptr); | 501 bool* has_break_points = nullptr); |
| 499 bool IsMutedAtCurrentLocation(JavaScriptFrame* frame); | 502 bool IsMutedAtCurrentLocation(JavaScriptFrame* frame); |
| 500 bool CheckBreakPoint(Handle<Object> break_point_object); | 503 bool CheckBreakPoint(Handle<Object> break_point_object); |
| 501 MaybeHandle<Object> CallFunction(const char* name, int argc, | 504 MaybeHandle<Object> CallFunction(const char* name, int argc, |
| 502 Handle<Object> args[]); | 505 Handle<Object> args[]); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 794 Handle<Code> code); | 797 Handle<Code> code); |
| 795 static bool DebugBreakSlotIsPatched(Address pc); | 798 static bool DebugBreakSlotIsPatched(Address pc); |
| 796 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 799 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
| 797 }; | 800 }; |
| 798 | 801 |
| 799 | 802 |
| 800 } // namespace internal | 803 } // namespace internal |
| 801 } // namespace v8 | 804 } // namespace v8 |
| 802 | 805 |
| 803 #endif // V8_DEBUG_DEBUG_H_ | 806 #endif // V8_DEBUG_DEBUG_H_ |
| OLD | NEW |