From 2f2c677e670063360cbb3fb1b32bd6cf36bcf03a Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Thu, 24 Feb 2022 16:42:22 -0800 Subject: Move find_toplevel_char to cp-support.[ch] find_toplevel_char is being used more and more outside of linespec.c, so this patch moves it into cp-support.[ch]. --- gdb/linespec.c | 77 ---------------------------------------------------------- 1 file changed, 77 deletions(-) (limited to 'gdb/linespec.c') diff --git a/gdb/linespec.c b/gdb/linespec.c index 707a3a2..4d41f74 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1298,83 +1298,6 @@ find_methods (struct type *t, enum language t_lang, const char *name, superclasses->push_back (TYPE_BASECLASS (t, ibase)); } -/* Find an instance of the character C in the string S that is outside - of all parenthesis pairs, single-quoted strings, and double-quoted - strings. Also, ignore the char within a template name, like a ',' - within foo, while considering C++ operator') && depth > 0) - depth--; - else if (*scan == 'o' && !quoted && depth == 0) - { - /* Handle C++ operator names. */ - if (strncmp (scan, CP_OPERATOR_STR, CP_OPERATOR_LEN) == 0) - { - scan += CP_OPERATOR_LEN; - if (*scan == c) - return scan; - while (isspace (*scan)) - { - ++scan; - if (*scan == c) - return scan; - } - if (*scan == '\0') - break; - - switch (*scan) - { - /* Skip over one less than the appropriate number of - characters: the for loop will skip over the last - one. */ - case '<': - if (scan[1] == '<') - { - scan++; - if (*scan == c) - return scan; - } - break; - case '>': - if (scan[1] == '>') - { - scan++; - if (*scan == c) - return scan; - } - break; - } - } - } - } - - return 0; -} - /* The string equivalent of find_toplevel_char. Returns a pointer to the location of NEEDLE in HAYSTACK, ignoring any occurrences inside "()" and "<>". Returns NULL if NEEDLE was not found. */ -- cgit v1.1