Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : init MC for liveness in a separate function
[simgrid.git] / src / mc / mc_checkpoint.c
index ad1de43..984323b 100644 (file)
@@ -112,6 +112,41 @@ void MC_take_snapshot(mc_snapshot_t snapshot)
   free_memory_map(maps);
 }
 
+void MC_init_memory_map_info(){
+  
+  unsigned int i = 0;
+  s_map_region_t reg;
+  memory_map_t maps = get_memory_map();
+
+   while (i < maps->mapsize) {
+    reg = maps->regions[i];
+    if ((reg.prot & PROT_WRITE)){
+      if (maps->regions[i].pathname == NULL){
+        if(reg.start_addr == raw_heap){
+          end_raw_heap = reg.end_addr;
+        }
+      } else {
+        if (!memcmp(basename(maps->regions[i].pathname), "libsimgrid", 10)){
+          start_data_libsimgrid = reg.start_addr;
+        }
+      }
+    }else if ((reg.prot & PROT_READ)){
+      if (maps->regions[i].pathname != NULL){
+        if (!memcmp(basename(maps->regions[i].pathname), "libsimgrid", 10)){
+          start_text_libsimgrid = reg.start_addr;
+          libsimgrid_path = strdup(maps->regions[i].pathname);
+        }else{
+          if (!memcmp(basename(maps->regions[i].pathname), basename(xbt_binary_name), strlen(basename(xbt_binary_name)))){
+            start_text_binary = reg.start_addr;
+          }
+        }
+      }
+    }
+    i++;
+  }
+
+}
+
 mc_snapshot_t MC_take_snapshot_liveness()
 {
 
@@ -222,7 +257,10 @@ void get_libsimgrid_plt_section(){
   int i, plt_not_found = 1;
   unsigned long int size, offset;
 
-  char *command = bprintf( "objdump --section-headers %s", libsimgrid_path);
+  if(libsimgrid_path == NULL)
+    libsimgrid_path = get_libsimgrid_path();
+
+  char *command = bprintf("objdump --section-headers %s", libsimgrid_path);
 
   fp = popen(command, "r");
 
@@ -259,7 +297,6 @@ void get_libsimgrid_plt_section(){
       }
     }
     
-    
   }
 
   free(command);