X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/72f3e5bb7597e85d02f6fb4dea3c7a8ac18d520a..ac2a2796d269a829faa7c4f45699e6f10751fa71:/src/mc/mc_checkpoint.c diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index d23fbf5911..0a90046c31 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -154,6 +154,8 @@ mc_snapshot_t MC_take_snapshot() memory_map_t maps = get_memory_map(); int nb_reg = 0; void *heap = NULL; + size_t size = 0; + void *start = NULL; /* Save the std heap and the writable mapped pages of libsimgrid */ while (i < maps->mapsize) { @@ -170,17 +172,18 @@ mc_snapshot_t MC_take_snapshot() i++; } else { if (!memcmp(basename(maps->regions[i].pathname), "libsimgrid", 10)){ - MC_snapshot_add_region(snapshot, 1, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr); - start_data_libsimgrid = reg.start_addr; + size = (char*)reg.end_addr - (char*)reg.start_addr; + start = reg.start_addr; nb_reg++; i++; reg = maps->regions[i]; if(reg.pathname == NULL && (reg.prot & PROT_WRITE) && i < maps->mapsize){ - MC_snapshot_add_region(snapshot, 1, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr); + size += (char*)reg.end_addr - (char*)reg.start_addr; reg = maps->regions[i]; i++; nb_reg++; } + MC_snapshot_add_region(snapshot, 1, start, size); } else { if (!memcmp(basename(maps->regions[i].pathname), basename(xbt_binary_name), strlen(basename(xbt_binary_name)))){ MC_snapshot_add_region(snapshot, 2, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr); @@ -197,18 +200,6 @@ mc_snapshot_t MC_take_snapshot() } } } - }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++; }else{ i++; } @@ -259,9 +250,6 @@ void get_libsimgrid_plt_section(){ int i, plt_found = 0; unsigned long int size, offset; - if(libsimgrid_path == NULL) - libsimgrid_path = get_libsimgrid_path(); - char *command = bprintf("objdump --section-headers %s", libsimgrid_path); fp = popen(command, "r");