[llvm] Supports viewing class member variables in lambda when using the vs debugger (PR #71564)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 19:44:35 PST 2023


================
@@ -2605,6 +2605,9 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {
       MemberBaseType = TypeTable.writeLeafType(BFR);
     }
     uint64_t MemberOffsetInBytes = MemberOffsetInBits / 8;
+    if (Ty->getName().find("<lambda") != std::string::npos) {
+      MemberName = "__this";
+    }
----------------
GkvJwa wrote:

Yeah, I debugged and saw that when parsing the AST the pdb information is generated. Add member information is also here

looking at the lambda function, its naming rules are as follows
https://github.com/llvm/llvm-project/blob/edd690b02e16e991393bf7f67631196942369aed/clang/lib/AST/MicrosoftMangle.cpp#L250-L255

Therefore, if want to modify the place where the information is generated, I don’t know if there is any other way to know that it is a lambda

https://github.com/llvm/llvm-project/pull/71564


More information about the llvm-commits mailing list