| 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 "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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 // Stores the way how LiveEdit has patched the stack. It is used when | 725 // Stores the way how LiveEdit has patched the stack. It is used when |
| 726 // debugger returns control back to user script. | 726 // debugger returns control back to user script. |
| 727 LiveEdit::FrameDropMode frame_drop_mode_; | 727 LiveEdit::FrameDropMode frame_drop_mode_; |
| 728 | 728 |
| 729 // When restarter frame is on stack, stores the address | 729 // When restarter frame is on stack, stores the address |
| 730 // of the pointer to function being restarted. Otherwise (most of the time) | 730 // of the pointer to function being restarted. Otherwise (most of the time) |
| 731 // stores NULL. This pointer is used with 'step in' implementation. | 731 // stores NULL. This pointer is used with 'step in' implementation. |
| 732 Object** restarter_frame_function_pointer_; | 732 Object** restarter_frame_function_pointer_; |
| 733 }; | 733 }; |
| 734 | 734 |
| 735 | |
| 736 class PreserveDebugState { | |
| 737 public: | |
| 738 explicit PreserveDebugState(Debug* debug) : debug_(debug) { | |
| 739 size_t size = sizeof(debug_->thread_local_); | |
| 740 storage_ = NewArray<char>(size); | |
| 741 MemCopy(storage_, &debug_->thread_local_, size); | |
| 742 } | |
| 743 | |
| 744 ~PreserveDebugState() { | |
| 745 size_t size = sizeof(debug_->thread_local_); | |
| 746 MemCopy(&debug_->thread_local_, storage_, size); | |
| 747 DeleteArray(storage_); | |
| 748 } | |
| 749 | |
| 750 private: | |
| 751 Debug* debug_; | |
| 752 char* storage_; | |
| 753 }; | |
| 754 | |
| 755 | |
| 756 // Storage location for registers when handling debug break calls | 735 // Storage location for registers when handling debug break calls |
| 757 ThreadLocal thread_local_; | 736 ThreadLocal thread_local_; |
| 758 | 737 |
| 759 Isolate* isolate_; | 738 Isolate* isolate_; |
| 760 | 739 |
| 761 friend class Isolate; | 740 friend class Isolate; |
| 762 friend class DebugScope; | 741 friend class DebugScope; |
| 763 friend class DisableBreak; | 742 friend class DisableBreak; |
| 764 friend class LiveEdit; | 743 friend class LiveEdit; |
| 765 friend class SuppressDebug; | 744 friend class SuppressDebug; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 // several frames above. | 839 // several frames above. |
| 861 // There is no calling conventions here, because it never actually gets | 840 // There is no calling conventions here, because it never actually gets |
| 862 // called, it only gets returned to. | 841 // called, it only gets returned to. |
| 863 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); | 842 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); |
| 864 }; | 843 }; |
| 865 | 844 |
| 866 | 845 |
| 867 } } // namespace v8::internal | 846 } } // namespace v8::internal |
| 868 | 847 |
| 869 #endif // V8_DEBUG_H_ | 848 #endif // V8_DEBUG_H_ |
| OLD | NEW |