aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2018-01-21 23:23:34 -0500
committerJoel Brobecker <brobecker@adacore.com>2018-01-21 23:23:34 -0500
commitde4cb04a20782b817fc80b49bba83b43cf1cb85d (patch)
tree30df9238a88ea847645fafef7e7530572bb4b3b9
parenta9e408182d2faaed5c2457b68ea3276c719a590f (diff)
downloadgdb-de4cb04a20782b817fc80b49bba83b43cf1cb85d.zip
gdb-de4cb04a20782b817fc80b49bba83b43cf1cb85d.tar.gz
gdb-de4cb04a20782b817fc80b49bba83b43cf1cb85d.tar.bz2
Ada/DWARF: Assume the Ada compiler produces descriptive type attributes
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2read.c12
2 files changed, 8 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 095f657..6a5572f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2018-01-22 Joel Brobecker <brobecker@adacore.com>
+ * dwarf2read.c (need_gnat_info): Return nonzero if the cu's
+ language is Ada.
+
+2018-01-22 Joel Brobecker <brobecker@adacore.com>
+
* linespec.c (create_sals_line_offset): Remove code that preserved
the symtab_and_line's line number.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 215f331..96026a8 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -21816,15 +21816,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