diff options
| author | Dave Lee <davelee.com@gmail.com> | 2023-03-03 11:15:55 -0800 |
|---|---|---|
| committer | Dave Lee <davelee.com@gmail.com> | 2023-03-08 11:19:43 -0800 |
| commit | 6c599b1e9b7e1b57952565468aed2de16af21082 (patch) | |
| tree | e8c131fb25d031b2e9ab1a2500b9a2850cd3726a /lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp | |
| parent | ac763b9fdf5b8b6cc563b30c3fe90499f3706b13 (diff) | |
| download | llvm-6c599b1e9b7e1b57952565468aed2de16af21082.zip llvm-6c599b1e9b7e1b57952565468aed2de16af21082.tar.gz llvm-6c599b1e9b7e1b57952565468aed2de16af21082.tar.bz2 | |
[lldb] Let 'v' command directly access ivars of _any_ self/this
The `v` (`frame variable`) command can directly access ivars/fields of `this` or `self`.
Such as `v field`, instead of `v this->field`. This change relaxes the criteria for
finding `this`/`self` variables.
There are cases where a `this`/`self` variable does exist, but up to now the `v` command
has not made use of it. The user would have to explicitly run `v this->field` or
`self->_ivar` to access ivars. This change allows such cases to also work (without
explicitly dereferencing `this`/`self`).
A very common example in Objective-C (and Swift) is weakly capturing `self`:
```
__weak Type *weakSelf = self;
void (^block)(void) = ^{
Type *self = weakSelf; // Re-establish strong reference.
// `v _ivar` should work just as well as `v self->_ivar`.
};
```
In this case, `self` exists but `v` would not have used it. With this change, the fact
that a variable named `self` exists is enough for it to be used.
Differential Revision: https://reviews.llvm.org/D145276
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.cpp')
0 files changed, 0 insertions, 0 deletions
