From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C79EC3858D34; Wed, 1 May 2024 13:14:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C79EC3858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1714569247; bh=enMSYk/4tswihPb+atAyliwsG4kAV8ICx8r256n6Ow0=; h=From:To:Subject:Date:From; b=wy4RCMAs2cpquaEDyvGipOk0MERcVJgDACKln3v3GNxx8dMX+lsIuCyuDgk1Yu1Ix pfbUVr6yA+g4XTIN036WcwUDyHuUT0isY4SAUBpLI8uUgcPSopRE8MGQQziWa/8SOZ EzfUe3I+IwazumucfcXhFZvg29q34wDVQDw61KEE= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/31689] New: [gdb/symtab] PR gas/29517 workaround, dwarf2 case Date: Wed, 01 May 2024 13:14:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab 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=3D31689 Bug ID: 31689 Summary: [gdb/symtab] PR gas/29517 workaround, dwarf2 case Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider the following example: ... $ gcc -g ~/data/hello.c $ gcc -g hello.s -c $ readelf -wi hello.o Contents of the .debug_info section: Compilation Unit @ offset 0: Length: 0x41 (32-bit) Version: 2 Abbrev Offset: 0 Pointer Size: 8 <0>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_stmt_list : 0 <10> DW_AT_low_pc : 0 <18> DW_AT_high_pc : 0x15 <20> DW_AT_name : (indirect string, offset: 0): hello.s <24> DW_AT_comp_dir : (indirect string, offset: 0x8): /home/vries/= gdb <28> DW_AT_producer : (indirect string, offset: 0x18): GNU AS 2.41= .0 <2c> DW_AT_language : 32769 (MIPS assembler) <1><2e>: Abbrev Number: 2 (DW_TAG_subprogram) <2f> DW_AT_name : (indirect string, offset: 0x26): main <33> DW_AT_external : 1 <34> DW_AT_low_pc : 0 <3c> DW_AT_high_pc : 0x15 <1><44>: Abbrev Number: 0 ... The return type of main is incorrect. It doesn't have a DW_AT_type attribu= te, and consequently the return type is void. This is PR gas/29517. There is a fix for this, added in gas 2.40. We can see that gas 2.41 is used. So the fix is present in the assembler u= sed. However, the fix only works for dwarf3 and later, because it requires DW_TAG_unspecified type, and the CU dwarf version is 2, due to: ... $ gcc -g hello.s -c -v 2>&1 | grep "/as " | sed 's%.*/as %as %' as --gdwarf2 -v --64 -o hello.o hello.s ... A workaround for this problem was added here: ... commit 1d45d90934b10862c00a22bcf4075815a785001b Author: Tom de Vries Date: Mon Oct 16 16:32:28 2023 +0200 [gdb/symtab] Work around PR gas/29517 ... but that one is only active for gas 2.39. For dwarf2, it should be active for gas >=3D 2.39. --=20 You are receiving this mail because: You are on the CC list for the bug.=