public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-30028-4717-QsXPar4TKO@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30028-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30028

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
(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.
> 
> 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;
>  
>    cust = find_pc_compunit_symtab (pc);
> -  if (cust != NULL && cust->epilogue_unwind_valid ())
> +  if (cust == NULL || cust->epilogue_unwind_valid ())
>      return 0;
>  
>    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;
>  
>    cust = find_pc_compunit_symtab (pc);
> -  if (cust != NULL && cust->epilogue_unwind_valid ())
> +  if (cust == NULL || cust->epilogue_unwind_valid ())
>      return 0;
>  
>    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 >= 5)
        cust->set_locations_valid (true);

-      if (gcc_4_minor >= 5)
+      if (cu->producer == nullptr)
+       /* In absence of producer information, optimistically assume that we'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 >= 5)
+       /* gcc >= 4.5.0.  */
        cust->set_epilogue_unwind_valid (true);

       cust->set_call_site_htab (cu->call_site_htab);
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-01-20 17:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 14:06 [Bug tdep/30028] New: " vries at gcc dot gnu.org
2023-01-20 14:13 ` [Bug tdep/30028] " vries at gcc dot gnu.org
2023-01-20 14:23 ` vries at gcc dot gnu.org
2023-01-20 14:47 ` vries at gcc dot gnu.org
2023-01-20 16:02 ` vries at gcc dot gnu.org
2023-01-20 16:24 ` vries at gcc dot gnu.org
2023-01-20 16:43 ` vries at gcc dot gnu.org
2023-01-20 17:46 ` vries at gcc dot gnu.org [this message]
2023-01-21  7:49 ` vries at gcc dot gnu.org
2023-01-21  7:49 ` [Bug tdep/30028] [gdb/tdep, x86_64, i386] " vries at gcc dot gnu.org
2023-02-20 13:51 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30028-4717-QsXPar4TKO@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).