Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/debug/debug.h

Issue 2033223003: [debug] implement intuitive semantics for stepping over await call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/arguments.h" 9 #include "src/arguments.h"
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 void ClearBreakPoint(Handle<Object> break_point_object); 449 void ClearBreakPoint(Handle<Object> break_point_object);
450 void ClearAllBreakPoints(); 450 void ClearAllBreakPoints();
451 void FloodWithOneShot(Handle<JSFunction> function, 451 void FloodWithOneShot(Handle<JSFunction> function,
452 BreakLocatorType type = ALL_BREAK_LOCATIONS); 452 BreakLocatorType type = ALL_BREAK_LOCATIONS);
453 void ChangeBreakOnException(ExceptionBreakType type, bool enable); 453 void ChangeBreakOnException(ExceptionBreakType type, bool enable);
454 bool IsBreakOnException(ExceptionBreakType type); 454 bool IsBreakOnException(ExceptionBreakType type);
455 455
456 // Stepping handling. 456 // Stepping handling.
457 void PrepareStep(StepAction step_action); 457 void PrepareStep(StepAction step_action);
458 void PrepareStepIn(Handle<JSFunction> function); 458 void PrepareStepIn(Handle<JSFunction> function);
459 void PrepareStepInSuspendedGenerator();
459 void PrepareStepOnThrow(); 460 void PrepareStepOnThrow();
460 void ClearStepping(); 461 void ClearStepping();
461 void ClearStepOut(); 462 void ClearStepOut();
462 void EnableStepIn(); 463 void EnableStepIn();
463 464
464 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); 465 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared);
465 466
467 void RecordAsyncFunction(Handle<JSGeneratorObject> generator_object);
468
466 // Returns whether the operation succeeded. Compilation can only be triggered 469 // Returns whether the operation succeeded. Compilation can only be triggered
467 // if a valid closure is passed as the second argument, otherwise the shared 470 // if a valid closure is passed as the second argument, otherwise the shared
468 // function needs to be compiled already. 471 // function needs to be compiled already.
469 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, 472 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared,
470 Handle<JSFunction> function); 473 Handle<JSFunction> function);
471 void CreateDebugInfo(Handle<SharedFunctionInfo> shared); 474 void CreateDebugInfo(Handle<SharedFunctionInfo> shared);
472 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); 475 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared);
473 476
474 template <typename C> 477 template <typename C>
475 bool CompileToRevealInnerFunctions(C* compilable); 478 bool CompileToRevealInnerFunctions(C* compilable);
(...skipping 14 matching lines...) Expand all
490 493
491 // Support for LiveEdit 494 // Support for LiveEdit
492 void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id, 495 void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
493 LiveEdit::FrameDropMode mode); 496 LiveEdit::FrameDropMode mode);
494 497
495 // Threading support. 498 // Threading support.
496 char* ArchiveDebug(char* to); 499 char* ArchiveDebug(char* to);
497 char* RestoreDebug(char* from); 500 char* RestoreDebug(char* from);
498 static int ArchiveSpacePerThread(); 501 static int ArchiveSpacePerThread();
499 void FreeThreadResources() { } 502 void FreeThreadResources() { }
503 void Iterate(ObjectVisitor* v);
500 504
501 bool CheckExecutionState(int id) { 505 bool CheckExecutionState(int id) {
502 return is_active() && !debug_context().is_null() && break_id() != 0 && 506 return is_active() && !debug_context().is_null() && break_id() != 0 &&
503 break_id() == id; 507 break_id() == id;
504 } 508 }
505 509
506 // Flags and states. 510 // Flags and states.
507 DebugScope* debugger_entry() { 511 DebugScope* debugger_entry() {
508 return reinterpret_cast<DebugScope*>( 512 return reinterpret_cast<DebugScope*>(
509 base::NoBarrier_Load(&thread_local_.current_debug_scope_)); 513 base::NoBarrier_Load(&thread_local_.current_debug_scope_));
(...skipping 27 matching lines...) Expand all
537 } 541 }
538 542
539 Address after_break_target_address() { 543 Address after_break_target_address() {
540 return reinterpret_cast<Address>(&after_break_target_); 544 return reinterpret_cast<Address>(&after_break_target_);
541 } 545 }
542 546
543 Address step_in_enabled_address() { 547 Address step_in_enabled_address() {
544 return reinterpret_cast<Address>(&thread_local_.step_in_enabled_); 548 return reinterpret_cast<Address>(&thread_local_.step_in_enabled_);
545 } 549 }
546 550
551 Address suspended_generator_address() {
552 return reinterpret_cast<Address>(&thread_local_.suspended_generator_);
553 }
554
547 StepAction last_step_action() { return thread_local_.last_step_action_; } 555 StepAction last_step_action() { return thread_local_.last_step_action_; }
548 556
549 DebugFeatureTracker* feature_tracker() { return &feature_tracker_; } 557 DebugFeatureTracker* feature_tracker() { return &feature_tracker_; }
550 558
551 private: 559 private:
552 explicit Debug(Isolate* isolate); 560 explicit Debug(Isolate* isolate);
553 561
554 void UpdateState(); 562 void UpdateState();
555 void Unload(); 563 void Unload();
556 void SetNextBreakId() { 564 void SetNextBreakId() {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 // to the next call that the embedder makes. 688 // to the next call that the embedder makes.
681 bool step_in_enabled_; 689 bool step_in_enabled_;
682 690
683 // Stores the way how LiveEdit has patched the stack. It is used when 691 // Stores the way how LiveEdit has patched the stack. It is used when
684 // debugger returns control back to user script. 692 // debugger returns control back to user script.
685 LiveEdit::FrameDropMode frame_drop_mode_; 693 LiveEdit::FrameDropMode frame_drop_mode_;
686 694
687 // Value of accumulator in interpreter frames. In non-interpreter frames 695 // Value of accumulator in interpreter frames. In non-interpreter frames
688 // this value will be the hole. 696 // this value will be the hole.
689 Handle<Object> return_value_; 697 Handle<Object> return_value_;
698
699 Object* suspended_generator_;
690 }; 700 };
691 701
692 // Storage location for registers when handling debug break calls 702 // Storage location for registers when handling debug break calls
693 ThreadLocal thread_local_; 703 ThreadLocal thread_local_;
694 704
695 Isolate* isolate_; 705 Isolate* isolate_;
696 706
697 friend class Isolate; 707 friend class Isolate;
698 friend class DebugScope; 708 friend class DebugScope;
699 friend class DisableBreak; 709 friend class DisableBreak;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 Handle<Code> code); 807 Handle<Code> code);
798 static bool DebugBreakSlotIsPatched(Address pc); 808 static bool DebugBreakSlotIsPatched(Address pc);
799 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); 809 static void ClearDebugBreakSlot(Isolate* isolate, Address pc);
800 }; 810 };
801 811
802 812
803 } // namespace internal 813 } // namespace internal
804 } // namespace v8 814 } // namespace v8
805 815
806 #endif // V8_DEBUG_DEBUG_H_ 816 #endif // V8_DEBUG_DEBUG_H_
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/debug/debug.cc » ('j') | src/debug/debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698