Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: base/debug_util.cc

Issue 201050: Print stack trace on exception in unit tests on Windows.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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) { 21 const void *const *StackTrace::Addresses(size_t* count) {
22 *count = trace_.size(); 22 *count = count_;
23 if (trace_.size()) 23 if (count_)
24 return &trace_[0]; 24 return trace_;
25 return NULL; 25 return NULL;
26 } 26 }
OLDNEW
« no previous file with comments | « base/debug_util.h ('k') | base/debug_util_posix.cc » ('j') | base/debug_util_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698