/* ex - Exception Handling */
-/* Copyright (c) 2005-2013. The SimGrid Team. */
+/* Copyright (c) 2005-2015. The SimGrid Team.
+ * All rights reserved. */
+
/* Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com> */
/* Copyright (c) 2002-2004 The OSSP Project <http://www.ossp.org/> */
/* Copyright (c) 2002-2004 Cable & Wireless <http://www.cw.com/> */
thread_error, /**< error while [un]locking */
host_error, /**< host failed */
tracing_error, /**< error during the simulation tracing */
- io_error, /**< disk or file error */
+ io_error, /**< disk or file error */
vm_error /**< vm error */
} xbt_errcat_t;
{ \
xbt_running_ctx_t *__xbt_ex_ctx_ptr = __xbt_running_ctx_fetch(); \
int __ex_cleanup = 0; \
- __ex_mctx_t *__ex_mctx_en; \
__ex_mctx_t __ex_mctx_me; \
- __ex_mctx_en = __xbt_ex_ctx_ptr->ctx_mctx; \
+ __ex_mctx_t * __ex_mctx_en = __xbt_ex_ctx_ptr->ctx_mctx; \
__xbt_ex_ctx_ptr->ctx_mctx = &__ex_mctx_me; \
if (__ex_mctx_save(&__ex_mctx_me)) { \
if (1)
_throw_ctx->exception.bt_strings = NULL; \
xbt_backtrace_current((xbt_ex_t *)&(_throw_ctx->exception));
-#define _THROW(c, v, m) \
+#define _XBT_THROW(c, v, m) \
do { /* change this sequence into one block */ \
xbt_running_ctx_t *_throw_ctx = __xbt_running_ctx_fetch(); \
THROW_PREPARE(_throw_ctx, c, v, m); \
/** @brief Builds and throws an exception
@hideinitializer */
-#define THROW(c, v) _THROW(c, v, NULL)
+#define THROW(c, v) _XBT_THROW(c, v, NULL)
/** @brief Builds and throws an exception with a printf-like formatted message
@hideinitializer */
-#define THROWF(c, v, ...) _THROW(c, v, bprintf(__VA_ARGS__))
+#define THROWF(c, v, ...) _XBT_THROW(c, v, bprintf(__VA_ARGS__))
#define THROW_IMPOSSIBLE \
THROWF(unknown_error, 0, "The Impossible Did Happen (yet again)")
/** @brief Exception destructor */
XBT_PUBLIC(void) xbt_ex_free(xbt_ex_t e);
+/** @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);