summaryrefslogtreecommitdiffstats
path: root/base/debug_util.h
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-24 00:13:08 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-24 00:13:08 +0000
commit96fd00320f4eef1cc52f68939f86b319f6d2095f (patch)
tree8fd31ba95099df9a246e95792162e2ab812128d6 /base/debug_util.h
parent719ceedfb713882fb1308fc99cac13962d5c8fb8 (diff)
downloadchromium_src-96fd00320f4eef1cc52f68939f86b319f6d2095f.zip
chromium_src-96fd00320f4eef1cc52f68939f86b319f6d2095f.tar.gz
chromium_src-96fd00320f4eef1cc52f68939f86b319f6d2095f.tar.bz2
Print backtraces on FATAL log messages in debug mode.
This provides basic support for looking up backtrace information on GNU libc systems and in Windows. The code is only enabled for FATAL log messages in debug mode. In a release build, it is unlikely that symbols will be available making the backtrace less useful. Review URL: http://codereview.chromium.org/62140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug_util.h')
-rw-r--r--base/debug_util.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/base/debug_util.h b/base/debug_util.h
index de49c43..3ca199c 100644
--- a/base/debug_util.h
+++ b/base/debug_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,10 +9,11 @@
#ifndef BASE_DEBUG_UTIL_H_
#define BASE_DEBUG_UTIL_H_
-#include "base/basictypes.h"
-
+#include <iostream>
#include <vector>
+#include "base/basictypes.h"
+
// A stacktrace can be helpful in debugging. For example, you can include a
// stacktrace member in a object (probably around #ifndef NDEBUG) so that you
// can later see where the given object was created from.
@@ -26,6 +27,9 @@ class StackTrace {
// Print a backtrace to stderr
void PrintBacktrace();
+ // Resolve backtrace to symbols and write to stream.
+ void OutputToStream(std::ostream* os);
+
private:
std::vector<void*> trace_;