Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Add dwarf_global field to dw_variable_t
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 10 Jan 2014 13:24:16 +0000 (14:24 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 17 Jan 2014 09:54:54 +0000 (10:54 +0100)
It is a better (but not perfect) identifier for a entry.

src/mc/mc_global.c
src/mc/mc_private.h

index 07b7e20..033d77b 100644 (file)
@@ -761,6 +761,7 @@ void MC_dwarf_get_variables(mc_object_info_t info) {
         if(strcmp(node_type, "DW_AT_name") == 0){
 
           var = xbt_new0(s_dw_variable_t, 1);
+          var->dwarf_offset = 0;
           var->name = xbt_strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *));
           xbt_dict_set(variables_origin, origin, xbt_strdup(var->name), NULL);
          
index 941cc0d..180d6f9 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef WIN32
 #include <sys/mman.h>
 #endif
+#include <elfutils/libdw.h>
+
 #include "mc/mc.h"
 #include "mc/datatypes.h"
 #include "xbt/fifo.h"
@@ -405,6 +407,7 @@ typedef struct s_dw_location_entry{
 }s_dw_location_entry_t, *dw_location_entry_t;
 
 typedef struct s_dw_variable{
+  Dwarf_Off dwarf_offset; /* Global offset of the field. */
   int global;
   char *name;
   char *type_origin;