Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
We need to store the binary name somewhere to display neat backtraces
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 7 Apr 2006 13:38:03 +0000 (13:38 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 7 Apr 2006 13:38:03 +0000 (13:38 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2103 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/module.h
src/xbt/module.c

index bc49ea4..21dd04c 100644 (file)
@@ -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);
index 32dc9ad..69b1db4 100644 (file)
@@ -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");