Wrong value printed by info locals for dynamic object.
[deliverable/binutils-gdb.git] / gdb / objc-lang.c
index f3a8b7308fb3701ce3054e641cb38f396a605e7d..1731fa720120578a34559a1a31b911d5bda1f900 100644 (file)
@@ -1,6 +1,6 @@
 /* Objective-C language support routines for GDB, the GNU debugger.
 
-   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009
+   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    Contributed by Apple Computer, Inc.
@@ -343,7 +343,7 @@ objc_printchar (int c, struct type *type, struct ui_file *stream)
 static void
 objc_printstr (struct ui_file *stream, struct type *type,
               const gdb_byte *string, unsigned int length,
-              int force_ellipses,
+              const char *encoding, int force_ellipses,
               const struct value_print_options *options)
 {
   unsigned int i;
@@ -1178,6 +1178,16 @@ find_methods (struct symtab *symtab, char type,
 
          QUIT;
 
+         /* Check the symbol name first as this can be done entirely without
+            sending any query to the target.  */
+         symname = SYMBOL_NATURAL_NAME (msymbol);
+         if (symname == NULL)
+           continue;
+
+         if ((symname[0] != '-' && symname[0] != '+') || (symname[1] != '['))
+           /* Not a method name.  */
+           continue;
+
          /* The minimal symbol might point to a function descriptor;
             resolve it to the actual code address instead.  */
          pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc,
@@ -1188,14 +1198,7 @@ find_methods (struct symtab *symtab, char type,
              /* Not in the specified symtab.  */
              continue;
 
-         symname = SYMBOL_NATURAL_NAME (msymbol);
-         if (symname == NULL)
-           continue;
-
-         if ((symname[0] != '-' && symname[0] != '+') || (symname[1] != '['))
-           /* Not a method name.  */
-           continue;
-      
+         /* Now that thinks are a bit sane, clean up the symname.  */
          while ((strlen (symname) + 1) >= tmplen)
            {
              tmplen = (tmplen == 0) ? 1024 : tmplen * 2;
This page took 0.025855 seconds and 4 git commands to generate.