-/* ex - Exception Handling */
-
/* Copyright (c) 2005-2015. The SimGrid Team.
* All rights reserved. */
#include <stdlib.h>
-#ifdef __cplusplus
-#include <string>
-#include <vector>
-#include <stdexcept>
-#endif
-
#include "xbt/base.h"
#include "xbt/sysdep.h"
#include "xbt/misc.h"
vm_error /**< vm error */
} xbt_errcat_t;
-#ifdef __cplusplus
-XBT_PUBLIC_CLASS xbt_ex : public std::runtime_error {
-public:
- xbt_ex() : std::runtime_error("") {}
- xbt_ex(const char* message) : std::runtime_error(message) {}
- ~xbt_ex() override;
-
- xbt_errcat_t category; /**< category like HTTP (what went wrong) */
- int value; /**< like errno (why did it went wrong) */
- /* throw point */
- std::string procname; /**< Name of the process who thrown this */
- int pid; /**< PID of the process who thrown this */
- const char *file; /**< Thrown point */
- int line; /**< Thrown point */
- const char *func; /**< Thrown point */
- /* Backtrace */
- std::vector<std::string> bt_strings;
- std::vector<void*> bt;
-};
-#endif
-
SG_BEGIN_DECL()
XBT_PUBLIC(const char *) xbt_ex_catname(xbt_errcat_t cat);
/** @brief The display made by an exception that is not catched */
XBT_PUBLIC(void) xbt_ex_display(xbt_ex_t * e);
-/** @brief Shows a backtrace of the current location */
-XBT_PUBLIC(void) xbt_backtrace_display_current(void);
-/** @brief reimplementation of glibc backtrace based directly on gcc library, without implicit malloc */
-XBT_PUBLIC(int) xbt_backtrace_no_malloc(void**bt, int size);
-/** @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);
-/** @brief Get current backtrace with libunwind */
-XBT_PUBLIC(int) xbt_libunwind_backtrace(void *bt[XBT_BACKTRACE_SIZE], int size);
-
SG_END_DECL()
/** @} */