Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.51 diff -u -p -r1.51 linespec.c --- linespec.c 2 Aug 2003 03:59:40 -0000 1.51 +++ linespec.c 4 Sep 2003 18:42:38 -0000 @@ -997,15 +997,33 @@ locate_first_half (char **argptr, int *i break; } /* Check for the end of the first half of the linespec. End of - line, a tab, a double colon or the last single colon, or a - space. But if enclosed in double quotes we do not break on - enclosed spaces. */ + line, a tab, or a space. But if enclosed in double quotes we + do not break on enclosed spaces. */ + /* APPLE LOCAL: Break out checks for ":"s so we can handle ObjC + selector names with :'s correctly. */ if (!*p - || p[0] == '\t' - || ((p[0] == ':') - && ((p[1] == ':') || (strchr (p + 1, ':') == NULL))) - || ((p[0] == ' ') && !*is_quote_enclosed)) - break; + || p[0] == '\t' + || ((p[0] == ' ') && !*is_quote_enclosed)) + break; + + /* Check for the end of the first half of the linespec. + A double colon or the last single colon. */ + if (p[0] == ':') + { + /* Look for an Objective-C method name start after the colon + or after a quote mark after the colon. ObjC names can have + colons in the argument names. + e.g. filename.m:'-[classname selector:]' + rbreak_command () canonializes its matches like this. */ + int is_objc_method = is_objc_method_format (p + 1) || + ((p[1] == '\'' || p[1] == '"') && + is_objc_method_format (p + 2)); + if (p[1] == ':' || is_objc_method || strchr (p + 1, ':') == NULL) + { + break; + } + } + if (p[0] == '.' && strchr (p, ':') == NULL) { /* Java qualified method. Find the *last* '.', since the