public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/symtab] Trust epilogue unwind info for unknown or non-gcc producer
@ 2023-02-20 11:20 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-02-20 11:20 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=868014341a7befe77468a87ef9d9da109cbf3c3c

commit 868014341a7befe77468a87ef9d9da109cbf3c3c
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Feb 20 12:20:14 2023 +0100

    [gdb/symtab] Trust epilogue unwind info for unknown or non-gcc producer
    
    Currently we only trust epilogue unwind info only for gcc >= 4.5.0.
    
    This has the effect that we don't trust epilogue unwind info for:
    - unknown producers (CU without DW_AT_producer attribute)
    - non-gcc producers (say, clang).
    
    Instead, only distrust epilogue unwind info only for gcc < 4.5.0.

Diff:
---
 gdb/dwarf2/read.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 11a2d3e7c9a..a5bc1d89a2d 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -6460,7 +6460,13 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language)
       if (cu->has_loclist && gcc_4_minor >= 5)
 	cust->set_locations_valid (true);
 
-      if (gcc_4_minor >= 5)
+      int major, minor;
+      if (cu->producer != nullptr
+	  && producer_is_gcc (cu->producer, &major, &minor)
+	  && (major < 4 || (major == 4 && minor < 5)))
+	/* Don't trust gcc < 4.5.x.  */
+	cust->set_epilogue_unwind_valid (false);
+      else
 	cust->set_epilogue_unwind_valid (true);
 
       cust->set_call_site_htab (cu->call_site_htab);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-20 11:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-20 11:20 [binutils-gdb] [gdb/symtab] Trust epilogue unwind info for unknown or non-gcc producer Tom de Vries

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).