2008-05-13 Paul Pluzhnikov * linespec.c (locate_first_half): Rename to... (locate_first_half_1): ... this. (locate_first_half): New fn. Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.77 diff -u -p -u -r1.77 linespec.c --- linespec.c 3 May 2008 00:37:34 -0000 1.77 +++ linespec.c 13 May 2008 18:26:58 -0000 @@ -1002,7 +1002,7 @@ decode_indirect (char **argptr) at the end. */ static char * -locate_first_half (char **argptr, int *is_quote_enclosed) +locate_first_half_1 (char **argptr, int *is_quote_enclosed) { char *ii; char *p, *p1; @@ -1094,6 +1094,25 @@ locate_first_half (char **argptr, int *i return p; } +static char * +locate_first_half (char **argptr, int *is_quote_enclosed) +{ + char *p; + char *at = strrchr(*argptr, '@'); + if (at) + { + /* Could be "pthread_create@GLIBC_2.0", or + "pthread_create@@GLIBC_2.1". */ + if (*argptr < at - 1 && at[-1] == '@') + --at; + *at = '\0'; + } + p = locate_first_half_1 (argptr, is_quote_enclosed); + if (at) + *at = '@'; + return p; +} + /* Here's where we recognise an Objective-C Selector. An Objective C