blob: 497dbe7bc40cee150d9d136892631154a4d77d2d [file] [log] [blame]
license.botf003cfe2008-08-24 09:55:55 +09001// Copyright (c) 2006-2008 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.
initial.commit3f4a7322008-07-27 06:49:38 +09004
initial.commit3f4a7322008-07-27 06:49:38 +09005#include "base/debug_util.h"
6
deanm@google.comc2b652a2008-08-13 20:15:11 +09007#include "base/platform_thread.h"
initial.commit3f4a7322008-07-27 06:49:38 +09008
initial.commit3f4a7322008-07-27 06:49:38 +09009bool DebugUtil::WaitForDebugger(int wait_seconds, bool silent) {
10 for (int i = 0; i < wait_seconds * 10; ++i) {
deanm@google.comc2b652a2008-08-13 20:15:11 +090011 if (BeingDebugged()) {
12 if (!silent)
13 BreakDebugger();
initial.commit3f4a7322008-07-27 06:49:38 +090014 return true;
15 }
deanm@google.comc2b652a2008-08-13 20:15:11 +090016 PlatformThread::Sleep(100);
initial.commit3f4a7322008-07-27 06:49:38 +090017 }
18 return false;
19}
license.botf003cfe2008-08-24 09:55:55 +090020