[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:54:21 PST 2023


GkvJwa wrote:

> > And how to add a test, which affects whether the debugger can recognize
> 
> In terms of test, I think you can add a test to check if the generated member name is "__this" using `llvm-pdbutil` and run check-llvm.

I tried to use the following code for testing(add some member variables):
```
class foo {
 public:
  void fun() {
    int aa = 1;
    int bb = 2;
    auto f = [=] {
      printf("%d %d\n", a, b);
	  printf("%d %d\n", aa, bb);
    };
    f();
  }
  ....
};
```
The information about other member variables was also modified to __this, which can also be parsed by the vs debugger

But should only modify the implicit this, so I added a check

---
In addition, I tried to use static lamdba and found that vs did not seem to support it, so I skipped overriding the variables here
https://github.com/llvm/llvm-project/blob/edd690b02e16e991393bf7f67631196942369aed/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp#L2575-L2585


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


More information about the llvm-commits mailing list