Revision: 3624
Author: [email protected]
Date: Fri Jan 15 14:40:57 2010
Log: Make debugger unloading deferred operation

This CL should make debugger handler setting an asynchronous operation for real.

Review URL: http://codereview.chromium.org/548045
http://code.google.com/p/v8/source/detail?r=3624

Modified:
 /branches/bleeding_edge/src/debug.cc
 /branches/bleeding_edge/src/debug.h
 /branches/bleeding_edge/test/cctest/test-debug.cc

=======================================
--- /branches/bleeding_edge/src/debug.cc        Fri Jan 15 05:42:32 2010
+++ /branches/bleeding_edge/src/debug.cc        Fri Jan 15 14:40:57 2010
@@ -2381,17 +2381,12 @@
   if (IsDebuggerActive()) {
     // Disable the compilation cache when the debugger is active.
     CompilationCache::Disable();
+    debugger_unload_pending_ = false;
   } else {
     CompilationCache::Enable();
-
     // Unload the debugger if event listener and message handler cleared.
-    if (Debug::InDebugger()) {
- // If we are in debugger set the flag to unload the debugger when last
-      // EnterDebugger on the current stack is destroyed.
-      debugger_unload_pending_ = true;
-    } else {
-      UnloadDebugger();
-    }
+    // Schedule this for later, because we may be in non-V8 thread.
+    debugger_unload_pending_ = true;
   }
 }

=======================================
--- /branches/bleeding_edge/src/debug.h Fri Dec 18 12:30:29 2009
+++ /branches/bleeding_edge/src/debug.h Fri Jan 15 14:40:57 2010
@@ -654,7 +654,9 @@

     // Check whether the message handler was been cleared.
     if (debugger_unload_pending_) {
-      UnloadDebugger();
+      if (Debug::debugger_entry() == NULL) {
+        UnloadDebugger();
+      }
     }

     // Currently argument event is not used.
=======================================
--- /branches/bleeding_edge/test/cctest/test-debug.cc Fri Jan 15 13:14:56 2010 +++ /branches/bleeding_edge/test/cctest/test-debug.cc Fri Jan 15 14:40:57 2010
@@ -443,6 +443,9 @@

 // Check that the debugger has been fully unloaded.
 static void CheckDebuggerUnloaded(bool check_functions = false) {
+  // Let debugger to unload itself synchronously
+  v8::Debug::ProcessDebugMessages();
+
   v8::internal::CheckDebuggerUnloaded(check_functions);
 }

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to