Chromium Code Reviews| 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? |