* symtab.c (symbol_find_demangled_name): Check for and demangle
authorAdam Fedor <fedor@gnu.org>
Tue, 29 Apr 2003 02:34:24 +0000 (02:34 +0000)
committerAdam Fedor <fedor@gnu.org>
Tue, 29 Apr 2003 02:34:24 +0000 (02:34 +0000)
ObjC symbols.
(symbol_init_demangled_name): Init for language_objc as well.

gdb/ChangeLog
gdb/Makefile.in
gdb/symtab.c

index 8753b2f6a9b4e15d6faccb0d1658f761e1513755..d7b46202395052c2e07eb9af975b93968e3c4957 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-28  Adam Fedor  <fedor@gnu.org>
+
+       * symtab.c (symbol_find_demangled_name): Check for and demangle
+       ObjC symbols.
+       (symbol_init_demangled_name): Init for language_objc as well.
+
 2003-04-28  Andrew Cagney  <cagney@redhat.com>
 
        * gdbarch.sh (DEPRECATED_TARGET_READ_FP): Replace TARGET_READ_FP.
index 7c582ff06de22418b3a0ec84093dde6e40f4d3ec..3707de27f96c8fa07ce5e46e9f4b930df9ce5b08 100644 (file)
@@ -2275,7 +2275,7 @@ symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
        $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \
        $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \
        $(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \
-       $(cp_abi_h) $(source_h) $(block_h)
+       $(cp_abi_h) $(source_h) $(block_h) $(objc_lang_h)
 target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \
        $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \
        $(gdb_wait_h) $(dcache_h) $(regcache_h)
index e144197d606b363fe4d29afa9a8517253f4677c6..2c46f9d67510d140fef909ba3dbd9b38be28529e 100644 (file)
@@ -40,6 +40,7 @@
 #include "linespec.h"
 #include "source.h"
 #include "filenames.h"         /* for FILENAME_CMP */
+#include "objc-lang.h"
 
 #include "hashtab.h"
 
@@ -459,6 +460,18 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
 
   if (gsymbol->language == language_unknown)
     gsymbol->language = language_auto;
+
+  if (gsymbol->language == language_objc
+      || gsymbol->language == language_auto)
+    {
+      demangled =
+       objc_demangle (mangled, 0);
+      if (demangled != NULL)
+       {
+         gsymbol->language = language_objc;
+         return demangled;
+       }
+    }
   if (gsymbol->language == language_cplus
       || gsymbol->language == language_auto)
     {
@@ -607,7 +620,8 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol,
 
   demangled = symbol_find_demangled_name (gsymbol, mangled);
   if (gsymbol->language == language_cplus
-      || gsymbol->language == language_java)
+      || gsymbol->language == language_java
+      || gsymbol->language == language_objc)
     {
       if (demangled)
        {
@@ -993,7 +1007,7 @@ lookup_symbol_aux (const char *name, const char *mangled_name,
     }
 #endif /* 0 */
 
-  /* C++: If requested to do so by the caller, 
+  /* C++/Java/Objective-C: If requested to do so by the caller, 
      check to see if NAME is a field of `this'. */
   if (is_a_field_of_this)
     {
@@ -1653,9 +1667,9 @@ find_main_psymtab (void)
    for now we don't worry about the slight inefficiency of looking for
    a match we'll never find, since it will go pretty quick.  Once the
    binary search terminates, we drop through and do a straight linear
-   search on the symbols.  Each symbol which is marked as being a C++
-   symbol (language_cplus set) has both the encoded and non-encoded names
-   tested for a match.
+   search on the symbols.  Each symbol which is marked as being a ObjC/C++
+   symbol (language_cplus or language_objc set) has both the encoded and 
+   non-encoded names tested for a match.
 
    If MANGLED_NAME is non-NULL, verify that any symbol we find has this
    particular mangled name.
This page took 0.032875 seconds and 4 git commands to generate.