aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-02-01 23:12:23 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-02-01 23:12:23 +0000
commitb06ead72a91c1af2a7b7cae87391e4401c6d4409 (patch)
tree1234c3262e2d4c4be393e83524e2cc168ccc7cbf /gdb/symtab.c
parent92273c8de8a5b0376e1d1106c6a4df4605240ae7 (diff)
downloadfsf-binutils-gdb-b06ead72a91c1af2a7b7cae87391e4401c6d4409.zip
fsf-binutils-gdb-b06ead72a91c1af2a7b7cae87391e4401c6d4409.tar.gz
fsf-binutils-gdb-b06ead72a91c1af2a7b7cae87391e4401c6d4409.tar.bz2
* symtab.c (symbol_set_names): Do not add an entry in the demangling
hash table for Ada symbols. Just store the linkage name as is, and leave the demangled_name as NULL.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 2e0a9b7..3912ebd 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -517,6 +517,24 @@ symbol_set_names (struct general_symbol_info *gsymbol,
if (objfile->demangled_names_hash == NULL)
create_demangled_names_hash (objfile);
+ if (gsymbol->language == language_ada)
+ {
+ /* In Ada, we do the symbol lookups using the mangled name, so
+ we can save some space by not storing the demangled name.
+
+ As a side note, we have also observed some overlap between
+ the C++ mangling and Ada mangling, similarly to what has
+ been observed with Java. Because we don't store the demangled
+ name with the symbol, we don't need to use the same trick
+ as Java. */
+ gsymbol->name = obstack_alloc (&objfile->objfile_obstack, len + 1);
+ memcpy (gsymbol->name, linkage_name, len);
+ gsymbol->name[len] = '\0';
+ gsymbol->language_specific.cplus_specific.demangled_name = NULL;
+
+ return;
+ }
+
/* The stabs reader generally provides names that are not
NUL-terminated; most of the other readers don't do this, so we
can just use the given copy, unless we're in the Java case. */