]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/inspect/ObjectInformation.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use std::byte for bye-oriented data manipulation (sonar).
[simgrid.git] / src / mc / inspect / ObjectInformation.cpp
index f7edbc5d72a2f3670ce8e2e0dbc8977cb0f6f11b..968d3aab77c6ddbbd666ff921c1b0156407fdbe1 100644 (file)
@@ -14,8 +14,7 @@
 #include "src/mc/mc_private.hpp"
 #include "xbt/file.hpp"
 
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
 
 /* For an executable object, addresses are virtual address (there is no offset) i.e.
  *  \f$\text{virtual address} = \{dwarf address}\f$
@@ -139,10 +138,7 @@ void find_object_address(std::vector<xbt::VmMap> const& maps, ObjectInformation*
 
   for (size_t i = 0; i < maps.size(); ++i) {
     simgrid::xbt::VmMap const& reg = maps[i];
-    if (maps[i].pathname.empty())
-      continue;
-    std::string map_basename = simgrid::xbt::Path(maps[i].pathname).get_base_name();
-    if (map_basename != name)
+    if (reg.pathname.empty() || name != simgrid::xbt::Path(reg.pathname).get_base_name())
       continue;
 
     // This is the non-GNU_RELRO-part of the data segment:
@@ -198,5 +194,4 @@ void find_object_address(std::vector<xbt::VmMap> const& maps, ObjectInformation*
   xbt_assert(result->start_exec || result->start_rw || result->start_ro);
 }
 
-} // namespace mc
-} // namespace simgrid
+} // namespace simgrid::mc