Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] OOPify/C++ify Type (cont)
[simgrid.git] / src / mc / mc_location.h
index a3b3bb5..1bafe6c 100644 (file)
@@ -4,11 +4,13 @@
 /* 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 MC_OBJECT_LOCATION_H
-#define MC_OBJECT_LOCATION_H
+#ifndef SIMGRID_MC_OBJECT_LOCATION_H
+#define SIMGRID_MC_OBJECT_LOCATION_H
 
 #include <stdint.h>
 
+#include <vector>
+
 #include <libunwind.h>
 #include <dwarf.h>
 #include <elfutils/libdw.h>
 #include "mc_forward.h"
 #include "AddressSpace.hpp"
 
+namespace simgrid {
+namespace mc {
+
+typedef std::vector<Dwarf_Op> DwarfExpression;
+
+}
+}
+
 SG_BEGIN_DECL()
 
 /** \brief a DWARF expression with optional validity contraints */
@@ -115,4 +125,17 @@ MC_SHOULD_BE_INTERNAL void* mc_find_frame_base(
 
 SG_END_DECL()
 
+namespace simgrid {
+namespace mc {
+
+inline
+int execute(DwarfExpression const& expression, mc_expression_state_t state)
+{
+  return mc_dwarf_execute_expression(
+    expression.size(), expression.data(), state);
+}
+
+}
+}
+
 #endif