| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 int step_count, | 431 int step_count, |
| 432 StackFrame::Id frame_id); | 432 StackFrame::Id frame_id); |
| 433 void ClearStepping(); | 433 void ClearStepping(); |
| 434 void ClearStepOut(); | 434 void ClearStepOut(); |
| 435 bool IsStepping() { return thread_local_.step_count_ > 0; } | 435 bool IsStepping() { return thread_local_.step_count_ > 0; } |
| 436 bool StepNextContinue(BreakLocation* location, JavaScriptFrame* frame); | 436 bool StepNextContinue(BreakLocation* location, JavaScriptFrame* frame); |
| 437 bool StepInActive() { return thread_local_.step_into_fp_ != 0; } | 437 bool StepInActive() { return thread_local_.step_into_fp_ != 0; } |
| 438 void HandleStepIn(Handle<Object> function_obj, bool is_constructor); | 438 void HandleStepIn(Handle<Object> function_obj, bool is_constructor); |
| 439 bool StepOutActive() { return thread_local_.step_out_fp_ != 0; } | 439 bool StepOutActive() { return thread_local_.step_out_fp_ != 0; } |
| 440 | 440 |
| 441 // Purge all code objects that have no debug break slots. | 441 void GetStepinPositions(JavaScriptFrame* frame, StackFrame::Id frame_id, |
| 442 void PrepareForBreakPoints(); | 442 List<int>* results_out); |
| 443 |
| 444 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); |
| 443 | 445 |
| 444 // Returns whether the operation succeeded. Compilation can only be triggered | 446 // Returns whether the operation succeeded. Compilation can only be triggered |
| 445 // if a valid closure is passed as the second argument, otherwise the shared | 447 // if a valid closure is passed as the second argument, otherwise the shared |
| 446 // function needs to be compiled already. | 448 // function needs to be compiled already. |
| 447 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, | 449 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, |
| 448 Handle<JSFunction> function); | 450 Handle<JSFunction> function); |
| 449 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); | 451 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); |
| 450 static bool HasDebugInfo(Handle<SharedFunctionInfo> shared); | |
| 451 | 452 |
| 452 template <typename C> | 453 template <typename C> |
| 453 bool CompileToRevealInnerFunctions(C* compilable); | 454 bool CompileToRevealInnerFunctions(C* compilable); |
| 454 | 455 |
| 455 // This function is used in FunctionNameUsing* tests. | 456 // This function is used in FunctionNameUsing* tests. |
| 456 Handle<Object> FindSharedFunctionInfoInScript(Handle<Script> script, | 457 Handle<Object> FindSharedFunctionInfoInScript(Handle<Script> script, |
| 457 int position); | 458 int position); |
| 458 | 459 |
| 459 // Returns true if the current stub call is patched to call the debugger. | 460 // Returns true if the current stub call is patched to call the debugger. |
| 460 static bool IsDebugBreak(Address addr); | 461 static bool IsDebugBreak(Address addr); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 base::NoBarrier_Load(&thread_local_.current_debug_scope_)); | 499 base::NoBarrier_Load(&thread_local_.current_debug_scope_)); |
| 499 } | 500 } |
| 500 inline Handle<Context> debug_context() { return debug_context_; } | 501 inline Handle<Context> debug_context() { return debug_context_; } |
| 501 void set_live_edit_enabled(bool v) { live_edit_enabled_ = v; } | 502 void set_live_edit_enabled(bool v) { live_edit_enabled_ = v; } |
| 502 bool live_edit_enabled() const { | 503 bool live_edit_enabled() const { |
| 503 return FLAG_enable_liveedit && live_edit_enabled_ ; | 504 return FLAG_enable_liveedit && live_edit_enabled_ ; |
| 504 } | 505 } |
| 505 | 506 |
| 506 inline bool is_active() const { return is_active_; } | 507 inline bool is_active() const { return is_active_; } |
| 507 inline bool is_loaded() const { return !debug_context_.is_null(); } | 508 inline bool is_loaded() const { return !debug_context_.is_null(); } |
| 508 inline bool has_break_points() const { return has_break_points_; } | |
| 509 inline bool in_debug_scope() const { | 509 inline bool in_debug_scope() const { |
| 510 return !!base::NoBarrier_Load(&thread_local_.current_debug_scope_); | 510 return !!base::NoBarrier_Load(&thread_local_.current_debug_scope_); |
| 511 } | 511 } |
| 512 void set_disable_break(bool v) { break_disabled_ = v; } | 512 void set_disable_break(bool v) { break_disabled_ = v; } |
| 513 | 513 |
| 514 StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; } | 514 StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; } |
| 515 int break_id() { return thread_local_.break_id_; } | 515 int break_id() { return thread_local_.break_id_; } |
| 516 | 516 |
| 517 // Support for embedding into generated code. | 517 // Support for embedding into generated code. |
| 518 Address is_active_address() { | 518 Address is_active_address() { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 int call_argc = -1); | 797 int call_argc = -1); |
| 798 | 798 |
| 799 static void PatchDebugBreakSlot(Address pc, Handle<Code> code); | 799 static void PatchDebugBreakSlot(Address pc, Handle<Code> code); |
| 800 static void ClearDebugBreakSlot(Address pc); | 800 static void ClearDebugBreakSlot(Address pc); |
| 801 }; | 801 }; |
| 802 | 802 |
| 803 | 803 |
| 804 } } // namespace v8::internal | 804 } } // namespace v8::internal |
| 805 | 805 |
| 806 #endif // V8_DEBUG_H_ | 806 #endif // V8_DEBUG_H_ |
| OLD | NEW |