/** @brief Exception destructor */
XBT_PUBLIC(void) xbt_ex_free(xbt_ex_t e);
-XBT_PUBLIC(void) xbt_ex_display(xbt_ex_t *e);
-XBT_PUBLIC(void) xbt_backtrace_display(void);
+/** @brief Shows a backtrace of the current location */
+XBT_PUBLIC(void) xbt_backtrace_display_current(void);
+
+/** @brief Captures a backtrace for further use */
+XBT_PUBLIC(void) xbt_backtrace_current(xbt_ex_t *e);
+/** @brief Display a previously captured backtrace */
+XBT_PUBLIC(void) xbt_backtrace_display(xbt_ex_t *e);
/** @} */
#endif /* __XBT_EX_H__ */
}
}
WARN1("Ignoring request to free an unknown socket (%p). Execution stack:",sock);
- xbt_backtrace_display();
+ xbt_backtrace_display_current();
}
XBT_OUT;
}
#if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
static void gras_sigusr_handler(int sig) {
INFO0("SIGUSR1 received. Display the backtrace");
- xbt_backtrace_display();
+ xbt_backtrace_display_current();
}
static void gras_sigint_handler(int sig) {
static double lastone = 0;
if (lastone == 0 || xbt_os_time() - lastone > 5) {
- xbt_backtrace_display();
+ xbt_backtrace_display_current();
fprintf(stderr,
"\nBacktrace displayed because Ctrl-C was pressed. Press again (within 5 sec) to abort the process.\n");
lastone = xbt_os_time();
#include "xbt/log.h"
#include "xbt/dynar.h"
#include "xbt/xbt_os_thread.h"
+#include "xbt/ex_interface.h"
#include "java/jxbt_context.h"
#include "java/jmsg.h"
#include "java/jmsg_process.h"