From 39cf43e4e190f5053b971b13ff1a1d82ebea5dba Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 30 May 2019 00:12:08 +0200 Subject: [PATCH] mc: Also remove the process_index This was used to switch between MMAP private segments --- src/include/mc/datatypes.h | 1 - src/mc/AddressSpace.hpp | 38 +---- src/mc/compare.cpp | 218 ++++++++++++----------------- src/mc/inspect/DwarfExpression.cpp | 2 +- src/mc/inspect/DwarfExpression.hpp | 2 - src/mc/inspect/Frame.cpp | 2 +- src/mc/inspect/LocationList.cpp | 9 +- src/mc/inspect/LocationList.hpp | 6 +- src/mc/inspect/mc_dwarf.hpp | 2 +- src/mc/inspect/mc_member.cpp | 3 +- src/mc/remote/Client.cpp | 6 - src/mc/remote/RemoteClient.cpp | 10 +- src/mc/remote/RemoteClient.hpp | 2 +- src/mc/sosp/ChunkedData.cpp | 2 +- src/mc/sosp/RegionSnapshot.cpp | 3 +- src/mc/sosp/mc_snapshot.cpp | 33 ++--- src/mc/sosp/mc_snapshot.hpp | 15 +- teshsuite/mc/dwarf/dwarf.cpp | 3 +- 18 files changed, 129 insertions(+), 228 deletions(-) diff --git a/src/include/mc/datatypes.h b/src/include/mc/datatypes.h index f0567c5a2e..9371068a53 100644 --- a/src/include/mc/datatypes.h +++ b/src/include/mc/datatypes.h @@ -22,7 +22,6 @@ struct s_stack_region{ #endif size_t size; int block; - int process_index; }; typedef struct s_stack_region s_stack_region_t; diff --git a/src/mc/AddressSpace.hpp b/src/mc/AddressSpace.hpp index 86ebd26cae..f0b6280e89 100644 --- a/src/mc/AddressSpace.hpp +++ b/src/mc/AddressSpace.hpp @@ -12,22 +12,6 @@ namespace simgrid { namespace mc { -/** Process index used when no process is available (SMPI privatization) - * - * The expected behavior is that if a process index is needed it will fail. - * */ -const int ProcessIndexMissing = -1; - -/** Process index used when we don't care about the process index (SMPI privatization) - * */ -const int ProcessIndexDisabled = -2; - -/** Constant used when any process will do (SMPI privatization) - * - * Note: This is is index of the first process. - */ -const int ProcessIndexAny = 0; - /** Options for read operations * * This is a set of flags managed with bitwise operators. Only the @@ -116,35 +100,27 @@ public: * @param buffer target buffer for the data * @param size number of bytes to read * @param address remote source address of the data - * @param process_index which process (used for SMPI privatization) * @param options */ - virtual const void* read_bytes(void* buffer, std::size_t size, - RemotePtr address, int process_index = ProcessIndexAny, - ReadOptions options = ReadOptions::none()) const = 0; + virtual const void* read_bytes(void* buffer, std::size_t size, RemotePtr address, + ReadOptions options = ReadOptions::none()) const = 0; /** Read a given data structure from the address space */ - template inline - void read(T *buffer, RemotePtr ptr, int process_index = ProcessIndexAny) const - { - this->read_bytes(buffer, sizeof(T), ptr, process_index); - } + template inline void read(T* buffer, RemotePtr ptr) const { this->read_bytes(buffer, sizeof(T), ptr); } - template inline - void read(Remote& buffer, RemotePtr ptr, int process_index = ProcessIndexAny) const + template inline void read(Remote& buffer, RemotePtr ptr) const { - this->read_bytes(buffer.getBuffer(), sizeof(T), ptr, process_index); + this->read_bytes(buffer.getBuffer(), sizeof(T), ptr); } /** Read a given data structure from the address space * * This version returns by value. */ - template inline - Remote read(RemotePtr ptr, int process_index = ProcessIndexMissing) const + template inline Remote read(RemotePtr ptr) const { Remote res; - this->read_bytes(&res, sizeof(T), ptr, process_index); + this->read_bytes(&res, sizeof(T), ptr); return res; } diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index 27d4dbcc6f..8525202ddf 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -22,12 +22,8 @@ struct HeapArea; struct ProcessComparisonState; struct StateComparator; -static int compare_heap_area( - StateComparator& state, - int process_index, const void *area1, const void* area2, - Snapshot* snapshot1, Snapshot* snapshot2, - HeapLocationPairs* previous, Type* type, int pointer_level); - +static int compare_heap_area(StateComparator& state, const void* area1, const void* area2, Snapshot* snapshot1, + Snapshot* snapshot2, HeapLocationPairs* previous, Type* type, int pointer_level); } } @@ -305,10 +301,10 @@ int mmalloc_compare_heap( void* heapinfo_address = &((xbt_mheap_t) process->heap_address)->heapinfo; // This is in snapshot do not use them directly: - const malloc_info* heapinfos1 = snapshot1->read( - RemotePtr((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing); - const malloc_info* heapinfos2 = snapshot2->read( - RemotePtr((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing); + const malloc_info* heapinfos1 = + snapshot1->read(RemotePtr((std::uint64_t)heapinfo_address)); + const malloc_info* heapinfos2 = + snapshot2->read(RemotePtr((std::uint64_t)heapinfo_address)); while (i1 < state.heaplimit) { @@ -349,8 +345,7 @@ int mmalloc_compare_heap( /* Try first to associate to same block in the other heap */ if (heapinfo2->type == heapinfo1->type && state.equals_to2_(i1, 0).valid_ == 0) { void* addr_block2 = (ADDR2UINT(i1) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase; - int res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_block1, addr_block2, - snapshot1, snapshot2, nullptr, nullptr, 0); + int res_compare = compare_heap_area(state, addr_block1, addr_block2, snapshot1, snapshot2, nullptr, nullptr, 0); if (res_compare != 1) { for (size_t k = 1; k < heapinfo2->busy_block.size; k++) state.equals_to2_(i1 + k, 0) = HeapArea(i1, -1); @@ -382,8 +377,7 @@ int mmalloc_compare_heap( continue; } - int res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_block1, addr_block2, - snapshot1, snapshot2, nullptr, nullptr, 0); + int res_compare = compare_heap_area(state, addr_block1, addr_block2, snapshot1, snapshot2, nullptr, nullptr, 0); if (res_compare != 1) { for (size_t k = 1; k < heapinfo2b->busy_block.size; k++) @@ -422,8 +416,7 @@ int mmalloc_compare_heap( if (heapinfo2->type == heapinfo1->type && not state.equals_to2_(i1, j1).valid_) { void* addr_block2 = (ADDR2UINT(i1) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase; void* addr_frag2 = (void*)((char*)addr_block2 + (j1 << heapinfo2->type)); - int res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_frag1, addr_frag2, - snapshot1, snapshot2, nullptr, nullptr, 0); + int res_compare = compare_heap_area(state, addr_frag1, addr_frag2, snapshot1, snapshot2, nullptr, nullptr, 0); if (res_compare != 1) equal = true; } @@ -461,8 +454,8 @@ int mmalloc_compare_heap( void* addr_block2 = (ADDR2UINT(i2) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase; void* addr_frag2 = (void*)((char*)addr_block2 + (j2 << heapinfo2b->type)); - int res_compare = compare_heap_area(state, simgrid::mc::ProcessIndexMissing, addr_frag1, addr_frag2, - snapshot2, snapshot2, nullptr, nullptr, 0); + int res_compare = + compare_heap_area(state, addr_frag1, addr_frag2, snapshot2, snapshot2, nullptr, nullptr, 0); if (res_compare != 1) { equal = true; break; @@ -547,13 +540,10 @@ int mmalloc_compare_heap( * @param size * @param check_ignore */ -static int compare_heap_area_without_type( - simgrid::mc::StateComparator& state, int process_index, - const void *real_area1, const void *real_area2, - simgrid::mc::Snapshot* snapshot1, - simgrid::mc::Snapshot* snapshot2, - HeapLocationPairs* previous, int size, - int check_ignore) +static int compare_heap_area_without_type(simgrid::mc::StateComparator& state, const void* real_area1, + const void* real_area2, simgrid::mc::Snapshot* snapshot1, + simgrid::mc::Snapshot* snapshot2, HeapLocationPairs* previous, int size, + int check_ignore) { simgrid::mc::RemoteClient* process = &mc_model_checker->process(); simgrid::mc::RegionSnapshot* heap_region1 = MC_get_heap_region(snapshot1); @@ -583,10 +573,8 @@ static int compare_heap_area_without_type( if (MC_snapshot_region_memcmp(((char *) real_area1) + i, heap_region1, ((char *) real_area2) + i, heap_region2, 1) != 0) { int pointer_align = (i / sizeof(void *)) * sizeof(void *); - const void* addr_pointed1 = snapshot1->read( - remote((void**)((char *) real_area1 + pointer_align)), process_index); - const void* addr_pointed2 = snapshot2->read( - remote((void**)((char *) real_area2 + pointer_align)), process_index); + const void* addr_pointed1 = snapshot1->read(remote((void**)((char*)real_area1 + pointer_align))); + const void* addr_pointed2 = snapshot2->read(remote((void**)((char*)real_area2 + pointer_align))); if (process->in_maestro_stack(remote(addr_pointed1)) && process->in_maestro_stack(remote(addr_pointed2))) { @@ -599,9 +587,8 @@ static int compare_heap_area_without_type( && addr_pointed2 > state.std_heap_copy.heapbase && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2)) { // Both addreses are in the heap: - int res_compare = compare_heap_area(state ,process_index, - addr_pointed1, addr_pointed2, - snapshot1, snapshot2, previous, nullptr, 0); + int res_compare = + compare_heap_area(state, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous, nullptr, 0); if (res_compare == 1) return res_compare; i = pointer_align + sizeof(void *); @@ -631,14 +618,10 @@ static int compare_heap_area_without_type( * @param pointer_level * @return 0 (same), 1 (different), -1 (unknown) */ -static int compare_heap_area_with_type( - simgrid::mc::StateComparator& state, int process_index, - const void *real_area1, const void *real_area2, - simgrid::mc::Snapshot* snapshot1, - simgrid::mc::Snapshot* snapshot2, - HeapLocationPairs* previous, simgrid::mc::Type* type, - int area_size, int check_ignore, - int pointer_level) +static int compare_heap_area_with_type(simgrid::mc::StateComparator& state, const void* real_area1, + const void* real_area2, simgrid::mc::Snapshot* snapshot1, + simgrid::mc::Snapshot* snapshot2, HeapLocationPairs* previous, + simgrid::mc::Type* type, int area_size, int check_ignore, int pointer_level) { do { @@ -730,7 +713,7 @@ static int compare_heap_area_with_type( } for (int i = 0; i < type->element_count; i++) { // TODO, add support for variable stride (DW_AT_byte_stride) - int res = compare_heap_area_with_type(state, process_index, (char*)real_area1 + (i * elm_size), + int res = compare_heap_area_with_type(state, (char*)real_area1 + (i * elm_size), (char*)real_area2 + (i * elm_size), snapshot1, snapshot2, previous, type->subtype, subtype->byte_size, check_ignore, pointer_level); if (res == 1) @@ -742,29 +725,29 @@ static int compare_heap_area_with_type( case DW_TAG_rvalue_reference_type: case DW_TAG_pointer_type: if (type->subtype && type->subtype->type == DW_TAG_subroutine_type) { - addr_pointed1 = snapshot1->read(remote((void**)real_area1), process_index); - addr_pointed2 = snapshot2->read(remote((void**)real_area2), process_index); + addr_pointed1 = snapshot1->read(remote((void**)real_area1)); + addr_pointed2 = snapshot2->read(remote((void**)real_area2)); return (addr_pointed1 != addr_pointed2); } pointer_level++; if (pointer_level <= 1) { - addr_pointed1 = snapshot1->read(remote((void**)real_area1), process_index); - addr_pointed2 = snapshot2->read(remote((void**)real_area2), process_index); + addr_pointed1 = snapshot1->read(remote((void**)real_area1)); + addr_pointed2 = snapshot2->read(remote((void**)real_area2)); if (addr_pointed1 > state.std_heap_copy.heapbase && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1) && addr_pointed2 > state.std_heap_copy.heapbase && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2)) - return compare_heap_area(state, process_index, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous, - type->subtype, pointer_level); + return compare_heap_area(state, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous, type->subtype, + pointer_level); else return (addr_pointed1 != addr_pointed2); } for (size_t i = 0; i < (area_size / sizeof(void*)); i++) { - addr_pointed1 = snapshot1->read(remote((void**)((char*)real_area1 + i * sizeof(void*))), process_index); - addr_pointed2 = snapshot2->read(remote((void**)((char*)real_area2 + i * sizeof(void*))), process_index); + addr_pointed1 = snapshot1->read(remote((void**)((char*)real_area1 + i * sizeof(void*)))); + addr_pointed2 = snapshot2->read(remote((void**)((char*)real_area2 + i * sizeof(void*)))); int res; if (addr_pointed1 > state.std_heap_copy.heapbase && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1) && addr_pointed2 > state.std_heap_copy.heapbase && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2)) - res = compare_heap_area(state, process_index, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous, - type->subtype, pointer_level); + res = compare_heap_area(state, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous, type->subtype, + pointer_level); else res = (addr_pointed1 != addr_pointed2); if (res == 1) @@ -780,7 +763,7 @@ static int compare_heap_area_with_type( if (area_size <= type->byte_size || area_size % type->byte_size != 0) return -1; for (size_t i = 0; i < (size_t)(area_size / type->byte_size); i++) { - int res = compare_heap_area_with_type(state, process_index, (char*)real_area1 + i * type->byte_size, + int res = compare_heap_area_with_type(state, (char*)real_area1 + i * type->byte_size, (char*)real_area2 + i * type->byte_size, snapshot1, snapshot2, previous, type, -1, check_ignore, 0); if (res == 1) @@ -789,12 +772,12 @@ static int compare_heap_area_with_type( } else { for (simgrid::mc::Member& member : type->members) { // TODO, optimize this? (for the offset case) - void* real_member1 = simgrid::dwarf::resolve_member(real_area1, type, &member, - (simgrid::mc::AddressSpace*)snapshot1, process_index); - void* real_member2 = simgrid::dwarf::resolve_member(real_area2, type, &member, - (simgrid::mc::AddressSpace*)snapshot2, process_index); - int res = compare_heap_area_with_type(state, process_index, real_member1, real_member2, snapshot1, - snapshot2, previous, member.type, -1, check_ignore, 0); + void* real_member1 = + simgrid::dwarf::resolve_member(real_area1, type, &member, (simgrid::mc::AddressSpace*)snapshot1); + void* real_member2 = + simgrid::dwarf::resolve_member(real_area2, type, &member, (simgrid::mc::AddressSpace*)snapshot2); + int res = compare_heap_area_with_type(state, real_member1, real_member2, snapshot1, snapshot2, previous, + member.type, -1, check_ignore, 0); if (res == 1) return res; } @@ -802,8 +785,8 @@ static int compare_heap_area_with_type( return 0; case DW_TAG_union_type: - return compare_heap_area_without_type(state, process_index, real_area1, real_area2, snapshot1, snapshot2, - previous, type->byte_size, check_ignore); + return compare_heap_area_without_type(state, real_area1, real_area2, snapshot1, snapshot2, previous, + type->byte_size, check_ignore); default: return 0; @@ -823,9 +806,8 @@ static int compare_heap_area_with_type( * @param area_size * @return DWARF type ID for given offset */ -static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc::Type* type, - int offset, int area_size, - simgrid::mc::Snapshot* snapshot, int process_index) +static simgrid::mc::Type* get_offset_type(void* real_base_address, simgrid::mc::Type* type, int offset, int area_size, + simgrid::mc::Snapshot* snapshot) { // Beginning of the block, the infered variable type if the type of the block: @@ -851,7 +833,7 @@ static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc:: if (member.offset() == offset) return member.type; } else { - void* real_member = simgrid::dwarf::resolve_member(real_base_address, type, &member, snapshot, process_index); + void* real_member = simgrid::dwarf::resolve_member(real_base_address, type, &member, snapshot); if ((char*)real_member - (char*)real_base_address == offset) return member.type; } @@ -876,13 +858,9 @@ static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc:: * @param pointer_level * @return 0 (same), 1 (different), -1 */ -static -int compare_heap_area(simgrid::mc::StateComparator& state, int process_index, - const void *area1, const void *area2, - simgrid::mc::Snapshot* snapshot1, - simgrid::mc::Snapshot* snapshot2, - HeapLocationPairs* previous, - simgrid::mc::Type* type, int pointer_level) +static int compare_heap_area(simgrid::mc::StateComparator& state, const void* area1, const void* area2, + simgrid::mc::Snapshot* snapshot1, simgrid::mc::Snapshot* snapshot2, + HeapLocationPairs* previous, simgrid::mc::Type* type, int pointer_level) { simgrid::mc::RemoteClient* process = &mc_model_checker->process(); @@ -905,8 +883,8 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index, // This is the address of std_heap->heapinfo in the application process: void* heapinfo_address = &((xbt_mheap_t) process->heap_address)->heapinfo; - const malloc_info* heapinfos1 = snapshot1->read(remote((const malloc_info**)heapinfo_address), process_index); - const malloc_info* heapinfos2 = snapshot2->read(remote((const malloc_info**)heapinfo_address), process_index); + const malloc_info* heapinfos1 = snapshot1->read(remote((const malloc_info**)heapinfo_address)); + const malloc_info* heapinfos2 = snapshot2->read(remote((const malloc_info**)heapinfo_address)); malloc_info heapinfo_temp1; malloc_info heapinfo_temp2; @@ -1087,20 +1065,14 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index, offset2 = (char*)area2 - (char*)real_addr_frag2; if (state.types1_(block1, frag1) != nullptr && state.types2_(block2, frag2) != nullptr) { - new_type1 = - get_offset_type(real_addr_frag1, state.types1_(block1, frag1), offset1, size, snapshot1, process_index); - new_type2 = - get_offset_type(real_addr_frag2, state.types2_(block2, frag2), offset1, size, snapshot2, process_index); + new_type1 = get_offset_type(real_addr_frag1, state.types1_(block1, frag1), offset1, size, snapshot1); + new_type2 = get_offset_type(real_addr_frag2, state.types2_(block2, frag2), offset1, size, snapshot2); } else if (state.types1_(block1, frag1) != nullptr) { - new_type1 = - get_offset_type(real_addr_frag1, state.types1_(block1, frag1), offset1, size, snapshot1, process_index); - new_type2 = - get_offset_type(real_addr_frag2, state.types1_(block1, frag1), offset2, size, snapshot2, process_index); + new_type1 = get_offset_type(real_addr_frag1, state.types1_(block1, frag1), offset1, size, snapshot1); + new_type2 = get_offset_type(real_addr_frag2, state.types1_(block1, frag1), offset2, size, snapshot2); } else if (state.types2_(block2, frag2) != nullptr) { - new_type1 = - get_offset_type(real_addr_frag1, state.types2_(block2, frag2), offset1, size, snapshot1, process_index); - new_type2 = - get_offset_type(real_addr_frag2, state.types2_(block2, frag2), offset2, size, snapshot2, process_index); + new_type1 = get_offset_type(real_addr_frag1, state.types2_(block2, frag2), offset1, size, snapshot1); + new_type2 = get_offset_type(real_addr_frag2, state.types2_(block2, frag2), offset2, size, snapshot2); } else { if (match_pairs) state.match_equals(previous); @@ -1155,11 +1127,11 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index, /* Start comparison */ int res_compare; if (type) - res_compare = compare_heap_area_with_type(state, process_index, area1, area2, snapshot1, snapshot2, previous, type, - size, check_ignore, pointer_level); + res_compare = compare_heap_area_with_type(state, area1, area2, snapshot1, snapshot2, previous, type, size, + check_ignore, pointer_level); else - res_compare = compare_heap_area_without_type(state, process_index, area1, area2, snapshot1, snapshot2, previous, - size, check_ignore); + res_compare = + compare_heap_area_without_type(state, area1, area2, snapshot1, snapshot2, previous, size, check_ignore); if (res_compare == 1) return res_compare; @@ -1175,7 +1147,7 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index, /************************** Snapshot comparison *******************************/ /******************************************************************************/ -static int compare_areas_with_type(simgrid::mc::StateComparator& state, int process_index, void* real_area1, +static int compare_areas_with_type(simgrid::mc::StateComparator& state, void* real_area1, simgrid::mc::Snapshot* snapshot1, simgrid::mc::RegionSnapshot* region1, void* real_area2, simgrid::mc::Snapshot* snapshot2, simgrid::mc::RegionSnapshot* region2, simgrid::mc::Type* type, int pointer_level) @@ -1235,8 +1207,8 @@ static int compare_areas_with_type(simgrid::mc::StateComparator& state, int proc } for (i = 0; i < type->element_count; i++) { size_t off = i * elm_size; - res = compare_areas_with_type(state, process_index, (char*)real_area1 + off, snapshot1, region1, - (char*)real_area2 + off, snapshot2, region2, type->subtype, pointer_level); + res = compare_areas_with_type(state, (char*)real_area1 + off, snapshot1, region1, (char*)real_area2 + off, + snapshot2, region2, type->subtype, pointer_level); if (res == 1) return res; } @@ -1267,8 +1239,8 @@ static int compare_areas_with_type(simgrid::mc::StateComparator& state, int proc if (not(addr_pointed2 > process->heap_address && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2))) return 1; // The pointers are both in the heap: - return simgrid::mc::compare_heap_area(state, process_index, addr_pointed1, addr_pointed2, snapshot1, - snapshot2, nullptr, type->subtype, pointer_level); + return simgrid::mc::compare_heap_area(state, addr_pointed1, addr_pointed2, snapshot1, snapshot2, nullptr, + type->subtype, pointer_level); } else if (region1->contain(simgrid::mc::remote(addr_pointed1))) { // The pointers are both in the current object R/W segment: @@ -1277,8 +1249,8 @@ static int compare_areas_with_type(simgrid::mc::StateComparator& state, int proc if (not type->type_id) return (addr_pointed1 != addr_pointed2); else - return compare_areas_with_type(state, process_index, addr_pointed1, snapshot1, region1, addr_pointed2, - snapshot2, region2, type->subtype, pointer_level); + return compare_areas_with_type(state, addr_pointed1, snapshot1, region1, addr_pointed2, snapshot2, region2, + type->subtype, pointer_level); } else { // TODO, We do not handle very well the case where @@ -1290,12 +1262,12 @@ static int compare_areas_with_type(simgrid::mc::StateComparator& state, int proc case DW_TAG_structure_type: case DW_TAG_class_type: for (simgrid::mc::Member& member : type->members) { - void* member1 = simgrid::dwarf::resolve_member(real_area1, type, &member, snapshot1, process_index); - void* member2 = simgrid::dwarf::resolve_member(real_area2, type, &member, snapshot2, process_index); - simgrid::mc::RegionSnapshot* subregion1 = snapshot1->get_region(member1, process_index, region1); // region1 is hinted - simgrid::mc::RegionSnapshot* subregion2 = snapshot2->get_region(member2, process_index, region2); // region2 is hinted - res = compare_areas_with_type(state, process_index, member1, snapshot1, subregion1, member2, snapshot2, - subregion2, member.type, pointer_level); + void* member1 = simgrid::dwarf::resolve_member(real_area1, type, &member, snapshot1); + void* member2 = simgrid::dwarf::resolve_member(real_area2, type, &member, snapshot2); + simgrid::mc::RegionSnapshot* subregion1 = snapshot1->get_region(member1, region1); // region1 is hinted + simgrid::mc::RegionSnapshot* subregion2 = snapshot2->get_region(member2, region2); // region2 is hinted + res = compare_areas_with_type(state, member1, snapshot1, subregion1, member2, snapshot2, subregion2, + member.type, pointer_level); if (res == 1) return res; } @@ -1312,7 +1284,7 @@ static int compare_areas_with_type(simgrid::mc::StateComparator& state, int proc } static int compare_global_variables(simgrid::mc::StateComparator& state, simgrid::mc::ObjectInformation* object_info, - int process_index, simgrid::mc::RegionSnapshot* r1, simgrid::mc::RegionSnapshot* r2, + simgrid::mc::RegionSnapshot* r1, simgrid::mc::RegionSnapshot* r2, simgrid::mc::Snapshot* snapshot1, simgrid::mc::Snapshot* snapshot2) { xbt_assert(r1 && r2, "Missing region."); @@ -1329,10 +1301,8 @@ static int compare_global_variables(simgrid::mc::StateComparator& state, simgrid continue; simgrid::mc::Type* bvariable_type = current_var.type; - int res = compare_areas_with_type(state, process_index, - (char *) current_var.address, snapshot1, r1, - (char *) current_var.address, snapshot2, r2, - bvariable_type, 0); + int res = compare_areas_with_type(state, (char*)current_var.address, snapshot1, r1, (char*)current_var.address, + snapshot2, r2, bvariable_type, 0); if (res == 1) { XBT_VERB("Global variable %s (%p) is different between snapshots", current_var.name.c_str(), @@ -1345,7 +1315,6 @@ static int compare_global_variables(simgrid::mc::StateComparator& state, simgrid } static int compare_local_variables(simgrid::mc::StateComparator& state, - int process_index, simgrid::mc::Snapshot* snapshot1, simgrid::mc::Snapshot* snapshot2, mc_snapshot_stack_t stack1, @@ -1379,10 +1348,9 @@ static int compare_local_variables(simgrid::mc::StateComparator& state, // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram simgrid::mc::Type* subtype = current_var1->type; - int res = - compare_areas_with_type(state, process_index, current_var1->address, snapshot1, - snapshot1->get_region(current_var1->address, process_index), current_var2->address, - snapshot2, snapshot2->get_region(current_var2->address, process_index), subtype, 0); + int res = compare_areas_with_type(state, current_var1->address, snapshot1, + snapshot1->get_region(current_var1->address), current_var2->address, + snapshot2, snapshot2->get_region(current_var2->address), subtype, 0); if (res == 1) { // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram @@ -1457,14 +1425,10 @@ int snapshot_compare(Snapshot* s1, Snapshot* s2) return 1; /* Init heap information used in heap comparison algorithm */ - xbt_mheap_t heap1 = (xbt_mheap_t)s1->read_bytes( - alloca(sizeof(struct mdesc)), sizeof(struct mdesc), - remote(process->heap_address), - simgrid::mc::ProcessIndexMissing, simgrid::mc::ReadOptions::lazy()); - xbt_mheap_t heap2 = (xbt_mheap_t)s2->read_bytes( - alloca(sizeof(struct mdesc)), sizeof(struct mdesc), - remote(process->heap_address), - simgrid::mc::ProcessIndexMissing, simgrid::mc::ReadOptions::lazy()); + xbt_mheap_t heap1 = (xbt_mheap_t)s1->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc), + remote(process->heap_address), simgrid::mc::ReadOptions::lazy()); + xbt_mheap_t heap2 = (xbt_mheap_t)s2->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc), + remote(process->heap_address), simgrid::mc::ReadOptions::lazy()); int res_init = state_comparator->initHeapInformation(heap1, heap2, &s1->to_ignore_, &s2->to_ignore_); if (res_init == -1) { @@ -1481,19 +1445,12 @@ int snapshot_compare(Snapshot* s1, Snapshot* s2) } /* Stacks comparison */ - int diff_local = 0; + // int diff_local = 0; for (unsigned int cursor = 0; cursor < s1->stacks_.size(); cursor++) { mc_snapshot_stack_t stack1 = &s1->stacks_[cursor]; mc_snapshot_stack_t stack2 = &s2->stacks_[cursor]; - if (stack1->process_index != stack2->process_index) { - diff_local = 1; - XBT_DEBUG("(%d - %d) Stacks with different process index (%i vs %i)", s1->num_state_, s2->num_state_, - stack1->process_index, stack2->process_index); - } - else diff_local = compare_local_variables(*state_comparator, - stack1->process_index, s1, s2, stack1, stack2); - if (diff_local > 0) { + if (compare_local_variables(*state_comparator, s1, s2, stack1, stack2) > 0) { #ifdef MC_DEBUG XBT_DEBUG("(%d - %d) Different local variables between stacks %d", num1, num2, cursor + 1); @@ -1526,8 +1483,7 @@ int snapshot_compare(Snapshot* s1, Snapshot* s2) xbt_assert(region1->object_info()); /* Compare global variables */ - if (compare_global_variables(*state_comparator, region1->object_info(), simgrid::mc::ProcessIndexDisabled, region1, - region2, s1, s2)) { + if (compare_global_variables(*state_comparator, region1->object_info(), region1, region2, s1, s2)) { #ifdef MC_DEBUG std::string const& name = region1->object_info()->file_name; diff --git a/src/mc/inspect/DwarfExpression.cpp b/src/mc/inspect/DwarfExpression.cpp index 89bca9510b..c0c6a3eb9c 100644 --- a/src/mc/inspect/DwarfExpression.cpp +++ b/src/mc/inspect/DwarfExpression.cpp @@ -256,7 +256,7 @@ void execute(const Dwarf_Op* ops, std::size_t n, const ExpressionContext& contex // Computed address: if (not context.address_space) throw evaluation_error("Missing address space"); - context.address_space->read_bytes(&stack.top(), sizeof(uintptr_t), remote(stack.top()), context.process_index); + context.address_space->read_bytes(&stack.top(), sizeof(uintptr_t), remote(stack.top())); break; // Not handled: diff --git a/src/mc/inspect/DwarfExpression.hpp b/src/mc/inspect/DwarfExpression.hpp index 5891042244..f67f7490e5 100644 --- a/src/mc/inspect/DwarfExpression.hpp +++ b/src/mc/inspect/DwarfExpression.hpp @@ -50,7 +50,6 @@ public: , frame_base(nullptr) , address_space(nullptr) , object_info(nullptr) - , process_index(simgrid::mc::ProcessIndexMissing) { } /** CPU state (registers) */ @@ -59,7 +58,6 @@ public: /** Address space used to read memory */ simgrid::mc::AddressSpace* address_space; simgrid::mc::ObjectInformation* object_info; - int process_index; }; /** When an error happens in the execution of a DWARF expression */ diff --git a/src/mc/inspect/Frame.cpp b/src/mc/inspect/Frame.cpp index dca624da69..25b3bc2cfc 100644 --- a/src/mc/inspect/Frame.cpp +++ b/src/mc/inspect/Frame.cpp @@ -16,7 +16,7 @@ namespace mc { void* Frame::frame_base(unw_cursor_t& unw_cursor) const { simgrid::dwarf::Location location = - simgrid::dwarf::resolve(frame_base_location, object_info, &unw_cursor, nullptr, nullptr, -1); + simgrid::dwarf::resolve(frame_base_location, object_info, &unw_cursor, nullptr, nullptr); if (location.in_memory()) return location.address(); else if (location.in_register()) { diff --git a/src/mc/inspect/LocationList.cpp b/src/mc/inspect/LocationList.cpp index ce194386bf..cc701965ee 100644 --- a/src/mc/inspect/LocationList.cpp +++ b/src/mc/inspect/LocationList.cpp @@ -20,15 +20,13 @@ namespace dwarf { /** Resolve a location expression */ Location resolve(simgrid::dwarf::DwarfExpression const& expression, simgrid::mc::ObjectInformation* object_info, - unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, - int process_index) + unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space) { simgrid::dwarf::ExpressionContext context; context.frame_base = frame_pointer_address; context.cursor = c; context.address_space = address_space; context.object_info = object_info; - context.process_index = process_index; if (not expression.empty() && expression[0].atom >= DW_OP_reg0 && expression[0].atom <= DW_OP_reg31) { int dwarf_register = expression[0].atom - DW_OP_reg0; @@ -52,8 +50,7 @@ static simgrid::dwarf::DwarfExpression const* find_expression(simgrid::dwarf::Lo } Location resolve(simgrid::dwarf::LocationList const& locations, simgrid::mc::ObjectInformation* object_info, - unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, - int process_index) + unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space) { unw_word_t ip = 0; if (c && unw_get_reg(c, UNW_REG_IP, &ip)) @@ -61,7 +58,7 @@ Location resolve(simgrid::dwarf::LocationList const& locations, simgrid::mc::Obj simgrid::dwarf::DwarfExpression const* expression = find_expression(locations, ip); if (not expression) xbt_die("Could not resolve location"); - return simgrid::dwarf::resolve(*expression, object_info, c, frame_pointer_address, address_space, process_index); + return simgrid::dwarf::resolve(*expression, object_info, c, frame_pointer_address, address_space); } LocationList location_list(simgrid::mc::ObjectInformation& info, Dwarf_Attribute& attr) diff --git a/src/mc/inspect/LocationList.hpp b/src/mc/inspect/LocationList.hpp index b937ef45cb..07dcb7c991 100644 --- a/src/mc/inspect/LocationList.hpp +++ b/src/mc/inspect/LocationList.hpp @@ -66,12 +66,10 @@ public: XBT_PRIVATE Location resolve(simgrid::dwarf::DwarfExpression const& expression, simgrid::mc::ObjectInformation* object_info, - unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, - int process_index); + unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space); Location resolve(simgrid::dwarf::LocationList const& locations, simgrid::mc::ObjectInformation* object_info, - unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, - int process_index); + unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space); XBT_PRIVATE simgrid::dwarf::LocationList location_list(simgrid::mc::ObjectInformation& info, Dwarf_Attribute& attr); diff --git a/src/mc/inspect/mc_dwarf.hpp b/src/mc/inspect/mc_dwarf.hpp index a533f00c0a..76b36f4ce4 100644 --- a/src/mc/inspect/mc_dwarf.hpp +++ b/src/mc/inspect/mc_dwarf.hpp @@ -20,7 +20,7 @@ XBT_PRIVATE const char* attrname(int attr); XBT_PRIVATE const char* tagname(int tag); XBT_PRIVATE void* resolve_member(const void* base, simgrid::mc::Type* type, simgrid::mc::Member* member, - simgrid::mc::AddressSpace* snapshot, int process_index); + simgrid::mc::AddressSpace* snapshot); XBT_PRIVATE int dwarf_register_to_libunwind(int dwarf_register); diff --git a/src/mc/inspect/mc_member.cpp b/src/mc/inspect/mc_member.cpp index 5b01e582b2..74f5e9f462 100644 --- a/src/mc/inspect/mc_member.cpp +++ b/src/mc/inspect/mc_member.cpp @@ -19,13 +19,12 @@ namespace dwarf { * @return Process address of the given member of the 'object' struct/class */ void* resolve_member(const void* base, simgrid::mc::Type* /*type*/, simgrid::mc::Member* member, - simgrid::mc::AddressSpace* address_space, int process_index) + simgrid::mc::AddressSpace* address_space) { ExpressionContext state; state.frame_base = nullptr; state.cursor = nullptr; state.address_space = address_space; - state.process_index = process_index; ExpressionStack stack; stack.push((ExpressionStack::value_type)base); diff --git a/src/mc/remote/Client.cpp b/src/mc/remote/Client.cpp index 75af567b02..71d790dbfc 100644 --- a/src/mc/remote/Client.cpp +++ b/src/mc/remote/Client.cpp @@ -236,12 +236,6 @@ void Client::declareStack(void* stack, size_t size, smx_actor_t process, ucontex region.context = context; region.size = size; region.block = ((char*)stack - (char*)heap->heapbase) / BLOCKSIZE + 1; -#if HAVE_SMPI - if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP && process) - region.process_index = process->get_pid() - 1; - else -#endif - region.process_index = -1; s_mc_message_stack_region_t message; message.type = MC_MESSAGE_STACK_REGION; diff --git a/src/mc/remote/RemoteClient.cpp b/src/mc/remote/RemoteClient.cpp index 3a9f7fc4ac..5730e8aced 100644 --- a/src/mc/remote/RemoteClient.cpp +++ b/src/mc/remote/RemoteClient.cpp @@ -206,8 +206,7 @@ void RemoteClient::init() xbt_die("No heap information in the target process"); if (not std_heap_var->address) xbt_die("No constant address for this variable"); - this->read_bytes(&this->heap_address, sizeof(mdesc*), remote(std_heap_var->address), - simgrid::mc::ProcessIndexDisabled); + this->read_bytes(&this->heap_address, sizeof(mdesc*), remote(std_heap_var->address)); this->smx_actors_infos.clear(); this->smx_dead_actors_infos.clear(); @@ -241,7 +240,7 @@ void RemoteClient::refresh_heap() // Read/dereference/refresh the std_heap pointer: if (not this->heap) this->heap.reset(new s_xbt_mheap_t()); - this->read_bytes(this->heap.get(), sizeof(mdesc), remote(this->heap_address), simgrid::mc::ProcessIndexDisabled); + this->read_bytes(this->heap.get(), sizeof(mdesc), remote(this->heap_address)); this->cache_flags_ |= RemoteClient::cache_heap; } @@ -258,8 +257,7 @@ void RemoteClient::refresh_malloc_info() size_t count = this->heap->heaplimit + 1; if (this->heap_info.size() < count) this->heap_info.resize(count); - this->read_bytes(this->heap_info.data(), count * sizeof(malloc_info), remote(this->heap->heapinfo), - simgrid::mc::ProcessIndexDisabled); + this->read_bytes(this->heap_info.data(), count * sizeof(malloc_info), remote(this->heap->heapinfo)); this->cache_flags_ |= RemoteClient::cache_malloc; } @@ -427,7 +425,7 @@ std::string RemoteClient::read_string(RemotePtr address) const } } -const void* RemoteClient::read_bytes(void* buffer, std::size_t size, RemotePtr address, int process_index, +const void* RemoteClient::read_bytes(void* buffer, std::size_t size, RemotePtr address, ReadOptions /*options*/) const { if (pread_whole(this->memory_file, buffer, size, (size_t)address.address()) < 0) diff --git a/src/mc/remote/RemoteClient.hpp b/src/mc/remote/RemoteClient.hpp index 68eb5261be..f215fe659a 100644 --- a/src/mc/remote/RemoteClient.hpp +++ b/src/mc/remote/RemoteClient.hpp @@ -80,7 +80,7 @@ public: RemoteClient& operator=(RemoteClient&&) = delete; // Read memory: - const void* read_bytes(void* buffer, std::size_t size, RemotePtr address, int process_index = ProcessIndexAny, + const void* read_bytes(void* buffer, std::size_t size, RemotePtr address, ReadOptions options = ReadOptions::none()) const override; void read_variable(const char* name, void* target, size_t size) const; diff --git a/src/mc/sosp/ChunkedData.cpp b/src/mc/sosp/ChunkedData.cpp index 2d5979963a..808fc60501 100644 --- a/src/mc/sosp/ChunkedData.cpp +++ b/src/mc/sosp/ChunkedData.cpp @@ -34,7 +34,7 @@ ChunkedData::ChunkedData(PageStore& store, AddressSpace& as, RemotePtr add - move the segments in shared memory (this will break `fork` however) */ - as.read_bytes(buffer.data(), xbt_pagesize, page, simgrid::mc::ProcessIndexDisabled); + as.read_bytes(buffer.data(), xbt_pagesize, page); pagenos_[i] = store_->store_page(buffer.data()); } diff --git a/src/mc/sosp/RegionSnapshot.cpp b/src/mc/sosp/RegionSnapshot.cpp index 2cec0cf1eb..56a2395f64 100644 --- a/src/mc/sosp/RegionSnapshot.cpp +++ b/src/mc/sosp/RegionSnapshot.cpp @@ -27,8 +27,7 @@ RegionDense::RegionDense(RegionType region_type, void* start_addr, void* permane { flat_data_ = Buffer::malloc(size); - mc_model_checker->process().read_bytes(flat_data_.get(), size, remote(permanent_addr), - simgrid::mc::ProcessIndexDisabled); + mc_model_checker->process().read_bytes(flat_data_.get(), size, remote(permanent_addr)); storage_type_ = StorageType::Flat; page_numbers_.clear(); diff --git a/src/mc/sosp/mc_snapshot.cpp b/src/mc/sosp/mc_snapshot.cpp index 89be71622e..535cfc24b5 100644 --- a/src/mc/sosp/mc_snapshot.cpp +++ b/src/mc/sosp/mc_snapshot.cpp @@ -107,7 +107,6 @@ void simgrid::mc::Snapshot::snapshot_regions(simgrid::mc::RemoteClient* process) add_region(simgrid::mc::RegionType::Heap, nullptr, start_heap, start_heap, (char*)end_heap - (char*)start_heap); heap_bytes_used_ = mmalloc_get_bytes_used_remote(heap->heaplimit, process->get_malloc_info()); - privatization_index_ = simgrid::mc::ProcessIndexMissing; } /** @brief Checks whether the variable is in scope for a given IP. @@ -128,7 +127,7 @@ static bool valid_variable(simgrid::mc::Variable* var, simgrid::mc::Frame* scope return true; } -static void fill_local_variables_values(mc_stack_frame_t stack_frame, simgrid::mc::Frame* scope, int process_index, +static void fill_local_variables_values(mc_stack_frame_t stack_frame, simgrid::mc::Frame* scope, std::vector& result) { if (not scope || not scope->range.contain(stack_frame->ip)) @@ -151,7 +150,7 @@ static void fill_local_variables_values(mc_stack_frame_t stack_frame, simgrid::m else if (not current_variable.location_list.empty()) { simgrid::dwarf::Location location = simgrid::dwarf::resolve( current_variable.location_list, current_variable.object_info, &(stack_frame->unw_cursor), - (void*)stack_frame->frame_base, &mc_model_checker->process(), process_index); + (void*)stack_frame->frame_base, &mc_model_checker->process()); if (not location.in_memory()) xbt_die("Cannot handle non-address variable"); @@ -165,15 +164,14 @@ static void fill_local_variables_values(mc_stack_frame_t stack_frame, simgrid::m // Recursive processing of nested scopes: for (simgrid::mc::Frame& nested_scope : scope->scopes) - fill_local_variables_values(stack_frame, &nested_scope, process_index, result); + fill_local_variables_values(stack_frame, &nested_scope, result); } -static std::vector get_local_variables_values(std::vector& stack_frames, - int process_index) +static std::vector get_local_variables_values(std::vector& stack_frames) { std::vector variables; for (s_mc_stack_frame_t& stack_frame : stack_frames) - fill_local_variables_values(&stack_frame, stack_frame.frame, process_index, variables); + fill_local_variables_values(&stack_frame, stack_frame.frame, variables); return variables; } @@ -244,8 +242,7 @@ void simgrid::mc::Snapshot::snapshot_stacks(simgrid::mc::RemoteClient* process) st.context.initialize(&mc_model_checker->process(), &context); st.stack_frames = unwind_stack_frames(&st.context); - st.local_variables = get_local_variables_values(st.stack_frames, stack.process_index); - st.process_index = stack.process_index; + st.local_variables = get_local_variables_values(st.stack_frames); unw_word_t sp = st.stack_frames[0].sp; @@ -266,8 +263,7 @@ static void snapshot_handle_ignore(simgrid::mc::Snapshot* snapshot) ignored_data.start = (void*)region.addr; ignored_data.data.resize(region.size); // TODO, we should do this once per privatization segment: - snapshot->process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr), - simgrid::mc::ProcessIndexDisabled); + snapshot->process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr)); snapshot->ignored_data_.push_back(std::move(ignored_data)); } @@ -286,7 +282,6 @@ Snapshot::Snapshot(int _num_state, RemoteClient* process) , num_state_(_num_state) , heap_bytes_used_(0) , enabled_processes_() - , privatization_index_(0) , hash_(0) { for (auto const& p : process->actors()) @@ -321,10 +316,9 @@ void Snapshot::add_region(RegionType type, ObjectInformation* object_info, void* snapshot_regions_.push_back(std::unique_ptr(std::move(region))); } -const void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr address, int process_index, - ReadOptions options) const +const void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr address, ReadOptions options) const { - RegionSnapshot* region = this->get_region((void*)address.address(), process_index); + RegionSnapshot* region = this->get_region((void*)address.address()); if (region) { const void* res = MC_region_read(region, buffer, (void*)address.address(), size); if (buffer == res || options & ReadOptions::lazy()) @@ -334,14 +328,13 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr return buffer; } } else - return this->process()->read_bytes(buffer, size, address, process_index, options); + return this->process()->read_bytes(buffer, size, address, options); } /** @brief Find the snapshoted region from a pointer * * @param addr Pointer - * @param process_index rank requesting the region * */ -RegionSnapshot* Snapshot::get_region(const void* addr, int process_index) const +RegionSnapshot* Snapshot::get_region(const void* addr) const { size_t n = snapshot_regions_.size(); for (size_t i = 0; i != n; ++i) { @@ -356,12 +349,12 @@ RegionSnapshot* Snapshot::get_region(const void* addr, int process_index) const } /** @brief Find the snapshoted region from a pointer, with a hinted_region */ -RegionSnapshot* Snapshot::get_region(const void* addr, int process_index, RegionSnapshot* hinted_region) const +RegionSnapshot* Snapshot::get_region(const void* addr, RegionSnapshot* hinted_region) const { if (hinted_region->contain(simgrid::mc::remote(addr))) return hinted_region; else - return get_region(addr, process_index); + return get_region(addr); } void Snapshot::restore(RemoteClient* process) diff --git a/src/mc/sosp/mc_snapshot.hpp b/src/mc/sosp/mc_snapshot.hpp index 5d6441fed7..52f8ac49fc 100644 --- a/src/mc/sosp/mc_snapshot.hpp +++ b/src/mc/sosp/mc_snapshot.hpp @@ -22,8 +22,7 @@ static XBT_ALWAYS_INLINE void* mc_translate_address_region_chunked(uintptr_t add return (char*)snapshot_page + offset; } -static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, simgrid::mc::RegionSnapshot* region, - int process_index) +static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, simgrid::mc::RegionSnapshot* region) { switch (region->storage_type()) { case simgrid::mc::StorageType::Flat: { @@ -75,7 +74,6 @@ struct XBT_PRIVATE s_mc_snapshot_stack_t { std::vector local_variables; simgrid::mc::UnwindContext context; std::vector stack_frames; - int process_index; }; typedef s_mc_snapshot_stack_t* mc_snapshot_stack_t; @@ -90,10 +88,10 @@ public: /* Initialization */ /* Regular use */ - const void* read_bytes(void* buffer, std::size_t size, RemotePtr address, int process_index = ProcessIndexAny, + const void* read_bytes(void* buffer, std::size_t size, RemotePtr address, ReadOptions options = ReadOptions::none()) const override; - RegionSnapshot* get_region(const void* addr, int process_index) const; - RegionSnapshot* get_region(const void* addr, int process_index, RegionSnapshot* hinted_region) const; + RegionSnapshot* get_region(const void* addr) const; + RegionSnapshot* get_region(const void* addr, RegionSnapshot* hinted_region) const; void restore(RemoteClient* process); // To be private @@ -101,7 +99,6 @@ public: std::size_t heap_bytes_used_; std::vector> snapshot_regions_; std::set enabled_processes_; - int privatization_index_ = 0; std::vector stack_sizes_; std::vector stacks_; std::vector to_ignore_; @@ -172,9 +169,7 @@ static XBT_ALWAYS_INLINE const void* MC_region_read(simgrid::mc::RegionSnapshot* } default: - // includes StorageType::NoData and StorageType::Privatized (we currently do not pass the process_index to this - // function so we assume that the privatized region has been resolved in the callers) - xbt_die("Storage type not supported"); + xbt_die("StorageType::NoData not supported"); } } diff --git a/teshsuite/mc/dwarf/dwarf.cpp b/teshsuite/mc/dwarf/dwarf.cpp index da8102fef5..c3f876ea74 100644 --- a/teshsuite/mc/dwarf/dwarf.cpp +++ b/teshsuite/mc/dwarf/dwarf.cpp @@ -64,8 +64,7 @@ static void test_local_variable(simgrid::mc::ObjectInformation* info, const char assert(var); void* frame_base = subprogram->frame_base(*cursor); - simgrid::dwarf::Location location = simgrid::dwarf::resolve( - var->location_list, info, cursor, frame_base, nullptr, -1); + simgrid::dwarf::Location location = simgrid::dwarf::resolve(var->location_list, info, cursor, frame_base, nullptr); xbt_assert(location.in_memory(), "Expected the variable %s of function %s to be in memory", variable, function); xbt_assert(location.address() == address, "Bad resolution of local variable %s of %s", variable, function); -- 2.20.1