• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // 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.
4 
5 #include "base/debug_util.h"
6 
7 #include "base/platform_thread.h"
8 
WaitForDebugger(int wait_seconds,bool silent)9 bool DebugUtil::WaitForDebugger(int wait_seconds, bool silent) {
10   for (int i = 0; i < wait_seconds * 10; ++i) {
11     if (BeingDebugged()) {
12       if (!silent)
13         BreakDebugger();
14       return true;
15     }
16     PlatformThread::Sleep(100);
17   }
18   return false;
19 }
20 
Addresses(size_t * count)21 const void *const *StackTrace::Addresses(size_t* count) {
22   *count = count_;
23   if (count_)
24     return trace_;
25   return NULL;
26 }
27