* symtab.c (symbol_set_names): Do not add an entry in the demangling
authorJoel Brobecker <brobecker@gnat.com>
Fri, 1 Feb 2008 23:12:23 +0000 (23:12 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Fri, 1 Feb 2008 23:12:23 +0000 (23:12 +0000)
        hash table for Ada symbols. Just store the linkage name as is,
        and leave the demangled_name as NULL.

gdb/ChangeLog
gdb/symtab.c

index c5380b0aeda4ae970f98c450509a706b66540884..9adc41410ec690babd0179811ea756ad882a0af2 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-01  Joel Brobecker  <brobecker@adacore.com>
+
+       * 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.
+
 2007-02-01  Joel Brobecker  <brobecker@adacore.com>
 
        * dwarf2read.c (add_partial_symbol): Always store all Ada subprograms
index 2e0a9b7df199166834a9d43b87cc49c983ec7afa..3912ebd4fd187757856aa067b0655b6ae62deb98 100644 (file)
@@ -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.  */
This page took 0.029016 seconds and 4 git commands to generate.