| Index: src/debug.h
|
| ===================================================================
|
| --- src/debug.h (revision 1004)
|
| +++ src/debug.h (working copy)
|
| @@ -461,7 +461,7 @@
|
| // which forwards it to the debug_message_handler set by the API.
|
| void SendMessage(Vector<uint16_t> event_json);
|
| // Formats an event into JSON, and calls SendMessage.
|
| - void SetEventJSONFromEvent(Handle<Object> event_data);
|
| + bool SetEventJSONFromEvent(Handle<Object> event_data);
|
| // Puts a command coming from the public API on the queue. Called
|
| // by the API client thread. This is where the API client hands off
|
| // processing of the command to the DebugMessageThread thread.
|
| @@ -490,16 +490,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.
|
| @@ -512,21 +513,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_; // Were there any JavaScript frames?
|
| StackFrame::Id break_frame_id_; // Previous break frame id.
|
| int break_id_; // Previous break id.
|
| bool load_failed_; // Did the debugger fail to load?
|
|
|