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

Unified Diff: src/debug.h

Issue 13720: Changed the debugger break handling to support situations where there are no ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/debug.cc » ('j') | src/runtime.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.h
===================================================================
--- src/debug.h (revision 952)
+++ src/debug.h (working copy)
@@ -489,16 +489,17 @@
// some reason could not be entered FailedToEnter will return true.
class EnterDebugger BASE_EMBEDDED {
public:
- EnterDebugger() : set_(!it_.done()) {
- // If there is no JavaScript frames on the stack don't switch to new break
- // and break frame.
- if (set_) {
- // Store the previous break is and frame id.
- break_id_ = Top::break_id();
- break_frame_id_ = Top::break_frame_id();
+ EnterDebugger() : has_js_frames_(!it_.done()) {
+ // Store the previous break id and frame id.
+ break_id_ = Top::break_id();
+ break_frame_id_ = Top::break_frame_id();
- // Create the new break info.
+ // Create the new break info. If there is no JavaScript frames there is no
+ // break frame id.
+ if (has_js_frames_) {
Top::new_break(it_.frame()->id());
+ } else {
+ Top::new_break(StackFrame::NO_ID);
}
// Make sure that debugger is loaded and enter the debugger context.
@@ -511,21 +512,19 @@
}
~EnterDebugger() {
- if (set_) {
- // Restore to the previous break state.
- Top::set_break(break_frame_id_, break_id_);
- }
+ // Restore to the previous break state.
+ Top::set_break(break_frame_id_, break_id_);
}
// Check whether the debugger could be entered.
inline bool FailedToEnter() { return load_failed_; }
// Check whether there are any JavaScript frames on the stack.
- inline bool HasJavaScriptFrames() { return set_; }
+ inline bool HasJavaScriptFrames() { return has_js_frames_; }
private:
JavaScriptFrameIterator it_;
- const bool set_; // Was the break actually set?
+ const bool has_js_frames_; // Where there any JavaScript frames?
Mads Ager (chromium) 2008/12/11 07:56:54 Where -> Were
Søren Thygesen Gjesse 2008/12/11 08:04:49 Done.
StackFrame::Id break_frame_id_; // Previous break frame id.
int break_id_; // Previous break id.
bool load_failed_; // Did the debugger fail to load?
« no previous file with comments | « no previous file | src/debug.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698