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()
{
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");
}
}
-
}
free(command);