blob: 2a6cac26945a50bfeaeab448ae41fbf6a39e28d3 [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
mark@chromium.org2fa8efb2009-01-17 07:06:19 +090021const void *const *StackTrace::Addresses(size_t* count) {
maruel@chromium.org6b771272009-09-09 08:53:53 +090022 *count = count_;
23 if (count_)
24 return trace_;
mark@chromium.org2fa8efb2009-01-17 07:06:19 +090025 return NULL;
26}