X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ff00d50c71255dd055527b806d9e2791013443d8..b3a2217b5c973d5a79c43d555162d2d516aa2631:/src/mc/mc_object_info.cpp diff --git a/src/mc/mc_object_info.cpp b/src/mc/mc_object_info.cpp index 7fc980821e..6034269268 100644 --- a/src/mc/mc_object_info.cpp +++ b/src/mc/mc_object_info.cpp @@ -14,6 +14,18 @@ namespace simgrid { namespace mc { +// Free functions + +static void mc_frame_free(void* frame) +{ + delete (simgrid::mc::Frame*)frame; +} + +static void mc_type_free(void* t) +{ + delete (simgrid::mc::Type*)t; +} + // Type Type::Type() @@ -53,6 +65,60 @@ Frame::Frame() // ObjectInformations +ObjectInformation::ObjectInformation() +{ + this->flags = 0; + this->file_name = nullptr; + this->start = nullptr; + this->end = nullptr; + this->start_exec = nullptr; + this->end_exec = nullptr; + this->start_rw = nullptr; + this->end_rw = nullptr; + this->start_ro = nullptr; + this->end_ro = nullptr; + this->subprograms = xbt_dict_new_homogeneous(mc_frame_free); + this->types = xbt_dict_new_homogeneous((void (*)(void *)) mc_type_free); + this->full_types_by_name = xbt_dict_new_homogeneous(NULL); + this->functions_index = nullptr; +} + +ObjectInformation::~ObjectInformation() +{ + xbt_free(this->file_name); + xbt_dict_free(&this->subprograms); + xbt_dict_free(&this->types); + xbt_dict_free(&this->full_types_by_name); + xbt_dynar_free(&this->functions_index); +} + +/** Find the DWARF offset for this ELF object + * + * An offset is applied to address found in DWARF: + * + *