From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95904 invoked by alias); 13 Dec 2018 17:06:53 -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 95836 invoked by uid 48); 13 Dec 2018 17:06:48 -0000 From: "Andreas.Kromke at dreamchip dot de" To: elfutils-devel@sourceware.org Subject: [Bug libdw/23981] New: dwarf_siblingof() fails with attribute form DW_FORM_ref_addr Date: Thu, 13 Dec 2018 17:06: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/msg00222.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23981 Bug ID: 23981 Summary: dwarf_siblingof() fails with attribute form DW_FORM_ref_addr 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: --- The API function dwarf_siblingof() internally calls __libdw_formref() which= is deprecated and especially does not support DW_FORM_ref_addr, resulting in a return code of -1 (format error). Instead dwarf_siblingof() should call dwarf_formref_die() or an internal variant of that. A temporary workaround might be: int my_dwarf_siblingof(Dwarf_Die *die, Dwarf_Die *result) { int ret =3D dwarf_siblingof(die, result); if (ret >=3D 0) return ret; Dwarf_Attribute attr_result; Dwarf_Attribute *attr =3D dwarf_attr(die, DW_AT_sibling, &attr_result); if (attr =3D=3D NULL) return -1; Dwarf_Die *formref_die =3D dwarf_formref_die(attr, result); if (formref_die =3D=3D NULL) return -1; return 0; } --=20 You are receiving this mail because: You are on the CC list for the bug.