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

Unified Diff: src/debug.cc

Issue 12472: Added a debugger call to run a JavaScript function in the debugger. When call... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 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
« no previous file with comments | « src/debug.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
===================================================================
--- src/debug.cc (revision 848)
+++ src/debug.cc (working copy)
@@ -1650,6 +1650,30 @@
}
+Handle<Object> Debugger::Call(Handle<JSFunction> fun,
+ Handle<Object> data,
+ bool* pending_exception) {
+ // Enter the debugger.
+ EnterDebugger debugger;
+ if (debugger.FailedToEnter() || !debugger.HasJavaScriptFrames()) {
+ return Factory::undefined_value();
+ }
+
+ // Create the execution state.
+ bool caught_exception = false;
+ Handle<Object> exec_state = MakeExecutionState(&caught_exception);
+ if (caught_exception) {
+ return Factory::undefined_value();
+ }
+
+ static const int kArgc = 2;
+ Object** argv[kArgc] = { exec_state.location(), data.location() };
+ Handle<Object> result = Execution::Call(fun, Factory::undefined_value(),
+ kArgc, argv, pending_exception);
+ return result;
+}
+
+
DebugMessageThread::DebugMessageThread()
: host_running_(true),
command_queue_(kQueueInitialSize),
« no previous file with comments | « src/debug.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698