X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3b53885f888f2539a533797e76a3f3ff84cdfe0c..fd4234eb94e29294081a0732440e5868e561d78b:/src/mc/Frame.hpp diff --git a/src/mc/Frame.hpp b/src/mc/Frame.hpp index 734b933458..2e269d3e39 100644 --- a/src/mc/Frame.hpp +++ b/src/mc/Frame.hpp @@ -9,36 +9,61 @@ #include -#include "mc_forward.h" -#include "mc_location.h" -#include "mc/Variable.hpp" -#include "mc/Frame.hpp" +#include +#include + +#include "src/mc/mc_forward.h" +#include "src/mc/LocationList.hpp" +#include "src/mc/Variable.hpp" +#include "src/mc/Frame.hpp" namespace simgrid { namespace mc { +/** Debug information about a given function or scope within a function */ class Frame { public: Frame(); - int tag; + /** Kind of scope (DW_TAG_subprogram, DW_TAG_inlined_subroutine, etc.) */ + int tag = DW_TAG_invalid; + + /** Name of the function (if it is a function) */ std::string name; - void *low_pc; - void *high_pc; - simgrid::mc::LocationList frame_base; + + /** Range of instruction addresses for which this scope is valid */ + simgrid::xbt::range range; + + simgrid::dwarf::LocationList frame_base_location; + + /** List of the variables (sorted by name) */ std::vector variables; - unsigned long int id; /* DWARF offset of the subprogram */ + + /* Unique identifier for this scope (in the object_info) + * + * This is the global DWARF offset of the DIE. */ + unsigned long int id = 0; + std::vector scopes; - unsigned long int abstract_origin_id; - simgrid::mc::ObjectInformation* object_info; + + /** Value of `DW_AT_abstract_origin` + * + * For inlined subprograms, this is the ID of the + * parent function. + */ + unsigned long int abstract_origin_id = 0; + + simgrid::mc::ObjectInformation* object_info = nullptr; + + void* frame_base(unw_cursor_t& unw_cursor) const; + void remove_variable(char* name); }; inline Frame::Frame() { this->tag = 0; - this->low_pc = nullptr; - this->high_pc = nullptr; + this->range = {0, 0}; this->id = 0; this->abstract_origin_id = 0; this->object_info = nullptr;