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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 | 123 |
124 inline RelocInfo::Mode rmode() const { return rmode_; } | 124 inline RelocInfo::Mode rmode() const { return rmode_; } |
125 inline RelocInfo::Mode original_rmode() const { return original_rmode_; } | 125 inline RelocInfo::Mode original_rmode() const { return original_rmode_; } |
126 | 126 |
127 inline Code* code() const { return debug_info_->code(); } | 127 inline Code* code() const { return debug_info_->code(); } |
128 inline Code* original_code() const { return debug_info_->original_code(); } | 128 inline Code* original_code() const { return debug_info_->original_code(); } |
129 | 129 |
130 private: | 130 private: |
131 BreakLocation(Handle<DebugInfo> debug_info, RelocInfo* rinfo, | 131 BreakLocation(Handle<DebugInfo> debug_info, RelocInfo* rinfo, |
132 RelocInfo* original_rinfo, int position, int statement_position) | 132 RelocInfo* original_rinfo, int position, |
133 : debug_info_(debug_info), | 133 int statement_position); |
134 pc_offset_(static_cast<int>(rinfo->pc() - debug_info->code()->entry())), | |
135 original_pc_offset_(static_cast<int>( | |
136 original_rinfo->pc() - debug_info->original_code()->entry())), | |
137 rmode_(rinfo->rmode()), | |
138 original_rmode_(original_rinfo->rmode()), | |
139 data_(rinfo->data()), | |
140 original_data_(original_rinfo->data()), | |
141 position_(position), | |
142 statement_position_(statement_position) {} | |
143 | 134 |
144 class Iterator { | 135 class Iterator { |
145 public: | 136 public: |
146 Iterator(Handle<DebugInfo> debug_info, BreakLocatorType type); | 137 Iterator(Handle<DebugInfo> debug_info, BreakLocatorType type); |
147 | 138 |
148 BreakLocation GetBreakLocation() { | 139 BreakLocation GetBreakLocation() { |
149 return BreakLocation(debug_info_, rinfo(), original_rinfo(), position(), | 140 return BreakLocation(debug_info_, rinfo(), original_rinfo(), position(), |
150 statement_position()); | 141 statement_position()); |
151 } | 142 } |
152 | 143 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 // Threading support. | 510 // Threading support. |
520 char* ArchiveDebug(char* to); | 511 char* ArchiveDebug(char* to); |
521 char* RestoreDebug(char* from); | 512 char* RestoreDebug(char* from); |
522 static int ArchiveSpacePerThread(); | 513 static int ArchiveSpacePerThread(); |
523 void FreeThreadResources() { } | 514 void FreeThreadResources() { } |
524 | 515 |
525 // Record function from which eval was called. | 516 // Record function from which eval was called. |
526 static void RecordEvalCaller(Handle<Script> script); | 517 static void RecordEvalCaller(Handle<Script> script); |
527 | 518 |
528 bool CheckExecutionState(int id) { | 519 bool CheckExecutionState(int id) { |
529 return !debug_context().is_null() && break_id() != 0 && break_id() == id; | 520 return is_active() && !debug_context().is_null() && break_id() != 0 && |
| 521 break_id() == id; |
530 } | 522 } |
531 | 523 |
532 // Flags and states. | 524 // Flags and states. |
533 DebugScope* debugger_entry() { | 525 DebugScope* debugger_entry() { |
534 return reinterpret_cast<DebugScope*>( | 526 return reinterpret_cast<DebugScope*>( |
535 base::NoBarrier_Load(&thread_local_.current_debug_scope_)); | 527 base::NoBarrier_Load(&thread_local_.current_debug_scope_)); |
536 } | 528 } |
537 inline Handle<Context> debug_context() { return debug_context_; } | 529 inline Handle<Context> debug_context() { return debug_context_; } |
538 void set_live_edit_enabled(bool v) { live_edit_enabled_ = v; } | 530 void set_live_edit_enabled(bool v) { live_edit_enabled_ = v; } |
539 bool live_edit_enabled() const { | 531 bool live_edit_enabled() const { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 // several frames above. | 823 // several frames above. |
832 // There is no calling conventions here, because it never actually gets | 824 // There is no calling conventions here, because it never actually gets |
833 // called, it only gets returned to. | 825 // called, it only gets returned to. |
834 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); | 826 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); |
835 }; | 827 }; |
836 | 828 |
837 | 829 |
838 } } // namespace v8::internal | 830 } } // namespace v8::internal |
839 | 831 |
840 #endif // V8_DEBUG_H_ | 832 #endif // V8_DEBUG_H_ |
OLD | NEW |