| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef RUNTIME_VM_DEBUGGER_H_ | 5 #ifndef RUNTIME_VM_DEBUGGER_H_ |
| 6 #define RUNTIME_VM_DEBUGGER_H_ | 6 #define RUNTIME_VM_DEBUGGER_H_ |
| 7 | 7 |
| 8 #include "include/dart_tools_api.h" | 8 #include "include/dart_tools_api.h" |
| 9 | 9 |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 void GetVarDescriptors(); | 354 void GetVarDescriptors(); |
| 355 void GetDescIndices(); | 355 void GetDescIndices(); |
| 356 | 356 |
| 357 RawObject* GetAsyncContextVariable(const String& name); | 357 RawObject* GetAsyncContextVariable(const String& name); |
| 358 RawObject* GetAsyncStreamControllerStreamAwaiter(const Object& stream); | 358 RawObject* GetAsyncStreamControllerStreamAwaiter(const Object& stream); |
| 359 RawObject* GetAsyncStreamControllerStream(); | 359 RawObject* GetAsyncStreamControllerStream(); |
| 360 RawObject* GetAsyncCompleterAwaiter(const Object& completer); | 360 RawObject* GetAsyncCompleterAwaiter(const Object& completer); |
| 361 RawObject* GetAsyncCompleter(); | 361 RawObject* GetAsyncCompleter(); |
| 362 void ExtractTokenPositionFromAsyncClosure(); | 362 void ExtractTokenPositionFromAsyncClosure(); |
| 363 | 363 |
| 364 bool IsAsyncMachinery() const; |
| 365 |
| 364 static const char* KindToCString(Kind kind) { | 366 static const char* KindToCString(Kind kind) { |
| 365 switch (kind) { | 367 switch (kind) { |
| 366 case kRegular: | 368 case kRegular: |
| 367 return "Regular"; | 369 return "Regular"; |
| 368 case kAsyncCausal: | 370 case kAsyncCausal: |
| 369 return "AsyncCausal"; | 371 return "AsyncCausal"; |
| 370 case kAsyncSuspensionMarker: | 372 case kAsyncSuspensionMarker: |
| 371 return "AsyncSuspensionMarker"; | 373 return "AsyncSuspensionMarker"; |
| 372 case kAsyncActivation: | 374 case kAsyncActivation: |
| 373 return "AsyncActivation"; | 375 return "AsyncActivation"; |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 | 710 |
| 709 // Can we rewind to the indicated frame? | 711 // Can we rewind to the indicated frame? |
| 710 bool CanRewindFrame(intptr_t frame_index, const char** error) const; | 712 bool CanRewindFrame(intptr_t frame_index, const char** error) const; |
| 711 | 713 |
| 712 void RewindToFrame(intptr_t frame_index); | 714 void RewindToFrame(intptr_t frame_index); |
| 713 void RewindToUnoptimizedFrame(StackFrame* frame, const Code& code); | 715 void RewindToUnoptimizedFrame(StackFrame* frame, const Code& code); |
| 714 void RewindToOptimizedFrame(StackFrame* frame, | 716 void RewindToOptimizedFrame(StackFrame* frame, |
| 715 const Code& code, | 717 const Code& code, |
| 716 intptr_t post_deopt_frame_index); | 718 intptr_t post_deopt_frame_index); |
| 717 | 719 |
| 720 void ResetSteppingFramePointers(); |
| 721 bool SteppedForSyntheticAsyncBreakpoint() const; |
| 722 void CleanupSyntheticAsyncBreakpoint(); |
| 723 void RememberTopFrameAwaiter(); |
| 724 void SetAsyncSteppingFramePointer(); |
| 725 |
| 718 Isolate* isolate_; | 726 Isolate* isolate_; |
| 719 Dart_Port isolate_id_; // A unique ID for the isolate in the debugger. | 727 Dart_Port isolate_id_; // A unique ID for the isolate in the debugger. |
| 720 bool initialized_; | 728 bool initialized_; |
| 721 | 729 |
| 722 // ID number generator. | 730 // ID number generator. |
| 723 intptr_t next_id_; | 731 intptr_t next_id_; |
| 724 | 732 |
| 725 BreakpointLocation* latent_locations_; | 733 BreakpointLocation* latent_locations_; |
| 726 BreakpointLocation* breakpoint_locations_; | 734 BreakpointLocation* breakpoint_locations_; |
| 727 CodeBreakpoint* code_breakpoints_; | 735 CodeBreakpoint* code_breakpoints_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 747 | 755 |
| 748 // Current stack trace. Valid only while IsPaused(). | 756 // Current stack trace. Valid only while IsPaused(). |
| 749 DebuggerStackTrace* stack_trace_; | 757 DebuggerStackTrace* stack_trace_; |
| 750 DebuggerStackTrace* async_causal_stack_trace_; | 758 DebuggerStackTrace* async_causal_stack_trace_; |
| 751 DebuggerStackTrace* awaiter_stack_trace_; | 759 DebuggerStackTrace* awaiter_stack_trace_; |
| 752 | 760 |
| 753 // When stepping through code, only pause the program if the top | 761 // When stepping through code, only pause the program if the top |
| 754 // frame corresponds to this fp value, or if the top frame is | 762 // frame corresponds to this fp value, or if the top frame is |
| 755 // lower on the stack. | 763 // lower on the stack. |
| 756 uword stepping_fp_; | 764 uword stepping_fp_; |
| 765 // Used to track the current async/async* function. |
| 766 uword async_stepping_fp_; |
| 767 RawObject* top_frame_awaiter_; |
| 757 | 768 |
| 758 // If we step while at a breakpoint, we would hit the same pc twice. | 769 // If we step while at a breakpoint, we would hit the same pc twice. |
| 759 // We use this field to let us skip the next single-step after a | 770 // We use this field to let us skip the next single-step after a |
| 760 // breakpoint. | 771 // breakpoint. |
| 761 bool skip_next_step_; | 772 bool skip_next_step_; |
| 762 | 773 |
| 763 bool needs_breakpoint_cleanup_; | 774 bool needs_breakpoint_cleanup_; |
| 764 | 775 |
| 765 // We keep this breakpoint alive until after the debugger does the step over | 776 // We keep this breakpoint alive until after the debugger does the step over |
| 766 // async continuation machinery so that we can report that we've stopped | 777 // async continuation machinery so that we can report that we've stopped |
| 767 // at the breakpoint. | 778 // at the breakpoint. |
| 768 Breakpoint* synthetic_async_breakpoint_; | 779 Breakpoint* synthetic_async_breakpoint_; |
| 769 | 780 |
| 770 Dart_ExceptionPauseInfo exc_pause_info_; | 781 Dart_ExceptionPauseInfo exc_pause_info_; |
| 771 | 782 |
| 772 static EventHandler* event_handler_; | 783 static EventHandler* event_handler_; |
| 773 | 784 |
| 774 friend class Isolate; | 785 friend class Isolate; |
| 775 friend class BreakpointLocation; | 786 friend class BreakpointLocation; |
| 776 DISALLOW_COPY_AND_ASSIGN(Debugger); | 787 DISALLOW_COPY_AND_ASSIGN(Debugger); |
| 777 }; | 788 }; |
| 778 | 789 |
| 779 | 790 |
| 780 } // namespace dart | 791 } // namespace dart |
| 781 | 792 |
| 782 #endif // RUNTIME_VM_DEBUGGER_H_ | 793 #endif // RUNTIME_VM_DEBUGGER_H_ |
| OLD | NEW |