Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Cleanup
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 24 Jul 2015 11:35:26 +0000 (13:35 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 24 Jul 2015 13:08:20 +0000 (15:08 +0200)
src/mc/mc_dwarf.cpp
src/mc/mc_object_info.h

index 0b0e2e4..3ac63ab 100644 (file)
@@ -610,14 +610,11 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
   Dwarf_Die * unit, simgrid::mc::Frame* frame,
   const char *ns)
 {
-
   simgrid::mc::Type type;
-  type.type = -1;
+  type.type = dwarf_tag(die);
   type.name = std::string();
   type.element_count = -1;
 
-  type.type = dwarf_tag(die);
-
   // Global Offset
   type.id = dwarf_dieoffset(die);
 
@@ -1141,7 +1138,7 @@ std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
   std::shared_ptr<simgrid::mc::ObjectInformation> result =
     std::make_shared<simgrid::mc::ObjectInformation>();
   if (executable)
-    result->flags |= MC_OBJECT_INFO_EXECUTABLE;
+    result->flags |= simgrid::mc::ObjectInformation::Executable;
   result->file_name = name;
   MC_find_object_address(maps, result.get());
   MC_dwarf_get_variables(result.get());
index c04b917..2ec4e56 100644 (file)
@@ -30,8 +30,6 @@
 
 // ***** Type
 
-typedef int e_mc_type_type;
-
 namespace simgrid {
 namespace mc {
 
@@ -47,7 +45,8 @@ public:
   Type(Type&& type) = default;
   Type& operator=(Type&&) = default;
 
-  e_mc_type_type type;
+  /** 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 */
@@ -89,11 +88,6 @@ public:
 
 // ***** Object info
 
-/** Bit field of options */
-typedef int mc_object_info_flags;
-#define MC_OBJECT_INFO_NONE 0
-#define MC_OBJECT_INFO_EXECUTABLE 1
-
 namespace simgrid {
 namespace mc {
 
@@ -165,7 +159,11 @@ public:
   ObjectInformation(ObjectInformation const&) = delete;
   ObjectInformation& operator=(ObjectInformation const&) = delete;
 
-  mc_object_info_flags flags;
+  // Flag:
+  static const int Executable = 1;
+
+  /** Bitfield of flags */
+  int flags;
   std::string file_name;
   const void* start;
   const void *end;
@@ -190,7 +188,7 @@ public:
 
   bool executable() const
   {
-    return this->flags & MC_OBJECT_INFO_EXECUTABLE;
+    return this->flags & simgrid::mc::ObjectInformation::Executable;
   }
 
   bool privatized() const
@@ -201,7 +199,6 @@ public:
   void* base_address() 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;
 
 };