From 2902f8e28b5d8e3c2bf4010c8bf495ae4bc98ff3 Mon Sep 17 00:00:00 2001 From: Hannes Domani Date: Fri, 1 Mar 2019 14:05:17 +0100 Subject: [PATCH 1/2] Don't expand typedefs for functions without arguments. --- gdb/linespec.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/gdb/linespec.c b/gdb/linespec.c index 0f2fcfdff0..b01afadd91 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -3899,6 +3899,23 @@ find_function_symbols (struct linespec_state *state, &info, state->search_pspace); } +static bool +is_simple_name (const char *name) +{ + do + { + if (name[0] == ':' && name[1] == ':') + name += 2; + if (*name == ':') + break; + while ((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z') + || (*name >= '0' && *name <= '9') || *name == '_') + name++; + } + while (name[0] == ':' && name[1] == ':'); + return *name == '\0'; +} + /* Find all symbols named NAME in FILE_SYMTABS, returning debug symbols in SYMBOLS and minimal symbols in MINSYMS. */ @@ -3910,7 +3927,9 @@ find_linespec_symbols (struct linespec_state *state, std::vector *symbols, std::vector *minsyms) { - std::string canon = cp_canonicalize_string_no_typedefs (lookup_name); + std::string canon; + if (!is_simple_name (lookup_name)) + canon = cp_canonicalize_string_no_typedefs (lookup_name); if (!canon.empty ()) lookup_name = canon.c_str (); -- 2.15.1.windows.2