Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize this function name before its API is frozen by a release ;)
[simgrid.git] / include / xbt / ex.h
index 81c7ef7..9699f6a 100644 (file)
@@ -411,18 +411,19 @@ extern void __xbt_ex_terminate_default(xbt_ex_t *e);
  */
 
 #define _THROW(c,v,m) \
-  do { /* change this sequence into one block */                               \
-     /* build the exception */ \
-     __xbt_ex_ctx()->ctx_ex.msg      = (m); \
-     __xbt_ex_ctx()->ctx_ex.category = (xbt_errcat_t)(c); \
-     __xbt_ex_ctx()->ctx_ex.value    = (v);  \
-     __xbt_ex_ctx()->ctx_ex.remote   = 0;                            \
-     __xbt_ex_ctx()->ctx_ex.host     = (char*)NULL;                            \
-     __xbt_ex_ctx()->ctx_ex.procname = strdup(xbt_procname());                 \
-     __xbt_ex_ctx()->ctx_ex.file     = (char*)__FILE__;                        \
-     __xbt_ex_ctx()->ctx_ex.line     = __LINE__;                               \
-     __xbt_ex_ctx()->ctx_ex.func     = (char*)_XBT_FUNCTION;                   \
+  do { /* change this sequence into one block */                              \
+     /* build the exception */                                                \
+     __xbt_ex_ctx()->ctx_ex.msg      = (m);                                   \
+     __xbt_ex_ctx()->ctx_ex.category = (xbt_errcat_t)(c);                     \
+     __xbt_ex_ctx()->ctx_ex.value    = (v);                                   \
+     __xbt_ex_ctx()->ctx_ex.remote   = 0;                                     \
+     __xbt_ex_ctx()->ctx_ex.host     = (char*)NULL;                           \
+     __xbt_ex_ctx()->ctx_ex.procname = (char*)xbt_procname();                 \
+     __xbt_ex_ctx()->ctx_ex.file     = (char*)__FILE__;                       \
+     __xbt_ex_ctx()->ctx_ex.line     = __LINE__;                              \
+     __xbt_ex_ctx()->ctx_ex.func     = (char*)_XBT_FUNCTION;                  \
      __xbt_ex_ctx()->ctx_ex.used     = backtrace((void**)__xbt_ex_ctx()->ctx_ex.bt,XBT_BACKTRACE_SIZE);\
+     __xbt_ex_ctx()->ctx_ex.bt_strings = NULL; \
      DO_THROW(__xbt_ex_ctx()->ctx_ex);\
   } while (0)
 
@@ -511,6 +512,7 @@ extern void __xbt_ex_terminate_default(xbt_ex_t *e);
 void xbt_ex_free(xbt_ex_t e);
 
 void xbt_ex_display(xbt_ex_t *e);
+void xbt_backtrace_display(void);
 
 /** @} */
 #endif /* __XBT_EX_H__ */