-/************************** Free functions *************************/
-
-void mc_frame_free(dw_frame_t frame)
-{
- xbt_free(frame->name);
- mc_dwarf_location_list_clear(&(frame->frame_base));
- xbt_dynar_free(&(frame->variables));
- xbt_dynar_free(&(frame->scopes));
- xbt_free(frame);
-}
-
-s_dw_type::s_dw_type()
-{
- this->type = 0;
- this->id = 0;
- this->name = nullptr;
- this->byte_size = 0;
- this->element_count = 0;
- this->dw_type_id = nullptr;
- this->members = nullptr;
- this->is_pointer_type = 0;
- this->location = { 0, 0, 0, 0};
- this->offset = 0;
- this->subtype = nullptr;
- this->full_type = nullptr;
-}
-
-s_dw_type::~s_dw_type()
-{
- xbt_free(this->name);
- xbt_free(this->dw_type_id);
- xbt_dynar_free(&this->members);
- mc_dwarf_expression_clear(&this->location);
-}
-
-static void dw_type_free(dw_type_t t)
-{
- delete t;
-}
-
-void dw_variable_free(dw_variable_t v)
-{
- if (v) {
- xbt_free(v->name);
- xbt_free(v->type_origin);
-
- if (v->locations.locations)
- mc_dwarf_location_list_clear(&v->locations);
- xbt_free(v);
- }
-}
-
-void dw_variable_free_voidp(void *t)
-{
- dw_variable_free((dw_variable_t) * (void **) t);
-}
-
-// ***** object_info
-
-s_mc_object_info::s_mc_object_info()
-{
- 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((void (*)(void *)) mc_frame_free);
- this->global_variables =
- xbt_dynar_new(sizeof(dw_variable_t), dw_variable_free_voidp);
- 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;
-}
-
-s_mc_object_info::~s_mc_object_info()
-{
- xbt_free(this->file_name);
- xbt_dict_free(&this->subprograms);
- xbt_dynar_free(&this->global_variables);
- xbt_dict_free(&this->types);
- xbt_dict_free(&this->full_types_by_name);
- xbt_dynar_free(&this->functions_index);
-}
-
-// ***** Helpers
-
-void *MC_object_base_address(mc_object_info_t info)
-{
- if (info->flags & MC_OBJECT_INFO_EXECUTABLE)
- return 0;
- void *result = info->start_exec;
- if (info->start_rw != NULL && result > (void *) info->start_rw)
- result = info->start_rw;
- if (info->start_ro != NULL && result > (void *) info->start_ro)
- result = info->start_ro;
- return result;
-}
-