[Lldb-commits] [lldb] [LLDB] Update DIL to pass current 'frame var' tests. (PR #145055)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 23 02:30:09 PDT 2025
================
@@ -178,11 +178,40 @@ ASTNodeUP DILParser::ParsePrimaryExpression() {
}
if (CurToken().Is(Token::l_paren)) {
- m_dil_lexer.Advance();
- auto expr = ParseExpression();
- Expect(Token::r_paren);
- m_dil_lexer.Advance();
- return expr;
+ // Check in case this is an anonynmous namespace
+ if (m_dil_lexer.LookAhead(1).Is(Token::identifier) &&
+ (m_dil_lexer.LookAhead(1).GetSpelling() == "anonymous") &&
+ m_dil_lexer.LookAhead(2).Is(Token::identifier) &&
+ (m_dil_lexer.LookAhead(2).GetSpelling() == "namespace") &&
+ m_dil_lexer.LookAhead(3).Is(Token::r_paren) &&
+ m_dil_lexer.LookAhead(4).Is(Token::coloncolon)) {
+ m_dil_lexer.Advance(4);
+
+ std::string identifier = "(anonymous namespace)";
+ Expect(Token::coloncolon);
+ // Save the source location for the diagnostics message.
+ uint32_t loc = CurToken().GetLocation();
+ m_dil_lexer.Advance();
+ assert(
+ (CurToken().Is(Token::identifier) || CurToken().Is(Token::l_paren)) &&
+ "Expected an identifier or anonymous namespeace, but not found.");
----------------
labath wrote:
No -- I don't think I am -- I just made lldb crash with this assertion.
https://github.com/llvm/llvm-project/pull/145055
More information about the lldb-commits
mailing list