Index: lldb/source/Symbol/Variable.cpp =================================================================== --- lldb/source/Symbol/Variable.cpp +++ lldb/source/Symbol/Variable.cpp @@ -383,8 +383,12 @@ } break; default: { - static RegularExpression g_regex( - llvm::StringRef("^([A-Za-z_:][A-Za-z_0-9:]*)(.*)")); + // A variable name can be something like foo, foo::bar, foo::bar, + // ::foo, foo::bar, and more. Rather than trying to construct + // a perfect regex, which is almost certainly going to lead to some edge + // cases that we don't handle, let's just take everything until the first + // . operator or -> operator. + static RegularExpression g_regex("^([^.-]*)(.*)"); RegularExpression::Match regex_match(1); std::string variable_name; variable_list.Clear();