1 /* Copyright (c) 2005-2018. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef XBT_BACKTRACE_H
7 #define XBT_BACKTRACE_H
13 typedef void* xbt_backtrace_location_t;
15 /** @brief Shows a backtrace of the current location */
16 XBT_PUBLIC void xbt_backtrace_display_current();
18 /** @brief reimplementation of glibc backtrace based directly on gcc library, without implicit malloc */
19 XBT_PUBLIC int xbt_backtrace_no_malloc(void** bt, int size);
21 /** @brief Captures a backtrace for further use */
22 XBT_PUBLIC size_t xbt_backtrace_current(xbt_backtrace_location_t* loc, size_t count);
24 /** @brief Display a previously captured backtrace */
25 XBT_PUBLIC void xbt_backtrace_display(xbt_backtrace_location_t* loc, size_t count);
27 /** @brief Get current backtrace with libunwind */
28 XBT_PUBLIC int xbt_libunwind_backtrace(void** bt, int size);