Last change
on this file was
2573,
checked in by ymipsl, 10 months ago
|
create new external source lib : cpptrace, for statck trace output
YM
|
File size:
621 bytes
|
Rev | Line | |
---|
[2573] | 1 | #ifndef CPPTRACE_HPP |
---|
| 2 | #define CPPTRACE_HPP |
---|
| 3 | |
---|
| 4 | #include "cpptrace_default.hpp" |
---|
| 5 | |
---|
| 6 | #include <cstdint> |
---|
| 7 | #include <string> |
---|
| 8 | #include <vector> |
---|
| 9 | |
---|
| 10 | #if defined(_WIN32) || defined(__CYGWIN__) |
---|
| 11 | #define CPPTRACE_API __declspec(dllexport) |
---|
| 12 | #else |
---|
| 13 | #define CPPTRACE_API |
---|
| 14 | #endif |
---|
| 15 | |
---|
| 16 | namespace cpptrace { |
---|
| 17 | struct stacktrace_frame { |
---|
| 18 | uintptr_t address; |
---|
| 19 | std::uint_least32_t line; |
---|
| 20 | std::uint_least32_t col; |
---|
| 21 | std::string filename; |
---|
| 22 | std::string symbol; |
---|
| 23 | }; |
---|
| 24 | CPPTRACE_API std::vector<stacktrace_frame> generate_trace(std::uint32_t skip = 0); |
---|
| 25 | CPPTRACE_API void print_trace(std::uint32_t skip = 0); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.