- MC_snapshot_add_region(snapshot, 2,
- mc_binary_info->start_rw, mc_binary_info->start_rw,
- mc_binary_info->end_rw - mc_binary_info->start_rw);
- snapshot->privatization_regions = NULL;
- snapshot->privatization_index = -1;
- }
-}
-
-/** @brief Finds the range of the different memory segments and binary paths */
-void MC_init_memory_map_info()
-{
-
- unsigned int i = 0;
- s_map_region_t reg;
- memory_map_t maps = MC_get_memory_map();
-
- maestro_stack_start = NULL;
- maestro_stack_end = NULL;
- libsimgrid_path = NULL;
-
- while (i < maps->mapsize) {
- reg = maps->regions[i];
- if (maps->regions[i].pathname == NULL) {
- // Nothing to do
- } else if ((reg.prot & PROT_WRITE)
- && !memcmp(maps->regions[i].pathname, "[stack]", 7)) {
- maestro_stack_start = reg.start_addr;
- maestro_stack_end = reg.end_addr;
- } else if ((reg.prot & PROT_READ) && (reg.prot & PROT_EXEC)
- && !memcmp(basename(maps->regions[i].pathname), "libsimgrid",
- 10)) {
- if (libsimgrid_path == NULL)
- libsimgrid_path = strdup(maps->regions[i].pathname);
- }
- i++;
- }
-
- xbt_assert(maestro_stack_start, "maestro_stack_start");
- xbt_assert(maestro_stack_end, "maestro_stack_end");
- xbt_assert(libsimgrid_path, "libsimgrid_path&");
-
- MC_free_memory_map(maps);
-
-}
-
-/** \brief Fill/lookup the "subtype" field.
- */
-static void MC_resolve_subtype(mc_object_info_t info, dw_type_t type)
-{
-
- if (type->dw_type_id == NULL)
- return;
- type->subtype = xbt_dict_get_or_null(info->types, type->dw_type_id);
- if (type->subtype == NULL)
- return;
- if (type->subtype->byte_size != 0)
- return;
- if (type->subtype->name == NULL)
- return;
- // Try to find a more complete description of the type:
- // We need to fix in order to support C++.
-
- dw_type_t subtype =
- xbt_dict_get_or_null(info->full_types_by_name, type->subtype->name);
- if (subtype != NULL) {
- type->subtype = subtype;
- }
-
-}
-
-void MC_post_process_types(mc_object_info_t info)
-{
- xbt_dict_cursor_t cursor = NULL;
- char *origin;
- dw_type_t type;
-
- // Lookup "subtype" field:
- xbt_dict_foreach(info->types, cursor, origin, type) {
- MC_resolve_subtype(info, type);
-
- dw_type_t member;
- unsigned int i = 0;
- if (type->members != NULL)
- xbt_dynar_foreach(type->members, i, member) {
- MC_resolve_subtype(info, member);
- }