]> sourceware.org Git - systemtap.git/commitdiff
Make use of dwarf_aggregate_size to find size attr of types
authorJafeer Uddin <juddin@redhat.com>
Tue, 25 Jun 2019 19:14:26 +0000 (15:14 -0400)
committerJafeer Uddin <juddin@redhat.com>
Tue, 2 Jul 2019 15:41:25 +0000 (11:41 -0400)
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

index 51af1a39e5cc7763d1ed88e70863125b3e0a50a3..f8531430d67f71afcfd108976216eb92e99ca417 100644 (file)
@@ -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) ?: "<anonymous>",
                                 dwarf_errmsg (-1)), ctx.e->tok);
 
This page took 0.033889 seconds and 5 git commands to generate.