Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove the --cfg=model-check:1 flag
[simgrid.git] / src / mc / mc_member.cpp
index 1fde63e..29fe1f5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014. The SimGrid Team.
+/* Copyright (c) 2014-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -8,6 +8,7 @@
 
 #include "mc_object_info.h"
 #include "mc_private.h"
+#include "mc/Type.hpp"
 
 /** Resolve snapshot in the process address space
  *
  * @param snapshot Snapshot (or NULL)
  * @return Process address of the given member of the 'object' struct/class
  */
-void *mc_member_resolve(const void *base, mc_type_t type, mc_type_t member,
-                        mc_address_space_t address_space, int process_index)
+void *mc_member_resolve(const void *base, simgrid::mc::Type* type, simgrid::mc::Type* member,
+                        simgrid::mc::AddressSpace* address_space, int process_index)
 {
-  if (!member->location.size) {
-    return ((char *) base) + member->offset;
-  }
+  // TODO, get rid of this?
+  if (!member->has_offset_location())
+    return ((char *) base) + member->offset();
 
   s_mc_expression_state_t state;
   memset(&state, 0, sizeof(s_mc_expression_state_t));
@@ -33,8 +34,8 @@ void *mc_member_resolve(const void *base, mc_type_t type, mc_type_t member,
   state.stack[0] = (uintptr_t) base;
   state.process_index = process_index;
 
-  if (mc_dwarf_execute_expression
-      (member->location.size, member->location.ops, &state))
+  if (simgrid::mc::execute(
+      member->location_expression, &state))
     xbt_die("Error evaluating DWARF expression");
   if (state.stack_size == 0)
     xbt_die("No value on the stack");