Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Better fix for compatibility with old/broken version of dwarf.h.
[simgrid.git] / src / mc / mc_dwarf.c
index 334e55c..b24af22 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <stdlib.h>
+#define DW_LANG_Objc DW_LANG_ObjC /* fix spelling error in older dwarf.h */
 #include <dwarf.h>
 #include <elfutils/libdw.h>
 #include <inttypes.h>
 
 #include "mc_private.h"
 
-// Define symbols not present in old version of dwarf.h.
-// Old version of dwarf.h, use DW_LANG_Objc instead of this:
-#define DW_LANG_ObjC 0x0010
-
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dwarf, mc, "DWARF processing");
 
 /** \brief The default DW_TAG_lower_bound for a given DW_AT_language.
@@ -711,7 +708,7 @@ static dw_variable_t MC_die_to_variable(mc_object_info_t info, Dwarf_Die* die, D
       if (dwarf_getlocation(&attr_location, &expr, &len)) {
         xbt_die(
           "Could not read location expression in DW_AT_location of variable <%"PRIx64">%s",
-          (uintptr_t) variable->dwarf_offset, variable->name);
+          (uint64_t) variable->dwarf_offset, variable->name);
       }
 
       if (len==1 && expr[0].atom == DW_OP_addr) {
@@ -732,7 +729,7 @@ static dw_variable_t MC_die_to_variable(mc_object_info_t info, Dwarf_Die* die, D
     break;
   default:
     xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%"PRIx64">%s",
-      form, form, klass, klass, (uintptr_t) variable->dwarf_offset, variable->name);
+      form, form, klass, klass, (uint64_t) variable->dwarf_offset, variable->name);
   }
 
   // Handle start_scope: