- (process->heap->heaplimit + 1) * sizeof(malloc_info);
- process->heap_info = (malloc_info*) realloc(process->heap_info, malloc_info_bytesize);
- MC_process_read(process, MC_ADDRESS_SPACE_READ_FLAGS_NONE,
- process->heap_info,
- process->heap->heapinfo, malloc_info_bytesize,
- MC_PROCESS_INDEX_DISABLED);
- process->cache_flags |= MC_PROCESS_CACHE_FLAG_MALLOC_INFO;
-}
-
-#define SO_RE "\\.so[\\.0-9]*$"
-#define VERSION_RE "-[\\.0-9]*$"
-
-const char* FILTERED_LIBS[] = {
- "libstdc++",
- "libc++",
- "libm",
- "libgcc_s",
- "libpthread",
- "libunwind",
- "libunwind-x86_64",
- "libunwind-x86",
- "libunwind-ptrace",
- "libdw",
- "libdl",
- "librt",
- "liblzma",
- "libelf",
- "libbz2",
- "libz",
- "libelf",
- "libc",
- "ld"
-};
-
-static bool MC_is_simgrid_lib(const char* libname)
-{
- return !strcmp(libname, "libsimgrid");
-}
-
-static bool MC_is_filtered_lib(const char* libname)
-{
- const size_t n = sizeof(FILTERED_LIBS) / sizeof(const char*);
- size_t i;
- for (i=0; i!=n; ++i)
- if (strcmp(libname, FILTERED_LIBS[i])==0)
- return true;
- return false;
-}
-
-struct s_mc_memory_map_re {
- regex_t so_re;
- regex_t version_re;
-};
-
-static char* MC_get_lib_name(const char* pathname, struct s_mc_memory_map_re* res) {
- const char* map_basename = basename((char*) pathname);
-
- regmatch_t match;
- if(regexec(&res->so_re, map_basename, 1, &match, 0))
- return NULL;
-
- char* libname = strndup(map_basename, match.rm_so);
-
- // Strip the version suffix:
- if(libname && !regexec(&res->version_re, libname, 1, &match, 0)) {
- char* temp = libname;
- libname = strndup(temp, match.rm_so);
- free(temp);
- }
-
- return libname;
+ (this->heap->heaplimit + 1) * sizeof(malloc_info);
+ this->heap_info = (malloc_info*) realloc(this->heap_info, malloc_info_bytesize);
+ this->read_bytes(this->heap_info, malloc_info_bytesize,
+ remote(this->heap->heapinfo), simgrid::mc::ProcessIndexDisabled);
+ this->cache_flags |= MC_PROCESS_CACHE_FLAG_MALLOC_INFO;