Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master'
[simgrid.git] / teshsuite / mc / dwarf / dwarf.c
index 059062d..8b22d4b 100644 (file)
@@ -15,6 +15,7 @@
 #include <mc/mc.h>
 
 #include "../../src/include/mc/datatypes.h"
+#include "../../src/mc/mc_object_info.h"
 #include "../../src/mc/mc_private.h"
 
 int test_some_array[4][5][6];
@@ -82,7 +83,15 @@ static void test_local_variable(mc_object_info_t info, const char* function, con
   assert(var);
 
   void* frame_base = mc_find_frame_base(subprogram, info, cursor);
-  xbt_assert((void*)mc_dwarf_resolve_locations(&var->locations, info, cursor, frame_base, NULL) == address,
+  s_mc_location_t location;
+
+  mc_dwarf_resolve_locations(&location,
+    &var->locations, info, cursor, frame_base, NULL, -1);
+
+  xbt_assert(mc_get_location_type(&location)==MC_LOCATION_TYPE_ADDRESS,
+    "Unexpected location type for variable %s of %s", variable, function);
+
+  xbt_assert(location.memory_location == address,
     "Bad resolution of local variable %s of %s", variable, function);
 
 }
@@ -129,7 +138,7 @@ int main(int argc, char** argv) {
   dw_variable_t var;
   dw_type_t type;
 
-  var = test_global_variable(mc_binary_info, "some_local_variable", &some_local_variable, sizeof(int));
+  test_global_variable(mc_binary_info, "some_local_variable", &some_local_variable, sizeof(int));
 
   var = test_global_variable(mc_binary_info, "test_some_array", &test_some_array, sizeof(test_some_array));
   type = xbt_dict_get_or_null(mc_binary_info->types, var->type_origin);