-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] Update dwim-print to support limited variable expression paths
`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
- Loading branch information
1 parent
a5af621
commit cce676f
Showing
5 changed files
with
76 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
C_SOURCES := main.c | ||
CXX_SOURCES := main.cpp | ||
|
||
include Makefile.rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
extern "C" int puts(const char *s); | ||
|
||
struct Structure { | ||
int number = 30; | ||
void f() { puts("break inside"); } | ||
}; | ||
|
||
struct Wrapper { | ||
Structure s; | ||
}; | ||
|
||
struct Opaque; | ||
|
||
int main(int argc, char **argv) { | ||
Structure s; | ||
Wrapper w; | ||
Wrapper *wp = &w; | ||
Opaque *opaque = (Opaque *)(void *)&s; | ||
puts("break here"); | ||
s.f(); | ||
return 0; | ||
} |