Index: src/debug-debugger.js |
diff --git a/src/debug-debugger.js b/src/debug-debugger.js |
index 91838e8ad0a81d71fdcd7e874379e11f3d4472fb..d1bafb4dcd3d77fa99f354b0a843b74e90d060b4 100644 |
--- a/src/debug-debugger.js |
+++ b/src/debug-debugger.js |
@@ -1449,6 +1449,8 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function( |
this.profileRequest_(request, response); |
} else if (request.command == 'changelive') { |
this.changeLiveRequest_(request, response); |
+ } else if (request.command == 'restartframe') { |
+ this.restartFrameRequest_(request, response); |
} else if (request.command == 'flags') { |
this.debuggerFlagsRequest_(request, response); |
} else if (request.command == 'v8flags') { |
@@ -2358,9 +2360,6 @@ DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { |
DebugCommandProcessor.prototype.changeLiveRequest_ = function( |
request, response) { |
- if (!Debug.LiveEdit) { |
- return response.failed('LiveEdit feature is not supported'); |
- } |
if (!request.arguments) { |
return response.failed('Missing arguments'); |
} |
@@ -2398,6 +2397,37 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function( |
}; |
+DebugCommandProcessor.prototype.restartFrameRequest_ = function( |
+ request, response) { |
+ if (!request.arguments) { |
+ return response.failed('Missing arguments'); |
+ } |
+ var frame = request.arguments.frame; |
+ |
+ // No frames to evaluate in frame. |
+ if (this.exec_state_.frameCount() == 0) { |
+ return response.failed('No frames'); |
+ } |
+ |
+ var frame_mirror; |
+ // Check whether a frame was specified. |
+ if (!IS_UNDEFINED(frame)) { |
+ var frame_number = %ToNumber(frame); |
+ if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) { |
+ return response.failed('Invalid frame "' + frame + '"'); |
+ } |
+ // Restart specified frame. |
+ frame_mirror = this.exec_state_.frame(frame_number); |
+ } else { |
+ // Restart selected frame. |
+ frame_mirror = this.exec_state_.frame(); |
+ } |
+ |
+ var result_description = Debug.LiveEdit.RestartFrame(frame_mirror); |
+ response.body = {result: result_description}; |
+}; |
+ |
+ |
DebugCommandProcessor.prototype.debuggerFlagsRequest_ = function(request, |
response) { |
// Check for legal request. |