X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1610a3a014ca193868cd6ed987728201c15b423c:/src/mc/LocationList.hpp..4bcfd40036f842e976d329cd0cee7349b8e0f4d6:/src/mc/inspect/LocationList.hpp diff --git a/src/mc/LocationList.hpp b/src/mc/inspect/LocationList.hpp similarity index 57% rename from src/mc/LocationList.hpp rename to src/mc/inspect/LocationList.hpp index 3427060139..b937ef45cb 100644 --- a/src/mc/LocationList.hpp +++ b/src/mc/inspect/LocationList.hpp @@ -9,9 +9,9 @@ #include "xbt/base.h" #include "xbt/range.hpp" +#include "src/mc/inspect/DwarfExpression.hpp" #include "src/mc/mc_base.h" #include "src/mc/mc_forward.hpp" -#include "src/mc/DwarfExpression.hpp" #include #include @@ -23,31 +23,22 @@ namespace dwarf { class LocationListEntry { public: typedef simgrid::xbt::Range range_type; + private: DwarfExpression expression_; // By default, the expression is always valid: range_type range_ = {0, UINT64_MAX}; + public: LocationListEntry() = default; - LocationListEntry(DwarfExpression expression, range_type range) - : expression_(std::move(expression)), range_(range) - {} + LocationListEntry(DwarfExpression expression, range_type range) : expression_(std::move(expression)), range_(range) {} explicit LocationListEntry(DwarfExpression expression) : expression_(std::move(expression)), range_({0, UINT64_MAX}) { } - DwarfExpression& expression() - { - return expression_; - } - DwarfExpression const& expression() const - { - return expression_; - } - bool valid_for_ip(unw_word_t ip) const - { - return range_.contain(ip); - } + DwarfExpression& expression() { return expression_; } + DwarfExpression const& expression() const { return expression_; } + bool valid_for_ip(unw_word_t ip) const { return range_.contain(ip); } }; typedef std::vector LocationList; @@ -66,34 +57,26 @@ public: explicit Location(int register_id) : memory_(nullptr), register_id_(register_id) {} // Type of location: bool in_register() const { return memory_ == nullptr; } - bool in_memory() const { return memory_ != nullptr; } + bool in_memory() const { return memory_ != nullptr; } // Get the location: - void* address() const { return memory_; } - int register_id() const { return register_id_; } + void* address() const { return memory_; } + int register_id() const { return register_id_; } }; XBT_PRIVATE -Location resolve( - simgrid::dwarf::DwarfExpression const& expression, - simgrid::mc::ObjectInformation* object_info, unw_cursor_t* c, - void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, - int process_index); - -Location resolve( - simgrid::dwarf::LocationList const& locations, - simgrid::mc::ObjectInformation* object_info, - unw_cursor_t * c, - void *frame_pointer_address, - simgrid::mc::AddressSpace* address_space, - int process_index); +Location resolve(simgrid::dwarf::DwarfExpression const& expression, simgrid::mc::ObjectInformation* object_info, + unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, + int process_index); + +Location resolve(simgrid::dwarf::LocationList const& locations, simgrid::mc::ObjectInformation* object_info, + unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, + int process_index); XBT_PRIVATE -simgrid::dwarf::LocationList location_list( - simgrid::mc::ObjectInformation& info, - Dwarf_Attribute& attr); +simgrid::dwarf::LocationList location_list(simgrid::mc::ObjectInformation& info, Dwarf_Attribute& attr); -} -} +} // namespace dwarf +} // namespace simgrid #endif