Skip to content

[lldb] Update dwim-print to support limited variable expression paths #9677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kastiglione
Copy link

frame variable supports nested variable access, which the API calls "variable
expression paths". This change updates dwim-print to support a subset of supported
variable expression paths.

Consider the expression a->b. In C++, the arrow operator can be overloaded, and where
that is the case, expression evaluation must be used to evaluate it, not frame variable.
Likewise, the subscript operator can be overloaded.

To avoid those cases, this change introduces a limited support for variable expression
paths. Use of the dot operator is allowed.

Additionally, this change allows dwim-print to directly access children of this and
self (see AllowDirectIVarAccess). This functionality is also provided by the same
GetValueForVariableExpressionPath method.

rdar://104348908
(cherry picked from commit 1250a1d)

…llvm#117452)

`frame variable` supports nested variable access, which the API calls "variable
expression paths". This change updates `dwim-print` to support a subset of supported
variable expression paths.

Consider the expression `a->b`. In C++, the arrow operator can be overloaded, and where
that is the case, expression evaluation must be used to evaluate it, not frame variable.
Likewise, the subscript operator can be overloaded.

To avoid those cases, this change introduces a limited support for variable expression
paths. Use of the dot operator is allowed.

Additionally, this change allows `dwim-print` to directly access children of `this` and
`self` (see AllowDirectIVarAccess). This functionality is also provided by the same
`GetValueForVariableExpressionPath` method.

rdar://104348908
(cherry picked from commit 1250a1d)
@kastiglione kastiglione requested a review from a team as a code owner December 3, 2024 00:12
@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione kastiglione changed the title [lldb] Update dwim-print to support limited variable expression paths (#117452) [lldb] Update dwim-print to support limited variable expression paths Dec 5, 2024
@adrian-prantl adrian-prantl merged commit 99f0b04 into swift/release/6.1 Dec 11, 2024
3 checks passed
@adrian-prantl adrian-prantl deleted the dl/lldb-Update-dwim-print-to-support-limited-variable-expression-paths-117452 branch December 11, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants