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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 343 |
344 // Check whether a global object is the debug global object. | 344 // Check whether a global object is the debug global object. |
345 bool IsDebugGlobal(JSGlobalObject* global); | 345 bool IsDebugGlobal(JSGlobalObject* global); |
346 | 346 |
347 // Check whether this frame is just about to return. | 347 // Check whether this frame is just about to return. |
348 bool IsBreakAtReturn(JavaScriptFrame* frame); | 348 bool IsBreakAtReturn(JavaScriptFrame* frame); |
349 | 349 |
350 // Support for LiveEdit | 350 // Support for LiveEdit |
351 void ScheduleFrameRestart(StackFrame* frame); | 351 void ScheduleFrameRestart(StackFrame* frame); |
352 | 352 |
353 bool IsFrameBlackboxed(JavaScriptFrame* frame); | 353 bool HasNonBlackboxedFrameOnStack(); |
354 | 354 |
355 // Threading support. | 355 // Threading support. |
356 char* ArchiveDebug(char* to); | 356 char* ArchiveDebug(char* to); |
357 char* RestoreDebug(char* from); | 357 char* RestoreDebug(char* from); |
358 static int ArchiveSpacePerThread(); | 358 static int ArchiveSpacePerThread(); |
359 void FreeThreadResources() { } | 359 void FreeThreadResources() { } |
360 void Iterate(ObjectVisitor* v); | 360 void Iterate(ObjectVisitor* v); |
361 | 361 |
362 bool CheckExecutionState(int id) { | 362 bool CheckExecutionState(int id) { |
363 return CheckExecutionState() && break_id() == id; | 363 return CheckExecutionState() && break_id() == id; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 void ApplyBreakPoints(Handle<DebugInfo> debug_info); | 476 void ApplyBreakPoints(Handle<DebugInfo> debug_info); |
477 // Clear code from instrumentation. | 477 // Clear code from instrumentation. |
478 void ClearBreakPoints(Handle<DebugInfo> debug_info); | 478 void ClearBreakPoints(Handle<DebugInfo> debug_info); |
479 // Clear all code from instrumentation. | 479 // Clear all code from instrumentation. |
480 void ClearAllBreakPoints(); | 480 void ClearAllBreakPoints(); |
481 // Instrument a function with one-shots. | 481 // Instrument a function with one-shots. |
482 void FloodWithOneShot(Handle<SharedFunctionInfo> function); | 482 void FloodWithOneShot(Handle<SharedFunctionInfo> function); |
483 // Clear all one-shot instrumentations, but restore break points. | 483 // Clear all one-shot instrumentations, but restore break points. |
484 void ClearOneShot(); | 484 void ClearOneShot(); |
485 | 485 |
| 486 bool HasPromiseBuiltinOnStack(); |
| 487 bool IsFrameBlackboxed(JavaScriptFrame* frame); |
| 488 |
486 void ActivateStepOut(StackFrame* frame); | 489 void ActivateStepOut(StackFrame* frame); |
487 void RemoveDebugInfoAndClearFromShared(Handle<DebugInfo> debug_info); | 490 void RemoveDebugInfoAndClearFromShared(Handle<DebugInfo> debug_info); |
488 MaybeHandle<FixedArray> CheckBreakPoints(Handle<DebugInfo> debug_info, | 491 MaybeHandle<FixedArray> CheckBreakPoints(Handle<DebugInfo> debug_info, |
489 BreakLocation* location, | 492 BreakLocation* location, |
490 bool* has_break_points = nullptr); | 493 bool* has_break_points = nullptr); |
491 bool IsMutedAtCurrentLocation(JavaScriptFrame* frame); | 494 bool IsMutedAtCurrentLocation(JavaScriptFrame* frame); |
492 bool CheckBreakPoint(Handle<Object> break_point_object); | 495 bool CheckBreakPoint(Handle<Object> break_point_object); |
493 MaybeHandle<Object> CallFunction(const char* name, int argc, | 496 MaybeHandle<Object> CallFunction(const char* name, int argc, |
494 Handle<Object> args[]); | 497 Handle<Object> args[]); |
495 | 498 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 591 |
589 friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc | 592 friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc |
590 friend void CheckDebuggerUnloaded(bool check_functions); // In test-debug.cc | 593 friend void CheckDebuggerUnloaded(bool check_functions); // In test-debug.cc |
591 | 594 |
592 DISALLOW_COPY_AND_ASSIGN(Debug); | 595 DISALLOW_COPY_AND_ASSIGN(Debug); |
593 }; | 596 }; |
594 | 597 |
595 class LegacyDebugDelegate : public v8::debug::DebugDelegate { | 598 class LegacyDebugDelegate : public v8::debug::DebugDelegate { |
596 public: | 599 public: |
597 explicit LegacyDebugDelegate(Isolate* isolate) : isolate_(isolate) {} | 600 explicit LegacyDebugDelegate(Isolate* isolate) : isolate_(isolate) {} |
598 void PromiseEventOccurred(v8::debug::PromiseDebugActionType type, int id, | 601 void PromiseEventOccurred(v8::Local<v8::Context> context, |
599 int parent_id) override; | 602 v8::debug::PromiseDebugActionType type, int id, |
| 603 int parent_id, bool breakable) override; |
600 void ScriptCompiled(v8::Local<v8::debug::Script> script, | 604 void ScriptCompiled(v8::Local<v8::debug::Script> script, |
601 bool has_compile_error) override; | 605 bool has_compile_error) override; |
602 void BreakProgramRequested(v8::Local<v8::Context> paused_context, | 606 void BreakProgramRequested(v8::Local<v8::Context> paused_context, |
603 v8::Local<v8::Object> exec_state, | 607 v8::Local<v8::Object> exec_state, |
604 v8::Local<v8::Value> break_points_hit) override; | 608 v8::Local<v8::Value> break_points_hit) override; |
605 void ExceptionThrown(v8::Local<v8::Context> paused_context, | 609 void ExceptionThrown(v8::Local<v8::Context> paused_context, |
606 v8::Local<v8::Object> exec_state, | 610 v8::Local<v8::Object> exec_state, |
607 v8::Local<v8::Value> exception, | 611 v8::Local<v8::Value> exception, |
608 v8::Local<v8::Value> promise, bool is_uncaught) override; | 612 v8::Local<v8::Value> promise, bool is_uncaught) override; |
609 bool IsFunctionBlackboxed(v8::Local<v8::debug::Script> script, | 613 bool IsFunctionBlackboxed(v8::Local<v8::debug::Script> script, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 Handle<Code> code); | 777 Handle<Code> code); |
774 static bool DebugBreakSlotIsPatched(Address pc); | 778 static bool DebugBreakSlotIsPatched(Address pc); |
775 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 779 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
776 }; | 780 }; |
777 | 781 |
778 | 782 |
779 } // namespace internal | 783 } // namespace internal |
780 } // namespace v8 | 784 } // namespace v8 |
781 | 785 |
782 #endif // V8_DEBUG_DEBUG_H_ | 786 #endif // V8_DEBUG_DEBUG_H_ |
OLD | NEW |