Index: runtime/vm/exceptions.cc |
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc |
index 343373fa127adef6f5465ce76ed174207d028ef2..767be8c21d2215bbd7624c9ca40ca9c08b8bba6b 100644 |
--- a/runtime/vm/exceptions.cc |
+++ b/runtime/vm/exceptions.cc |
@@ -763,13 +763,13 @@ void Exceptions::Throw(Thread* thread, const Instance& exception) { |
// Do not notify debugger on stack overflow and out of memory exceptions. |
// The VM would crash when the debugger calls back into the VM to |
// get values of variables. |
- if (FLAG_support_debugger) { |
- Isolate* isolate = thread->isolate(); |
- if (exception.raw() != isolate->object_store()->out_of_memory() && |
- exception.raw() != isolate->object_store()->stack_overflow()) { |
- isolate->debugger()->PauseException(exception); |
- } |
+#if !defined(PRODUCT) |
+ Isolate* isolate = thread->isolate(); |
+ if (exception.raw() != isolate->object_store()->out_of_memory() && |
+ exception.raw() != isolate->object_store()->stack_overflow()) { |
+ isolate->debugger()->PauseException(exception); |
} |
+#endif |
// Null object is a valid exception object. |
ThrowExceptionHelper(thread, exception, StackTrace::Handle(thread->zone()), |
false); |