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

Unified Diff: runtime/vm/thread_interrupter.cc

Issue 2682343002: Disable the profiler when a debugger is attached (Closed)
Patch Set: Created 3 years, 10 months 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
Index: runtime/vm/thread_interrupter.cc
diff --git a/runtime/vm/thread_interrupter.cc b/runtime/vm/thread_interrupter.cc
index 0ad9ead78a78515ad8db21d12bffd6bca09eacf7..b9d583a531f4b491534016938eef56eb12f8fbd9 100644
--- a/runtime/vm/thread_interrupter.cc
+++ b/runtime/vm/thread_interrupter.cc
@@ -70,6 +70,14 @@ void ThreadInterrupter::InitOnce() {
void ThreadInterrupter::Startup() {
ASSERT(initialized_);
+ if (IsDebuggerAttached()) {
+ MonitorLocker shutdown_ml(monitor_);
+ shutdown_ = true;
+ if (FLAG_trace_thread_interrupter) {
+ OS::Print("ThreadInterrupter disabled because a debugger is attached.\n");
Vyacheslav Egorov (Google) 2017/02/09 17:14:05 OS::PrintErr?
Cutch 2017/02/09 18:34:07 Done here and elsewhere
+ }
+ return;
+ }
if (FLAG_trace_thread_interrupter) {
OS::Print("ThreadInterrupter starting up.\n");
}

Powered by Google App Engine
This is Rietveld 408576698