| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/debug_util.h" | 5 #include "base/debug_util.h" |
| 6 | 6 |
| 7 #include "base/platform_thread.h" | 7 #include "base/platform_thread.h" |
| 8 | 8 |
| 9 bool DebugUtil::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) { | 10 for (int i = 0; i < wait_seconds * 10; ++i) { |
| 11 if (BeingDebugged()) { | 11 if (BeingDebugged()) { |
| 12 if (!silent) | 12 if (!silent) |
| 13 BreakDebugger(); | 13 BreakDebugger(); |
| 14 return true; | 14 return true; |
| 15 } | 15 } |
| 16 PlatformThread::Sleep(100); | 16 PlatformThread::Sleep(100); |
| 17 } | 17 } |
| 18 return false; | 18 return false; |
| 19 } | 19 } |
| 20 | 20 |
| 21 const void *const *StackTrace::Addresses(size_t* count) { |
| 22 *count = trace_.size(); |
| 23 if (trace_.size()) |
| 24 return &trace_[0]; |
| 25 return NULL; |
| 26 } |
| OLD | NEW |