From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7348A385841E; Fri, 20 Jan 2023 17:46:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7348A385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674236812; bh=4kNGvuK7uv3siA2vN3ODm2ojyr68Lug/KnyKujRyxbo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rUEzcZ5lbtlU6hxneDWRQDaPeWdOLF6Ms0ui6lrEM1k4SMLoGfiV4jYvWgLotqEvO OQcCK3oORiiHFdmFkXgqHM8N7M6yX5emBIjMfXqYHXchUNROYHjUQp6RyHcg9fLzVK UgGs3pb9Hs7suuylpPoFVLIEqzPxvBF5QiM0q5gk= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/30028] [gdb/tdep, x86_64] Epilogue unwinder preferred over dwarf unwinder based on gcc 4.4 Date: Fri, 20 Jan 2023 17:46:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: Message-ID: In-Reply-To: References: 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=3D30028 --- Comment #7 from Tom de Vries --- (In reply to Tom de Vries from comment #6) > (In reply to Tom de Vries from comment #5) > > So, maybe we should just flip the switch on the default assumption. >=20 > Like so: > ... > diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c > index 76e843ecc35..86e12b4304a 100644 > --- a/gdb/amd64-tdep.c > +++ b/gdb/amd64-tdep.c > @@ -2905,7 +2905,7 @@ amd64_stack_frame_destroyed_p > struct compunit_symtab *cust; >=20=20 > cust =3D find_pc_compunit_symtab (pc); > - if (cust !=3D NULL && cust->epilogue_unwind_valid ()) > + if (cust =3D=3D NULL || cust->epilogue_unwind_valid ()) > return 0; >=20=20 > if (target_read_memory (pc, &insn, 1)) > diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c > index 580664d2ce5..46ad2913788 100644 > --- a/gdb/i386-tdep.c > +++ b/gdb/i386-tdep.c > @@ -2222,7 +2222,7 @@ i386_stack_frame_destroyed_p > struct compunit_symtab *cust; >=20=20 > cust =3D find_pc_compunit_symtab (pc); > - if (cust !=3D NULL && cust->epilogue_unwind_valid ()) > + if (cust =3D=3D NULL || cust->epilogue_unwind_valid ()) > return 0; >=20=20 > if (target_read_memory (pc, &insn, 1)) > ... And likewise: ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 44b54f77de9..44e85ebcfe9 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -8484,7 +8484,15 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_la nguage) if (cu->has_loclist && gcc_4_minor >=3D 5) cust->set_locations_valid (true); - if (gcc_4_minor >=3D 5) + if (cu->producer =3D=3D nullptr) + /* In absence of producer information, optimistically assume that w= e're + not dealing with gcc < 4.5.0. */ + cust->set_epilogue_unwind_valid (true); + if (!producer_is_gcc (cu->producer, nullptr, nullptr)) + /* Not gcc. */ + cust->set_epilogue_unwind_valid (true); + else if (gcc_4_minor >=3D 5) + /* gcc >=3D 4.5.0. */ cust->set_epilogue_unwind_valid (true); cust->set_call_site_htab (cu->call_site_htab); ... --=20 You are receiving this mail because: You are on the CC list for the bug.=