Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
761a4b682964f84a32b2f8d0f325d8d686c286e7
[simgrid.git] / include / xbt / backtrace.h
1 /* Copyright (c) 2005-2018. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #ifndef XBT_BACKTRACE_H
7 #define XBT_BACKTRACE_H
8
9 #include <xbt/base.h>
10
11 SG_BEGIN_DECL()
12
13 typedef void* xbt_backtrace_location_t;
14
15 /** @brief Shows a backtrace of the current location */
16 XBT_PUBLIC void xbt_backtrace_display_current();
17
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);
20
21 /** @brief Captures a backtrace for further use */
22 XBT_PUBLIC size_t xbt_backtrace_current(xbt_backtrace_location_t* loc, size_t count);
23
24 /** @brief Display a previously captured backtrace */
25 XBT_PUBLIC void xbt_backtrace_display(xbt_backtrace_location_t* loc, size_t count);
26
27 /** @brief Get current backtrace with libunwind */
28 XBT_PUBLIC int xbt_libunwind_backtrace(void** bt, int size);
29
30 SG_END_DECL()
31
32 #endif