| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // This class controls the debug info for all functions which currently have | 209 // This class controls the debug info for all functions which currently have |
| 210 // active breakpoints in them. This debug info is held in the heap root object | 210 // active breakpoints in them. This debug info is held in the heap root object |
| 211 // debug_info which is a FixedArray. Each entry in this list is of class | 211 // debug_info which is a FixedArray. Each entry in this list is of class |
| 212 // DebugInfo. | 212 // DebugInfo. |
| 213 class Debug { | 213 class Debug { |
| 214 public: | 214 public: |
| 215 bool Load(); | 215 bool Load(); |
| 216 void Unload(); | 216 void Unload(); |
| 217 bool IsLoaded() { return !debug_context_.is_null(); } | 217 bool IsLoaded() { return !debug_context_.is_null(); } |
| 218 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } | 218 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } |
| 219 void PreemptionWhileInDebugger(); | |
| 220 | 219 |
| 221 Object* Break(Arguments args); | 220 Object* Break(Arguments args); |
| 222 void SetBreakPoint(Handle<JSFunction> function, | 221 void SetBreakPoint(Handle<JSFunction> function, |
| 223 Handle<Object> break_point_object, | 222 Handle<Object> break_point_object, |
| 224 int* source_position); | 223 int* source_position); |
| 225 bool SetBreakPointForScript(Handle<Script> script, | 224 bool SetBreakPointForScript(Handle<Script> script, |
| 226 Handle<Object> break_point_object, | 225 Handle<Object> break_point_object, |
| 227 int* source_position, | 226 int* source_position, |
| 228 BreakPositionAlignment alignment); | 227 BreakPositionAlignment alignment); |
| 229 void ClearBreakPoint(Handle<Object> break_point_object); | 228 void ClearBreakPoint(Handle<Object> break_point_object); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 Address step_out_fp() { return thread_local_.step_out_fp_; } | 309 Address step_out_fp() { return thread_local_.step_out_fp_; } |
| 311 | 310 |
| 312 EnterDebugger* debugger_entry() { | 311 EnterDebugger* debugger_entry() { |
| 313 return thread_local_.debugger_entry_; | 312 return thread_local_.debugger_entry_; |
| 314 } | 313 } |
| 315 void set_debugger_entry(EnterDebugger* entry) { | 314 void set_debugger_entry(EnterDebugger* entry) { |
| 316 thread_local_.debugger_entry_ = entry; | 315 thread_local_.debugger_entry_ = entry; |
| 317 } | 316 } |
| 318 | 317 |
| 319 // Check whether any of the specified interrupts are pending. | 318 // Check whether any of the specified interrupts are pending. |
| 320 bool is_interrupt_pending(InterruptFlag what) { | 319 bool has_pending_interrupt() { |
| 321 return (thread_local_.pending_interrupts_ & what) != 0; | 320 return thread_local_.has_pending_interrupt_; |
| 322 } | 321 } |
| 323 | 322 |
| 324 // Set specified interrupts as pending. | 323 // Set specified interrupts as pending. |
| 325 void set_interrupts_pending(InterruptFlag what) { | 324 void set_has_pending_interrupt(bool value) { |
| 326 thread_local_.pending_interrupts_ |= what; | 325 thread_local_.has_pending_interrupt_ = value; |
| 327 } | |
| 328 | |
| 329 // Clear specified interrupts from pending. | |
| 330 void clear_interrupt_pending(InterruptFlag what) { | |
| 331 thread_local_.pending_interrupts_ &= ~static_cast<int>(what); | |
| 332 } | 326 } |
| 333 | 327 |
| 334 // Getter and setter for the disable break state. | 328 // Getter and setter for the disable break state. |
| 335 bool disable_break() { return disable_break_; } | 329 bool disable_break() { return disable_break_; } |
| 336 void set_disable_break(bool disable_break) { | 330 void set_disable_break(bool disable_break) { |
| 337 disable_break_ = disable_break; | 331 disable_break_ = disable_break; |
| 338 } | 332 } |
| 339 | 333 |
| 340 // Getters for the current exception break state. | 334 // Getters for the current exception break state. |
| 341 bool break_on_exception() { return break_on_exception_; } | 335 bool break_on_exception() { return break_on_exception_; } |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 Address after_break_target_; | 572 Address after_break_target_; |
| 579 | 573 |
| 580 // Stores the way how LiveEdit has patched the stack. It is used when | 574 // Stores the way how LiveEdit has patched the stack. It is used when |
| 581 // debugger returns control back to user script. | 575 // debugger returns control back to user script. |
| 582 FrameDropMode frame_drop_mode_; | 576 FrameDropMode frame_drop_mode_; |
| 583 | 577 |
| 584 // Top debugger entry. | 578 // Top debugger entry. |
| 585 EnterDebugger* debugger_entry_; | 579 EnterDebugger* debugger_entry_; |
| 586 | 580 |
| 587 // Pending interrupts scheduled while debugging. | 581 // Pending interrupts scheduled while debugging. |
| 588 int pending_interrupts_; | 582 bool has_pending_interrupt_; |
| 589 | 583 |
| 590 // When restarter frame is on stack, stores the address | 584 // When restarter frame is on stack, stores the address |
| 591 // of the pointer to function being restarted. Otherwise (most of the time) | 585 // of the pointer to function being restarted. Otherwise (most of the time) |
| 592 // stores NULL. This pointer is used with 'step in' implementation. | 586 // stores NULL. This pointer is used with 'step in' implementation. |
| 593 Object** restarter_frame_function_pointer_; | 587 Object** restarter_frame_function_pointer_; |
| 594 }; | 588 }; |
| 595 | 589 |
| 596 // Storage location for registers when handling debug break calls | 590 // Storage location for registers when handling debug break calls |
| 597 JSCallerSavedBuffer registers_; | 591 JSCallerSavedBuffer registers_; |
| 598 ThreadLocal thread_local_; | 592 ThreadLocal thread_local_; |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 Mutex mutex_; | 1013 Mutex mutex_; |
| 1020 bool already_signalled_; | 1014 bool already_signalled_; |
| 1021 | 1015 |
| 1022 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); | 1016 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); |
| 1023 }; | 1017 }; |
| 1024 | 1018 |
| 1025 | 1019 |
| 1026 } } // namespace v8::internal | 1020 } } // namespace v8::internal |
| 1027 | 1021 |
| 1028 #endif // V8_DEBUG_H_ | 1022 #endif // V8_DEBUG_H_ |
| OLD | NEW |