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

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: Created 8 years, 1 month 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
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index a5331a014de6f79f30404dd19a5965a5a7969769..a4fe425fa19994d81d8509257313f720219321b6 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,20 @@ 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);
Yang 2012/11/19 17:00:55 80 char limit
Peter Rybin 2012/11/20 22:27:21 Done.
+ } 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 +1932,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
« src/debug-debugger.js ('K') | « src/debug-debugger.js ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698