| 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__) |
| 67 // Prints the stack trace to stderr. | 68 // Prints the stack trace to stderr. |
| 68 void Print() const; | 69 void Print() const; |
| 69 | 70 |
| 70 // Resolves backtrace to symbols and write to stream. | 71 // Resolves backtrace to symbols and write to stream. |
| 71 void OutputToStream(std::ostream* os) const; | 72 void OutputToStream(std::ostream* os) const; |
| 73 #endif |
| 72 | 74 |
| 73 // Resolves backtrace to symbols and returns as string. | 75 // Resolves backtrace to symbols and returns as string. |
| 74 std::string ToString() const; | 76 std::string ToString() const; |
| 75 | 77 |
| 76 private: | 78 private: |
| 77 // From http://msdn.microsoft.com/en-us/library/bb204633.aspx, | 79 // From http://msdn.microsoft.com/en-us/library/bb204633.aspx, |
| 78 // the sum of FramesToSkip and FramesToCapture must be less than 63, | 80 // the sum of FramesToSkip and FramesToCapture must be less than 63, |
| 79 // so set it to 62. Even if on POSIX it could be a larger value, it usually | 81 // so set it to 62. Even if on POSIX it could be a larger value, it usually |
| 80 // doesn't give much more information. | 82 // doesn't give much more information. |
| 81 static const int kMaxTraces = 62; | 83 static const int kMaxTraces = 62; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 101 int base, | 103 int base, |
| 102 size_t padding); | 104 size_t padding); |
| 103 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) | 105 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) |
| 104 | 106 |
| 105 } // namespace internal | 107 } // namespace internal |
| 106 | 108 |
| 107 } // namespace debug | 109 } // namespace debug |
| 108 } // namespace base | 110 } // namespace base |
| 109 | 111 |
| 110 #endif // BASE_DEBUG_STACK_TRACE_H_ | 112 #endif // BASE_DEBUG_STACK_TRACE_H_ |
| OLD | NEW |