Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move Frame, ModelChecker, ObjectInformation, Type, Variable in their own files
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 24 Jul 2015 12:13:05 +0000 (14:13 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 27 Jul 2015 08:31:38 +0000 (10:31 +0200)
22 files changed:
buildtools/Cmake/DefinePackages.cmake
src/mc/Frame.hpp [new file with mode: 0644]
src/mc/ObjectInformation.cpp [new file with mode: 0644]
src/mc/ObjectInformation.hpp [new file with mode: 0644]
src/mc/Type.hpp [new file with mode: 0644]
src/mc/Variable.cpp [new file with mode: 0644]
src/mc/Variable.hpp [new file with mode: 0644]
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_dwarf_tagnames.cpp
src/mc/mc_member.cpp
src/mc/mc_object_info.cpp
src/mc/mc_object_info.h
src/mc/mc_process.cpp
src/mc/mc_unw.cpp
src/mc/mcer_ignore.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/mc/dwarf_expression/dwarf_expression.cpp
tools/generate-dwarf-functions

index dcb025e..d72eaf8 100644 (file)
@@ -601,6 +601,18 @@ set(MC_SRC_BASE
 set(MC_SRC
   src/mc/AddressSpace.hpp
   src/mc/AddressSpace.cpp
+  src/mc/Frame.hpp
+  src/mc/ModelChecker.hpp
+  src/mc/ModelChecker.cpp
+  src/mc/ObjectInformation.hpp
+  src/mc/ObjectInformation.cpp
+  src/mc/PageStore.hpp
+  src/mc/PageStore.cpp
+  src/mc/RegionSnapshot.cpp
+  src/mc/RegionSnapshot.hpp
+  src/mc/Type.hpp
+  src/mc/Variable.hpp
+
   src/mc/mc_forward.h
   src/mc/mc_forward.hpp
   src/mc/mc_process.h
@@ -609,17 +621,11 @@ set(MC_SRC
   src/mc/mc_unw.cpp
   src/mc/mc_unw_vmread.cpp
   src/mc/mc_mmalloc.h
-  src/mc/ModelChecker.hpp
-  src/mc/ModelChecker.cpp
   src/mc/mc_object_info.h
   src/mc/mc_object_info.cpp
   src/mc/mc_checkpoint.cpp
   src/mc/mc_snapshot.h
   src/mc/mc_snapshot.cpp
-  src/mc/RegionSnapshot.cpp
-  src/mc/RegionSnapshot.hpp
-  src/mc/PageStore.hpp
-  src/mc/PageStore.cpp
   src/mc/mc_page_snapshot.cpp
   src/mc/mc_comm_pattern.h
   src/mc/mc_comm_pattern.cpp
diff --git a/src/mc/Frame.hpp b/src/mc/Frame.hpp
new file mode 100644 (file)
index 0000000..bdbbbca
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright (c) 2007-2015. 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. */
+
+#ifndef SIMGRID_MC_FRAME_HPP
+#define SIMGRID_MC_FRAME_HPP
+
+#include <string>
+
+#include "mc_forward.h"
+#include "mc_location.h"
+
+namespace simgrid {
+namespace mc {
+
+class Frame {
+public:
+  Frame();
+
+  int tag;
+  std::string name;
+  void *low_pc;
+  void *high_pc;
+  simgrid::mc::LocationList frame_base;
+  std::vector<Variable> variables;
+  unsigned long int id; /* DWARF offset of the subprogram */
+  std::vector<Frame> scopes;
+  unsigned long int abstract_origin_id;
+  simgrid::mc::ObjectInformation* object_info;
+};
+
+}
+}
+
+#endif
diff --git a/src/mc/ObjectInformation.cpp b/src/mc/ObjectInformation.cpp
new file mode 100644 (file)
index 0000000..0305fd5
--- /dev/null
@@ -0,0 +1,98 @@
+#include "mc/Frame.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
+
+namespace simgrid {
+namespace mc {
+
+ObjectInformation::ObjectInformation()
+{
+  this->flags = 0;
+  this->start = nullptr;
+  this->end = nullptr;
+  this->start_exec = nullptr;
+  this->end_exec = nullptr;
+  this->start_rw = nullptr;
+  this->end_rw = nullptr;
+  this->start_ro = nullptr;
+  this->end_ro = nullptr;
+}
+
+/** Find the DWARF offset for this ELF object
+ *
+ *  An offset is applied to address found in DWARF:
+ *
+ *  * for an executable obejct, addresses are virtual address
+ *    (there is no offset) i.e.
+ *    \f$\text{virtual address} = \{dwarf address}\f$;
+ *
+ *  * for a shared object, the addreses are offset from the begining
+ *    of the shared object (the base address of the mapped shared
+ *    object must be used as offset
+ *    i.e. \f$\text{virtual address} = \text{shared object base address}
+ *             + \text{dwarf address}\f$.
+ */
+void *ObjectInformation::base_address() const
+{
+  if (this->executable())
+    return nullptr;
+
+  void *result = this->start_exec;
+  if (this->start_rw != NULL && result > (void *) this->start_rw)
+    result = this->start_rw;
+  if (this->start_ro != NULL && result > (void *) this->start_ro)
+    result = this->start_ro;
+  return result;
+}
+
+/* Find a function by instruction pointer */
+simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const
+{
+  /* This is implemented by binary search on a sorted array.
+   *
+   * We do quite a lot ot those so we want this to be cache efficient.
+   * We pack the only information we need in the index entries in order
+   * to successfully do the binary search. We do not need the high_pc
+   * during the binary search (only at the end) so it is not included
+   * in the index entry. We could use parallel arrays as well.
+   *
+   * We cannot really use the std:: alogrithm for this.
+   * We could use std::binary_search by including the high_pc inside
+   * the FunctionIndexEntry.
+   */
+  const simgrid::mc::FunctionIndexEntry* base =
+    this->functions_index.data();
+  int i = 0;
+  int j = this->functions_index.size() - 1;
+  while (j >= i) {
+    int k = i + ((j - i) / 2);
+
+    /* In most of the search, we do not dereference the base[k].function.
+     * This way the memory accesses are located in the base[k] array. */
+    if (ip < base[k].low_pc)
+      j = k - 1;
+    else if (k < j && ip >= base[k + 1].low_pc)
+      i = k + 1;
+
+    /* At this point, the search is over.
+     * Either we have found the correct function or we do not know
+     * any function corresponding to this instruction address.
+     * Only at the point do we derefernce the function pointer. */
+    else if (ip < base[k].function->high_pc)
+      return base[k].function;
+    else
+      return nullptr;
+  }
+  return nullptr;
+}
+
+simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const
+{
+  for (simgrid::mc::Variable& variable : this->global_variables)
+    if(variable.name == name)
+      return &variable;
+  return nullptr;
+}
+
+}
+}
\ No newline at end of file
diff --git a/src/mc/ObjectInformation.hpp b/src/mc/ObjectInformation.hpp
new file mode 100644 (file)
index 0000000..8ada283
--- /dev/null
@@ -0,0 +1,104 @@
+/* Copyright (c) 2007-2015. 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. */
+
+#ifndef SIMGRID_MC_OBJECT_INFORMATION_HPP
+#define SIMGRID_MC_OBJECT_INFORMATION_HPP
+
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#include "mc/mc_forward.h"
+#include "mc/Type.hpp"
+#include "mc/Frame.hpp"
+
+#include "smpi/private.h"
+
+namespace simgrid {
+namespace mc {
+
+/** An entry in the functions index
+ *
+ *  See the code of ObjectInformation::find_function.
+ */
+struct FunctionIndexEntry {
+  void* low_pc;
+  simgrid::mc::Frame* function;
+};
+
+/** Information about an (ELF) executable/sharedobject
+ *
+ *  This contain sall the information we have at runtime about an
+ *  executable/shared object in the target (modelchecked) process:
+ *  - where it is located in the virtual address space;
+ *  - where are located it's different memory mapping in the the
+ *    virtual address space ;
+ *  - all the debugging (DWARF) information,
+ *    - location of the functions,
+ *    - types
+ *  - etc.
+ *
+ *  It is not copyable because we are taking pointers to Types/Frames.
+ *  We'd have to update/rebuild some data structures in order to copy
+ *  successfully.
+ */
+
+class ObjectInformation {
+public:
+  ObjectInformation();
+
+  // Not copyable:
+  ObjectInformation(ObjectInformation const&) = delete;
+  ObjectInformation& operator=(ObjectInformation const&) = delete;
+
+  // Flag:
+  static const int Executable = 1;
+
+  /** Bitfield of flags */
+  int flags;
+  std::string file_name;
+  const void* start;
+  const void *end;
+  char *start_exec;
+  char *end_exec; // Executable segment
+  char *start_rw;
+  char *end_rw; // Read-write segment
+  char *start_ro;
+  char *end_ro; // read-only segment
+  std::unordered_map<std::uint64_t, simgrid::mc::Frame> subprograms;
+  // TODO, remove the mutable (to remove it we'll have to add a lot of const everywhere)
+  mutable std::vector<simgrid::mc::Variable> global_variables;
+  std::unordered_map<std::uint64_t, simgrid::mc::Type> types;
+  std::unordered_map<std::string, simgrid::mc::Type*> full_types_by_name;
+
+  /** Index of functions by IP
+   *
+   * The entries are sorted by low_pc and a binary search can be used to look
+   * them up. Should we used a binary tree instead?
+   */
+  std::vector<FunctionIndexEntry> functions_index;
+
+  bool executable() const
+  {
+    return this->flags & simgrid::mc::ObjectInformation::Executable;
+  }
+
+  bool privatized() const
+  {
+    return this->executable() && smpi_privatize_global_variables;
+  }
+
+  void* base_address() const;
+
+  simgrid::mc::Frame* find_function(const void *ip) const;
+  simgrid::mc::Variable* find_variable(const char* name) const;
+
+};
+
+}
+}
+
+#endif
diff --git a/src/mc/Type.hpp b/src/mc/Type.hpp
new file mode 100644 (file)
index 0000000..287a679
--- /dev/null
@@ -0,0 +1,72 @@
+/* Copyright (c) 2007-2015. 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. */
+
+#ifndef SIMGRID_MC_TYPE_HPP
+#define SIMGRID_MC_TYPE_HPP
+
+#include <vector>
+#include <string>
+
+#include "mc_forward.h"
+#include "mc_location.h"
+
+namespace simgrid {
+namespace mc {
+
+/** Represents a type in the program
+ *
+ *  It is currently used to represent members of structs and unions as well.
+ */
+class Type {
+public:
+  Type();
+  Type(Type const& type) = default;
+  Type& operator=(Type const&) = default;
+  Type(Type&& type) = default;
+  Type& operator=(Type&&) = default;
+
+  /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */
+  int type;
+  unsigned id; /* Offset in the section (in hexadecimal form) */
+  std::string name; /* Name of the type */
+  int byte_size; /* Size in bytes */
+  int element_count; /* Number of elements for array type */
+  unsigned type_id; /* DW_AT_type id */
+  std::vector<Type> members; /* if DW_TAG_structure_type, DW_TAG_class_type, DW_TAG_union_type*/
+  int is_pointer_type;
+
+  // Location (for members) is either of:
+  simgrid::mc::DwarfExpression location_expression;
+
+  simgrid::mc::Type* subtype; // DW_AT_type
+  simgrid::mc::Type* full_type; // The same (but more complete) type
+
+  bool has_offset_location() const
+  {
+    return location_expression.size() == 1 &&
+      location_expression[0].atom == DW_OP_plus_uconst;
+  }
+
+  // TODO, check if this shortcut is really necessary
+  int offset() const
+  {
+    xbt_assert(this->has_offset_location());
+    return this->location_expression[0].number;
+  }
+
+  void offset(int new_offset)
+  {
+    Dwarf_Op op;
+    op.atom = DW_OP_plus_uconst;
+    op.number = new_offset;
+    this->location_expression = { op };
+  }
+};
+
+}
+}
+
+#endif
diff --git a/src/mc/Variable.cpp b/src/mc/Variable.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/mc/Variable.hpp b/src/mc/Variable.hpp
new file mode 100644 (file)
index 0000000..ec1e071
--- /dev/null
@@ -0,0 +1,39 @@
+/* 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. */
+
+#ifndef SIMGRID_MC_VARIABLE_HPP
+#define SIMGRID_MC_VARIABLE_HPP
+
+#include <string>
+
+#include "mc_forward.h"
+#include "mc_location.h"
+
+namespace simgrid {
+namespace mc {
+
+class Variable {
+public:
+  Variable();
+
+  unsigned dwarf_offset; /* Global offset of the field. */
+  int global;
+  std::string name;
+  unsigned type_id;
+  simgrid::mc::Type* type;
+
+  // Use either of:
+  simgrid::mc::LocationList location_list;
+  void* address;
+
+  size_t start_scope;
+  simgrid::mc::ObjectInformation* object_info;
+};
+
+}
+}
+
+#endif
index 54f04df..f585555 100644 (file)
 #include "mc_smx.h"
 #include "mc_hash.hpp"
 
+#include "mc/ObjectInformation.hpp"
+#include "mc/Frame.hpp"
+#include "mc/Variable.hpp"
+
 using simgrid::mc::remote;
 
 extern "C" {
index 9802a17..4510abb 100644 (file)
 #include "mc_private.h"
 #include "mc_smx.h"
 
+#include "mc/Frame.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
+
 #ifdef HAVE_SMPI
 #include "smpi/private.h"
 #endif
index 628bbb6..68e1398 100644 (file)
@@ -14,6 +14,7 @@
 #include "mc/datatypes.h"
 #include "mc/mc_private.h"
 #include "mc/mc_snapshot.h"
+#include "mc/Type.hpp"
 
 using simgrid::mc::remote;
 
index 3ac63ab..e433de4 100644 (file)
 
 #include "mc_object_info.h"
 #include "mc_private.h"
+#include "mc_process.h"
+
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dwarf, mc, "DWARF processing");
 
index cc4b930..15d6631 100644 (file)
 
 #include "mc_object_info.h"
 #include "mc_private.h"
+#include "mc_location.h"
+#include "mc/AddressSpace.hpp"
+#include "mc/Frame.hpp"
+#include "mc/ObjectInformation.hpp"
 
 using simgrid::mc::remote;
 
index 0ea1de0..af6b526 100644 (file)
@@ -7,6 +7,7 @@
 /* Warning: autogenerated, do not edit! */
 
 #include <dwarf.h>
+#include <elfutils/libdw.h>
 
 #include <xbt/base.h>
 #include "mc_object_info.h"
index 59e7e7d..228332d 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "mc_object_info.h"
 #include "mc_private.h"
+#include "mc/Type.hpp"
 
 /** Resolve snapshot in the process address space
  *
index 3d3703c..a3895bf 100644 (file)
@@ -10,6 +10,9 @@
 
 #include "mc_object_info.h"
 #include "mc_private.h"
+#include "mc/Frame.hpp"
+#include "mc/Type.hpp"
+#include "mc/Variable.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -65,96 +68,5 @@ Frame::Frame()
   this->object_info = nullptr;
 }
 
-// ObjectInformations
-
-ObjectInformation::ObjectInformation()
-{
-  this->flags = 0;
-  this->start = nullptr;
-  this->end = nullptr;
-  this->start_exec = nullptr;
-  this->end_exec = nullptr;
-  this->start_rw = nullptr;
-  this->end_rw = nullptr;
-  this->start_ro = nullptr;
-  this->end_ro = nullptr;
-}
-
-/** Find the DWARF offset for this ELF object
- *
- *  An offset is applied to address found in DWARF:
- *
- *  * for an executable obejct, addresses are virtual address
- *    (there is no offset) i.e.
- *    \f$\text{virtual address} = \{dwarf address}\f$;
- *
- *  * for a shared object, the addreses are offset from the begining
- *    of the shared object (the base address of the mapped shared
- *    object must be used as offset
- *    i.e. \f$\text{virtual address} = \text{shared object base address}
- *             + \text{dwarf address}\f$.
- */
-void *ObjectInformation::base_address() const
-{
-  if (this->executable())
-    return nullptr;
-
-  void *result = this->start_exec;
-  if (this->start_rw != NULL && result > (void *) this->start_rw)
-    result = this->start_rw;
-  if (this->start_ro != NULL && result > (void *) this->start_ro)
-    result = this->start_ro;
-  return result;
-}
-
-/* Find a function by instruction pointer */
-simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const
-{
-  /* This is implemented by binary search on a sorted array.
-   *
-   * We do quite a lot ot those so we want this to be cache efficient.
-   * We pack the only information we need in the index entries in order
-   * to successfully do the binary search. We do not need the high_pc
-   * during the binary search (only at the end) so it is not included
-   * in the index entry. We could use parallel arrays as well.
-   *
-   * We cannot really use the std:: alogrithm for this.
-   * We could use std::binary_search by including the high_pc inside
-   * the FunctionIndexEntry.
-   */
-  const simgrid::mc::FunctionIndexEntry* base =
-    this->functions_index.data();
-  int i = 0;
-  int j = this->functions_index.size() - 1;
-  while (j >= i) {
-    int k = i + ((j - i) / 2);
-
-    /* In most of the search, we do not dereference the base[k].function.
-     * This way the memory accesses are located in the base[k] array. */
-    if (ip < base[k].low_pc)
-      j = k - 1;
-    else if (k < j && ip >= base[k + 1].low_pc)
-      i = k + 1;
-
-    /* At this point, the search is over.
-     * Either we have found the correct function or we do not know
-     * any function corresponding to this instruction address.
-     * Only at the point do we derefernce the function pointer. */
-    else if (ip < base[k].function->high_pc)
-      return base[k].function;
-    else
-      return nullptr;
-  }
-  return nullptr;
-}
-
-simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const
-{
-  for (simgrid::mc::Variable& variable : this->global_variables)
-    if(variable.name == name)
-      return &variable;
-  return nullptr;
-}
-
 }
 }
\ No newline at end of file
index 2ec4e56..c1c6ae4 100644 (file)
 /* 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
- *  Debug information for the MC.
- */
-
 #ifndef SIMGRID_MC_OBJECT_INFO_H
 #define SIMGRID_MC_OBJECT_INFO_H
 
-#include <cstdint>
-
-#include <string>
 #include <vector>
-#include <unordered_map>
-
-#include <simgrid_config.h>
-#include <xbt/dict.h>
-#include <xbt/dynar.h>
+#include <memory>
 
-#include <elfutils/libdw.h>
+#include <xbt/base.h>
 
 #include "mc_forward.hpp"
-#include "mc_location.h"
-#include "mc_process.h"
-#include "../smpi/private.h"
-
-// ***** Type
-
-namespace simgrid {
-namespace mc {
-
-/** Represents a type in the program
- *
- *  It is currently used to represent members of structs and unions as well.
- */
-class Type {
-public:
-  Type();
-  Type(Type const& type) = default;
-  Type& operator=(Type const&) = default;
-  Type(Type&& type) = default;
-  Type& operator=(Type&&) = default;
-
-  /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */
-  int type;
-  Dwarf_Off id; /* Offset in the section (in hexadecimal form) */
-  std::string name; /* Name of the type */
-  int byte_size; /* Size in bytes */
-  int element_count; /* Number of elements for array type */
-  std::uint64_t type_id; /* DW_AT_type id */
-  std::vector<Type> members; /* if DW_TAG_structure_type, DW_TAG_class_type, DW_TAG_union_type*/
-  int is_pointer_type;
-
-  // Location (for members) is either of:
-  simgrid::mc::DwarfExpression location_expression;
-
-  simgrid::mc::Type* subtype; // DW_AT_type
-  simgrid::mc::Type* full_type; // The same (but more complete) type
-
-  bool has_offset_location() const
-  {
-    return location_expression.size() == 1 &&
-      location_expression[0].atom == DW_OP_plus_uconst;
-  }
-
-  // TODO, check if this shortcut is really necessary
-  int offset() const
-  {
-    xbt_assert(this->has_offset_location());
-    return this->location_expression[0].number;
-  }
-
-  void offset(int new_offset)
-  {
-    Dwarf_Op op;
-    op.atom = DW_OP_plus_uconst;
-    op.number = new_offset;
-    this->location_expression = { op };
-  }
-};
-
-}
-}
-
-// ***** Object info
-
-namespace simgrid {
-namespace mc {
-
-class Variable {
-public:
-  Variable();
-
-  Dwarf_Off dwarf_offset; /* Global offset of the field. */
-  int global;
-  std::string name;
-  std::uint64_t type_id;
-  simgrid::mc::Type* type;
-
-  // Use either of:
-  simgrid::mc::LocationList location_list;
-  void* address;
-
-  size_t start_scope;
-  simgrid::mc::ObjectInformation* object_info;
-};
-
-class Frame {
-public:
-  Frame();
-
-  int tag;
-  std::string name;
-  void *low_pc;
-  void *high_pc;
-  simgrid::mc::LocationList frame_base;
-  std::vector<Variable> variables;
-  unsigned long int id; /* DWARF offset of the subprogram */
-  std::vector<Frame> scopes;
-  Dwarf_Off abstract_origin_id;
-  simgrid::mc::ObjectInformation* object_info;
-};
-
-/** An entry in the functions index
- *
- *  See the code of ObjectInformation::find_function.
- */
-struct FunctionIndexEntry {
-  void* low_pc;
-  simgrid::mc::Frame* function;
-};
-
-/** Information about an (ELF) executable/sharedobject
- *
- *  This contain sall the information we have at runtime about an
- *  executable/shared object in the target (modelchecked) process:
- *  - where it is located in the virtual address space;
- *  - where are located it's different memory mapping in the the
- *    virtual address space ;
- *  - all the debugging (DWARF) information,
- *    - location of the functions,
- *    - types
- *  - etc.
- *
- *  It is not copyable because we are taking pointers to Types/Frames.
- *  We'd have to update/rebuild some data structures in order to copy
- *  successfully.
- */
-
-class ObjectInformation {
-public:
-  ObjectInformation();
-
-  // Not copyable:
-  ObjectInformation(ObjectInformation const&) = delete;
-  ObjectInformation& operator=(ObjectInformation const&) = delete;
-
-  // Flag:
-  static const int Executable = 1;
-
-  /** Bitfield of flags */
-  int flags;
-  std::string file_name;
-  const void* start;
-  const void *end;
-  char *start_exec;
-  char *end_exec; // Executable segment
-  char *start_rw;
-  char *end_rw; // Read-write segment
-  char *start_ro;
-  char *end_ro; // read-only segment
-  std::unordered_map<std::uint64_t, simgrid::mc::Frame> subprograms;
-  // TODO, remove the mutable (to remove it we'll have to add a lot of const everywhere)
-  mutable std::vector<simgrid::mc::Variable> global_variables;
-  std::unordered_map<std::uint64_t, simgrid::mc::Type> types;
-  std::unordered_map<std::string, simgrid::mc::Type*> full_types_by_name;
-
-  /** Index of functions by IP
-   *
-   * The entries are sorted by low_pc and a binary search can be used to look
-   * them up. Should we used a binary tree instead?
-   */
-  std::vector<FunctionIndexEntry> functions_index;
-
-  bool executable() const
-  {
-    return this->flags & simgrid::mc::ObjectInformation::Executable;
-  }
-
-  bool privatized() const
-  {
-    return this->executable() && smpi_privatize_global_variables;
-  }
-
-  void* base_address() const;
-
-  simgrid::mc::Frame* find_function(const void *ip) const;
-  simgrid::mc::Variable* find_variable(const char* name) const;
-
-};
-
-}
-}
-
+#include "mc_memory_map.h"
 
 XBT_INTERNAL std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
   std::vector<simgrid::mc::VmMap> const& maps, const char* name, int executable);
@@ -213,6 +21,7 @@ XBT_INTERNAL void MC_post_process_object_info(simgrid::mc::Process* process, sim
 
 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);
 
index 2cc2b04..c29ebcf 100644 (file)
 
 #include "mc_process.h"
 #include "mc_object_info.h"
-#include "AddressSpace.hpp"
 #include "mc_unw.h"
 #include "mc_snapshot.h"
 #include "mc_ignore.h"
 #include "mc_smx.h"
 #include "mc_server.h"
 
+#include "mc/AddressSpace.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
+
 using simgrid::mc::remote;
 
 extern "C" {
index 0d78305..899b403 100644 (file)
@@ -21,6 +21,7 @@
 #include "mc_object_info.h"
 #include "mc_process.h"
 #include "mc_unw.h"
+#include "mc/Frame.hpp"
 
 using simgrid::mc::remote;
 
index 1de7873..f1fc2a1 100644 (file)
 #include "mc/mc_protocol.h"
 #include "mc/mc_client.h"
 
+#include "mc/Frame.hpp"
+#include "mc/Variable.hpp"
+#include "mc/ObjectInformation.hpp"
+
 extern "C" {
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mcer_ignore, mc,
index 4bd2e89..9aeec32 100644 (file)
 #include <xbt.h>
 #include <mc/mc.h>
 
-#include "../../src/include/mc/datatypes.h"
-#include "../../src/mc/mc_object_info.h"
-#include "../../src/mc/mc_private.h"
+#include "mc/datatypes.h"
+#include "mc/mc_object_info.h"
+#include "mc/mc_private.h"
+#include "mc/mc_process.h"
+
+#include "mc/Type.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
 
 int test_some_array[4][5][6];
 struct some_struct { int first; int second[4][5]; } test_some_struct;
index afd40aa..b586d62 100644 (file)
 #include <assert.h>
 #include <stdlib.h>
 
-#include "../src/mc/mc_private.h"
-#include "../src/mc/mc_object_info.h"
+#include "mc/mc_process.h"
+#include "mc/mc_private.h"
+#include "mc/mc_object_info.h"
+
+#include "mc/Type.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
 
 static simgrid::mc::Process* process;
 
index fbb496a..2164ff2 100755 (executable)
@@ -12,6 +12,7 @@ cat - > src/mc/mc_dwarf_tagnames.cpp <<EOF
 /* Warning: autogenerated, do not edit! */
 
 #include <dwarf.h>
+#include <elfutils/libdw.h>
 
 #include <xbt/base.h>
 #include "mc_object_info.h"