| 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/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 kDebugNotActive, | 79 kDebugNotActive, |
| 80 kDebugAsyncFunction, | 80 kDebugAsyncFunction, |
| 81 kDebugPromiseResolve, | 81 kDebugPromiseResolve, |
| 82 kDebugPromiseReject, | 82 kDebugPromiseReject, |
| 83 kDebugPromiseResolveThenableJob, | 83 kDebugPromiseResolveThenableJob, |
| 84 kDebugPromiseCollected, | 84 kDebugPromiseCollected, |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 class BreakLocation { | 87 class BreakLocation { |
| 88 public: | 88 public: |
| 89 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, | 89 static BreakLocation FromFrame(StandardFrame* frame); |
| 90 JavaScriptFrame* frame); | |
| 91 | 90 |
| 92 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, | 91 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, |
| 93 JavaScriptFrame* frame, | 92 JavaScriptFrame* frame, |
| 94 List<BreakLocation>* result_out); | 93 List<BreakLocation>* result_out); |
| 95 | 94 |
| 96 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } | 95 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } |
| 97 inline bool IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; } | 96 inline bool IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; } |
| 98 inline bool IsTailCall() const { | 97 inline bool IsTailCall() const { |
| 99 return type_ == DEBUG_BREAK_SLOT_AT_TAIL_CALL; | 98 return type_ == DEBUG_BREAK_SLOT_AT_TAIL_CALL; |
| 100 } | 99 } |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 Handle<Object> break_point_object, | 446 Handle<Object> break_point_object, |
| 448 int* source_position); | 447 int* source_position); |
| 449 bool SetBreakPointForScript(Handle<Script> script, | 448 bool SetBreakPointForScript(Handle<Script> script, |
| 450 Handle<Object> break_point_object, | 449 Handle<Object> break_point_object, |
| 451 int* source_position, | 450 int* source_position, |
| 452 BreakPositionAlignment alignment); | 451 BreakPositionAlignment alignment); |
| 453 void ClearBreakPoint(Handle<Object> break_point_object); | 452 void ClearBreakPoint(Handle<Object> break_point_object); |
| 454 void ChangeBreakOnException(ExceptionBreakType type, bool enable); | 453 void ChangeBreakOnException(ExceptionBreakType type, bool enable); |
| 455 bool IsBreakOnException(ExceptionBreakType type); | 454 bool IsBreakOnException(ExceptionBreakType type); |
| 456 | 455 |
| 456 // The parameter is either a BreakPointInfo object, or a FixedArray of |
| 457 // BreakPointInfo objects. |
| 458 // Returns an empty handle if no breakpoint is hit, or a FixedArray with all |
| 459 // hit breakpoints. |
| 460 MaybeHandle<FixedArray> GetHitBreakPointObjects( |
| 461 Handle<Object> break_point_objects); |
| 462 |
| 457 // Stepping handling. | 463 // Stepping handling. |
| 458 void PrepareStep(StepAction step_action); | 464 void PrepareStep(StepAction step_action); |
| 459 void PrepareStepIn(Handle<JSFunction> function); | 465 void PrepareStepIn(Handle<JSFunction> function); |
| 460 void PrepareStepInSuspendedGenerator(); | 466 void PrepareStepInSuspendedGenerator(); |
| 461 void PrepareStepOnThrow(); | 467 void PrepareStepOnThrow(); |
| 462 void ClearStepping(); | 468 void ClearStepping(); |
| 463 void ClearStepOut(); | 469 void ClearStepOut(); |
| 464 | 470 |
| 465 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); | 471 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); |
| 466 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, | 472 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 // Clear all code from instrumentation. | 633 // Clear all code from instrumentation. |
| 628 void ClearAllBreakPoints(); | 634 void ClearAllBreakPoints(); |
| 629 // Instrument a function with one-shots. | 635 // Instrument a function with one-shots. |
| 630 void FloodWithOneShot(Handle<JSFunction> function, | 636 void FloodWithOneShot(Handle<JSFunction> function, |
| 631 BreakLocatorType type = ALL_BREAK_LOCATIONS); | 637 BreakLocatorType type = ALL_BREAK_LOCATIONS); |
| 632 // Clear all one-shot instrumentations, but restore break points. | 638 // Clear all one-shot instrumentations, but restore break points. |
| 633 void ClearOneShot(); | 639 void ClearOneShot(); |
| 634 | 640 |
| 635 void ActivateStepOut(StackFrame* frame); | 641 void ActivateStepOut(StackFrame* frame); |
| 636 void RemoveDebugInfoAndClearFromShared(Handle<DebugInfo> debug_info); | 642 void RemoveDebugInfoAndClearFromShared(Handle<DebugInfo> debug_info); |
| 637 Handle<Object> CheckBreakPoints(Handle<DebugInfo> debug_info, | 643 MaybeHandle<FixedArray> CheckBreakPoints(Handle<DebugInfo> debug_info, |
| 638 BreakLocation* location, | 644 BreakLocation* location, |
| 639 bool* has_break_points = nullptr); | 645 bool* has_break_points = nullptr); |
| 640 bool IsMutedAtCurrentLocation(JavaScriptFrame* frame); | 646 bool IsMutedAtCurrentLocation(JavaScriptFrame* frame); |
| 641 bool CheckBreakPoint(Handle<Object> break_point_object); | 647 bool CheckBreakPoint(Handle<Object> break_point_object); |
| 642 MaybeHandle<Object> CallFunction(const char* name, int argc, | 648 MaybeHandle<Object> CallFunction(const char* name, int argc, |
| 643 Handle<Object> args[]); | 649 Handle<Object> args[]); |
| 644 | 650 |
| 645 inline void AssertDebugContext() { | 651 inline void AssertDebugContext() { |
| 646 DCHECK(isolate_->context() == *debug_context()); | 652 DCHECK(isolate_->context() == *debug_context()); |
| 647 DCHECK(in_debug_scope()); | 653 DCHECK(in_debug_scope()); |
| 648 } | 654 } |
| 649 | 655 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 Handle<Code> code); | 835 Handle<Code> code); |
| 830 static bool DebugBreakSlotIsPatched(Address pc); | 836 static bool DebugBreakSlotIsPatched(Address pc); |
| 831 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 837 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
| 832 }; | 838 }; |
| 833 | 839 |
| 834 | 840 |
| 835 } // namespace internal | 841 } // namespace internal |
| 836 } // namespace v8 | 842 } // namespace v8 |
| 837 | 843 |
| 838 #endif // V8_DEBUG_DEBUG_H_ | 844 #endif // V8_DEBUG_DEBUG_H_ |
| OLD | NEW |