From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115075 invoked by alias); 13 Dec 2018 17:21:42 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 115005 invoked by uid 48); 13 Dec 2018 17:21:37 -0000 From: "Andreas.Kromke at dreamchip dot de" To: elfutils-devel@sourceware.org Subject: [Bug libdw/23982] New: dwarf_formref_die() does not support DW_FORM_indirect Date: Thu, 13 Dec 2018 17:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libdw X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Andreas.Kromke at dreamchip dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2018-q4/txt/msg00223.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23982 Bug ID: 23982 Summary: dwarf_formref_die() does not support DW_FORM_indirect Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: Andreas.Kromke at dreamchip dot de CC: elfutils-devel at sourceware dot org Target Milestone: --- This kind of indirect form is generated by some ARM compilers. A temporary workaround might be: Dwarf_Attribute *attr =3D dwarf_attr_integrate(die, DW_AT_type, &attr_mem); if (attr !=3D NULL) { unsigned int whatform =3D dwarf_whatform(attr); while(whatform =3D=3D DW_FORM_indirect) { uint64_t val; const unsigned char *p =3D (const unsigned char *) attr->valp; get_uleb128_unchecked(val, p); whatform =3D (unsigned int) val; attr_mem.form =3D whatform; attr_mem.valp =3D (void *) p; } Dwarf_Die *type =3D dwarf_formref_die(attr, type_die); ... However, this method is rather ugly, because it needs the internal function get_uleb128_unchecked(). --=20 You are receiving this mail because: You are on the CC list for the bug.