| 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_DEBUG_H_ | 5 #ifndef V8_DEBUG_DEBUG_H_ |
| 6 #define V8_DEBUG_DEBUG_H_ | 6 #define V8_DEBUG_DEBUG_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
| 10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 // Check whether a global object is the debug global object. | 345 // Check whether a global object is the debug global object. |
| 346 bool IsDebugGlobal(JSGlobalObject* global); | 346 bool IsDebugGlobal(JSGlobalObject* global); |
| 347 | 347 |
| 348 // Check whether this frame is just about to return. | 348 // Check whether this frame is just about to return. |
| 349 bool IsBreakAtReturn(JavaScriptFrame* frame); | 349 bool IsBreakAtReturn(JavaScriptFrame* frame); |
| 350 | 350 |
| 351 // Support for LiveEdit | 351 // Support for LiveEdit |
| 352 void ScheduleFrameRestart(StackFrame* frame); | 352 void ScheduleFrameRestart(StackFrame* frame); |
| 353 | 353 |
| 354 bool IsFrameBlackboxed(JavaScriptFrame* frame); | 354 bool AllFramesOnStackAreBlackboxed(); |
| 355 | 355 |
| 356 // Threading support. | 356 // Threading support. |
| 357 char* ArchiveDebug(char* to); | 357 char* ArchiveDebug(char* to); |
| 358 char* RestoreDebug(char* from); | 358 char* RestoreDebug(char* from); |
| 359 static int ArchiveSpacePerThread(); | 359 static int ArchiveSpacePerThread(); |
| 360 void FreeThreadResources() { } | 360 void FreeThreadResources() { } |
| 361 void Iterate(ObjectVisitor* v); | 361 void Iterate(ObjectVisitor* v); |
| 362 | 362 |
| 363 bool CheckExecutionState(int id) { | 363 bool CheckExecutionState(int id) { |
| 364 return CheckExecutionState() && break_id() == id; | 364 return CheckExecutionState() && break_id() == id; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 void ApplyBreakPoints(Handle<DebugInfo> debug_info); | 480 void ApplyBreakPoints(Handle<DebugInfo> debug_info); |
| 481 // Clear code from instrumentation. | 481 // Clear code from instrumentation. |
| 482 void ClearBreakPoints(Handle<DebugInfo> debug_info); | 482 void ClearBreakPoints(Handle<DebugInfo> debug_info); |
| 483 // Clear all code from instrumentation. | 483 // Clear all code from instrumentation. |
| 484 void ClearAllBreakPoints(); | 484 void ClearAllBreakPoints(); |
| 485 // Instrument a function with one-shots. | 485 // Instrument a function with one-shots. |
| 486 void FloodWithOneShot(Handle<SharedFunctionInfo> function); | 486 void FloodWithOneShot(Handle<SharedFunctionInfo> function); |
| 487 // Clear all one-shot instrumentations, but restore break points. | 487 // Clear all one-shot instrumentations, but restore break points. |
| 488 void ClearOneShot(); | 488 void ClearOneShot(); |
| 489 | 489 |
| 490 bool IsFrameBlackboxed(JavaScriptFrame* frame); |
| 491 |
| 490 void ActivateStepOut(StackFrame* frame); | 492 void ActivateStepOut(StackFrame* frame); |
| 491 void RemoveDebugInfoAndClearFromShared(Handle<DebugInfo> debug_info); | 493 void RemoveDebugInfoAndClearFromShared(Handle<DebugInfo> debug_info); |
| 492 MaybeHandle<FixedArray> CheckBreakPoints(Handle<DebugInfo> debug_info, | 494 MaybeHandle<FixedArray> CheckBreakPoints(Handle<DebugInfo> debug_info, |
| 493 BreakLocation* location, | 495 BreakLocation* location, |
| 494 bool* has_break_points = nullptr); | 496 bool* has_break_points = nullptr); |
| 495 bool IsMutedAtCurrentLocation(JavaScriptFrame* frame); | 497 bool IsMutedAtCurrentLocation(JavaScriptFrame* frame); |
| 496 bool CheckBreakPoint(Handle<Object> break_point_object); | 498 bool CheckBreakPoint(Handle<Object> break_point_object); |
| 497 MaybeHandle<Object> CallFunction(const char* name, int argc, | 499 MaybeHandle<Object> CallFunction(const char* name, int argc, |
| 498 Handle<Object> args[]); | 500 Handle<Object> args[]); |
| 499 | 501 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 | 594 |
| 593 friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc | 595 friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc |
| 594 friend void CheckDebuggerUnloaded(bool check_functions); // In test-debug.cc | 596 friend void CheckDebuggerUnloaded(bool check_functions); // In test-debug.cc |
| 595 | 597 |
| 596 DISALLOW_COPY_AND_ASSIGN(Debug); | 598 DISALLOW_COPY_AND_ASSIGN(Debug); |
| 597 }; | 599 }; |
| 598 | 600 |
| 599 class LegacyDebugDelegate : public v8::debug::DebugDelegate { | 601 class LegacyDebugDelegate : public v8::debug::DebugDelegate { |
| 600 public: | 602 public: |
| 601 explicit LegacyDebugDelegate(Isolate* isolate) : isolate_(isolate) {} | 603 explicit LegacyDebugDelegate(Isolate* isolate) : isolate_(isolate) {} |
| 602 void PromiseEventOccurred(v8::debug::PromiseDebugActionType type, int id, | 604 void PromiseEventOccurred(v8::Local<v8::Context> context, |
| 603 int parent_id) override; | 605 v8::debug::PromiseDebugActionType type, int id, |
| 606 int parent_id, bool created_by_user) override; |
| 604 void ScriptCompiled(v8::Local<v8::debug::Script> script, | 607 void ScriptCompiled(v8::Local<v8::debug::Script> script, |
| 605 bool has_compile_error) override; | 608 bool has_compile_error) override; |
| 606 void BreakProgramRequested(v8::Local<v8::Context> paused_context, | 609 void BreakProgramRequested(v8::Local<v8::Context> paused_context, |
| 607 v8::Local<v8::Object> exec_state, | 610 v8::Local<v8::Object> exec_state, |
| 608 v8::Local<v8::Value> break_points_hit) override; | 611 v8::Local<v8::Value> break_points_hit) override; |
| 609 void ExceptionThrown(v8::Local<v8::Context> paused_context, | 612 void ExceptionThrown(v8::Local<v8::Context> paused_context, |
| 610 v8::Local<v8::Object> exec_state, | 613 v8::Local<v8::Object> exec_state, |
| 611 v8::Local<v8::Value> exception, | 614 v8::Local<v8::Value> exception, |
| 612 v8::Local<v8::Value> promise, bool is_uncaught) override; | 615 v8::Local<v8::Value> promise, bool is_uncaught) override; |
| 613 bool IsFunctionBlackboxed(v8::Local<v8::debug::Script> script, | 616 bool IsFunctionBlackboxed(v8::Local<v8::debug::Script> script, |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 Handle<Code> code); | 792 Handle<Code> code); |
| 790 static bool DebugBreakSlotIsPatched(Address pc); | 793 static bool DebugBreakSlotIsPatched(Address pc); |
| 791 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 794 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
| 792 }; | 795 }; |
| 793 | 796 |
| 794 | 797 |
| 795 } // namespace internal | 798 } // namespace internal |
| 796 } // namespace v8 | 799 } // namespace v8 |
| 797 | 800 |
| 798 #endif // V8_DEBUG_DEBUG_H_ | 801 #endif // V8_DEBUG_DEBUG_H_ |
| OLD | NEW |