OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef BASE_DEBUG_STACK_TRACE_H_ | 5 #ifndef BASE_DEBUG_STACK_TRACE_H_ |
6 #define BASE_DEBUG_STACK_TRACE_H_ | 6 #define BASE_DEBUG_STACK_TRACE_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 #endif | 57 #endif |
58 | 58 |
59 // Copying and assignment are allowed with the default functions. | 59 // Copying and assignment are allowed with the default functions. |
60 | 60 |
61 ~StackTrace(); | 61 ~StackTrace(); |
62 | 62 |
63 // Gets an array of instruction pointer values. |*count| will be set to the | 63 // Gets an array of instruction pointer values. |*count| will be set to the |
64 // number of elements in the returned array. | 64 // number of elements in the returned array. |
65 const void* const* Addresses(size_t* count) const; | 65 const void* const* Addresses(size_t* count) const; |
66 | 66 |
67 #if !defined(__UCLIBC__) | |
68 // Prints the stack trace to stderr. | 67 // Prints the stack trace to stderr. |
69 void Print() const; | 68 void Print() const; |
70 | 69 |
71 // Resolves backtrace to symbols and write to stream. | 70 // Resolves backtrace to symbols and write to stream. |
72 void OutputToStream(std::ostream* os) const; | 71 void OutputToStream(std::ostream* os) const; |
73 #endif | |
74 | 72 |
75 // Resolves backtrace to symbols and returns as string. | 73 // Resolves backtrace to symbols and returns as string. |
76 std::string ToString() const; | 74 std::string ToString() const; |
77 | 75 |
78 private: | 76 private: |
79 // From http://msdn.microsoft.com/en-us/library/bb204633.aspx, | 77 // From http://msdn.microsoft.com/en-us/library/bb204633.aspx, |
80 // the sum of FramesToSkip and FramesToCapture must be less than 63, | 78 // the sum of FramesToSkip and FramesToCapture must be less than 63, |
81 // so set it to 62. Even if on POSIX it could be a larger value, it usually | 79 // so set it to 62. Even if on POSIX it could be a larger value, it usually |
82 // doesn't give much more information. | 80 // doesn't give much more information. |
83 static const int kMaxTraces = 62; | 81 static const int kMaxTraces = 62; |
(...skipping 19 matching lines...) Expand all Loading... |
103 int base, | 101 int base, |
104 size_t padding); | 102 size_t padding); |
105 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) | 103 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) |
106 | 104 |
107 } // namespace internal | 105 } // namespace internal |
108 | 106 |
109 } // namespace debug | 107 } // namespace debug |
110 } // namespace base | 108 } // namespace base |
111 | 109 |
112 #endif // BASE_DEBUG_STACK_TRACE_H_ | 110 #endif // BASE_DEBUG_STACK_TRACE_H_ |
OLD | NEW |