From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C77BE3858D1E; Thu, 8 Sep 2022 08:38:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C77BE3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662626297; bh=pFEdvATpD3wmpcc3VoTx1qeZiXTakBLakJfbVowTU0Q=; h=From:To:Subject:Date:From; b=HddUOTyLAvlvF1ccQP+xu17XCHY1MuBLeaH/acFmZ3YqVTAp4lYdujuDqSPmumnvV 9s5ELqTr/t0ROfdAPbXQKU9Hqsmwq6nO6eqS02gIJSpTmH/sIvEKaLuSD5Cpt+NHXC uaBeMm7yI7xzqVNs7Pyz+4fnNmlXySzs93ZaTKEc= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/29558] New: [gdb/symtab] Handle gas-generated debug info (DW_TAG_unspecified_type) Date: Thu, 08 Sep 2022 08:38:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW 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 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29558 Bug ID: 29558 Summary: [gdb/symtab] Handle gas-generated debug info (DW_TAG_unspecified_type) Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I. A recent commit 5578fbf672e ("GAS: Add a return type tag to DWARF DIEs generated for function symbols") fixes a problem with gas-generated dwarf i= nfo. So, let's see if we can reproduce the problem and test the fix in gdb. Multi-source test-case: ... $ cat test.c extern int foo (void); int main (void) { int res =3D foo (); return res; } $ cat test2.c int foo (void) { return 0; } ... Test script: ... $ cat compile.sh #!/bin/sh as=3D/home/vries/binutils/install/bin/as gcc -c -g test.c gcc -S test2.c $as --64 -gdwarf-5 -o test2.o test2.s gcc test.o test2.o=20 ./gdb.sh -batch a.out -ex start -ex "p foo" -ex "p (int) foo ()" ... II. 2.38 Using $as from 2.38: ... $ ./compile.sh Temporary breakpoint 1 at 0x40049f: file test.c, line 6. Temporary breakpoint 1, main () at test.c:6 6 int res =3D foo (); $1 =3D {} 0x4004ac $2 =3D 0 ... Looks as expected. III. 2.39 Using $as from 2.39: ... $ ./compile.sh Temporary breakpoint 1 at 0x40049f: file test.c, line 6. Temporary breakpoint 1, main () at test.c:6 6 int res =3D foo (); $1 =3D {void (void)} 0x4004ac Invalid cast. ... So, this is the bug the commit is trying to fix. III. current trunk Using $as from current trunk: ... $ ./compile.sh Dwarf Error: unexpected tag 'DW_TAG_unspecified_type' at offset 0xf4 Temporary breakpoint 1 at 0x40049f: file test.c, line 6. Temporary breakpoint 1, main () at test.c:6 6 int res =3D foo (); Dwarf Error: unexpected tag 'DW_TAG_unspecified_type' at offset 0xf4 Dwarf Error: unexpected tag 'DW_TAG_unspecified_type' at offset 0xf4 ... So, either the debug info is invalid, or gdb needs to learn how to handle t= his. --=20 You are receiving this mail because: You are on the CC list for the bug.=