license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame] | 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. |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 4 | |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 5 | #include "base/debug_util.h" |
| 6 | |
deanm@google.com | c2b652a | 2008-08-13 20:15:11 +0900 | [diff] [blame] | 7 | #include "base/platform_thread.h" |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 8 | |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 9 | bool DebugUtil::WaitForDebugger(int wait_seconds, bool silent) { |
| 10 | for (int i = 0; i < wait_seconds * 10; ++i) { |
deanm@google.com | c2b652a | 2008-08-13 20:15:11 +0900 | [diff] [blame] | 11 | if (BeingDebugged()) { |
| 12 | if (!silent) |
| 13 | BreakDebugger(); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 14 | return true; |
| 15 | } |
deanm@google.com | c2b652a | 2008-08-13 20:15:11 +0900 | [diff] [blame] | 16 | PlatformThread::Sleep(100); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 17 | } |
| 18 | return false; |
| 19 | } |
license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame] | 20 | |
mark@chromium.org | 2fa8efb | 2009-01-17 07:06:19 +0900 | [diff] [blame] | 21 | const void *const *StackTrace::Addresses(size_t* count) { |
maruel@chromium.org | 6b77127 | 2009-09-09 08:53:53 +0900 | [diff] [blame] | 22 | *count = count_; |
| 23 | if (count_) |
| 24 | return trace_; |
mark@chromium.org | 2fa8efb | 2009-01-17 07:06:19 +0900 | [diff] [blame] | 25 | return NULL; |
| 26 | } |