Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix location expression initialization
[simgrid.git] / src / mc / mc_dwarf.cpp
index 3b8e900..774eb33 100644 (file)
@@ -5,6 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <cinttypes>
+#include <cstdint>
 
 #include <algorithm>
 #include <memory>
@@ -505,7 +506,7 @@ static void MC_dwarf_fill_member_location(simgrid::mc::Type* type, simgrid::mc::
             ("Could not read location expression DW_AT_data_member_location in DW_TAG_member %s of type <%"
              PRIx64 ">%s", MC_dwarf_attr_integrate_string(child, DW_AT_name),
              (uint64_t) type->id, type->name.c_str());
-      simgrid::mc::DwarfExpression(expr, expr+len);
+      member->location_expression = simgrid::mc::DwarfExpression(expr, expr+len);
       break;
     }
   case MC_DW_CLASS_CONSTANT:
@@ -987,7 +988,9 @@ void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info)
     xbt_die("Could not open file %s", info->file_name.c_str());
   Dwarf *dwarf = dwarf_begin(fd, DWARF_C_READ);
   if (dwarf == NULL)
-    xbt_die("Your program must be compiled with -g (%s)",
+    xbt_die("Missing debugging information in %s\n"
+      "Your program and its dependencies must have debugging information.\n"
+      "You might want to recompile with -g or install the suitable debugging package.\n",
       info->file_name.c_str());
   // For each compilation unit:
   Dwarf_Off offset = 0;
@@ -1063,7 +1066,7 @@ static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid:
     auto i = info->subprograms.find(scope->abstract_origin_id);
     xbt_assert(i != info->subprograms.end(),
       "Could not lookup abstract origin %" PRIx64,
-      (uint64_t) scope->abstract_origin_id);
+      (std::uint64_t) scope->abstract_origin_id);
     scope->name = i->second.name;
   }