From: mquinson Date: Wed, 15 Feb 2006 14:53:53 +0000 (+0000) Subject: Make the maximal backtrace size configurable X-Git-Tag: v3.3~3440 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7143a7cd4af07cfcb16e49a957e8ce527fa119df Make the maximal backtrace size configurable git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1918 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/xbt/ex.h b/include/xbt/ex.h index 12f5722560..c2d2cacca4 100644 --- a/include/xbt/ex.h +++ b/include/xbt/ex.h @@ -237,7 +237,7 @@ typedef struct { int line; char *func; /**< to be freed only for remote exceptions */ /* Backtrace */ - void *bt[10]; + void *bt[XBT_BACKTRACE_SIZE]; int used; } xbt_ex_t; @@ -376,7 +376,7 @@ extern void __xbt_ex_terminate_default(xbt_ex_t *e); __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,10);\ + __xbt_ex_ctx()->ctx_ex.used = backtrace((void**)__xbt_ex_ctx()->ctx_ex.bt,XBT_BACKTRACE_SIZE);\ /* deal with the exception */ \ if (__xbt_ex_ctx()->ctx_mctx == NULL) \ __xbt_ex_terminate((xbt_ex_t *)&(__xbt_ex_ctx()->ctx_ex)); /* not catched */\ diff --git a/include/xbt/misc.h b/include/xbt/misc.h index 8c2709aab6..03257f5f88 100644 --- a/include/xbt/misc.h +++ b/include/xbt/misc.h @@ -93,6 +93,8 @@ const char *xbt_procname(void); typedef int (int_f_pvoid_pvoid_t) (void*,void*); typedef int (*int_f_void_t) (void); /* FIXME: rename it to int_pf_void_t */ + +#define XBT_BACKTRACE_SIZE 10 /* FIXME: better place? Do document */ SG_END_DECL()