1 /* Copyright (c) 2005-2018. The SimGrid Team. All rights reserved. */
3 #ifndef XBT_BACKTRACE_H
4 #define XBT_BACKTRACE_H
14 typedef void* xbt_backtrace_location_t;
16 /** @brief Shows a backtrace of the current location */
17 XBT_PUBLIC void xbt_backtrace_display_current();
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);
22 /** @brief Captures a backtrace for further use */
23 XBT_PUBLIC size_t xbt_backtrace_current(xbt_backtrace_location_t* loc, size_t count);
25 /** @brief Display a previously captured backtrace */
26 XBT_PUBLIC void xbt_backtrace_display(xbt_backtrace_location_t* loc, size_t count);
28 /** @brief Get current backtrace with libunwind */
29 XBT_PUBLIC int xbt_libunwind_backtrace(void** bt, int size);