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

Unified Diff: runtime/vm/thread_interrupter.cc

Issue 2682343002: Disable the profiler when a debugger is attached (Closed)
Patch Set: vegorov review 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
« no previous file with comments | « runtime/vm/thread_interrupter.h ('k') | runtime/vm/thread_interrupter_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_interrupter.cc
diff --git a/runtime/vm/thread_interrupter.cc b/runtime/vm/thread_interrupter.cc
index 0ad9ead78a78515ad8db21d12bffd6bca09eacf7..0372f68bcf3b44b79e4ef72a21d4e72ff27eda5a 100644
--- a/runtime/vm/thread_interrupter.cc
+++ b/runtime/vm/thread_interrupter.cc
@@ -70,8 +70,17 @@ void ThreadInterrupter::InitOnce() {
void ThreadInterrupter::Startup() {
ASSERT(initialized_);
+ if (IsDebuggerAttached()) {
+ MonitorLocker shutdown_ml(monitor_);
+ shutdown_ = true;
+ if (FLAG_trace_thread_interrupter) {
+ OS::PrintErr(
+ "ThreadInterrupter disabled because a debugger is attached.\n");
+ }
+ return;
+ }
if (FLAG_trace_thread_interrupter) {
- OS::Print("ThreadInterrupter starting up.\n");
+ OS::PrintErr("ThreadInterrupter starting up.\n");
}
ASSERT(interrupter_thread_id_ == OSThread::kInvalidThreadJoinId);
{
@@ -83,7 +92,7 @@ void ThreadInterrupter::Startup() {
}
ASSERT(interrupter_thread_id_ != OSThread::kInvalidThreadJoinId);
if (FLAG_trace_thread_interrupter) {
- OS::Print("ThreadInterrupter running.\n");
+ OS::PrintErr("ThreadInterrupter running.\n");
}
}
@@ -100,7 +109,7 @@ void ThreadInterrupter::Shutdown() {
shutdown_ml.Notify();
ASSERT(initialized_);
if (FLAG_trace_thread_interrupter) {
- OS::Print("ThreadInterrupter shutting down.\n");
+ OS::PrintErr("ThreadInterrupter shutting down.\n");
}
}
@@ -110,7 +119,7 @@ void ThreadInterrupter::Shutdown() {
interrupter_thread_id_ = OSThread::kInvalidThreadJoinId;
if (FLAG_trace_thread_interrupter) {
- OS::Print("ThreadInterrupter shut down.\n");
+ OS::PrintErr("ThreadInterrupter shut down.\n");
}
}
@@ -149,7 +158,7 @@ void ThreadInterrupter::ThreadMain(uword parameters) {
ASSERT(initialized_);
InstallSignalHandler();
if (FLAG_trace_thread_interrupter) {
- OS::Print("ThreadInterrupter thread running.\n");
+ OS::PrintErr("ThreadInterrupter thread running.\n");
}
{
// Signal to main thread we are ready.
@@ -215,7 +224,7 @@ void ThreadInterrupter::ThreadMain(uword parameters) {
}
RemoveSignalHandler();
if (FLAG_trace_thread_interrupter) {
- OS::Print("ThreadInterrupter thread exiting.\n");
+ OS::PrintErr("ThreadInterrupter thread exiting.\n");
}
{
// Signal to main thread we are exiting.
« no previous file with comments | « runtime/vm/thread_interrupter.h ('k') | runtime/vm/thread_interrupter_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698