From: mquinson Date: Fri, 7 Apr 2006 13:38:03 +0000 (+0000) Subject: We need to store the binary name somewhere to display neat backtraces X-Git-Tag: v3.3~3255 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7856e312fded65253e43c2ddcd8373b1a48ebc14 We need to store the binary name somewhere to display neat backtraces git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2103 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/xbt/module.h b/include/xbt/module.h index bc49ea42ea..21dd04cab7 100644 --- a/include/xbt/module.h +++ b/include/xbt/module.h @@ -10,6 +10,8 @@ #ifndef _XBT_MODULE_H #define _XBT_MODULE_H +extern char *xbt_binary_name; + typedef struct xbt_module_ xbt_module_t; typedef xbt_module_t (*xbt_module_new_fct_t)(int argc, char **argv); diff --git a/src/xbt/module.c b/src/xbt/module.c index 32dc9ad3f0..69b1db4c5e 100644 --- a/src/xbt/module.c +++ b/src/xbt/module.c @@ -18,6 +18,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module,xbt, "module handling"); +char *xbt_binary_name=NULL; /* Mandatory to retrieve neat backtraces */ + struct xbt_module_ { xbt_dynar_t *deps; xbt_cfg_t *cfg; @@ -32,7 +34,8 @@ xbt_init(int *argc, char **argv) { static short int first_run = 1; if (!first_run) return; - + + xbt_binary_name = strdup(argv[0]); first_run = 0; VERB0("Initialize XBT");