Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove a lot of typedefs and typedef usage
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 23 Jul 2015 11:05:18 +0000 (13:05 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 23 Jul 2015 12:12:38 +0000 (14:12 +0200)
Do not hide the real type of things behind typedefs. Some typedefs are
still there because they are used by C code.

36 files changed:
buildtools/Cmake/DefinePackages.cmake
src/mc/AddressSpace.hpp
src/mc/ModelChecker.hpp
src/mc/PageStore.hpp
src/mc/RegionSnapshot.cpp
src/mc/RegionSnapshot.hpp
src/mc/mc_checkpoint.cpp
src/mc/mc_compare.cpp
src/mc/mc_diff.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_dwarf_expression.cpp
src/mc/mc_forward.h
src/mc/mc_forward.hpp [new file with mode: 0644]
src/mc/mc_hash.cpp
src/mc/mc_location.h
src/mc/mc_member.cpp
src/mc/mc_memory_map.h
src/mc/mc_object_info.cpp
src/mc/mc_object_info.h
src/mc/mc_page_snapshot.cpp
src/mc/mc_process.cpp
src/mc/mc_process.h
src/mc/mc_safety.h
src/mc/mc_server.cpp
src/mc/mc_server.h
src/mc/mc_smx.cpp
src/mc/mc_smx.h
src/mc/mc_snapshot.cpp
src/mc/mc_snapshot.h
src/mc/mc_unw.cpp
src/mc/mc_unw.h
src/mc/mc_visited.cpp
src/mc/mc_xbt.cpp
src/mc/mcer_ignore.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/mc/dwarf_expression/dwarf_expression.cpp

index c31683e..94d3a08 100644 (file)
@@ -603,6 +603,7 @@ set(MC_SRC
   src/mc/AddressSpace.hpp
   src/mc/AddressSpace.cpp
   src/mc/mc_forward.h
+  src/mc/mc_forward.hpp
   src/mc/mc_process.h
   src/mc/mc_process.cpp
   src/mc/mc_unw.h
index ea260c2..fb1cddf 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <stdint.h>
 
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 
 namespace simgrid {
 namespace mc {
index 8ef6f80..d397d8f 100644 (file)
@@ -12,7 +12,7 @@
 #include <simgrid_config.h>
 #include <xbt/dict.h>
 
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 #include "mc_process.h"
 #include "PageStore.hpp"
 #include "mc_protocol.h"
index 9e72f1d..5dee482 100644 (file)
@@ -14,7 +14,7 @@
 #include <boost/unordered_set.hpp>
 
 #include "mc_mmu.h"
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 
 namespace simgrid {
 namespace mc {
index 23853c8..4a6e63f 100644 (file)
@@ -56,7 +56,7 @@ RegionSnapshot region(
 RegionSnapshot sparse_region(RegionType region_type,
   void *start_addr, void* permanent_addr, size_t size)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
 
   xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize-1)) == 0,
     "Not at the beginning of a page");
index 5e09e62..9915186 100644 (file)
@@ -124,7 +124,7 @@ class RegionSnapshot {
 private:
   RegionType region_type_;
   StorageType storage_type_;
-  mc_object_info_t object_info_;
+  simgrid::mc::ObjectInformation* object_info_;
 
   /** @brief  Virtual address of the region in the simulated process */
   void *start_addr_;
@@ -251,8 +251,8 @@ public:
     return privatized_regions_;
   }
 
-  mc_object_info_t object_info() const { return object_info_; }
-  void object_info(mc_object_info_t info) { object_info_ = info; }
+  simgrid::mc::ObjectInformation* object_info() const { return object_info_; }
+  void object_info(simgrid::mc::ObjectInformation* info) { object_info_ = info; }
 
   // Other getters
 
index e521d56..54f04df 100644 (file)
@@ -116,7 +116,7 @@ extern "C" {
 
 static void MC_snapshot_add_region(int index, mc_snapshot_t snapshot,
                                   simgrid::mc::RegionType type,
-                                  mc_object_info_t object_info,
+                                  simgrid::mc::ObjectInformation* object_info,
                                   void *start_addr, void* permanent_addr, size_t size)
 {
   if (type == simgrid::mc::RegionType::Data)
@@ -139,7 +139,7 @@ static void MC_snapshot_add_region(int index, mc_snapshot_t snapshot,
   return;
 }
 
-static void MC_get_memory_regions(mc_process_t process, mc_snapshot_t snapshot)
+static void MC_get_memory_regions(simgrid::mc::Process* process, mc_snapshot_t snapshot)
 {
   const size_t n = process->object_infos.size();
   snapshot->snapshot_regions.resize(n + 1);
@@ -181,7 +181,7 @@ static void MC_get_memory_regions(mc_process_t process, mc_snapshot_t snapshot)
  *  `dl_iterate_phdr` would be more robust but would not work in cross-process.
  * */
 void MC_find_object_address(
-  std::vector<simgrid::mc::VmMap> const& maps, mc_object_info_t result)
+  std::vector<simgrid::mc::VmMap> const& maps, simgrid::mc::ObjectInformation* result)
 {
   const char* file_name = xbt_strdup(result->file_name.c_str());
   const char *name = basename(file_name);
@@ -245,7 +245,7 @@ void MC_find_object_address(
  *  \param ip    Instruction pointer
  *  \return      true if the variable is valid
  * */
-static bool mc_valid_variable(mc_variable_t var, mc_frame_t scope,
+static bool mc_valid_variable(simgrid::mc::Variable* var, simgrid::mc::Frame* scope,
                               const void *ip)
 {
   // The variable is not yet valid:
@@ -256,10 +256,10 @@ static bool mc_valid_variable(mc_variable_t var, mc_frame_t scope,
 }
 
 static void mc_fill_local_variables_values(mc_stack_frame_t stack_frame,
-                                           mc_frame_t scope, int process_index,
+                                           simgrid::mc::Frame* scope, int process_index,
                                            std::vector<s_local_variable>& result)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
 
   void *ip = (void *) stack_frame->ip;
   if (ip < scope->low_pc || ip >= scope->high_pc)
@@ -336,7 +336,7 @@ static void MC_stack_frame_free_voipd(void *s)
 
 static std::vector<s_mc_stack_frame_t> MC_unwind_stack_frames(mc_unw_context_t stack_context)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
   std::vector<s_mc_stack_frame_t> result;
 
   unw_cursor_t c;
@@ -363,7 +363,7 @@ static std::vector<s_mc_stack_frame_t> MC_unwind_stack_frames(mc_unw_context_t s
 
       // TODO, use real addresses in frame_t instead of fixing it here
 
-      mc_frame_t frame = process->find_function(remote(ip));
+      simgrid::mc::Frame* frame = process->find_function(remote(ip));
       stack_frame.frame = frame;
 
       if (frame) {
@@ -569,7 +569,7 @@ mc_snapshot_t MC_take_snapshot(int num_state)
 {
   XBT_DEBUG("Taking snapshot %i", num_state);
 
-  mc_process_t mc_process = &mc_model_checker->process();
+  simgrid::mc::Process* mc_process = &mc_model_checker->process();
 
   mc_snapshot_t snapshot = new simgrid::mc::Snapshot();
 
index 0663ab8..9802a17 100644 (file)
@@ -104,11 +104,12 @@ static int compare_areas_with_type(struct mc_compare_state& state,
                                    int process_index,
                                    void* real_area1, mc_snapshot_t snapshot1, mc_mem_region_t region1,
                                    void* real_area2, mc_snapshot_t snapshot2, mc_mem_region_t region2,
-                                   mc_type_t type, int pointer_level)
+                                   simgrid::mc::Type* type, int pointer_level)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
 
-  mc_type_t subtype, subsubtype;
+  simgrid::mc::Type* subtype;
+  simgrid::mc::Type* subsubtype;
   int elm_size, i, res;
 
   top:
@@ -258,7 +259,7 @@ static int compare_areas_with_type(struct mc_compare_state& state,
   return 0;
 }
 
-static int compare_global_variables(mc_object_info_t object_info,
+static int compare_global_variables(simgrid::mc::ObjectInformation* object_info,
                                     int process_index,
                                     mc_mem_region_t r1,
                                     mc_mem_region_t r2, mc_snapshot_t snapshot1,
@@ -305,7 +306,7 @@ static int compare_global_variables(mc_object_info_t object_info,
         || (char *) current_var.address > (char *) object_info->end_rw)
       continue;
 
-    mc_type_t bvariable_type = current_var.type;
+    simgrid::mc::Type* bvariable_type = current_var.type;
     int res =
         compare_areas_with_type(state, process_index,
                                 (char *) current_var.address, snapshot1, r1,
@@ -359,7 +360,7 @@ static int compare_local_variables(int process_index,
       }
       // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
 
-        mc_type_t subtype = current_var1->type;
+        simgrid::mc::Type* subtype = current_var1->type;
         res =
             compare_areas_with_type(state, process_index,
                                     current_var1->address, snapshot1, mc_get_snapshot_region(current_var1->address, snapshot1, process_index),
@@ -386,7 +387,7 @@ static int compare_local_variables(int process_index,
 
 int snapshot_compare(void *state1, void *state2)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
 
   mc_snapshot_t s1, s2;
   int num1, num2;
index d489ae5..628bbb6 100644 (file)
@@ -151,7 +151,8 @@ struct s_mc_diff {
   std::vector<s_mc_heap_ignore_region_t>* to_ignore1;
   std::vector<s_mc_heap_ignore_region_t>* to_ignore2;
   s_heap_area_t *equals_to1, *equals_to2;
-  mc_type_t *types1, *types2;
+  simgrid::mc::Type **types1;
+  simgrid::mc::Type **types2;
   size_t available;
 };
 
@@ -383,7 +384,7 @@ int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2,
     state->types1 = (simgrid::mc::Type**)
         realloc(state->types1,
                 state->heaplimit * MAX_FRAGMENT_PER_BLOCK *
-                sizeof(type_name *));
+                sizeof(simgrid::mc::Type*));
     state->equals_to2 = (s_heap_area_t*)
         realloc(state->equals_to2,
                 state->heaplimit * MAX_FRAGMENT_PER_BLOCK *
@@ -391,7 +392,7 @@ int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2,
     state->types2 = (simgrid::mc::Type**)
         realloc(state->types2,
                 state->heaplimit * MAX_FRAGMENT_PER_BLOCK *
-                sizeof(type_name *));
+                sizeof(simgrid::mc::Type*));
     state->available = state->heaplimit;
   }
 
@@ -430,7 +431,7 @@ mc_mem_region_t MC_get_heap_region(mc_snapshot_t snapshot)
 
 int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
   struct s_mc_diff *state = mc_diff_info;
 
   /* Start comparison */
@@ -787,7 +788,7 @@ static int compare_heap_area_without_type(struct s_mc_diff *state, int process_i
                                           xbt_dynar_t previous, int size,
                                           int check_ignore)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
 
   int i = 0;
   const void *addr_pointed1, *addr_pointed2;
@@ -875,7 +876,7 @@ static int compare_heap_area_with_type(struct s_mc_diff *state, int process_inde
                                        const void *real_area1, const void *real_area2,
                                        mc_snapshot_t snapshot1,
                                        mc_snapshot_t snapshot2,
-                                       xbt_dynar_t previous, mc_type_t type,
+                                       xbt_dynar_t previous, simgrid::mc::Type* type,
                                        int area_size, int check_ignore,
                                        int pointer_level)
 {
@@ -893,7 +894,7 @@ top:
     return 0;
   }
 
-  mc_type_t subtype, subsubtype;
+  simgrid::mc::Type *subtype, *subsubtype;
   int res, elm_size;
   const void *addr_pointed1, *addr_pointed2;
 
@@ -1043,9 +1044,9 @@ top:
       for(simgrid::mc::Type& member : type->members) {
         // TODO, optimize this? (for the offset case)
         void *real_member1 =
-            mc_member_resolve(real_area1, type, &member, (mc_address_space_t) snapshot1, process_index);
+            mc_member_resolve(real_area1, type, &member, (simgrid::mc::AddressSpace*) snapshot1, process_index);
         void *real_member2 =
-            mc_member_resolve(real_area2, type, &member, (mc_address_space_t) snapshot2, process_index);
+            mc_member_resolve(real_area2, type, &member, (simgrid::mc::AddressSpace*) snapshot2, process_index);
         res =
             compare_heap_area_with_type(state, process_index, real_member1, real_member2,
                                         snapshot1, snapshot2,
@@ -1080,7 +1081,7 @@ top:
  * @param  area_size
  * @return                    DWARF type ID for given offset
  */
-static mc_type_t get_offset_type(void *real_base_address, mc_type_t type,
+static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc::Type* type,
                                  int offset, int area_size,
                                  mc_snapshot_t snapshot, int process_index)
 {
@@ -1139,9 +1140,9 @@ static mc_type_t get_offset_type(void *real_base_address, mc_type_t type,
  */
 int compare_heap_area(int process_index, const void *area1, const void *area2, mc_snapshot_t snapshot1,
                       mc_snapshot_t snapshot2, xbt_dynar_t previous,
-                      mc_type_t type, int pointer_level)
+                      simgrid::mc::Type* type, int pointer_level)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
 
   struct s_mc_diff *state = mc_diff_info;
 
@@ -1154,7 +1155,7 @@ int compare_heap_area(int process_index, const void *area1, const void *area2, m
   int type_size = -1;
   int offset1 = 0, offset2 = 0;
   int new_size1 = -1, new_size2 = -1;
-  mc_type_t new_type1 = NULL, new_type2 = NULL;
+  simgrid::mc::Type *new_type1 = NULL, *new_type2 = NULL;
 
   int match_pairs = 0;
 
index ed26c43..2134b08 100644 (file)
@@ -61,14 +61,14 @@ static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit);
  *  \param unit the DIE of the compile unit of the current DIE
  *  \param frame containg frame if any
  */
-static void MC_dwarf_handle_die(mc_object_info_t info, Dwarf_Die * die,
-                                Dwarf_Die * unit, mc_frame_t frame,
+static void MC_dwarf_handle_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                Dwarf_Die * unit, simgrid::mc::Frame* frame,
                                 const char *ns);
 
 /** \brief Process a type DIE
  */
-static void MC_dwarf_handle_type_die(mc_object_info_t info, Dwarf_Die * die,
-                                     Dwarf_Die * unit, mc_frame_t frame,
+static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                     Dwarf_Die * unit, simgrid::mc::Frame* frame,
                                      const char *ns);
 
 /** \brief Calls MC_dwarf_handle_die on all childrend of the given die
@@ -78,8 +78,8 @@ static void MC_dwarf_handle_type_die(mc_object_info_t info, Dwarf_Die * die,
  *  \param unit the DIE of the compile unit of the current DIE
  *  \param frame containg frame if any
  */
-static void MC_dwarf_handle_children(mc_object_info_t info, Dwarf_Die * die,
-                                     Dwarf_Die * unit, mc_frame_t frame,
+static void MC_dwarf_handle_children(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                     Dwarf_Die * unit, simgrid::mc::Frame* frame,
                                      const char *ns);
 
 /** \brief Handle a variable (DW_TAG_variable or other)
@@ -89,8 +89,8 @@ static void MC_dwarf_handle_children(mc_object_info_t info, Dwarf_Die * die,
  *  \param unit the DIE of the compile unit of the current DIE
  *  \param frame containg frame if any
  */
-static void MC_dwarf_handle_variable_die(mc_object_info_t info, Dwarf_Die * die,
-                                         Dwarf_Die * unit, mc_frame_t frame,
+static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                         Dwarf_Die * unit, simgrid::mc::Frame* frame,
                                          const char *ns);
 
 /** \brief Get the DW_TAG_type of the DIE
@@ -468,7 +468,7 @@ static bool MC_compare_variable(
     return a.address < b.address;
 }
 
-// ***** mc_type_t
+// ***** simgrid::mc::Type*
 
 /** \brief Initialize the location of a member of a type
  * (DW_AT_data_member_location of a DW_TAG_member).
@@ -477,7 +477,7 @@ static bool MC_compare_variable(
  *  \param  member the member of the type
  *  \param  child  DIE of the member (DW_TAG_member)
  */
-static void MC_dwarf_fill_member_location(mc_type_t type, mc_type_t member,
+static void MC_dwarf_fill_member_location(simgrid::mc::Type* type, simgrid::mc::Type* member,
                                           Dwarf_Die * child)
 {
   if (dwarf_hasattr(child, DW_AT_data_bit_offset)) {
@@ -547,8 +547,8 @@ static void MC_dwarf_fill_member_location(mc_type_t type, mc_type_t member,
  *  \param unit DIE of the compilation unit containing the type DIE
  *  \param type the type
  */
-static void MC_dwarf_add_members(mc_object_info_t info, Dwarf_Die * die,
-                                 Dwarf_Die * unit, mc_type_t type)
+static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                 Dwarf_Die * unit, simgrid::mc::Type* type)
 {
   int res;
   Dwarf_Die child;
@@ -606,8 +606,8 @@ static void MC_dwarf_add_members(mc_object_info_t info, Dwarf_Die * die,
  *  \return MC representation of the type
  */
 static simgrid::mc::Type MC_dwarf_die_to_type(
-  mc_object_info_t info, Dwarf_Die * die,
-  Dwarf_Die * unit, mc_frame_t frame,
+  simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+  Dwarf_Die * unit, simgrid::mc::Frame* frame,
   const char *ns)
 {
 
@@ -690,8 +690,8 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
   return std::move(type);
 }
 
-static void MC_dwarf_handle_type_die(mc_object_info_t info, Dwarf_Die * die,
-                                     Dwarf_Die * unit, mc_frame_t frame,
+static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                     Dwarf_Die * unit, simgrid::mc::Frame* frame,
                                      const char *ns)
 {
   simgrid::mc::Type type = MC_dwarf_die_to_type(info, die, unit, frame, ns);
@@ -703,8 +703,8 @@ static void MC_dwarf_handle_type_die(mc_object_info_t info, Dwarf_Die * die,
 static int mc_anonymous_variable_index = 0;
 
 static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
-  mc_object_info_t info, Dwarf_Die * die,
-  Dwarf_Die * unit, mc_frame_t frame,
+  simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+  Dwarf_Die * unit, simgrid::mc::Frame* frame,
   const char *ns)
 {
   // Skip declarations:
@@ -814,8 +814,8 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
   return std::move(variable);
 }
 
-static void MC_dwarf_handle_variable_die(mc_object_info_t info, Dwarf_Die * die,
-                                         Dwarf_Die * unit, mc_frame_t frame,
+static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                         Dwarf_Die * unit, simgrid::mc::Frame* frame,
                                          const char *ns)
 {
   std::unique_ptr<simgrid::mc::Variable> variable =
@@ -831,8 +831,8 @@ static void MC_dwarf_handle_variable_die(mc_object_info_t info, Dwarf_Die * die,
     xbt_die("No frame for this local variable");
 }
 
-static void MC_dwarf_handle_scope_die(mc_object_info_t info, Dwarf_Die * die,
-                                      Dwarf_Die * unit, mc_frame_t parent_frame,
+static void MC_dwarf_handle_scope_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                      Dwarf_Die * unit, simgrid::mc::Frame* parent_frame,
                                       const char *ns)
 {
   // TODO, handle DW_TAG_type/DW_TAG_location for DW_TAG_with_stmt
@@ -926,9 +926,9 @@ static void MC_dwarf_handle_scope_die(mc_object_info_t info, Dwarf_Die * die,
     parent_frame->scopes.push_back(std::move(frame));
 }
 
-static void mc_dwarf_handle_namespace_die(mc_object_info_t info,
+static void mc_dwarf_handle_namespace_die(simgrid::mc::ObjectInformation* info,
                                           Dwarf_Die * die, Dwarf_Die * unit,
-                                          mc_frame_t frame,
+                                          simgrid::mc::Frame* frame,
                                           const char *ns)
 {
   const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
@@ -940,8 +940,8 @@ static void mc_dwarf_handle_namespace_die(mc_object_info_t info,
   xbt_free(new_ns);
 }
 
-static void MC_dwarf_handle_children(mc_object_info_t info, Dwarf_Die * die,
-                                     Dwarf_Die * unit, mc_frame_t frame,
+static void MC_dwarf_handle_children(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                     Dwarf_Die * unit, simgrid::mc::Frame* frame,
                                      const char *ns)
 {
   // For each child DIE:
@@ -953,8 +953,8 @@ static void MC_dwarf_handle_children(mc_object_info_t info, Dwarf_Die * die,
   }
 }
 
-static void MC_dwarf_handle_die(mc_object_info_t info, Dwarf_Die * die,
-                                Dwarf_Die * unit, mc_frame_t frame,
+static void MC_dwarf_handle_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
+                                Dwarf_Die * unit, simgrid::mc::Frame* frame,
                                 const char *ns)
 {
   int tag = dwarf_tag(die);
@@ -992,7 +992,7 @@ static void MC_dwarf_handle_die(mc_object_info_t info, Dwarf_Die * die,
  *  Read the DWARf information of the EFFL object and populate the
  *  lists of types, variables, functions.
  */
-void MC_dwarf_get_variables(mc_object_info_t info)
+void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info)
 {
   int fd = open(info->file_name.c_str(), O_RDONLY);
   if (fd < 0)
@@ -1039,7 +1039,7 @@ static int MC_compare_frame_index_items(simgrid::mc::FunctionIndexEntry* a,
     return 1;
 }
 
-static void MC_make_functions_index(mc_object_info_t info)
+static void MC_make_functions_index(simgrid::mc::ObjectInformation* info)
 {
   info->functions_index.clear();
 
@@ -1063,7 +1063,7 @@ static void MC_make_functions_index(mc_object_info_t info)
         });
 }
 
-static void MC_post_process_variables(mc_object_info_t info)
+static void MC_post_process_variables(simgrid::mc::ObjectInformation* info)
 {
   // Someone needs this to be sorted but who?
   std::sort(info->global_variables.begin(), info->global_variables.end(),
@@ -1076,7 +1076,7 @@ static void MC_post_process_variables(mc_object_info_t info)
     }
 }
 
-static void mc_post_process_scope(mc_object_info_t info, mc_frame_t scope)
+static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid::mc::Frame* scope)
 {
 
   if (scope->tag == DW_TAG_inlined_subroutine) {
@@ -1103,7 +1103,7 @@ static void mc_post_process_scope(mc_object_info_t info, mc_frame_t scope)
 
 /** \brief Fill/lookup the "subtype" field.
  */
-static void MC_resolve_subtype(mc_object_info_t info, mc_type_t type)
+static void MC_resolve_subtype(simgrid::mc::ObjectInformation* info, simgrid::mc::Type* type)
 {
   if (!type->type_id)
     return;
@@ -1122,7 +1122,7 @@ static void MC_resolve_subtype(mc_object_info_t info, mc_type_t type)
     type->subtype = *subtype;
 }
 
-static void MC_post_process_types(mc_object_info_t info)
+static void MC_post_process_types(simgrid::mc::ObjectInformation* info)
 {
   // Lookup "subtype" field:
   for(auto& i : info->types) {
@@ -1133,11 +1133,11 @@ static void MC_post_process_types(mc_object_info_t info)
 }
 
 /** \brief Finds informations about a given shared object/executable */
-std::shared_ptr<s_mc_object_info_t> MC_find_object_info(
+std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
   std::vector<simgrid::mc::VmMap> const& maps, const char *name, int executable)
 {
-  std::shared_ptr<s_mc_object_info_t> result =
-    std::make_shared<s_mc_object_info_t>();
+  std::shared_ptr<simgrid::mc::ObjectInformation> result =
+    std::make_shared<simgrid::mc::ObjectInformation>();
   if (executable)
     result->flags |= MC_OBJECT_INFO_EXECUTABLE;
   result->file_name = name;
@@ -1153,12 +1153,12 @@ std::shared_ptr<s_mc_object_info_t> MC_find_object_info(
 
 /*************************************************************************/
 
-void MC_post_process_object_info(mc_process_t process, mc_object_info_t info)
+void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info)
 {
   for (auto& i : info->types) {
 
-    mc_type_t type = &(i.second);
-    mc_type_t subtype = type;
+    simgrid::mc::Type* type = &(i.second);
+    simgrid::mc::Type* subtype = type;
     while (subtype->type == DW_TAG_typedef || subtype->type == DW_TAG_volatile_type
       || subtype->type == DW_TAG_const_type) {
       if (subtype->subtype)
index 3e4d99e..cc4b930 100644 (file)
@@ -430,10 +430,10 @@ int mc_dwarf_execute_expression(size_t n, const Dwarf_Op * ops,
  */
 void mc_dwarf_resolve_location(mc_location_t location,
                                simgrid::mc::DwarfExpression* expression,
-                               mc_object_info_t object_info,
+                               simgrid::mc::ObjectInformation* object_info,
                                unw_cursor_t * c,
                                void *frame_pointer_address,
-                               mc_address_space_t address_space, int process_index)
+                               simgrid::mc::AddressSpace* address_space, int process_index)
 {
   s_mc_expression_state_t state;
   memset(&state, 0, sizeof(s_mc_expression_state_t));
@@ -480,10 +480,10 @@ static simgrid::mc::DwarfExpression* mc_find_expression(
 
 void mc_dwarf_resolve_locations(mc_location_t location,
                                 simgrid::mc::LocationList* locations,
-                                mc_object_info_t object_info,
+                                simgrid::mc::ObjectInformation* object_info,
                                 unw_cursor_t * c,
                                 void *frame_pointer_address,
-                                mc_address_space_t address_space,
+                                simgrid::mc::AddressSpace* address_space,
                                 int process_index)
 {
 
@@ -508,7 +508,7 @@ void mc_dwarf_resolve_locations(mc_location_t location,
  *  \param frame
  *  \param unw_cursor
  */
-void *mc_find_frame_base(mc_frame_t frame, mc_object_info_t object_info,
+void *mc_find_frame_base(simgrid::mc::Frame* frame, simgrid::mc::ObjectInformation* object_info,
                          unw_cursor_t * unw_cursor)
 {
   s_mc_location_t location;
@@ -537,7 +537,7 @@ void *mc_find_frame_base(mc_frame_t frame, mc_object_info_t object_info,
 }
 
 void mc_dwarf_location_list_init(
-  simgrid::mc::LocationList* list, mc_object_info_t info,
+  simgrid::mc::LocationList* list, simgrid::mc::ObjectInformation* info,
   Dwarf_Die * die, Dwarf_Attribute * attr)
 {
   list->clear();
index 42edadf..a3a56e6 100644 (file)
@@ -4,68 +4,27 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+/** \file mc_forward.h
+ *
+ *  Define type names for pointers of MC objects for the C code
+ */
+
 #ifndef SIMGRID_MC_FORWARD_H
 #define SIMGRID_MC_FORWARD_H
 
-#include <xbt/misc.h>
-#include <mc/datatypes.h>
-
 #ifdef __cplusplus
 
-#define MC_OVERRIDE
-
-namespace simgrid {
-namespace mc {
-
-class PageStore;
-class ModelChecker;
-class AddressSpace;
-class Process;
-class Snapshot;
-class ObjectInformation;
-class Type;
-class Variable;
-class Frame;
-
-}
-}
-
-typedef ::simgrid::mc::ModelChecker s_mc_model_checker_t;
-typedef ::simgrid::mc::PageStore s_mc_pages_store_t;
-typedef ::simgrid::mc::AddressSpace s_mc_address_space_t;
-typedef ::simgrid::mc::Process s_mc_process_t;
-typedef ::simgrid::mc::Snapshot s_mc_snapshot_t;
-typedef ::simgrid::mc::ObjectInformation s_mc_object_info_t;
-typedef ::simgrid::mc::Type s_mc_type_t;
-typedef ::simgrid::mc::Variable s_mc_variable_t;
-typedef ::simgrid::mc::Frame s_mc_frame_t;
+// If we're in C++, we give the real definition:
+#include "mc_forward.hpp"
+typedef simgrid::mc::Snapshot *mc_snapshot_t;
+typedef simgrid::mc::Type *mc_type_t;
 
 #else
 
-typedef struct _s_mc_model_checker s_mc_model_checker_t;
-typedef struct _s_mc_pages_store s_mc_pages_store_t;
-typedef struct _s_mc_address_space_t s_mc_address_space_t;
-typedef struct _s_mc_process_t s_mc_process_t;
-typedef struct _s_mc_snapshot_t s_mc_snapshot_t;
-typedef struct _s_mc_object_info_t s_mc_object_info_t;
-typedef struct _s_mc_type_t s_mc_type_t;
-typedef struct _s_mc_variable_t s_mc_variable_t;
-typedef struct _s_mc_frame_t s_mc_frame_t;
+// Otherwise we use dummy opaque structs:
+typedef struct _mc_snapshot_t *mc_snapshot_t;
+typedef struct _s_mc_type_t *mc_type_t;
 
 #endif
 
-typedef s_mc_pages_store_t *mc_pages_store_t;
-typedef s_mc_model_checker_t *mc_model_checker_t;
-typedef s_mc_address_space_t *mc_address_space_t;
-typedef s_mc_process_t *mc_process_t;
-typedef s_mc_snapshot_t *mc_snapshot_t;
-typedef s_mc_object_info_t *mc_object_info_t;
-typedef s_mc_type_t *mc_type_t;
-typedef s_mc_variable_t *mc_variable_t;
-typedef s_mc_frame_t *mc_frame_t;
-
-SG_BEGIN_DECL()
-extern mc_model_checker_t mc_model_checker;
-SG_END_DECL()
-
 #endif
diff --git a/src/mc/mc_forward.hpp b/src/mc/mc_forward.hpp
new file mode 100644 (file)
index 0000000..9bb9813
--- /dev/null
@@ -0,0 +1,36 @@
+/* Copyright (c) 2007-2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/** \file mc_forward.hpp
+ *
+ *  Forward definitions for MC types
+ */
+
+#ifndef SIMGRID_MC_FORWARD_HPP
+#define SIMGRID_MC_FORWARD_HPP
+
+#define MC_OVERRIDE
+
+namespace simgrid {
+namespace mc {
+
+class PageStore;
+class ModelChecker;
+class AddressSpace;
+class Process;
+class Snapshot;
+class ObjectInformation;
+class Type;
+class Variable;
+class Frame;
+
+}
+}
+
+// TODO, try to get rid of the global ModelChecker variable
+extern simgrid::mc::ModelChecker* mc_model_checker;
+
+#endif
index ea71646..602fced 100644 (file)
@@ -83,10 +83,10 @@ static void mc_hash_binary(hash_type * hash, const void *s, size_t len)
  *  \param type type of the variable
  * */
 static void mc_hash_value(hash_type * hash, mc_hashing_state * state,
-                          mc_object_info_t info, const void *address,
-                          mc_type_t type)
+                          simgrid::mc::ObjectInformation* info, const void *address,
+                          simgrid::mc::Type* type)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
 top:
 
   switch (type->type) {
@@ -111,7 +111,7 @@ top:
         return;
 
       long element_count = type->element_count;
-      mc_type_t subtype = type->subtype;
+      simgrid::mc::Type* subtype = type->subtype;
       if (subtype == NULL) {
         XBT_DEBUG("Hash array without subtype");
         return;
@@ -145,7 +145,7 @@ top:
         return;
 
       unsigned int cursor = 0;
-      mc_type_t member;
+      simgrid::mc::Type* member;
       xbt_dynar_foreach(type->members, cursor, member) {
         XBT_DEBUG("Hash struct member %s", member->name);
         if (type->subtype == NULL)
@@ -208,10 +208,10 @@ top:
 }
 
 static void mc_hash_object_globals(hash_type * hash, mc_hashing_state * state,
-                                   mc_object_info_t info)
+                                   simgrid::mc::ObjectInformation* info)
 {
   unsigned int cursor = 0;
-  mc_variable_t variable;
+  simgrid::mc::Variable* variable;
   xbt_dynar_foreach(info->global_variables, cursor, variable) {
     XBT_DEBUG("Hash global variable %s", variable->name);
 
@@ -220,7 +220,7 @@ static void mc_hash_object_globals(hash_type * hash, mc_hashing_state * state,
       continue;
     }
 
-    mc_type_t type = variable->type;
+    simgrid::mc::Type* type = variable->type;
     if (type == NULL) {
       // Nothing
       continue;
@@ -241,15 +241,15 @@ static void mc_hash_object_globals(hash_type * hash, mc_hashing_state * state,
 }
 
 static void mc_hash_stack_frame(mc_hash_t * hash,
-                                mc_object_info_t info,
-                                unw_cursor_t * unw_cursor, mc_frame_t frame,
+                                simgrid::mc::ObjectInformation* info,
+                                unw_cursor_t * unw_cursor, simgrid::mc::Frame* frame,
                                 char *frame_pointer, mc_hashing_state * state)
 {
 
   // return; // TEMP
 
   unsigned int cursor = 0;
-  mc_variable_t variable;
+  simgrid::mc::Variable* variable;
   xbt_dynar_foreach(frame->variables, cursor, variable) {
 
     if (variable->type_id == NULL) {
@@ -268,7 +268,7 @@ static void mc_hash_stack_frame(mc_hash_t * hash,
                                             variable->object_info, unw_cursor,
                                             frame_pointer, NULL);
 
-    mc_type_t type = variable->type;
+    simgrid::mc::Type* type = variable->type;
     if (type == NULL) {
       XBT_DEBUG("Hash local variable %s without loctypeation", variable->name);
       continue;
@@ -291,7 +291,7 @@ static void mc_hash_stack(mc_hash_t * hash, mc_snapshot_stack_t stack,
 
     hash_update(*hash, stack_frame.ip);
 
-    mc_object_info_t info;
+    simgrid::mc::ObjectInformation* info;
     if (stack_frame.ip >= (unw_word_t) libsimgrid_info->start_exec
         && stack_frame.ip < (unw_word_t) libsimgrid_info->end_exec)
       info = libsimgrid_info;
index 7f60328..76a2a26 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <simgrid_config.h>
 #include "mc_base.h"
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 #include "AddressSpace.hpp"
 
 namespace simgrid {
@@ -92,17 +92,17 @@ enum mc_location_type mc_get_location_type(mc_location_t location) {
 
 XBT_INTERNAL void mc_dwarf_resolve_location(
   mc_location_t location, simgrid::mc::DwarfExpression* expression,
-  mc_object_info_t object_info, unw_cursor_t* c,
-  void* frame_pointer_address, mc_address_space_t address_space,
+  simgrid::mc::ObjectInformation* object_info, unw_cursor_t* c,
+  void* frame_pointer_address, simgrid::mc::AddressSpace* address_space,
   int process_index);
 MC_SHOULD_BE_INTERNAL void mc_dwarf_resolve_locations(
   mc_location_t location, simgrid::mc::LocationList* locations,
-  mc_object_info_t object_info, unw_cursor_t* c,
-  void* frame_pointer_address, mc_address_space_t address_space,
+  simgrid::mc::ObjectInformation* object_info, unw_cursor_t* c,
+  void* frame_pointer_address, simgrid::mc::AddressSpace* address_space,
   int process_index);
 
 XBT_INTERNAL void mc_dwarf_location_list_init(
-  simgrid::mc::LocationList*, mc_object_info_t info, Dwarf_Die* die,
+  simgrid::mc::LocationList*, simgrid::mc::ObjectInformation* info, Dwarf_Die* die,
   Dwarf_Attribute* attr);
 
 #define MC_EXPRESSION_STACK_SIZE 64
@@ -121,8 +121,8 @@ typedef struct s_mc_expression_state {
 
   unw_cursor_t* cursor;
   void* frame_base;
-  mc_address_space_t address_space;
-  mc_object_info_t object_info;
+  simgrid::mc::AddressSpace* address_space;
+  simgrid::mc::ObjectInformation* object_info;
   int process_index;
 } s_mc_expression_state_t, *mc_expression_state_t;
 
@@ -130,7 +130,7 @@ MC_SHOULD_BE_INTERNAL int mc_dwarf_execute_expression(
   size_t n, const Dwarf_Op* ops, mc_expression_state_t state);
 
 MC_SHOULD_BE_INTERNAL void* mc_find_frame_base(
-  mc_frame_t frame, mc_object_info_t object_info, unw_cursor_t* unw_cursor);
+  simgrid::mc::Frame* frame, simgrid::mc::ObjectInformation* object_info, unw_cursor_t* unw_cursor);
 
 SG_END_DECL()
 
index b96a30f..59e7e7d 100644 (file)
@@ -17,8 +17,8 @@
  * @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)
 {
   // TODO, get rid of this?
   if (!member->has_offset_location())
index 21f2bdd..27844ad 100644 (file)
 
 #include <sys/types.h>
 
+#include <xbt/base.h>
+
 #include <simgrid_config.h>
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -40,7 +42,7 @@ std::vector<VmMap> get_memory_map(pid_t pid);
 extern "C" {
 
 XBT_INTERNAL void MC_find_object_address(
-  std::vector<simgrid::mc::VmMap> const& maps, mc_object_info_t result);
+  std::vector<simgrid::mc::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
 
 }
 
index 11817a2..a582e21 100644 (file)
@@ -108,7 +108,7 @@ void *ObjectInformation::base_address() const
 }
 
 /* Find a function by instruction pointer */
-mc_frame_t ObjectInformation::find_function(const void *ip) const
+simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const
 {
   /* This is implemented by binary search on a sorted array.
    *
index b175daf..c04b917 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <elfutils/libdw.h>
 
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 #include "mc_location.h"
 #include "mc_process.h"
 #include "../smpi/private.h"
@@ -59,8 +59,8 @@ public:
   // Location (for members) is either of:
   simgrid::mc::DwarfExpression location_expression;
 
-  mc_type_t subtype; // DW_AT_type
-  mc_type_t full_type; // The same (but more complete) type
+  simgrid::mc::Type* subtype; // DW_AT_type
+  simgrid::mc::Type* full_type; // The same (but more complete) type
 
   bool has_offset_location() const
   {
@@ -105,14 +105,14 @@ public:
   int global;
   std::string name;
   std::uint64_t type_id;
-  mc_type_t type;
+  simgrid::mc::Type* type;
 
   // Use either of:
   simgrid::mc::LocationList location_list;
   void* address;
 
   size_t start_scope;
-  mc_object_info_t object_info;
+  simgrid::mc::ObjectInformation* object_info;
 };
 
 class Frame {
@@ -128,7 +128,7 @@ public:
   unsigned long int id; /* DWARF offset of the subprogram */
   std::vector<Frame> scopes;
   Dwarf_Off abstract_origin_id;
-  mc_object_info_t object_info;
+  simgrid::mc::ObjectInformation* object_info;
 };
 
 /** An entry in the functions index
@@ -137,7 +137,7 @@ public:
  */
 struct FunctionIndexEntry {
   void* low_pc;
-  mc_frame_t function;
+  simgrid::mc::Frame* function;
 };
 
 /** Information about an (ELF) executable/sharedobject
@@ -200,7 +200,7 @@ public:
 
   void* base_address() const;
 
-  mc_frame_t find_function(const void *ip) const;
+  simgrid::mc::Frame* find_function(const void *ip) const;
   // TODO, should be simgrid::mc::Variable*
   simgrid::mc::Variable* find_variable(const char* name) const;
 
@@ -210,17 +210,17 @@ public:
 }
 
 
-XBT_INTERNAL std::shared_ptr<s_mc_object_info_t> MC_find_object_info(
+XBT_INTERNAL std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
   std::vector<simgrid::mc::VmMap> const& maps, const char* name, int executable);
-XBT_INTERNAL void MC_post_process_object_info(mc_process_t process, mc_object_info_t info);
+XBT_INTERNAL void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info);
 
-XBT_INTERNAL void MC_dwarf_get_variables(mc_object_info_t info);
-XBT_INTERNAL void MC_dwarf_get_variables_libdw(mc_object_info_t info);
+XBT_INTERNAL void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info);
+XBT_INTERNAL void MC_dwarf_get_variables_libdw(simgrid::mc::ObjectInformation* info);
 XBT_INTERNAL const char* MC_dwarf_attrname(int attr);
 XBT_INTERNAL const char* MC_dwarf_tagname(int tag);
 
 XBT_INTERNAL void* mc_member_resolve(
-  const void* base, mc_type_t type, mc_type_t member,
-  mc_address_space_t snapshot, int process_index);
+  const void* base, simgrid::mc::Type* type, simgrid::mc::Type* member,
+  simgrid::mc::AddressSpace* snapshot, int process_index);
 
 #endif
index 7bb42f0..91dfcbd 100644 (file)
@@ -69,7 +69,7 @@ extern "C" {
  *  @param page_count       Number of pages of the region
  *  @param pagenos
  */
-void mc_restore_page_snapshot_region(mc_process_t process,
+void mc_restore_page_snapshot_region(simgrid::mc::Process* process,
   void* start_addr, simgrid::mc::PerPageCopy const& pages_copy)
 {
   for (size_t i = 0; i != pages_copy.page_count(); ++i) {
@@ -82,7 +82,7 @@ void mc_restore_page_snapshot_region(mc_process_t process,
 
 // ***** High level API
 
-void mc_region_restore_sparse(mc_process_t process, mc_mem_region_t reg)
+void mc_region_restore_sparse(simgrid::mc::Process* process, mc_mem_region_t reg)
 {
   xbt_assert(((reg->permanent_address().address()) & (xbt_pagesize-1)) == 0,
     "Not at the beginning of a page");
index fda88dd..2cc2b04 100644 (file)
@@ -218,7 +218,7 @@ Process::Process(pid_t pid, int sockfd)
   }
 
   // Read std_heap (is a struct mdesc*):
-  mc_variable_t std_heap_var = process->find_variable("__mmalloc_default_mdp");
+  simgrid::mc::Variable* std_heap_var = process->find_variable("__mmalloc_default_mdp");
   if (!std_heap_var)
     xbt_die("No heap information in the target process");
   if(!std_heap_var->address)
@@ -377,7 +377,7 @@ void Process::init_memory_map_info()
       }
     }
 
-    std::shared_ptr<s_mc_object_info_t> info =
+    std::shared_ptr<simgrid::mc::ObjectInformation> info =
       MC_find_object_info(this->memory_map_, pathname, is_executable);
     this->object_infos.push_back(info);
     if (is_executable)
@@ -400,7 +400,7 @@ void Process::init_memory_map_info()
   XBT_DEBUG("Get debug information done !");
 }
 
-std::shared_ptr<s_mc_object_info_t> Process::find_object_info(remote_ptr<void> addr) const
+std::shared_ptr<simgrid::mc::ObjectInformation> Process::find_object_info(remote_ptr<void> addr) const
 {
   for (auto const& object_info : this->object_infos) {
     if (addr.address() >= (std::uint64_t)object_info->start
@@ -433,29 +433,29 @@ std::shared_ptr<ObjectInformation> Process::find_object_info_rw(remote_ptr<void>
   return nullptr;
 }
 
-mc_frame_t Process::find_function(remote_ptr<void> ip) const
+simgrid::mc::Frame* Process::find_function(remote_ptr<void> ip) const
 {
-  std::shared_ptr<s_mc_object_info_t> info = this->find_object_info_exec(ip);
+  std::shared_ptr<simgrid::mc::ObjectInformation> info = this->find_object_info_exec(ip);
   return info ? info->find_function((void*) ip.address()) : nullptr;
 }
 
 /** Find (one occurence of) the named variable definition
  */
-mc_variable_t Process::find_variable(const char* name) const
+simgrid::mc::Variable* Process::find_variable(const char* name) const
 {
   // First lookup the variable in the executable shared object.
   // A global variable used directly by the executable code from a library
   // is reinstanciated in the executable memory .data/.bss.
   // We need to look up the variable in the execvutable first.
   if (this->binary_info) {
-    std::shared_ptr<s_mc_object_info_t> const& info = this->binary_info;
-    mc_variable_t var = info->find_variable(name);
+    std::shared_ptr<simgrid::mc::ObjectInformation> const& info = this->binary_info;
+    simgrid::mc::Variable* var = info->find_variable(name);
     if (var)
       return var;
   }
 
-  for (std::shared_ptr<s_mc_object_info_t> const& info : this->object_infos) {
-    mc_variable_t var = info->find_variable(name);
+  for (std::shared_ptr<simgrid::mc::ObjectInformation> const& info : this->object_infos) {
+    simgrid::mc::Variable* var = info->find_variable(name);
     if (var)
       return var;
   }
@@ -465,7 +465,7 @@ mc_variable_t Process::find_variable(const char* name) const
 
 void Process::read_variable(const char* name, void* target, size_t size) const
 {
-  mc_variable_t var = this->find_variable(name);
+  simgrid::mc::Variable* var = this->find_variable(name);
   if (!var->address)
     xbt_die("No simple location for this variable");
   if (!var->type->full_type)
@@ -515,7 +515,7 @@ const void *Process::read_bytes(void* buffer, std::size_t size,
   AddressSpace::ReadMode mode) const
 {
   if (process_index != simgrid::mc::ProcessIndexDisabled) {
-    std::shared_ptr<s_mc_object_info_t> const& info =
+    std::shared_ptr<simgrid::mc::ObjectInformation> const& info =
       this->find_object_info_rw((void*)address.address());
     // Segment overlap is not handled.
     if (info.get() && info.get()->privatized()) {
index 3215c4f..8aee3c0 100644 (file)
@@ -27,7 +27,7 @@
 #include "simix/popping_private.h"
 #include "simix/smx_private.h"
 
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 #include "mc_base.h"
 #include "mc_mmalloc.h" // std_heap
 #include "mc_memory_map.h"
@@ -89,11 +89,11 @@ public:
   void clear_bytes(remote_ptr<void> address, size_t len);
 
   // Debug information:
-  std::shared_ptr<s_mc_object_info_t> find_object_info(remote_ptr<void> addr) const;
-  std::shared_ptr<s_mc_object_info_t> find_object_info_exec(remote_ptr<void> addr) const;
-  std::shared_ptr<s_mc_object_info_t> find_object_info_rw(remote_ptr<void> addr) const;
-  mc_frame_t find_function(remote_ptr<void> ip) const;
-  mc_variable_t find_variable(const char* name) const;
+  std::shared_ptr<simgrid::mc::ObjectInformation> find_object_info(remote_ptr<void> addr) const;
+  std::shared_ptr<simgrid::mc::ObjectInformation> find_object_info_exec(remote_ptr<void> addr) const;
+  std::shared_ptr<simgrid::mc::ObjectInformation> find_object_info_rw(remote_ptr<void> addr) const;
+  simgrid::mc::Frame* find_function(remote_ptr<void> ip) const;
+  simgrid::mc::Variable* find_variable(const char* name) const;
 
   // Heap access:
   xbt_mheap_t get_heap()
@@ -173,10 +173,10 @@ private:
   std::vector<IgnoredRegion> ignored_regions_;
 
 public: // object info
-  // TODO, make private (first, objectify mc_object_info_t)
-  std::vector<std::shared_ptr<s_mc_object_info_t>> object_infos;
-  std::shared_ptr<s_mc_object_info_t> libsimgrid_info;
-  std::shared_ptr<s_mc_object_info_t> binary_info;
+  // TODO, make private (first, objectify simgrid::mc::ObjectInformation*)
+  std::vector<std::shared_ptr<simgrid::mc::ObjectInformation>> object_infos;
+  std::shared_ptr<simgrid::mc::ObjectInformation> libsimgrid_info;
+  std::shared_ptr<simgrid::mc::ObjectInformation> binary_info;
 
 public: // Copies of MCed SMX data structures
   /** Copy of `simix_global->process_list`
@@ -218,7 +218,8 @@ public: // Libunwind-data
   /** Full-featured MC-aware libunwind address space for the process
    *
    *  This address space is using a mc_unw_context_t
-   *  (with mc_process_t/mc_address_space_t and unw_context_t).
+   *  (with simgrid::mc::Process* / simgrid::mc::AddressSpace*
+   *  and unw_context_t).
    */
   unw_addr_space_t unw_addr_space;
 
index bd5ab1f..8e47e89 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <simgrid_config.h>
 #include <xbt/dict.h>
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 #include "mc_state.h"
 
 SG_BEGIN_DECL()
index 020e170..b882504 100644 (file)
@@ -37,7 +37,7 @@ mc_server_t mc_server;
 
 struct mc_symbol_pointer_callback
 {
-  mc_process_t process;
+  simgrid::mc::Process* process;
   void* value;
 };
 
@@ -95,7 +95,7 @@ void s_mc_server::shutdown()
 {
   XBT_DEBUG("Shuting down model-checker");
 
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
   int status = process->status();
   if (process->running()) {
     XBT_DEBUG("Killing process");
@@ -123,7 +123,7 @@ void s_mc_server::exit()
   }
 }
 
-void s_mc_server::resume(mc_process_t process)
+void s_mc_server::resume(simgrid::mc::Process* process)
 {
   int res = process->send_message(MC_MESSAGE_CONTINUE);
   if (res)
@@ -336,7 +336,7 @@ void s_mc_server::on_signal(const struct signalfd_siginfo* info)
   }
 }
 
-void MC_server_wait_client(mc_process_t process)
+void MC_server_wait_client(simgrid::mc::Process* process)
 {
   mc_server->resume(process);
   while (mc_model_checker->process().running()) {
@@ -345,7 +345,7 @@ void MC_server_wait_client(mc_process_t process)
   }
 }
 
-void MC_server_simcall_handle(mc_process_t process, unsigned long pid, int value)
+void MC_server_simcall_handle(simgrid::mc::Process* process, unsigned long pid, int value)
 {
   s_mc_simcall_handle_message m;
   memset(&m, 0, sizeof(m));
index e2c1a23..7a54ecc 100644 (file)
@@ -28,8 +28,8 @@ typedef struct s_mc_server s_mc_server_t, *mc_server_t;
 
 extern mc_server_t mc_server;
 
-XBT_INTERNAL void MC_server_wait_client(mc_process_t process);
-XBT_INTERNAL void MC_server_simcall_handle(mc_process_t process, unsigned long pid, int value);
+XBT_INTERNAL void MC_server_wait_client(simgrid::mc::Process* process);
+XBT_INTERNAL void MC_server_simcall_handle(simgrid::mc::Process* process, unsigned long pid, int value);
 
 XBT_INTERNAL void MC_server_loop(mc_server_t server);
 
@@ -47,7 +47,7 @@ public:
   void start();
   void shutdown();
   void exit();
-  void resume(mc_process_t process);
+  void resume(simgrid::mc::Process* process);
   void loop();
   bool handle_events();
 protected:
index 8372875..805d655 100644 (file)
@@ -57,7 +57,7 @@ mc_smx_process_info_t MC_smx_process_get_info(smx_process_t p)
  *  @param remote_swag Address of the process SWAG in the remote list
  */
 static void MC_process_refresh_simix_process_list(
-  mc_process_t process,
+  simgrid::mc::Process* process,
   xbt_dynar_t target, xbt_swag_t remote_swag)
 {
   // swag = REMOTE(*simix_global->process_list)
@@ -84,7 +84,7 @@ static void MC_process_refresh_simix_process_list(
   assert(i == swag.count);
 }
 
-void MC_process_smx_refresh(mc_process_t process)
+void MC_process_smx_refresh(simgrid::mc::Process* process)
 {
   xbt_assert(mc_mode == MC_MODE_SERVER);
   xbt_assert(!process->is_self());
@@ -178,7 +178,7 @@ const char* MC_smx_process_get_host_name(smx_process_t p)
   if (mc_mode == MC_MODE_CLIENT)
     return SIMIX_host_get_name(p->smx_host);
 
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
 
   // Currently, smx_host_t = xbt_dictelm_t.
   // TODO, add an static_assert on this if switching to C++
@@ -199,7 +199,7 @@ const char* MC_smx_process_get_host_name(smx_process_t p)
 
 const char* MC_smx_process_get_name(smx_process_t p)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
   if (mc_mode == MC_MODE_CLIENT)
     return p->name;
   if (!p->name)
index 49d69be..c9cdd7a 100644 (file)
@@ -33,7 +33,7 @@
  *
  * The process lists are currently refreshed each time MCed code is executed.
  * We don't try to give a persistent MCer address for a given MCed process.
- * For this reason, a MCer mc_process_t is currently not reusable after
+ * For this reason, a MCer simgrid::mc::Process* is currently not reusable after
  * MCed code.
  */
 
@@ -51,7 +51,7 @@ struct s_mc_smx_process_info {
 
 XBT_INTERNAL xbt_dynar_t MC_smx_process_info_list_new(void);
 
-XBT_INTERNAL void MC_process_smx_refresh(mc_process_t process);
+XBT_INTERNAL void MC_process_smx_refresh(simgrid::mc::Process* process);
 
 /** Get the issuer of  a simcall (`req->issuer`)
  *
index bfc3d89..3277f97 100644 (file)
@@ -24,7 +24,7 @@ extern "C" {
  *         (or NULL if it does not belong to any snapshot region)
  * */
 mc_mem_region_t mc_get_snapshot_region(
-  const void* addr, const s_mc_snapshot_t* snapshot, int process_index)
+  const void* addr, const simgrid::mc::Snapshot* snapshot, int process_index)
 {
   size_t n = snapshot->snapshot_regions.size();
   for (size_t i = 0; i != n; ++i) {
index 2c97848..418278d 100644 (file)
@@ -19,7 +19,7 @@
 #include <xbt/asserts.h>
 #include <xbt/dynar.h>
 
-#include "mc_forward.h"
+#include "mc_forward.hpp"
 #include "ModelChecker.hpp"
 #include "PageStore.hpp"
 #include "mc_mmalloc.h"
@@ -31,7 +31,7 @@ SG_BEGIN_DECL()
 
 // ***** Snapshot region
 
-XBT_INTERNAL void mc_region_restore_sparse(mc_process_t process, mc_mem_region_t reg);
+XBT_INTERNAL void mc_region_restore_sparse(simgrid::mc::Process* process, mc_mem_region_t reg);
 
 static inline __attribute__((always_inline))
 void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region)
@@ -72,7 +72,7 @@ void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int pr
 }
 
 XBT_INTERNAL mc_mem_region_t mc_get_snapshot_region(
-  const void* addr, const s_mc_snapshot_t *snapshot, int process_index);
+  const void* addr, const simgrid::mc::Snapshot *snapshot, int process_index);
 
 }
 
@@ -104,16 +104,16 @@ typedef struct s_mc_stack_frame {
   /** Stack pointer */
   unw_word_t sp;
   unw_word_t frame_base;
-  mc_frame_t frame;
+  simgrid::mc::Frame* frame;
   std::string frame_name;
   unw_cursor_t unw_cursor;
 } s_mc_stack_frame_t, *mc_stack_frame_t;
 
 typedef struct s_local_variable{
-  mc_frame_t subprogram;
+  simgrid::mc::Frame* subprogram;
   unsigned long ip;
   std::string name;
-  mc_type_t type;
+  simgrid::mc::Type* type;
   void *address;
   int region;
 } s_local_variable_t, *local_variable_t;
@@ -147,7 +147,7 @@ public:
     remote_ptr<void> address, int process_index = ProcessIndexAny,
     ReadMode mode = Normal) const MC_OVERRIDE;
 public: // To be private
-  mc_process_t process;
+  simgrid::mc::Process* process;
   int num_state;
   size_t heap_bytes_used;
   std::vector<std::unique_ptr<s_mc_mem_region_t>> snapshot_regions;
@@ -181,7 +181,7 @@ XBT_INTERNAL mc_snapshot_t MC_take_snapshot(int num_state);
 XBT_INTERNAL void MC_restore_snapshot(mc_snapshot_t);
 
 XBT_INTERNAL void mc_restore_page_snapshot_region(
-  mc_process_t process,
+  simgrid::mc::Process* process,
   void* start_addr, simgrid::mc::PerPageCopy const& pagenos);
 
 MC_SHOULD_BE_INTERNAL const void* MC_region_read_fragmented(
index dc688ee..0d78305 100644 (file)
@@ -74,7 +74,7 @@ static int get_dyn_info_list_addr(unw_addr_space_t as,
 
 /** Read from the target address space memory (libunwind method)
  *
- *  Delegates to the `mc_process_t`.
+ *  Delegates to the `simgrid::mc::Process*`.
  */
 static int access_mem(unw_addr_space_t as,
               unw_word_t addr, unw_word_t *valp,
@@ -164,7 +164,7 @@ static int get_proc_name(unw_addr_space_t as,
               void* arg)
 {
   mc_unw_context_t context = (mc_unw_context_t) arg;
-  mc_frame_t frame = context->process->find_function(remote(addr));
+  simgrid::mc::Frame* frame = context->process->find_function(remote(addr));
   if (!frame)
     return - UNW_ENOINFO;
   *offp = (unw_word_t) frame->low_pc - addr;
@@ -195,7 +195,7 @@ unw_accessors_t mc_unw_accessors =
 // ***** Context management
 
 int mc_unw_init_context(
-  mc_unw_context_t context, mc_process_t process, unw_context_t* c)
+  mc_unw_context_t context, simgrid::mc::Process* process, unw_context_t* c)
 {
   context->address_space = process;
   context->process = process;
@@ -223,9 +223,9 @@ int mc_unw_init_cursor(unw_cursor_t *cursor, mc_unw_context_t context)
 {
   if (!context->process || !context->address_space)
     return -UNW_EUNSPEC;
-  mc_address_space_t as = context->address_space;
+  simgrid::mc::AddressSpace* as = context->address_space;
 
-  mc_process_t process = dynamic_cast<mc_process_t>(as);
+  simgrid::mc::Process* process = dynamic_cast<simgrid::mc::Process*>(as);
   if (process && process->is_self())
     return unw_init_local(cursor, &context->context);
 
index eac812d..7928d0b 100644 (file)
@@ -17,7 +17,7 @@
  *
  *  This component implements the libunwind API for he model-checker:
  *
- *    * reading memory from a mc_address_space_t;
+ *    * reading memory from a simgrid::mc::AddressSpace*;
  *
  *    * reading stack registers from a saved snapshot (context).
  *
@@ -48,7 +48,7 @@ extern unw_accessors_t mc_unw_vmread_accessors;
 
 /** Virtual table for our `libunwind` implementation
  *
- *  Stack unwinding on a `mc_process_t` (for memory, unwinding information)
+ *  Stack unwinding on a `simgrid::mc::Process*` (for memory, unwinding information)
  *  and `ucontext_t` (for processor registers).
  *
  *  It works with the `s_mc_unw_context_t` context.
@@ -60,14 +60,14 @@ extern XBT_INTERNAL unw_accessors_t mc_unw_accessors;
 /** A `libunwind` context
  */
 typedef struct s_mc_unw_context {
-  mc_address_space_t address_space;
-  mc_process_t       process;
+  simgrid::mc::AddressSpace* address_space;
+  simgrid::mc::Process*       process;
   unw_context_t      context;
 } s_mc_unw_context_t, *mc_unw_context_t;
 
 /** Initialises an already allocated context */
 XBT_INTERNAL int mc_unw_init_context(
-  mc_unw_context_t context, mc_process_t process, unw_context_t* c);
+  mc_unw_context_t context, simgrid::mc::Process* process, unw_context_t* c);
 
 // ***** Libunwind cursor
 
index 4b19189..59c43c5 100644 (file)
@@ -54,7 +54,7 @@ void visited_state_free_voidp(void *s)
  */
 static mc_visited_state_t visited_state_new()
 {
-  mc_process_t process = &(mc_model_checker->process());
+  simgrid::mc::Process* process = &(mc_model_checker->process());
   mc_visited_state_t new_state = xbt_new0(s_mc_visited_state_t, 1);
   new_state->heap_bytes_used = mmalloc_get_bytes_used_remote(
     process->get_heap()->heaplimit,
@@ -76,7 +76,7 @@ static mc_visited_state_t visited_state_new()
 
 mc_visited_pair_t MC_visited_pair_new(int pair_num, xbt_automaton_state_t automaton_state, xbt_dynar_t atomic_propositions, mc_state_t graph_state)
 {
-  mc_process_t process = &(mc_model_checker->process());
+  simgrid::mc::Process* process = &(mc_model_checker->process());
   mc_visited_pair_t pair = NULL;
   pair = xbt_new0(s_mc_visited_pair_t, 1);
   pair->graph_state = graph_state;
index 7742139..5f1780b 100644 (file)
@@ -4,6 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <xbt/sysdep.h>
+
 #include "mc/AddressSpace.hpp"
 #include "mc_xbt.hpp"
 
index 4c75203..1de7873 100644 (file)
@@ -111,17 +111,17 @@ void MC_heap_region_ignore_remove(void *address, size_t size)
 
 void MCer_ignore_global_variable(const char *name)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
   xbt_assert(!process->object_infos.empty(), "MC subsystem not initialized");
 
-  for (std::shared_ptr<s_mc_object_info_t> const& info : process->object_infos) {
+  for (std::shared_ptr<simgrid::mc::ObjectInformation> const& info : process->object_infos) {
 
     // Binary search:
     int start = 0;
     int end = info->global_variables.size() - 1;
     while (start <= end) {
       unsigned int cursor = (start + end) / 2;
-      mc_variable_t current_var = &info->global_variables[cursor];
+      simgrid::mc::Variable* current_var = &info->global_variables[cursor];
       int cmp = strcmp(current_var->name.c_str(), name);
       if (cmp == 0) {
         info->global_variables.erase(
@@ -141,25 +141,25 @@ void MCer_ignore_global_variable(const char *name)
 
 static void mc_ignore_local_variable_in_scope(const char *var_name,
                                               const char *subprogram_name,
-                                              mc_frame_t subprogram,
-                                              mc_frame_t scope);
+                                              simgrid::mc::Frame* subprogram,
+                                              simgrid::mc::Frame* scope);
 static void MC_ignore_local_variable_in_object(const char *var_name,
                                                const char *subprogram_name,
-                                               mc_object_info_t info);
+                                               simgrid::mc::ObjectInformation* info);
 
 void MC_ignore_local_variable(const char *var_name, const char *frame_name)
 {
-  mc_process_t process = &mc_model_checker->process();
+  simgrid::mc::Process* process = &mc_model_checker->process();
   if (strcmp(frame_name, "*") == 0)
     frame_name = NULL;
 
-  for (std::shared_ptr<s_mc_object_info_t> const& info : process->object_infos)
+  for (std::shared_ptr<simgrid::mc::ObjectInformation> const& info : process->object_infos)
     MC_ignore_local_variable_in_object(var_name, frame_name, info.get());
 }
 
 static void MC_ignore_local_variable_in_object(const char *var_name,
                                                const char *subprogram_name,
-                                               mc_object_info_t info)
+                                               simgrid::mc::ObjectInformation* info)
 {
   for (auto& entry : info->subprograms)
     mc_ignore_local_variable_in_scope(
@@ -179,8 +179,8 @@ static void MC_ignore_local_variable_in_object(const char *var_name,
  */
 static void mc_ignore_local_variable_in_scope(const char *var_name,
                                               const char *subprogram_name,
-                                              mc_frame_t subprogram,
-                                              mc_frame_t scope)
+                                              simgrid::mc::Frame* subprogram,
+                                              simgrid::mc::Frame* scope)
 {
   // Processing of direct variables:
 
@@ -196,7 +196,7 @@ static void mc_ignore_local_variable_in_scope(const char *var_name,
     // Dichotomic search:
     while (start <= end) {
       int cursor = (start + end) / 2;
-      mc_variable_t current_var = &scope->variables[cursor];
+      simgrid::mc::Variable* current_var = &scope->variables[cursor];
 
       int compare = strcmp(current_var->name.c_str(), var_name);
       if (compare == 0) {
@@ -218,7 +218,7 @@ static void mc_ignore_local_variable_in_scope(const char *var_name,
   for (simgrid::mc::Frame& nested_scope : scope->scopes) {
     // The new scope may be an inlined subroutine, in this case we want to use its
     // namespaced name in recursive calls:
-    mc_frame_t nested_subprogram =
+    simgrid::mc::Frame* nested_subprogram =
         nested_scope.tag ==
         DW_TAG_inlined_subroutine ? &nested_scope : subprogram;
 
index 40f99bb..4bd2e89 100644 (file)
@@ -21,7 +21,7 @@
 int test_some_array[4][5][6];
 struct some_struct { int first; int second[4][5]; } test_some_struct;
 
-static mc_type_t find_type_by_name(mc_object_info_t info, const char* name)
+static simgrid::mc::Type* find_type_by_name(simgrid::mc::ObjectInformation* info, const char* name)
 {
   for (auto& entry : info->types)
     if(entry.second.name == name)
@@ -29,8 +29,8 @@ static mc_type_t find_type_by_name(mc_object_info_t info, const char* name)
   return nullptr;
 }
 
-static mc_frame_t find_function_by_name(
-    mc_object_info_t info, const char* name)
+static simgrid::mc::Frame* find_function_by_name(
+    simgrid::mc::ObjectInformation* info, const char* name)
 {
   for (auto& entry : info->subprograms)
     if(entry.second.name == name)
@@ -38,8 +38,8 @@ static mc_frame_t find_function_by_name(
   return nullptr;
 }
 
-static mc_variable_t find_local_variable(
-    mc_frame_t frame, const char* argument_name)
+static simgrid::mc::Variable* find_local_variable(
+    simgrid::mc::Frame* frame, const char* argument_name)
 {
   for (simgrid::mc::Variable& variable : frame->variables)
     if(argument_name == variable.name)
@@ -55,12 +55,12 @@ static mc_variable_t find_local_variable(
   return nullptr;
 }
 
-static void test_local_variable(mc_object_info_t info, const char* function, const char* variable, void* address, unw_cursor_t* cursor) {
-  mc_frame_t subprogram = find_function_by_name(info, function);
+static void test_local_variable(simgrid::mc::ObjectInformation* info, const char* function, const char* variable, void* address, unw_cursor_t* cursor) {
+  simgrid::mc::Frame* subprogram = find_function_by_name(info, function);
   assert(subprogram);
   // TODO, Lookup frame by IP and test against name instead
 
-  mc_variable_t var = find_local_variable(subprogram, variable);
+  simgrid::mc::Variable* var = find_local_variable(subprogram, variable);
   assert(var);
 
   void* frame_base = mc_find_frame_base(subprogram, info, cursor);
@@ -77,9 +77,9 @@ static void test_local_variable(mc_object_info_t info, const char* function, con
 
 }
 
-static mc_variable_t test_global_variable(mc_process_t process, mc_object_info_t info, const char* name, void* address, long byte_size) {
+static simgrid::mc::Variable* test_global_variable(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info, const char* name, void* address, long byte_size) {
 
-  mc_variable_t variable = info->find_variable(name);
+  simgrid::mc::Variable* variable = info->find_variable(name);
   xbt_assert(variable, "Global variable %s was not found", name);
   xbt_assert(variable->name == name,
     "Name mismatch for %s", name);
@@ -90,12 +90,12 @@ static mc_variable_t test_global_variable(mc_process_t process, mc_object_info_t
 
   auto i = process->binary_info->types.find(variable->type_id);
   xbt_assert(i != process->binary_info->types.end(), "Missing type for %s", name);
-  mc_type_t type = &i->second;
+  simgrid::mc::Type* type = &i->second;
   xbt_assert(type->byte_size = byte_size, "Byte size mismatch for %s", name);
   return variable;
 }
 
-static mc_type_t find_member(mc_object_info_t info, const char* name, mc_type_t type)
+static simgrid::mc::Type* find_member(simgrid::mc::ObjectInformation* info, const char* name, simgrid::mc::Type* type)
 {
   for (simgrid::mc::Type& member : type->members)
     if(member.name == name)
@@ -107,7 +107,7 @@ int some_local_variable = 0;
 
 typedef struct foo {int i;} s_foo;
 
-static void test_type_by_name(mc_process_t process, s_foo my_foo)
+static void test_type_by_name(simgrid::mc::Process* process, s_foo my_foo)
 {
   assert(
     process->binary_info->full_types_by_name.find("struct foo") !=
@@ -118,11 +118,11 @@ int main(int argc, char** argv)
 {
   SIMIX_global_init(&argc, argv);
 
-  mc_variable_t var;
-  mc_type_t type;
+  simgrid::mc::Variable* var;
+  simgrid::mc::Type* type;
 
-  s_mc_process_t p(getpid(), -1);
-  mc_process_t process = &p;
+  simgrid::mc::Process p(getpid(), -1);
+  simgrid::mc::Process* process = &p;
 
   test_global_variable(process, process->binary_info.get(),
     "some_local_variable", &some_local_variable, sizeof(int));
index fc7ab69..afd40aa 100644 (file)
@@ -15,7 +15,7 @@
 #include "../src/mc/mc_private.h"
 #include "../src/mc/mc_object_info.h"
 
-static mc_process_t process;
+static simgrid::mc::Process* process;
 
 static
 uintptr_t eval_binary_operation(mc_expression_state_t state, int op, uintptr_t a, uintptr_t b) {
@@ -119,7 +119,7 @@ int main(int argc, char** argv) {
 
   s_mc_expression_state_t state;
   memset(&state, 0, sizeof(s_mc_expression_state_t));
-  state.address_space = (mc_address_space_t) process;
+  state.address_space = (simgrid::mc::AddressSpace*) process;
 
   basic_test(&state);