Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid shadowing outer variables.
[simgrid.git] / src / mc / sosp / mc_checkpoint.cpp
index f5d279f..26e07f5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2008-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -158,7 +158,7 @@ static void get_memory_regions(simgrid::mc::RemoteClient* process, simgrid::mc::
     snapshot->privatization_index = simgrid::mc::ProcessIndexMissing;
 }
 
-/** \brief Fills the position of the segments (executable, read-only, read/write).
+/** @brief Fills the position of the segments (executable, read-only, read/write).
  * */
 // TODO, use the ELF segment information for more robustness
 void find_object_address(std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result)
@@ -226,14 +226,14 @@ void find_object_address(std::vector<simgrid::xbt::VmMap> const& maps, simgrid::
 /************************************* Take Snapshot ************************************/
 /****************************************************************************************/
 
-/** \brief Checks whether the variable is in scope for a given IP.
+/** @brief Checks whether the variable is in scope for a given IP.
  *
  *  A variable may be defined only from a given value of IP.
  *
- *  \param var   Variable description
- *  \param scope Scope description
- *  \param ip    Instruction pointer
- *  \return      true if the variable is valid
+ *  @param var   Variable description
+ *  @param scope Scope description
+ *  @param ip    Instruction pointer
+ *  @return      true if the variable is valid
  * */
 static bool valid_variable(simgrid::mc::Variable* var, simgrid::mc::Frame* scope, const void* ip)
 {
@@ -343,7 +343,7 @@ static std::vector<s_mc_stack_frame_t> unwind_stack_frames(simgrid::mc::UnwindCo
     result.push_back(std::move(stack_frame));
 
     /* Stop before context switch with maestro */
-    if (frame != nullptr && frame->name == "smx_ctx_sysv_wrapper")
+    if (frame != nullptr && frame->name == "smx_ctx_wrapper")
       break;
 
     int ret = unw_step(&c);
@@ -419,7 +419,8 @@ static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
 {
   const size_t fd_dir_path_size = 20;
   char fd_dir_path[fd_dir_path_size];
-  int res = snprintf(fd_dir_path, fd_dir_path_size, "/proc/%lli/fd", (long long int)pid);
+  int res;
+  res = snprintf(fd_dir_path, fd_dir_path_size, "/proc/%lli/fd", (long long int)pid);
   xbt_assert(res >= 0);
   if ((size_t)res > fd_dir_path_size)
     xbt_die("Unexpected buffer is too small for fd_dir_path");
@@ -440,7 +441,7 @@ static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
 
     const size_t source_size = 25;
     char source[25];
-    int res = snprintf(source, source_size, "/proc/%lli/fd/%s", (long long int)pid, fd_number->d_name);
+    res = snprintf(source, source_size, "/proc/%lli/fd/%s", (long long int)pid, fd_number->d_name);
     xbt_assert(res >= 0);
     if ((size_t)res > source_size)
       xbt_die("Unexpected buffer is too small for fd %s", fd_number->d_name);
@@ -504,7 +505,7 @@ std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
   std::shared_ptr<simgrid::mc::Snapshot> snapshot = std::make_shared<simgrid::mc::Snapshot>(mc_process, num_state);
 
   for (auto const& p : mc_model_checker->process().actors())
-    snapshot->enabled_processes.insert(p.copy.getBuffer()->pid_);
+    snapshot->enabled_processes.insert(p.copy.getBuffer()->get_pid());
 
   snapshot_handle_ignore(snapshot.get());