MRPT
1.9.9
mrpt
system
backtrace.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
#pragma once
10
11
#include <string>
12
#include <vector>
13
14
namespace
mrpt::system
15
{
16
/** Used in getCallStackBackTrace() */
17
struct
TCallStackEntry
18
{
19
inline
TCallStackEntry
() :
address
(nullptr) {}
20
/** Address of the calling point */
21
void
*
address
;
22
/** Demangled symbol name */
23
std::string
symbolName
;
24
/** Original (before demangle) symbol name */
25
std::string
symbolNameOriginal
;
26
};
27
28
#ifdef _MSC_VER
29
template
class
std::vector<TCallStackEntry>;
30
#endif
31
32
/** See: getCallStackBackTrace() */
33
struct
TCallStackBackTrace
34
{
35
TCallStackBackTrace
();
36
std::vector<TCallStackEntry>
backtrace_levels
;
37
38
/** Prints all backtrace entries, one per line in a human-readable format.
39
*/
40
std::string asString()
const
;
41
};
42
43
/** Returns a list of strings representing the current call stack
44
* backtrace. If possible, human-readable names are used for
45
* functions.
46
*/
47
void
getCallStackBackTrace
(
TCallStackBackTrace
& out_bt);
48
49
}
// namespace mrpt::system
mrpt::system::TCallStackEntry
Used in getCallStackBackTrace()
Definition:
backtrace.h:17
mrpt::system
Definition:
backtrace.h:14
mrpt::system::getCallStackBackTrace
void getCallStackBackTrace(TCallStackBackTrace &out_bt)
Returns a list of strings representing the current call stack backtrace.
Definition:
backtrace.cpp:32
mrpt::system::TCallStackEntry::address
void * address
Address of the calling point.
Definition:
backtrace.h:21
mrpt::system::TCallStackEntry::symbolName
std::string symbolName
Demangled symbol name.
Definition:
backtrace.h:23
mrpt::system::TCallStackEntry::TCallStackEntry
TCallStackEntry()
Definition:
backtrace.h:19
mrpt::system::TCallStackBackTrace::backtrace_levels
std::vector< TCallStackEntry > backtrace_levels
Definition:
backtrace.h:36
mrpt::system::TCallStackEntry::symbolNameOriginal
std::string symbolNameOriginal
Original (before demangle) symbol name.
Definition:
backtrace.h:25
mrpt::system::TCallStackBackTrace
See: getCallStackBackTrace()
Definition:
backtrace.h:33
Page generated by
Doxygen 1.8.14
for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020