Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove code for finding an array byte size
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 4 Feb 2014 09:18:59 +0000 (10:18 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 4 Feb 2014 09:18:59 +0000 (10:18 +0100)
This was useless as it was already handled by libdw dwarf_aggregate_size.

src/mc/mc_checkpoint.c
src/mc/mc_global.c

index 5aeff81..d2efa6e 100644 (file)
@@ -239,12 +239,17 @@ void MC_init_memory_map_info(){
 
 }
 
+static void MC_post_process_types(mc_object_info_t info) {
+  // Nothing here
+}
+
 /** \brief Finds informations about a given shared object/executable */
 mc_object_info_t MC_find_object_info(memory_map_t maps, char* name) {
   mc_object_info_t result = MC_new_object_info();
   result->file_name = xbt_strdup(name);
   MC_find_object_address(maps, result);
   MC_dwarf_get_variables(result);
+  MC_post_process_types(result);
   return result;
 }
 
index 7bf5c97..b3cc8ba 100644 (file)
@@ -19,8 +19,6 @@
 #include "xbt/automaton.h"
 #include "xbt/dict.h"
 
-static void MC_post_process_types(mc_object_info_t info);
-
 XBT_LOG_NEW_CATEGORY(mc, "All MC categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc,
                                 "Logging specific to MC (global)");
@@ -435,26 +433,6 @@ void MC_dwarf_register_variable(mc_object_info_t info, dw_frame_t frame, dw_vari
     MC_dwarf_register_non_global_variable(info, frame, variable);
 }
 
-static void MC_post_process_array_size(mc_object_info_t info, dw_type_t type) {
-  xbt_assert(type->dw_type_id, "No base type for array <%p>%s", type->id, type->name);
-  dw_type_t subtype = xbt_dict_get_or_null(info->types, type->dw_type_id);
-  xbt_assert(subtype, "Unkown base type <%s> for array <%p>%s", type->dw_type_id, type->id, type->name);
-  if(subtype->type==DW_TAG_array_type && type->byte_size==0) {
-         MC_post_process_array_size(info, subtype);
-  }
-  type->byte_size = type->element_count*subtype->byte_size;
-}
-
-static void MC_post_process_types(mc_object_info_t info) {
-  xbt_dict_cursor_t cursor;
-  char *origin;
-  dw_type_t type;
-  xbt_dict_foreach(info->types, cursor, origin, type){
-    if(type->type==DW_TAG_array_type && type->byte_size==0)
-      MC_post_process_array_size(info, type);
-  }
-}
-
 /*******************************  Ignore mechanism *******************************/
 /*********************************************************************************/