OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 | 567 |
568 // This class is used for entering the debugger. Create an instance in the stack | 568 // This class is used for entering the debugger. Create an instance in the stack |
569 // to enter the debugger. This will set the current break state, make sure the | 569 // to enter the debugger. This will set the current break state, make sure the |
570 // debugger is loaded and switch to the debugger context. If the debugger for | 570 // debugger is loaded and switch to the debugger context. If the debugger for |
571 // some reason could not be entered FailedToEnter will return true. | 571 // some reason could not be entered FailedToEnter will return true. |
572 class EnterDebugger BASE_EMBEDDED { | 572 class EnterDebugger BASE_EMBEDDED { |
573 public: | 573 public: |
574 EnterDebugger() | 574 EnterDebugger() |
575 : prev_(Debug::debugger_entry()), | 575 : prev_(Debug::debugger_entry()), |
576 has_js_frames_(!it_.done()) { | 576 has_js_frames_(!it_.done()) { |
577 ASSERT(!Debug::preemption_pending()); | 577 ASSERT(prev_ == NULL ? !Debug::preemption_pending() : true); |
578 | 578 |
579 // Link recursive debugger entry. | 579 // Link recursive debugger entry. |
580 Debug::set_debugger_entry(this); | 580 Debug::set_debugger_entry(this); |
581 | 581 |
582 // If a preemption is pending when first entering the debugger clear it as | |
583 // we don't want preemption happening while executing JavaScript in the | |
584 // debugger. When recursively entering the debugger the preemption flag | |
585 // cannot be set as this is disabled while in the debugger (see | |
586 // RuntimePreempt). | |
587 if (prev_ == NULL && StackGuard::IsPreempted()) { | |
588 StackGuard::Continue(PREEMPT); | |
589 } | |
590 ASSERT(!StackGuard::IsPreempted()); | |
591 | |
592 // Store the previous break id and frame id. | 582 // Store the previous break id and frame id. |
593 break_id_ = Debug::break_id(); | 583 break_id_ = Debug::break_id(); |
594 break_frame_id_ = Debug::break_frame_id(); | 584 break_frame_id_ = Debug::break_frame_id(); |
595 | 585 |
596 // Create the new break info. If there is no JavaScript frames there is no | 586 // Create the new break info. If there is no JavaScript frames there is no |
597 // break frame id. | 587 // break frame id. |
598 if (has_js_frames_) { | 588 if (has_js_frames_) { |
599 Debug::NewBreak(it_.frame()->id()); | 589 Debug::NewBreak(it_.frame()->id()); |
600 } else { | 590 } else { |
601 Debug::NewBreak(StackFrame::NO_ID); | 591 Debug::NewBreak(StackFrame::NO_ID); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 } | 695 } |
706 private: | 696 private: |
707 Debug::AddressId id_; | 697 Debug::AddressId id_; |
708 int reg_; | 698 int reg_; |
709 }; | 699 }; |
710 | 700 |
711 | 701 |
712 } } // namespace v8::internal | 702 } } // namespace v8::internal |
713 | 703 |
714 #endif // V8_V8_DEBUG_H_ | 704 #endif // V8_V8_DEBUG_H_ |
OLD | NEW |