int is_quote_enclosed;
int is_objc_method = 0;
char *saved_arg = *argptr;
+ /* If IS_QUOTED, the end of the quoted bit. */
+ char *end_quote = NULL;
if (not_found_ptr)
*not_found_ptr = 0;
*/
set_flags (*argptr, &is_quoted, &paren_pointer);
+ if (is_quoted)
+ end_quote = skip_quoted (*argptr);
/* Check to see if it's a multipart linespec (with colons or
periods). */
return values;
}
+ if (is_quoted)
+ *argptr = *argptr + 1;
+
/* Does it look like there actually were two parts? */
- if ((p[0] == ':' || p[0] == '.') && paren_pointer == NULL)
+ if (p[0] == ':' || p[0] == '.')
{
- if (is_quoted)
- *argptr = *argptr + 1;
-
/* Is it a C++ or Java compound data structure?
The check on p[1] == ':' is capturing the case of "::",
since p[0]==':' was checked above.
can return now. */
if (p[0] == '.' || p[1] == ':')
- return decode_compound (argptr, funfirstline, canonical,
- saved_arg, p, not_found_ptr);
+ {
+ if (paren_pointer == NULL)
+ return decode_compound (argptr, funfirstline, canonical,
+ saved_arg, p, not_found_ptr);
+ /* Otherwise, fall through to decode_variable below. */
+ }
+ else
+ {
+ /* No, the first part is a filename; set file_symtab to be that file's
+ symtab. Also, move argptr past the filename. */
- /* No, the first part is a filename; set file_symtab to be that file's
- symtab. Also, move argptr past the filename. */
+ file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed,
+ not_found_ptr);
- file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed,
- not_found_ptr);
+ /* Check for single quotes on the non-filename part. */
+ if (!is_quoted)
+ {
+ is_quoted = (**argptr
+ && strchr (get_gdb_completer_quote_characters (),
+ **argptr) != NULL);
+ if (is_quoted)
+ end_quote = skip_quoted (*argptr);
+ }
+ }
}
#if 0
/* No one really seems to know why this was added. It certainly
p = skip_quoted (*argptr + (((*argptr)[1] == '$') ? 2 : 1));
else if (is_quoted)
{
- p = skip_quoted (*argptr);
+ p = end_quote;
if (p[-1] != '\'')
error (_("Unmatched single quote."));
}
copy[p - *argptr - 1] = '\0';
copy++;
}
+ else if (is_quoted)
+ copy[p - *argptr - 1] = '\0';
while (*p == ' ' || *p == '\t')
p++;
*argptr = p;
"int foo::overloadfnarg.*\\(int arg, int \\(\\*foo\\) \\(int\\)\\).*" \
"list overloaded function with function ptr args - quotes around argument"
+# Test list with filename.
+
+gdb_test "list ${srcfile}:intToChar" "int intToChar.*"
+gdb_test "list ${srcfile}:intToChar(char)" "int intToChar.*"
+gdb_test "list ${srcfile}:'intToChar(char)'" "int intToChar.*"
+gdb_test "list '${srcfile}:intToChar(char)'" "int intToChar.*"
+
+# And with filename and namespace... which does not work.
+
+setup_kfail *-*-* gdb/11289
+gdb_test "list ${srcfile}:foo::overloadfnarg(int)" "int foo::overloadfnarg"
+
+setup_kfail *-*-* gdb/11289
+gdb_test "list ${srcfile}:'foo::overloadfnarg(int)'" "int foo::overloadfnarg"
+
# Now some tests to see how overloading and namespaces interact.
gdb_test "print overloadNamespace(1)" ".\[0-9\]* = 1"