*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / objc-lang.c
index 280751fbf7e2c43710a15775b2c2066d6a899437..592b52e3ca2c25a39427b3dd624d3165893cd0f5 100644 (file)
@@ -743,19 +743,26 @@ selectors_info (char *regexp, int from_tty)
     {
       QUIT;
       name = SYMBOL_NATURAL_NAME (msymbol);
-      if (name &&
-        (name[0] == '-' || name[0] == '+') &&
-         name[1] == '[')               /* Got a method name.  */
+      if (name
+          && (name[0] == '-' || name[0] == '+')
+         && name[1] == '[')            /* Got a method name.  */
        {
          /* Filter for class/instance methods.  */
          if (plusminus && name[0] != plusminus)
            continue;
          /* Find selector part.  */
-         name = (char *) strchr(name+2, ' ');
+         name = (char *) strchr (name+2, ' ');
+         if (name == NULL)
+           {
+             complaint (&symfile_complaints, 
+                        _("Bad method name '%s'"), 
+                        SYMBOL_NATURAL_NAME (msymbol));
+             continue;
+           }
          if (regexp == NULL || re_exec(++name) != 0)
            { 
              char *mystart = name;
-             char *myend   = (char *) strchr(mystart, ']');
+             char *myend   = (char *) strchr (mystart, ']');
              
              if (myend && (myend - mystart > maxlen))
                maxlen = myend - mystart;       /* Get longest selector.  */
@@ -1214,6 +1221,8 @@ find_methods (struct symtab *symtab, char type,
          pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc,
                                                   &current_target);
 
+         objfile_csym++;
+
          if (symtab)
            if (pc < BLOCK_START (block) || pc >= BLOCK_END (block))
              /* Not in the specified symtab.  */
@@ -1230,8 +1239,6 @@ find_methods (struct symtab *symtab, char type,
          if (parse_method (tmp, &ntype, &nclass,
                            &ncategory, &nselector) == NULL)
            continue;
-      
-         objfile_csym++;
 
          if ((type != '\0') && (ntype != type))
            continue;
This page took 0.024187 seconds and 4 git commands to generate.