1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/debug/debugger.h"
6 #include "base/logging.h"
7 #include "base/threading/platform_thread.h"
12 static bool is_debug_ui_suppressed
= false;
14 bool WaitForDebugger(int wait_seconds
, bool silent
) {
15 #if defined(OS_ANDROID)
16 // The pid from which we know which process to attach to are not output by
17 // android ddms, so we have to print it out explicitly.
18 DLOG(INFO
) << "DebugUtil::WaitForDebugger(pid=" << static_cast<int>(getpid())
21 for (int i
= 0; i
< wait_seconds
* 10; ++i
) {
22 if (BeingDebugged()) {
27 PlatformThread::Sleep(TimeDelta::FromMilliseconds(100));
32 void SetSuppressDebugUI(bool suppress
) {
33 is_debug_ui_suppressed
= suppress
;
36 bool IsDebugUISuppressed() {
37 return is_debug_ui_suppressed
;