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

Unified Diff: src/mirror-debugger.js

Issue 11415042: Issue 2399 part 1: In debugger allow modifying local variable values (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: follow codereview Created 8 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 | « src/debug-debugger.js ('k') | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index a5331a014de6f79f30404dd19a5965a5a7969769..7f1a05aed9479e8b8cb0d12cf7777bcea1eae73c 100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -1844,10 +1844,14 @@ function ScopeDetails(frame, fun, index) {
frame.details_.frameId(),
frame.details_.inlinedFrameIndex(),
index);
+ this.frame_id_ = frame.details_.frameId();
+ this.inlined_frame_id_ = frame.details_.inlinedFrameIndex();
} else {
this.details_ = %GetFunctionScopeDetails(fun.value(), index);
+ this.fun_value_ = fun.value();
this.break_id_ = undefined;
}
+ this.index_ = index;
}
@@ -1867,6 +1871,22 @@ ScopeDetails.prototype.object = function() {
};
+ScopeDetails.prototype.setVariableValueImpl = function(name, new_value) {
+ var raw_res;
+ if (!IS_UNDEFINED(this.break_id_)) {
+ %CheckExecutionState(this.break_id_);
+ raw_res = %SetScopeVariableValue(this.break_id_, this.frame_id_,
+ this.inlined_frame_id_, this.index_, name, new_value);
+ } else {
+ raw_res = %SetScopeVariableValue(this.fun_value_, null, null, this.index_,
+ name, new_value);
+ }
+ if (!raw_res) {
+ throw new Error("Failed to set variable value");
+ }
+};
+
+
/**
* Mirror object for scope of frame or function. Either frame or function must
* be specified.
@@ -1914,6 +1934,11 @@ ScopeMirror.prototype.scopeObject = function() {
};
+ScopeMirror.prototype.setVariableValue = function(name, new_value) {
+ this.details_.setVariableValueImpl(name, new_value);
+};
+
+
/**
* Mirror object for script source.
* @param {Script} script The script object
« no previous file with comments | « src/debug-debugger.js ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698