MRPT
2.0.4
test.cpp
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 details in https://www.mrpt.org/License |
8
+---------------------------------------------------------------------------+
9
*/
10
11
#include <
mrpt/core/exceptions.h
>
12
#include <
mrpt/system/backtrace.h
>
13
#include <iostream>
14
15
class
Foo
16
{
17
public
:
18
static
int
func1
(
int
a,
int
b)
19
{
20
mrpt::system::TCallStackBackTrace
bt;
21
mrpt::system::getCallStackBackTrace
(bt);
22
std::cout << bt.
asString
();
23
return
a + b;
24
}
25
};
26
27
int
main
()
28
{
29
try
30
{
31
Foo::func1
(1, 2);
32
return
0;
33
}
34
catch
(
const
std::exception& e)
35
{
36
std::cerr <<
"MRPT error: "
<<
mrpt::exception_to_str
(e) << std::endl;
37
return
-1;
38
}
39
}
Foo::func1
static int func1(int a, int b)
Definition:
vision_stereo_rectify/test.cpp:18
exceptions.h
Foo
Definition:
EigenAlignment_unittest.cpp:39
mrpt::system::TCallStackBackTrace::asString
std::string asString() const
Prints all backtrace entries, one per line in a human-readable format.
Definition:
backtrace.cpp:124
backtrace.h
main
int main()
Definition:
vision_stereo_rectify/test.cpp:78
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::TCallStackBackTrace
See: getCallStackBackTrace()
Definition:
backtrace.h:34
mrpt::exception_to_str
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
Definition:
exceptions.cpp:59
Page generated by
Doxygen 1.8.18
for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020