summaryrefslogtreecommitdiffstats
path: root/src/debug-debugger.js
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 13:52:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:41:47 +0100
commitb0fe1620dcb4135ac3ab2d66ff93072373911299 (patch)
tree3487cdc7e01ec56a6f84ea20f4bae596a0b73986 /src/debug-debugger.js
parentdf5bff59602802b769e994b0dc1d8869a27fa40c (diff)
downloadandroid_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.tar.gz
android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.tar.bz2
android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.zip
Update V8 to r6101 as required by WebKit r74534
Change-Id: I7f84af8dd732f11898fd644b2c2b1538914cb78d
Diffstat (limited to 'src/debug-debugger.js')
-rw-r--r--src/debug-debugger.js36
1 files changed, 29 insertions, 7 deletions
diff --git a/src/debug-debugger.js b/src/debug-debugger.js
index d091991a..090c661d 100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -858,6 +858,7 @@ Debug.debuggerFlags = function() {
return debugger_flags;
};
+Debug.MakeMirror = MakeMirror;
function MakeExecutionState(break_id) {
return new ExecutionState(break_id);
@@ -876,9 +877,11 @@ ExecutionState.prototype.prepareStep = function(opt_action, opt_count) {
return %PrepareStep(this.break_id, action, count);
}
-ExecutionState.prototype.evaluateGlobal = function(source, disable_break) {
- return MakeMirror(
- %DebugEvaluateGlobal(this.break_id, source, Boolean(disable_break)));
+ExecutionState.prototype.evaluateGlobal = function(source, disable_break,
+ opt_additional_context) {
+ return MakeMirror(%DebugEvaluateGlobal(this.break_id, source,
+ Boolean(disable_break),
+ opt_additional_context));
};
ExecutionState.prototype.frameCount = function() {
@@ -1837,6 +1840,7 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
var frame = request.arguments.frame;
var global = request.arguments.global;
var disable_break = request.arguments.disable_break;
+ var additional_context = request.arguments.additional_context;
// The expression argument could be an integer so we convert it to a
// string.
@@ -1850,12 +1854,30 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
if (!IS_UNDEFINED(frame) && global) {
return response.failed('Arguments "frame" and "global" are exclusive');
}
+
+ var additional_context_object;
+ if (additional_context) {
+ additional_context_object = {};
+ for (var i = 0; i < additional_context.length; i++) {
+ var mapping = additional_context[i];
+ if (!IS_STRING(mapping.name) || !IS_NUMBER(mapping.handle)) {
+ return response.failed("Context element #" + i +
+ " must contain name:string and handle:number");
+ }
+ var context_value_mirror = LookupMirror(mapping.handle);
+ if (!context_value_mirror) {
+ return response.failed("Context object '" + mapping.name +
+ "' #" + mapping.handle + "# not found");
+ }
+ additional_context_object[mapping.name] = context_value_mirror.value();
+ }
+ }
// Global evaluate.
if (global) {
// Evaluate in the global context.
- response.body =
- this.exec_state_.evaluateGlobal(expression, Boolean(disable_break));
+ response.body = this.exec_state_.evaluateGlobal(
+ expression, Boolean(disable_break), additional_context_object);
return;
}
@@ -1877,12 +1899,12 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
}
// Evaluate in the specified frame.
response.body = this.exec_state_.frame(frame_number).evaluate(
- expression, Boolean(disable_break));
+ expression, Boolean(disable_break), additional_context_object);
return;
} else {
// Evaluate in the selected frame.
response.body = this.exec_state_.frame().evaluate(
- expression, Boolean(disable_break));
+ expression, Boolean(disable_break), additional_context_object);
return;
}
};