Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Simplify MC_dwarf_get_variables()
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 7 Sep 2015 13:42:11 +0000 (15:42 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 7 Sep 2015 13:42:11 +0000 (15:42 +0200)
src/mc/mc_dwarf.cpp

index 9283528..e55aeeb 100644 (file)
@@ -1008,20 +1008,12 @@ void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info)
   Dwarf_Off offset = 0;
   Dwarf_Off next_offset = 0;
   size_t length;
+
   while (dwarf_nextcu(dwarf, offset, &next_offset, &length, NULL, NULL, NULL) ==
          0) {
     Dwarf_Die unit_die;
-    if (dwarf_offdie(dwarf, offset + length, &unit_die) != NULL) {
-
-      // For each child DIE:
-      Dwarf_Die child;
-      int res;
-      for (res = dwarf_child(&unit_die, &child); res == 0;
-           res = dwarf_siblingof(&child, &child)) {
-        MC_dwarf_handle_die(info, &child, &unit_die, NULL, NULL);
-      }
-
-    }
+    if (dwarf_offdie(dwarf, offset + length, &unit_die) != NULL)
+      MC_dwarf_handle_children(info, &unit_die, &unit_die, NULL, NULL);
     offset = next_offset;
   }