[llvm] Supports viewing class member variables in lambda when using the vs debugger (PR #71564)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 9 23:29:59 PST 2023
https://github.com/GkvJwa updated https://github.com/llvm/llvm-project/pull/71564
>From 5575f62f92772c15dcf11fb2ec2da1a0f3fcee87 Mon Sep 17 00:00:00 2001
From: GkvJwa <gkvjwa at gmail.com>
Date: Wed, 8 Nov 2023 01:37:19 +0800
Subject: [PATCH] Supports viewing class member in lambda when using the vs
debugger
Use "__this" in DataMemberRecord, make vs debugger can be parsed normally
---
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 3a9d5fa3b936e0e..7d5a58a09eb8e99 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -2605,6 +2605,10 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {
MemberBaseType = TypeTable.writeLeafType(BFR);
}
uint64_t MemberOffsetInBytes = MemberOffsetInBits / 8;
+ if (Ty->getName().find("<lambda") != std::string::npos &&
+ MemberName == "this") {
+ MemberName = "__this";
+ }
DataMemberRecord DMR(Access, MemberBaseType, MemberOffsetInBytes,
MemberName);
ContinuationBuilder.writeMemberType(DMR);
More information about the llvm-commits
mailing list