Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
12b63acbe5f5ac4453fb67e9d07a088b809e722d
[simgrid.git] / include / xbt / ex.h
1 /* $Id$ */
2
3 /* ex - Exception Handling (modified to fit into SimGrid from OSSP version) */
4
5 /*  Copyright (c) 2005-2006 Martin Quinson                                  */
6 /*  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>       */
7 /*  Copyright (c) 2002-2004 The OSSP Project <http://www.ossp.org/>         */
8 /*  Copyright (c) 2002-2004 Cable & Wireless <http://www.cw.com/>           */
9 /*  All rights reserved.                                                    */
10
11 /* This program is free software; you can redistribute it and/or modify it
12   * under the terms of the license (GNU LGPL) which comes with this package. */
13
14 #ifndef __XBT_EX_H__
15 #define __XBT_EX_H__
16
17 #include <xbt/sysdep.h>
18 #include <xbt/misc.h>
19
20 /* do not include execinfo.h directly since it's not always available. 
21    Instead, copy the parts we need (and fake when it's not there) */
22 extern int backtrace (void **__array, int __size);
23
24 /* required ISO-C standard facilities */
25 #include <errno.h>
26 #include <stdio.h>
27
28
29 /*-*-* Emergency debuging: define this when the exceptions get crazy *-*-*/
30 #undef __EX_MAYDAY
31
32 #ifdef __EX_MAYDAY
33 int gras_os_getpid(void);
34 #  define MAYDAY_SAVE(m)    printf("%d %s:%d save %p\n",                \
35                                    gras_os_getpid(),__FILE__,__LINE__,  \
36                                    (m)->jb                              \
37                                   ),
38 #  define MAYDAY_RESTORE(m) printf("%d %s:%d restore %p\n",             \
39                                    gras_os_getpid(),__FILE__,__LINE__,  \
40                                    (m)->jb                              \
41                                   ),
42 #  define MAYDAY_CATCH(e)   printf("%d %s:%d Catched '%s'\n",           \
43                                    gras_os_getpid(),__FILE__,__LINE__,  \
44                                    e.msg                                \
45                                   ),
46 #else
47 #  define MAYDAY_SAVE(m)
48 #  define MAYDAY_RESTORE(m)
49 #  define MAYDAY_CATCH(e)
50 #endif
51
52 /*-*-* end of debugging stuff *-*-*/
53
54
55 /* the machine context */
56 #if defined(__EX_MCTX_MCSC__)
57 #include <ucontext.h>            /* POSIX.1 ucontext(3) */
58 #define __ex_mctx_struct         ucontext_t uc;
59 #define __ex_mctx_save(mctx)     (getcontext(&(mctx)->uc) == 0)
60 #define __ex_mctx_restored(mctx) /* noop */
61 #define __ex_mctx_restore(mctx)  (void)setcontext(&(mctx)->uc)
62
63 #elif defined(__EX_MCTX_SSJLJ__)
64 #include <setjmp.h>              /* POSIX.1 sigjmp_buf(3) */
65 #define __ex_mctx_struct         sigjmp_buf jb;
66 #define __ex_mctx_save(mctx)     (sigsetjmp((mctx)->jb, 1) == 0)
67 #define __ex_mctx_restored(mctx) /* noop */
68 #define __ex_mctx_restore(mctx)  (void)siglongjmp((mctx)->jb, 1)
69
70 #elif defined(__EX_MCTX_SJLJ__) || !defined(__EX_MCTX_CUSTOM__) || defined(__EX_MAYDAY)
71 #include <setjmp.h>              /* ISO-C jmp_buf(3) */
72 #define __ex_mctx_struct         jmp_buf jb;
73 #define __ex_mctx_save(mctx)     ( MAYDAY_SAVE(mctx) setjmp((mctx)->jb) == 0)
74 #define __ex_mctx_restored(mctx) /* noop */
75 #define __ex_mctx_restore(mctx)  ( MAYDAY_RESTORE(mctx) (void)longjmp((mctx)->jb, 1))
76 #endif
77
78 /* declare the machine context type */
79 typedef struct { __ex_mctx_struct } __ex_mctx_t;
80
81 /** @addtogroup XBT_ex
82  *  @brief A set of macros providing exception a la C++ in ANSI C (grounding feature)
83  *
84  * This module is a small ISO-C++ style exception handling library
85  * for use in the ISO-C language. It allows you to use the paradigm 
86  * of throwing and catching exceptions in order to reduce the amount
87  * of error handling code without hindering program robustness.
88  *               
89  * This is achieved by directly transferring exceptional return codes
90  * (and the program control flow) from the location where the exception
91  * is raised (throw point) to the location where it is handled (catch
92  * point) -- usually from a deeply nested sub-routine to a parent 
93  * routine. All intermediate routines no longer have to make sure that 
94  * the exceptional return codes from sub-routines are correctly passed 
95  * back to the parent.
96  *
97  * These features are brought to you by a modified version of the libex 
98  * library, one of the numerous masterpiece of Ralf S. Engelschall.
99  *
100  * \htmlonly <div class="toc">\endhtmlonly
101  *
102  * @section XBT_ex_toc TABLE OF CONTENTS
103  *
104  *  - \ref XBT_ex_intro
105  *  - \ref XBT_ex_base
106  *  - \ref XBT_ex_pitfalls
107  *
108  * \htmlonly </div> \endhtmlonly
109  *
110  * @section XBT_ex_intro DESCRIPTION
111  * 
112  * In SimGrid, an exception is a triple <\a msg , \a category , \a value> 
113  * where \a msg is a human-readable text describing the exceptional 
114  * condition, \a code an integer describing what went wrong and \a value
115  * providing a sort of sub-category. (this is different in the original libex).
116  *
117  * @section XBT_ex_base BASIC USAGE
118  *
119  * \em TRY \b TRIED_BLOCK [\em CLEANUP \b CLEANUP_BLOCK] \em CATCH (variable) \b CATCH_BLOCK
120  *
121  * This is the primary syntactical construct provided. It is modeled after the
122  * ISO-C++ try-catch clause and should sound familiar to most of you.
123  *
124  * Any exception thrown directly from the TRIED_BLOCK block or from called
125  * subroutines is caught. Cleanups which must be done after this block
126  * (whenever an exception arised or not) should be placed into the optionnal
127  * CLEANUP_BLOCK. The code dealing with the exceptions when they arise should
128  * be placed into the (mandatory) CATCH_BLOCK.
129  *
130  * 
131  * In absence of exception, the control flow goes into the blocks TRIED_BLOCK
132  * and CLEANUP_BLOCK (if present); The CATCH_BLOCK block is then ignored. 
133  *
134  * When an exception is thrown, the control flow goes through the following
135  * blocks: TRIED_BLOCK (up to the statement throwing the exception),
136  * CLEANUP_BLOCK (if any) and CATCH_BLOCK. The exception is stored in a
137  * variable for inspection inside the CATCH_BLOCK. This variable must be
138  * declared in the outter scope, but its value is only valid within the
139  * CATCH_BLOCK block. 
140  *
141  * Some notes:
142  *  - TRY, CLEANUP and CATCH cannot be used separately, they work
143  *    only in combination and form a language clause as a whole.
144  *  - In contrast to the syntax of other languages (such as C++ or Jave) there
145  *    is only one CATCH block and not multiple ones (all exceptions are
146  *    of the same \em xbt_ex_t C type). 
147  *  - the variable of CATCH can naturally be reused in subsequent 
148  *    CATCH clauses.
149  *  - it is possible to nest TRY clauses.
150  *
151  * The TRY block is a regular ISO-C language statement block, but
152  * 
153  * <center><b>it is not
154  * allowed to jump into it via "goto" or longjmp(3) or out of it via "break",
155  * "return", "goto" or longjmp(3)</b>.</center>
156  *
157  * This is because there is some hidden setup and
158  * cleanup that needs to be done regardless of whether an exception is
159  * caught. Bypassing these steps will break the exception handling facility.
160  *     
161  * The CLEANUP and CATCH blocks are regular ISO-C language statement
162  * blocks without any restrictions. You are even allowed to throw (and, in the
163  * CATCH block, to re-throw) exceptions.
164  *
165  * There is one subtle detail you should remember about TRY blocks:
166  * Variables used in the CLEANUP or CATCH clauses must be declared with
167  * the storage class "volatile", otherwise they might contain outdated
168  * information if an exception it thrown.
169  *
170  *
171  * This is because you usually do not know which commands in the TRY
172  * were already successful before the exception was thrown (logically speaking)
173  * and because the underlying ISO-C setjmp(3) facility applies those
174  * restrictions (technically speaking). As a matter of fact, value changes
175  * between the TRY and the THROW may be discarded if you forget the
176  * "volatile" keyword. 
177  * 
178  * \section XBT_ex_pitfalls PROGRAMMING PITFALLS 
179  *
180  * Exception handling is a very elegant and efficient way of dealing with
181  * exceptional situation. Nevertheless it requires additional discipline in
182  * programming and there are a few pitfalls one must be aware of. Look the
183  * following code which shows some pitfalls and contains many errors (assuming
184  * a mallocex() function which throws an exception if malloc(3) fails):
185  *
186  * \dontinclude ex.c
187  * \skip BAD_EXAMPLE
188  * \until end_of_bad_example
189  *
190  * This example raises a few issues:
191  *  -# \b variable \b scope \n
192  *     Variables which are used in the CLEANUP or CATCH clauses must be
193  *     declared before the TRY clause, otherwise they only exist inside the
194  *     TRY block. In the example above, cp1, cp2 and cp3 only exist in the
195  *     TRY block and are invisible from the CLEANUP and CATCH
196  *     blocks.
197  *  -# \b variable \b initialization \n
198  *     Variables which are used in the CLEANUP or CATCH clauses must
199  *     be initialized before the point of the first possible THROW is
200  *     reached. In the example above, CLEANUP would have trouble using cp3
201  *     if mallocex() throws a exception when allocating a TOOBIG buffer.
202  *  -# \b volatile \b variable \n
203  *     Variables which are used in the CLEANUP or CATCH clauses MUST BE
204  *     DECLARED AS "volatile", otherwise they might contain outdated
205  *     information when an exception is thrown. 
206  *  -# \b clean \b before \b catch \n
207  *     The CLEANUP clause is not only place before the CATCH clause in
208  *     the source code, it also occures before in the control flow. So,
209  *     resources being cleaned up cannot be used in the CATCH block. In the
210  *     example, c3 gets freed before the printf placed in CATCH.
211  *  -# \b variable \b uninitialization \n
212  *     If resources are passed out of the scope of the
213  *     TRY/CLEANUP/CATCH construct, they naturally shouldn't get
214  *     cleaned up. The example above does free(3) cp1 in CLEANUP although
215  *     its value was affected to globalcontext->first, invalidating this
216  *     pointer.
217
218  * The following is fixed version of the code (annotated with the pitfall items
219  * for reference): 
220  *
221  * \skip GOOD_EXAMPLE
222  * \until end_of_good_example
223  *
224  * @{
225  */
226
227 /* we need this symbol here, even if it breaks a bit the module separation */
228 long int gras_os_getpid(void);
229
230 /** @brief different kind of errors */
231 typedef enum {
232   unknown_error=0,  /**< unknown error */
233   arg_error,        /**< Invalid argument */
234   mismatch_error,   /**< The provided ID does not match */
235   not_found_error,  /**< The searched element was not found */
236   
237   system_error,   /**< a syscall did fail */
238   network_error,  /**< error while sending/receiving data */
239   timeout_error,  /**< not quick enough, dude */
240   thread_error    /**< error while [un]locking */
241 } xbt_errcat_t;
242
243 const char * xbt_ex_catname(xbt_errcat_t cat);
244
245 /** @brief Structure describing an exception */
246 typedef struct {
247   char        *msg;      /**< human readable message; to be freed */
248   xbt_errcat_t category; /**< category like HTTP (what went wrong) */
249   int          value;    /**< like errno (why did it went wrong) */
250   /* throw point */
251   short int remote; /* whether it was raised remotely */
252   char *host;     /* NULL for localhost; hostname if remote */
253   /* FIXME: host should be hostname:port[#thread] */
254   char *procname; 
255   long int pid;
256   char *file;     /**< to be freed only for remote exceptions */
257   int   line;     
258   char *func;     /**< to be freed only for remote exceptions */
259   /* Backtrace */
260   int   used;
261   char **bt_strings; /* only filed on display (or before the network propagation) */
262   void *bt[XBT_BACKTRACE_SIZE];
263 } xbt_ex_t;
264
265 /* declare the context type (private) */
266 typedef struct {
267     __ex_mctx_t  *ctx_mctx;     /* permanent machine context of enclosing try/catch */
268     volatile int ctx_caught;    /* temporary flag whether exception was caught */
269     volatile xbt_ex_t ctx_ex;   /* temporary exception storage */
270 } ex_ctx_t;
271
272 /* the static and dynamic initializers for a context structure */
273 #define XBT_CTX_INITIALIZER \
274     { NULL, 0, { /* content */ NULL, unknown_error, 0, \
275                  /* throw point*/ 0,NULL, NULL,0, NULL, 0, NULL,\
276                  /* backtrace */ 0,NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL} } }
277 #define XBT_CTX_INITIALIZE(ctx) \
278     do { \
279         (ctx)->ctx_mctx          = NULL; \
280         (ctx)->ctx_caught        = 0;    \
281         (ctx)->ctx_ex.msg        = NULL; \
282         (ctx)->ctx_ex.category   = 0;    \
283         (ctx)->ctx_ex.value      = 0;    \
284         (ctx)->ctx_ex.remote     = 0;    \
285         (ctx)->ctx_ex.host       = NULL; \
286         (ctx)->ctx_ex.procname   = NULL; \
287         (ctx)->ctx_ex.pid        = 0;    \
288         (ctx)->ctx_ex.file       = NULL; \
289         (ctx)->ctx_ex.line       = 0;    \
290         (ctx)->ctx_ex.func       = NULL; \
291         (ctx)->ctx_ex.bt[0]      = NULL; \
292         (ctx)->ctx_ex.bt[1]      = NULL; \
293         (ctx)->ctx_ex.bt[2]      = NULL; \
294         (ctx)->ctx_ex.bt[3]      = NULL; \
295         (ctx)->ctx_ex.bt[4]      = NULL; \
296         (ctx)->ctx_ex.bt[5]      = NULL; \
297         (ctx)->ctx_ex.bt[6]      = NULL; \
298         (ctx)->ctx_ex.bt[7]      = NULL; \
299         (ctx)->ctx_ex.bt[8]      = NULL; \
300         (ctx)->ctx_ex.bt[9]      = NULL; \
301         (ctx)->ctx_ex.used       = 0; \
302         (ctx)->ctx_ex.bt_strings = NULL; \
303     } while (0)
304
305 /* the exception context */
306 typedef ex_ctx_t *(*ex_ctx_cb_t)(void);
307 extern ex_ctx_cb_t __xbt_ex_ctx;
308 extern ex_ctx_t *__xbt_ex_ctx_default(void);
309
310 /* the termination handler */
311 typedef void (*ex_term_cb_t)(xbt_ex_t *);
312 extern ex_term_cb_t __xbt_ex_terminate;
313 extern void __xbt_ex_terminate_default(xbt_ex_t *e);
314
315 /** @brief Introduce a block where exception may be dealed with 
316  *  @hideinitializer
317  */
318 #define TRY \
319     { \
320         ex_ctx_t *__xbt_ex_ctx_ptr = __xbt_ex_ctx(); \
321         int __ex_cleanup = 0; \
322         __ex_mctx_t *__ex_mctx_en; \
323         __ex_mctx_t __ex_mctx_me; \
324         __ex_mctx_en = __xbt_ex_ctx_ptr->ctx_mctx; \
325         __xbt_ex_ctx_ptr->ctx_mctx = &__ex_mctx_me; \
326         if (__ex_mctx_save(&__ex_mctx_me)) { \
327             if (1)
328
329 /** @brief optional(!) block for cleanup 
330  *  @hideinitializer
331  */
332 #define CLEANUP \
333             else { \
334             } \
335             __xbt_ex_ctx_ptr->ctx_caught = 0; \
336         } else { \
337             __ex_mctx_restored(&__ex_mctx_me); \
338             __xbt_ex_ctx_ptr->ctx_caught = 1; \
339         } \
340         __xbt_ex_ctx_ptr->ctx_mctx = __ex_mctx_en; \
341         __ex_cleanup = 1; \
342         if (1) { \
343             if (1)
344
345 #ifndef DOXYGEN_SKIP
346 #  ifdef __cplusplus
347 #    define XBT_EX_T_CPLUSPLUSCAST (xbt_ex_t&)
348 #  else
349 #    define XBT_EX_T_CPLUSPLUSCAST 
350 #  endif
351 #endif
352
353 /** @brief the block for catching (ie, deal with) an exception 
354  *  @hideinitializer
355  */
356 #define CATCH(e) \
357             else { \
358             } \
359             if (!(__ex_cleanup)) \
360                 __xbt_ex_ctx_ptr->ctx_caught = 0; \
361         } else { \
362             if (!(__ex_cleanup)) { \
363                 __ex_mctx_restored(&__ex_mctx_me); \
364                 __xbt_ex_ctx_ptr->ctx_caught = 1; \
365             } \
366         } \
367         __xbt_ex_ctx_ptr->ctx_mctx = __ex_mctx_en; \
368     } \
369     if (   !(__xbt_ex_ctx()->ctx_caught) \
370         || ((e) = XBT_EX_T_CPLUSPLUSCAST __xbt_ex_ctx()->ctx_ex, MAYDAY_CATCH(e) 0)) { \
371     } \
372     else
373
374 #define DO_THROW(e) \
375      /* deal with the exception */                                             \
376      if (__xbt_ex_ctx()->ctx_mctx == NULL)                                     \
377        __xbt_ex_terminate((xbt_ex_t *)&(e)); /* not catched */\
378      else                                                                      \
379        __ex_mctx_restore(__xbt_ex_ctx()->ctx_mctx); /* catched somewhere */    \
380      abort()/* nope, stupid GCC, we won't survive a THROW (this won't be reached) */
381
382 /** @brief Helper macro for THROWS0-6
383  *  @hideinitializer
384  *
385  *  @param c: category code (integer)
386  *  @param v: value (integer)
387  *  @param m: message text
388  *
389  * If called from within a TRY/CATCH construct, this exception 
390  * is copied into the CATCH relevant variable program control flow 
391  * is derouted to the CATCH (after the optional sg_cleanup). 
392  *
393  * If no TRY/CATCH construct embeeds this call, the program calls
394  * abort(3). 
395  *
396  * The THROW can be performed everywhere, including inside TRY, 
397  * CLEANUP and CATCH blocks.
398  */
399
400 #define _THROW(c,v,m) \
401   do { /* change this sequence into one block */                              \
402      /* build the exception */                                                \
403      __xbt_ex_ctx()->ctx_ex.msg      = (m);                                   \
404      __xbt_ex_ctx()->ctx_ex.category = (xbt_errcat_t)(c);                     \
405      __xbt_ex_ctx()->ctx_ex.value    = (v);                                   \
406      __xbt_ex_ctx()->ctx_ex.remote   = 0;                                     \
407      __xbt_ex_ctx()->ctx_ex.host     = (char*)NULL;                           \
408      __xbt_ex_ctx()->ctx_ex.procname = (char*)xbt_procname();                 \
409      __xbt_ex_ctx()->ctx_ex.pid      = gras_os_getpid();                      \
410      __xbt_ex_ctx()->ctx_ex.file     = (char*)__FILE__;                       \
411      __xbt_ex_ctx()->ctx_ex.line     = __LINE__;                              \
412      __xbt_ex_ctx()->ctx_ex.func     = (char*)_XBT_FUNCTION;                  \
413      __xbt_ex_ctx()->ctx_ex.used     = backtrace((void**)__xbt_ex_ctx()->ctx_ex.bt,XBT_BACKTRACE_SIZE);\
414      __xbt_ex_ctx()->ctx_ex.bt_strings = NULL; \
415      DO_THROW(__xbt_ex_ctx()->ctx_ex);\
416   } while (0)
417
418 /** @brief Builds and throws an exception with a string taking no arguments
419     @hideinitializer */
420 #define THROW0(c,v,m)                   _THROW(c,v,(m?bprintf(m):NULL))
421 /** @brief Builds and throws an exception with a string taking one argument
422     @hideinitializer */
423 #define THROW1(c,v,m,a1)                _THROW(c,v,bprintf(m,a1))
424 /** @brief Builds and throws an exception with a string taking two arguments
425     @hideinitializer */
426 #define THROW2(c,v,m,a1,a2)             _THROW(c,v,bprintf(m,a1,a2))
427 /** @brief Builds and throws an exception with a string taking three arguments
428     @hideinitializer */
429 #define THROW3(c,v,m,a1,a2,a3)          _THROW(c,v,bprintf(m,a1,a2,a3))
430 /** @brief Builds and throws an exception with a string taking four arguments
431     @hideinitializer */
432 #define THROW4(c,v,m,a1,a2,a3,a4)       _THROW(c,v,bprintf(m,a1,a2,a3,a4))
433 /** @brief Builds and throws an exception with a string taking five arguments
434     @hideinitializer */
435 #define THROW5(c,v,m,a1,a2,a3,a4,a5)    _THROW(c,v,bprintf(m,a1,a2,a3,a4,a5))
436 /** @brief Builds and throws an exception with a string taking six arguments
437     @hideinitializer */
438 #define THROW6(c,v,m,a1,a2,a3,a4,a5,a6) _THROW(c,v,bprintf(m,a1,a2,a3,a4,a5,a6))
439
440 #define THROW_IMPOSSIBLE     THROW0(unknown_error,0,"The Impossible Did Happen (yet again)")
441 #define THROW_UNIMPLEMENTED  THROW1(unknown_error,0,"Function %s unimplemented",__FUNCTION__)
442
443 #ifndef NDEBUG
444 #  define DIE_IMPOSSIBLE       xbt_assert0(0,"The Impossible Did Happen (yet again)")
445 #else
446 #  define DIE_IMPOSSIBLE       exit(1);
447 #endif
448
449 /** @brief re-throwing of an already caught exception (ie, pass it to the upper catch block) 
450  *  @hideinitializer
451  */
452 #define RETHROW \
453   do { \
454    if (__xbt_ex_ctx()->ctx_mctx == NULL) \
455      __xbt_ex_terminate((xbt_ex_t *)&(__xbt_ex_ctx()->ctx_ex)); \
456    else \
457      __ex_mctx_restore(__xbt_ex_ctx()->ctx_mctx); \
458    abort();\
459   } while(0)
460
461
462 #ifndef DOXYGEN_SKIP
463 #define _XBT_PRE_RETHROW \
464   do {                                                               \
465     char *_xbt_ex_internal_msg = __xbt_ex_ctx()->ctx_ex.msg;         \
466     __xbt_ex_ctx()->ctx_ex.msg = bprintf(
467 #define _XBT_POST_RETHROW \
468  _xbt_ex_internal_msg); \
469     free(_xbt_ex_internal_msg);                                      \
470     RETHROW;                                                         \
471   } while (0)
472 #endif
473
474 /** @brief like THROW0, but adding some details to the message of an existing exception
475  *  @hideinitializer
476  */
477 #define RETHROW0(msg)           _XBT_PRE_RETHROW msg,          _XBT_POST_RETHROW
478 /** @brief like THROW1, but adding some details to the message of an existing exception
479  *  @hideinitializer
480  */
481 #define RETHROW1(msg,a)         _XBT_PRE_RETHROW msg,a,        _XBT_POST_RETHROW
482 /** @brief like THROW2, but adding some details to the message of an existing exception
483  *  @hideinitializer
484  */
485 #define RETHROW2(msg,a,b)       _XBT_PRE_RETHROW msg,a,b,      _XBT_POST_RETHROW
486 /** @brief like THROW3, but adding some details to the message of an existing exception
487  *  @hideinitializer
488  */
489 #define RETHROW3(msg,a,b,c)     _XBT_PRE_RETHROW msg,a,b,c,    _XBT_POST_RETHROW
490 /** @brief like THROW4, but adding some details to the message of an existing exception
491  *  @hideinitializer
492  */
493 #define RETHROW4(msg,a,b,c,d)   _XBT_PRE_RETHROW msg,a,b,c,    _XBT_POST_RETHROW
494 /** @brief like THROW5, but adding some details to the message of an existing exception
495  *  @hideinitializer
496  */
497 #define RETHROW5(msg,a,b,c,d,e) _XBT_PRE_RETHROW msg,a,b,c,d,e _XBT_POST_RETHROW
498
499 /** @brief Exception destructor */
500 void xbt_ex_free(xbt_ex_t e);
501
502 void xbt_ex_display(xbt_ex_t *e);
503 void xbt_backtrace_display(void);
504
505 /** @} */
506 #endif /* __XBT_EX_H__ */
507