From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 78C153858C50; Thu, 9 Feb 2023 14:24:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78C153858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675952676; bh=P2ITC8siNtYpR+pRm0Pdg9AHGFYZv9UPK9OV1KFIW1c=; h=From:To:Subject:Date:From; b=BGAt6ynbXc6gwL4bO/D/6XBI2DayiKPLA5sYKazrKA/xY0ns74sv0X08wppqjZPQd Yv2wgw1b+d0gu7P6w/jDD48FzYfy3nbIqyLD7fippmQd6R19Z1kXPDhUIa+zSQJoMG epn7097XaERVOzY3zVpqIuNrYJTyY27yedh4t8C0= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/30102] New: [gdb/tdep, amd64] Disable i386 unwinders Date: Thu, 09 Feb 2023 14:24:36 +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: minor 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=3D30102 Bug ID: 30102 Summary: [gdb/tdep, amd64] Disable i386 unwinders Product: gdb Version: HEAD Status: NEW Severity: minor Priority: P2 Component: tdep Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- As mentioned here ( https://sourceware.org/pipermail/gdb-patches/2023-February/196724.html ), f= or i386 we have these unwinders: ... $ gdb -q -batch -ex "set arch i386" -ex "maint info frame-unwinders" The target architecture is set to "i386". dummy DUMMY_FRAME dwarf2 tailcall TAILCALL_FRAME inline INLINE_FRAME i386 epilogue NORMAL_FRAME dwarf2 NORMAL_FRAME dwarf2 signal SIGTRAMP_FRAME i386 stack tramp NORMAL_FRAME i386 sigtramp SIGTRAMP_FRAME i386 prologue NORMAL_FRAME ... and for amd64: ... $ gdb -q -batch -ex "set arch i386:x86-64" -ex "maint info frame-unwinders" The target architecture is set to "i386:x86-64". dummy DUMMY_FRAME dwarf2 tailcall TAILCALL_FRAME inline INLINE_FRAME python NORMAL_FRAME amd64 epilogue NORMAL_FRAME i386 epilogue NORMAL_FRAME dwarf2 NORMAL_FRAME dwarf2 signal SIGTRAMP_FRAME amd64 sigtramp SIGTRAMP_FRAME amd64 prologue NORMAL_FRAME i386 stack tramp NORMAL_FRAME i386 sigtramp SIGTRAMP_FRAME i386 prologue NORMAL_FRAME ... So, why are the i386 unwinders there for amd64? I recently played around with disabling or moving the "amd64 epilogue" unwinder, and while investigating the effect of that, I came across a failu= re that was due to the "i386 epilogue" unwinder becoming active and giving the wrong answer, which suggest that the i386 unwinders shouldn't be there for amd64. Using this tentative patch: ... diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 580664d2ce5..8dccae633f7 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8613,7 +8613,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arc hes) appended to the list first, so that it supercedes the DWARF unwinder in function epilogues (where the DWARF unwinder currently fails). */ - frame_unwind_append_unwinder (gdbarch, &i386_epilogue_frame_unwind); + if (info.bfd_arch_info->bits_per_word =3D=3D 32) + frame_unwind_append_unwinder (gdbarch, &i386_epilogue_frame_unwind); /* Hook in the DWARF CFI frame unwinder. This unwinder is appended to the list before the prologue-based unwinders, so that DWARF @@ -8792,9 +8793,12 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *ar ches) tdep-> bnd0_regnum =3D -1; /* Hook in the legacy prologue-based unwinders last (fallback). */ - frame_unwind_append_unwinder (gdbarch, &i386_stack_tramp_frame_unwind); - frame_unwind_append_unwinder (gdbarch, &i386_sigtramp_frame_unwind); - frame_unwind_append_unwinder (gdbarch, &i386_frame_unwind); + if (info.bfd_arch_info->bits_per_word =3D=3D 32) + { + frame_unwind_append_unwinder (gdbarch, &i386_stack_tramp_frame_unwin= d); + frame_unwind_append_unwinder (gdbarch, &i386_sigtramp_frame_unwind); + frame_unwind_append_unwinder (gdbarch, &i386_frame_unwind); + } /* If we have a register mapping, enable the generic core file support, unless it has already been enabled. */ ... we have for i386 as before, and for amd64: ... $ gdb -q -batch -ex "set arch i386:x86-64" -ex "maint info frame-unwinders" The target architecture is set to "i386:x86-64". dummy DUMMY_FRAME=20=20=20=20=20 dwarf2 tailcall TAILCALL_FRAME=20=20 inline INLINE_FRAME=20=20=20=20 python NORMAL_FRAME=20=20=20=20 amd64 epilogue NORMAL_FRAME=20=20=20=20 dwarf2 NORMAL_FRAME=20=20=20=20 dwarf2 signal SIGTRAMP_FRAME=20=20 amd64 sigtramp SIGTRAMP_FRAME=20=20 amd64 prologue NORMAL_FRAME=20=20=20=20 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=