From 4e7093719a890d3f66368f7e3ae60092570c163d Mon Sep 17 00:00:00 2001 From: Jafeer Uddin Date: Tue, 25 Jun 2019 15:14:26 -0400 Subject: [PATCH] Make use of dwarf_aggregate_size to find size attr of types When trying to probe go lang structure pointers, was getting "cannot find byte_size attribute" errors. This patch fixes that issue by using the dwarf_aggregate_size function in elfutils. --- dwflpp.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dwflpp.cxx b/dwflpp.cxx index 51af1a39e..f8531430d 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -3959,11 +3959,9 @@ dwflpp::translate_pointer(location_context &ctx, Dwarf_Die *typedie, location *loc = ctx.locations.back (); if (loc->type != loc_implicit_pointer) { - Dwarf_Attribute size_attr; Dwarf_Word byte_size; - if (dwarf_attr_integrate (typedie, DW_AT_byte_size, &size_attr) == NULL - || dwarf_formudata (&size_attr, &byte_size) != 0) - throw SEMANTIC_ERROR (_F("cannot get byte_size attribute for type %s: %s", + if (dwarf_aggregate_size (typedie, &byte_size) != 0) + throw SEMANTIC_ERROR (_F("cannot get size for type %s: %s", dwarf_diename (typedie) ?: "", dwarf_errmsg (-1)), ctx.e->tok); -- 2.43.5