Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move some SIMIX inspection code in the Process class
[simgrid.git] / src / mc / Process.cpp
index a04ec5c..5dfae37 100644 (file)
@@ -107,13 +107,17 @@ struct s_mc_memory_map_re {
 
 static char* get_lib_name(const char* pathname, struct s_mc_memory_map_re* res)
 {
-  const char* map_basename = xbt_basename((char*) pathname);
+  char* map_basename = xbt_basename(pathname);
 
   regmatch_t match;
-  if(regexec(&res->so_re, map_basename, 1, &match, 0))
+  if(regexec(&res->so_re, map_basename, 1, &match, 0)) {
+    free(map_basename);
     return nullptr;
+  }
 
   char* libname = strndup(map_basename, match.rm_so);
+  free(map_basename);
+  map_basename = nullptr;
 
   // Strip the version suffix:
   if(libname && !regexec(&res->version_re, libname, 1, &match, 0)) {
@@ -684,9 +688,16 @@ void Process::ignore_local_variable(const char *var_name, const char *frame_name
 std::vector<simgrid::mc::SimixProcessInformation>& Process::simix_processes()
 {
   xbt_assert(mc_mode != MC_MODE_CLIENT);
-  MC_process_smx_refresh(&mc_model_checker->process());
+  this->refresh_simix();
   return smx_process_infos;
 }
 
+std::vector<simgrid::mc::SimixProcessInformation>& Process::old_simix_processes()
+{
+  xbt_assert(mc_mode != MC_MODE_CLIENT);
+  this->refresh_simix();
+  return smx_old_process_infos;
+}
+
 }
 }