| 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_H_ | 5 #ifndef V8_DEBUG_H_ |
| 6 #define V8_DEBUG_H_ | 6 #define V8_DEBUG_H_ |
| 7 | 7 |
| 8 #include "allocation.h" | 8 #include "allocation.h" |
| 9 #include "arguments.h" | 9 #include "arguments.h" |
| 10 #include "assembler.h" | 10 #include "assembler.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 bool old_state_; | 406 bool old_state_; |
| 407 DISALLOW_COPY_AND_ASSIGN(IgnoreScope); | 407 DISALLOW_COPY_AND_ASSIGN(IgnoreScope); |
| 408 }; | 408 }; |
| 409 | 409 |
| 410 | 410 |
| 411 bool Load(); | 411 bool Load(); |
| 412 void Unload(); | 412 void Unload(); |
| 413 bool IsLoaded() { return !debug_context_.is_null(); } | 413 bool IsLoaded() { return !debug_context_.is_null(); } |
| 414 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } | 414 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } |
| 415 | 415 |
| 416 Object* Break(Arguments args); | 416 void Break(Arguments args, JavaScriptFrame*); |
| 417 void SetAfterBreakTarget(JavaScriptFrame* frame); |
| 417 bool SetBreakPoint(Handle<JSFunction> function, | 418 bool SetBreakPoint(Handle<JSFunction> function, |
| 418 Handle<Object> break_point_object, | 419 Handle<Object> break_point_object, |
| 419 int* source_position); | 420 int* source_position); |
| 420 bool SetBreakPointForScript(Handle<Script> script, | 421 bool SetBreakPointForScript(Handle<Script> script, |
| 421 Handle<Object> break_point_object, | 422 Handle<Object> break_point_object, |
| 422 int* source_position, | 423 int* source_position, |
| 423 BreakPositionAlignment alignment); | 424 BreakPositionAlignment alignment); |
| 424 void ClearBreakPoint(Handle<Object> break_point_object); | 425 void ClearBreakPoint(Handle<Object> break_point_object); |
| 425 void ClearAllBreakPoints(); | 426 void ClearAllBreakPoints(); |
| 426 void FloodWithOneShot(Handle<JSFunction> function); | 427 void FloodWithOneShot(Handle<JSFunction> function); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 bool break_on_uncaught_exception() { | 533 bool break_on_uncaught_exception() { |
| 533 return break_on_uncaught_exception_; | 534 return break_on_uncaught_exception_; |
| 534 } | 535 } |
| 535 | 536 |
| 536 void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id, | 537 void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id, |
| 537 LiveEdit::FrameDropMode mode, | 538 LiveEdit::FrameDropMode mode, |
| 538 Object** restarter_frame_function_pointer); | 539 Object** restarter_frame_function_pointer); |
| 539 | 540 |
| 540 // Support for setting the address to jump to when returning from break point. | 541 // Support for setting the address to jump to when returning from break point. |
| 541 Address after_break_target_address() { | 542 Address after_break_target_address() { |
| 542 return reinterpret_cast<Address>(&thread_local_.after_break_target_); | 543 return reinterpret_cast<Address>(&after_break_target_); |
| 543 } | 544 } |
| 544 | 545 |
| 545 Address restarter_frame_function_pointer_address() { | 546 Address restarter_frame_function_pointer_address() { |
| 546 Object*** address = &thread_local_.restarter_frame_function_pointer_; | 547 Object*** address = &thread_local_.restarter_frame_function_pointer_; |
| 547 return reinterpret_cast<Address>(address); | 548 return reinterpret_cast<Address>(address); |
| 548 } | 549 } |
| 549 | 550 |
| 550 static const int kEstimatedNofBreakPointsInFunction = 16; | 551 static const int kEstimatedNofBreakPointsInFunction = 16; |
| 551 | 552 |
| 552 // Passed to MakeWeak. | 553 // Passed to MakeWeak. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 } | 628 } |
| 628 | 629 |
| 629 static bool CompileDebuggerScript(Isolate* isolate, int index); | 630 static bool CompileDebuggerScript(Isolate* isolate, int index); |
| 630 void ClearOneShot(); | 631 void ClearOneShot(); |
| 631 void ActivateStepIn(StackFrame* frame); | 632 void ActivateStepIn(StackFrame* frame); |
| 632 void ClearStepIn(); | 633 void ClearStepIn(); |
| 633 void ActivateStepOut(StackFrame* frame); | 634 void ActivateStepOut(StackFrame* frame); |
| 634 void ClearStepNext(); | 635 void ClearStepNext(); |
| 635 // Returns whether the compile succeeded. | 636 // Returns whether the compile succeeded. |
| 636 void RemoveDebugInfo(Handle<DebugInfo> debug_info); | 637 void RemoveDebugInfo(Handle<DebugInfo> debug_info); |
| 637 void SetAfterBreakTarget(JavaScriptFrame* frame); | |
| 638 Handle<Object> CheckBreakPoints(Handle<Object> break_point); | 638 Handle<Object> CheckBreakPoints(Handle<Object> break_point); |
| 639 bool CheckBreakPoint(Handle<Object> break_point_object); | 639 bool CheckBreakPoint(Handle<Object> break_point_object); |
| 640 | 640 |
| 641 void EnsureFunctionHasDebugBreakSlots(Handle<JSFunction> function); | 641 void EnsureFunctionHasDebugBreakSlots(Handle<JSFunction> function); |
| 642 void RecompileAndRelocateSuspendedGenerators( | 642 void RecompileAndRelocateSuspendedGenerators( |
| 643 const List<Handle<JSGeneratorObject> > &suspended_generators); | 643 const List<Handle<JSGeneratorObject> > &suspended_generators); |
| 644 | 644 |
| 645 void ThreadInit(); | 645 void ThreadInit(); |
| 646 | 646 |
| 647 class PromiseOnStack { | 647 class PromiseOnStack { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 676 bool ignore_debugger_; | 676 bool ignore_debugger_; |
| 677 bool live_edit_enabled_; | 677 bool live_edit_enabled_; |
| 678 bool has_break_points_; | 678 bool has_break_points_; |
| 679 bool disable_break_; | 679 bool disable_break_; |
| 680 bool break_on_exception_; | 680 bool break_on_exception_; |
| 681 bool break_on_uncaught_exception_; | 681 bool break_on_uncaught_exception_; |
| 682 | 682 |
| 683 ScriptCache* script_cache_; // Cache of all scripts in the heap. | 683 ScriptCache* script_cache_; // Cache of all scripts in the heap. |
| 684 DebugInfoListNode* debug_info_list_; // List of active debug info objects. | 684 DebugInfoListNode* debug_info_list_; // List of active debug info objects. |
| 685 | 685 |
| 686 // Storage location for jump when exiting debug break calls. |
| 687 // Note that this address is not GC safe. It should be computed immediately |
| 688 // before returning to the DebugBreakCallHelper. |
| 689 Address after_break_target_; |
| 690 |
| 686 // Per-thread data. | 691 // Per-thread data. |
| 687 class ThreadLocal { | 692 class ThreadLocal { |
| 688 public: | 693 public: |
| 689 // Top debugger entry. | 694 // Top debugger entry. |
| 690 EnterDebugger* debugger_entry_; | 695 EnterDebugger* debugger_entry_; |
| 691 | 696 |
| 692 // Counter for generating next break id. | 697 // Counter for generating next break id. |
| 693 int break_count_; | 698 int break_count_; |
| 694 | 699 |
| 695 // Current break id. | 700 // Current break id. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 713 // Number of queued steps left to perform before debug event. | 718 // Number of queued steps left to perform before debug event. |
| 714 int queued_step_count_; | 719 int queued_step_count_; |
| 715 | 720 |
| 716 // Frame pointer for frame from which step in was performed. | 721 // Frame pointer for frame from which step in was performed. |
| 717 Address step_into_fp_; | 722 Address step_into_fp_; |
| 718 | 723 |
| 719 // Frame pointer for the frame where debugger should be called when current | 724 // Frame pointer for the frame where debugger should be called when current |
| 720 // step out action is completed. | 725 // step out action is completed. |
| 721 Address step_out_fp_; | 726 Address step_out_fp_; |
| 722 | 727 |
| 723 // Storage location for jump when exiting debug break calls. | |
| 724 Address after_break_target_; | |
| 725 | |
| 726 // Pending interrupts scheduled while debugging. | 728 // Pending interrupts scheduled while debugging. |
| 727 bool has_pending_interrupt_; | 729 bool has_pending_interrupt_; |
| 728 | 730 |
| 729 // Stores the way how LiveEdit has patched the stack. It is used when | 731 // Stores the way how LiveEdit has patched the stack. It is used when |
| 730 // debugger returns control back to user script. | 732 // debugger returns control back to user script. |
| 731 LiveEdit::FrameDropMode frame_drop_mode_; | 733 LiveEdit::FrameDropMode frame_drop_mode_; |
| 732 | 734 |
| 733 // When restarter frame is on stack, stores the address | 735 // When restarter frame is on stack, stores the address |
| 734 // of the pointer to function being restarted. Otherwise (most of the time) | 736 // of the pointer to function being restarted. Otherwise (most of the time) |
| 735 // stores NULL. This pointer is used with 'step in' implementation. | 737 // stores NULL. This pointer is used with 'step in' implementation. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 // several frames above. | 831 // several frames above. |
| 830 // There is no calling conventions here, because it never actually gets | 832 // There is no calling conventions here, because it never actually gets |
| 831 // called, it only gets returned to. | 833 // called, it only gets returned to. |
| 832 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); | 834 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); |
| 833 }; | 835 }; |
| 834 | 836 |
| 835 | 837 |
| 836 } } // namespace v8::internal | 838 } } // namespace v8::internal |
| 837 | 839 |
| 838 #endif // V8_DEBUG_H_ | 840 #endif // V8_DEBUG_H_ |
| OLD | NEW |