Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modernize FindSimGrid
[simgrid.git] / include / xbt / backtrace.hpp
1 /* Copyright (c) 2005-2019. The SimGrid Team.
2  * All rights reserved. */
3
4 #ifndef SIMGRIX_XBT_BACKTRACE_HPP
5 #define SIMGRIX_XBT_BACKTRACE_HPP
6
7 #include <cstddef>
8
9 #include <string>
10 #include <memory>
11 #include <vector>
12
13 #include <xbt/base.h>
14 #include <xbt/backtrace.h>
15
16 namespace simgrid {
17 namespace xbt {
18
19 /** Try to demangle a C++ name
20  *
21  *  Return the origin string if this fails.
22  */
23 XBT_PUBLIC() std::unique_ptr<char, void(*)(void*)> demangle(const char* name);
24
25 /** Get the current backtrace */
26 XBT_PUBLIC(std::vector<xbt_backtrace_location_t>) backtrace();
27
28 /* Translate the backtrace in a human friendly form
29  *
30  *  Try ro resolve symbols and source code location.
31  */
32 XBT_PUBLIC(std::vector<std::string>) resolveBacktrace(
33   xbt_backtrace_location_t const* loc, std::size_t count);
34
35 }
36 }
37
38 #endif