Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modernize FindSimGrid
[simgrid.git] / include / xbt / backtrace.h
1 /* Copyright (c) 2005-2017. The SimGrid Team. All rights reserved.          */
2
3 #ifndef XBT_BACKTRACE_H
4 #define XBT_BACKTRACE_H
5
6 #ifdef __cplusplus
7 #include <cstddef>
8 #endif
9
10 #include <xbt/base.h>
11
12 SG_BEGIN_DECL()
13
14 typedef void* xbt_backtrace_location_t;
15
16 /** @brief Shows a backtrace of the current location */
17 XBT_PUBLIC(void) xbt_backtrace_display_current();
18
19 /** @brief reimplementation of glibc backtrace based directly on gcc library, without implicit malloc  */
20 XBT_PUBLIC(int) xbt_backtrace_no_malloc(void**bt, int size);
21
22 /** @brief Captures a backtrace for further use */
23 XBT_PUBLIC(size_t) xbt_backtrace_current(xbt_backtrace_location_t* loc, size_t count);
24
25 /** @brief Display a previously captured backtrace */
26 XBT_PUBLIC(void) xbt_backtrace_display(xbt_backtrace_location_t* loc, size_t count);
27
28 /** @brief Get current backtrace with libunwind */
29 XBT_PUBLIC(int) xbt_libunwind_backtrace(void** bt, int size);
30
31 SG_END_DECL()
32
33 #endif