debugger.cc revision 513209b27ff55e2841eac0e4120199c23acce758
1// Copyright (c) 2010 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.
4
5#include "base/debug/debugger.h"
6
7#include "base/platform_thread.h"
8
9namespace base {
10namespace debug {
11
12bool WaitForDebugger(int wait_seconds, bool silent) {
13  for (int i = 0; i < wait_seconds * 10; ++i) {
14    if (BeingDebugged()) {
15      if (!silent)
16        BreakDebugger();
17      return true;
18    }
19    PlatformThread::Sleep(100);
20  }
21  return false;
22}
23
24}  // namespace debug
25}  // namespace base
26