Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Include ELF file name in object_info_t
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 24 Dec 2013 13:25:34 +0000 (14:25 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 9 Jan 2014 13:15:40 +0000 (14:15 +0100)
src/mc/mc_global.c
src/mc/mc_private.h

index 3f97546..457776c 100644 (file)
@@ -176,6 +176,7 @@ static void dw_variable_free_voidp(void *t){
 
 mc_object_info_t MC_new_object_info() {
   mc_object_info_t res = xbt_new(s_mc_object_info_t, 1);
+  res->file_name = NULL;
   res->local_variables = xbt_dict_new_homogeneous(NULL);
   res->global_variables = xbt_dynar_new(sizeof(dw_variable_t), dw_variable_free_voidp);
   res->types = xbt_dict_new_homogeneous(NULL);
@@ -183,6 +184,7 @@ mc_object_info_t MC_new_object_info() {
 }
 
 void MC_free_object_info(mc_object_info_t* info) {
+  xbt_free(&(*info)->file_name);
   xbt_dict_free(&(*info)->local_variables);
   xbt_dynar_free(&(*info)->global_variables);
   xbt_dict_free(&(*info)->types);
@@ -528,6 +530,8 @@ static mc_object_info_t MC_dwarf_get_variables(const char *elf_file){
     perror("popen for objdump failed");
 
   mc_object_info_t result = MC_new_object_info();
+  result->file_name = xbt_strdup(elf_file);
+
   xbt_dict_t *local_variables = &result->local_variables;
   xbt_dynar_t *global_variables = &result->global_variables;
   xbt_dict_t *types = &result->types;
index c9bd28e..d381612 100644 (file)
@@ -334,6 +334,7 @@ void MC_dump_stack_liveness(xbt_fifo_t stack);
 /********************************** Variables with DWARF **********************************/
 
 typedef struct s_mc_object_info {
+  char* file_name;
   xbt_dict_t local_variables;
   xbt_dynar_t global_variables;
   xbt_dict_t types;