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

Unified Diff: src/debug.cc

Issue 781623004: [V8] Report v8::AfterCompile and v8::CompileError to listener on pause (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed tests Created 6 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.h ('k') | test/mjsunit/debug-clearbreakpointgroup.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index d8844cc414e3f03c64f803dac22fdfaa8c5a003f..a7321b2b157f074a02e8a8dd5bf7e78148803cbc 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -2630,8 +2630,12 @@ void Debug::OnException(Handle<Object> exception, bool uncaught,
void Debug::OnCompileError(Handle<Script> script) {
- // No more to do if not debugging.
- if (in_debug_scope() || ignore_events()) return;
+ if (ignore_events()) return;
+
+ if (in_debug_scope()) {
+ ProcessCompileEventInDebugScope(v8::CompileError, script);
+ return;
+ }
HandleScope scope(isolate_);
DebugScope debug_scope(this);
@@ -2692,8 +2696,12 @@ void Debug::OnAfterCompile(Handle<Script> script) {
// Add the newly compiled script to the script cache.
if (script_cache_ != NULL) script_cache_->Add(script);
- // No more to do if not debugging.
- if (in_debug_scope() || ignore_events()) return;
+ if (ignore_events()) return;
+
+ if (in_debug_scope()) {
+ ProcessCompileEventInDebugScope(v8::AfterCompile, script);
+ return;
+ }
HandleScope scope(isolate_);
DebugScope debug_scope(this);
@@ -2848,6 +2856,27 @@ void Debug::CallEventCallback(v8::DebugEvent event,
}
+void Debug::ProcessCompileEventInDebugScope(v8::DebugEvent event,
+ Handle<Script> script) {
+ if (event_listener_.is_null()) return;
+
+ SuppressDebug while_processing(this);
+ DebugScope debug_scope(this);
+ if (debug_scope.failed()) return;
+
+ Handle<Object> event_data;
+ // Bail out and don't call debugger if exception.
+ if (!MakeCompileEvent(script, event).ToHandle(&event_data)) return;
+
+ // Create the execution state.
+ Handle<Object> exec_state;
+ // Bail out and don't call debugger if exception.
+ if (!MakeExecutionState().ToHandle(&exec_state)) return;
+
+ CallEventCallback(event, exec_state, event_data, NULL);
+}
+
+
Handle<Context> Debug::GetDebugContext() {
DebugScope debug_scope(this);
// The global handle may be destroyed soon after. Return it reboxed.
« no previous file with comments | « src/debug.h ('k') | test/mjsunit/debug-clearbreakpointgroup.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698