From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1C216385802F; Wed, 6 Mar 2024 10:52:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C216385802F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709722338; bh=kavwyJgZKs1B58txE64DsESt368sUKniw79bYbKOzI8=; h=From:To:Subject:Date:From; b=DKK4g1lP5G8vriyrsqAUSL31hE0H9scsWD/9uf1+US4G0q7keTEj5ON6fcSOzQGH0 785JgleMIbNxbk3eGWu/zAzNEZ5Op5N+Hz++XAw0Q/qA0sPI0P1ZScUIN0WFKmUmP5 Qa9u1gtXtqEwC9G1q6qpRbVgNavA4QWvCuXY2IS8= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/31453] New: [gdb/tdep, arm] FAIL: gdb.arch/pr25124.exp: disassemble thumb instruction (1st try) Date: Wed, 06 Mar 2024 10:52:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep 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=3D31453 Bug ID: 31453 Summary: [gdb/tdep, arm] FAIL: gdb.arch/pr25124.exp: disassemble thumb instruction (1st try) Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: tdep Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- On arm-linux, I ran into: ... (gdb) x /i main+8^M 0x4e1 : vrhadd.u16 d14, d14, d31^M (gdb) FAIL: gdb.arch/pr25124.exp: disassemble thumb instruction (1st try) ... Likewise, this fails: ... $ gdb -q -batch outputs/gdb.arch/pr25124/pr25124 -ex "disassemble main" Dump of assembler code for function main: 0x000004d9 <-1>: bx pc 0x000004db <+1>: nop 0x000004dd <+3>: movs r0, r0 0x000004df <+5>: b.n 0xc22 0x000004e1 <+7>: vrhadd.u16 d14, d14, d31 End of assembler dump. ... This is a regression due to PR gas/31115 (reported on 2.39, found this with 2.40, presumably also present in 2.41, and still unfixed), which makes gas produce a low_pc with the thumb bit set: ... <1><24>: Abbrev Number: 2 (DW_TAG_subprogram) <25> DW_AT_name : (indirect string, offset: 0x65): main <29> DW_AT_external : 1 <29> DW_AT_type : <0x2f> <2a> DW_AT_low_pc : 0x4d9 <2e> DW_AT_high_pc : 12 <1><2f>: Abbrev Number: 3 (DW_TAG_unspecified_type) ... With this workaround in gdb: ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 486be7e4921..b4c8c41f5f8 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9974,6 +9974,9 @@ read_func_scope (struct die_info *die, struct dwarf2_= cu *cu) lowpc =3D per_objfile->relocate (unrel_low); highpc =3D per_objfile->relocate (unrel_high); + lowpc =3D gdbarch_addr_bits_remove (gdbarch, lowpc); + highpc =3D gdbarch_addr_bits_remove (gdbarch, highpc); + /* If we have any template arguments, then we must allocate a different sort of symbol. */ for (child_die =3D die->child; child_die; child_die =3D child_die->sibli= ng) ... the test-case passes, and the disassembly command produces sane output: ... $ gdb -q -batch outputs/gdb.arch/pr25124/pr25124 -ex "disassemble main" Dump of assembler code for function main: 0x000004d8 <+0>: bx pc 0x000004da <+2>: nop 0x000004dc <+4>: mov r0, #0 0x000004e0 <+8>: bx lr End of assembler dump. ... --=20 You are receiving this mail because: You are on the CC list for the bug.=