X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/39b079c66644d717e0a7983d3325410dd05152b2..13388755930c20f4c3785153b8952cf30c23183a:/src/mc/mc_object_info.h diff --git a/src/mc/mc_object_info.h b/src/mc/mc_object_info.h index 9dbf036ae8..f7ab5b5dae 100644 --- a/src/mc/mc_object_info.h +++ b/src/mc/mc_object_info.h @@ -8,8 +8,8 @@ * Debug information for the MC. */ -#ifndef MC_OBJECT_INFO_H -#define MC_OBJECT_INFO_H +#ifndef SIMGRID_MC_OBJECT_INFO_H +#define SIMGRID_MC_OBJECT_INFO_H #include #include @@ -58,11 +58,15 @@ typedef int mc_object_info_flags; #define MC_OBJECT_INFO_NONE 0 #define MC_OBJECT_INFO_EXECUTABLE 1 -struct s_mc_object_info { - s_mc_object_info(); - ~s_mc_object_info(); - s_mc_object_info(s_mc_object_info const&) = delete; - s_mc_object_info& operator=(s_mc_object_info const&) = delete; +namespace simgrid { +namespace mc { + +class ObjectInformation { +public: + ObjectInformation(); + ~ObjectInformation(); + ObjectInformation(ObjectInformation const&) = delete; + ObjectInformation& operator=(ObjectInformation const&) = delete; mc_object_info_flags flags; char* file_name; @@ -83,44 +87,29 @@ struct s_mc_object_info { // lookup of a function given an instruction pointer. // The entries are sorted by low_pc and a binary search can be used to look them up. xbt_dynar_t functions_index; -}; -static inline __attribute__ ((always_inline)) -bool MC_object_info_executable(mc_object_info_t info) -{ - return info->flags & MC_OBJECT_INFO_EXECUTABLE; -} + bool executable() const + { + return this->flags & MC_OBJECT_INFO_EXECUTABLE; + } -static inline __attribute__ ((always_inline)) -bool MC_object_info_is_privatized(mc_object_info_t info) -{ - return info && MC_object_info_executable(info) && smpi_privatize_global_variables; -} + bool privatized() const + { + return this->executable() && smpi_privatize_global_variables; + } -/** Find the DWARF offset for this ELF object - * - * An offset is applied to address found in DWARF: - * - *