public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA/commit] Ada/DWARF: Assume the Ada compiler produces descriptive type attributes
@ 2018-01-10  7:25 Joel Brobecker
  2018-01-22  4:25 ` pushed: " Joel Brobecker
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Brobecker @ 2018-01-10  7:25 UTC (permalink / raw)
  To: gdb-patches

Hello,

GCC was enhanced in 2011 to generate this attribute, so I think we can
now assume that it is available when using that compiler. Doing so
allows us to speed up what we call "parallel type" lookups when
processing certain types encoded using the GNAT encoding.

This patch changes need_gnat_info to always expect those attributes
to be generated when the language is Ada. This is an assumption
that on the surfcace looks like it might be a bit on the edge; but
in practice, it should be OK because this is only useful in the
context of handling GNAT-specific encodings. Other Ada compilers
would presumably produce debugging information using pure DWARF
constructs, so would not be impacted by this.

gdb/ChangeLog:

        * dwarf2read.c (need_gnat_info): Return nonzero if the cu's
        language is Ada.

Tested on x86_64-linux.
I will commit in a week or so unless there are any comments...

Thank you,
-- 
Joel

---
 gdb/dwarf2read.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index dca2fe9..ad13d4b 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -21973,15 +21973,9 @@ die_type (struct die_info *die, struct dwarf2_cu *cu)
 static int
 need_gnat_info (struct dwarf2_cu *cu)
 {
-  /* FIXME: brobecker/2010-10-12: As of now, only the AdaCore version
-     of GNAT produces this auxiliary information, without any indication
-     that it is produced.  Part of enhancing the FSF version of GNAT
-     to produce that information will be to put in place an indicator
-     that we can use in order to determine whether the descriptive type
-     info is available or not.  One suggestion that has been made is
-     to use a new attribute, attached to the CU die.  For now, assume
-     that the descriptive type info is not available.  */
-  return 0;
+  /* Assume that the Ada compiler was GNAT, which always produces
+     the auxiliary information.  */
+  return (cu->language == language_ada);
 }
 
 /* Return the auxiliary type of the die in question using its
-- 
2.1.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* pushed: [RFA/commit] Ada/DWARF: Assume the Ada compiler produces descriptive type attributes
  2018-01-10  7:25 [RFA/commit] Ada/DWARF: Assume the Ada compiler produces descriptive type attributes Joel Brobecker
@ 2018-01-22  4:25 ` Joel Brobecker
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Brobecker @ 2018-01-22  4:25 UTC (permalink / raw)
  To: gdb-patches

> gdb/ChangeLog:
> 
>         * dwarf2read.c (need_gnat_info): Return nonzero if the cu's
>         language is Ada.

Now pushed, after re-testing on x86_64-linux.

Thanks,
-- 
Joel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-22  4:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10  7:25 [RFA/commit] Ada/DWARF: Assume the Ada compiler produces descriptive type attributes Joel Brobecker
2018-01-22  4:25 ` pushed: " Joel Brobecker

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