I have a lambda that captures this
. When I debug it I have trouble seeing members of the captures object: if I do a p *this
, LLDB prints:
((anonymous class)) $1 = {
this = 0x17ebb62c
}
So apparently I have the lambda's class that contain only one member, which is the this
pointer it has captured. Seems legit, so I tried p this->this
and then it reports:
error: expected unqualified-id
I fear that LLDB is lost because this is both a keyword and a member of my anonymous class. Is that the case? What can I do to circumvent that?
Suppose the following code:
struct S
{
auto f() { return [this](){ return ++i; }; }
int i = 0;
};
I find it sometimes necessary to proceed in two passes:
> break S::f
> continue
...
> print *this
((anonymous class)) $1 = {
this = 0x17ebb62c
}
> print (S*)0x17ebb62c
S $2 = {
i = 0
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With