From b3a2217b5c973d5a79c43d555162d2d516aa2631 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Mon, 20 Jul 2015 15:42:47 +0200 Subject: [PATCH] [mc] Move ObjectInformation methods in mc_object_info.cpp --- src/mc/mc_dwarf.cpp | 81 --------------------------------------- src/mc/mc_object_info.cpp | 66 +++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 81 deletions(-) diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index 4e86738aa3..91e62c045d 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -20,16 +20,6 @@ #include "mc_object_info.h" #include "mc_private.h" -static void mc_variable_free_voidp(void *t) -{ - delete *(simgrid::mc::Variable**)t; -} - -static void mc_frame_free(void* frame) -{ - delete (simgrid::mc::Frame*)frame; -} - static void MC_dwarf_register_global_variable( mc_object_info_t info, std::unique_ptr variable); static void MC_register_variable( @@ -1030,77 +1020,6 @@ void MC_dwarf_get_variables(mc_object_info_t info) close(fd); } -/************************** Free functions *************************/ - -static void dw_type_free(mc_type_t t) -{ - delete t; -} - -// ***** object_info - -namespace simgrid { -namespace mc { - -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 *)) dw_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: - * - *