-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLDB] Add field member operators to DIL #138093
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fe9ac0f
[LLDB] Add field member operators to DIL
cmtice 9c73725
Merge remote-tracking branch 'origin/main' into DIL-member-of
cmtice b3bf921
Remove special code for finding field members and rely entirely on
cmtice 4afffe9
Minor code cleanups:
cmtice a8eea48
- Remove code treating arrays as pointers.
cmtice 2abdab6
Merge remote-tracking branch 'origin/main' into DIL-member-of
cmtice 9e39777
Make fragile_ivar, check_ptr_vs_member and use_synthetic members
cmtice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
3 changes: 3 additions & 0 deletions
3
lldb/test/API/commands/frame/var-dil/basics/MemberOf/Makefile
This file contains hidden or 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,3 @@ | ||
CXX_SOURCES := main.cpp | ||
|
||
include Makefile.rules |
43 changes: 43 additions & 0 deletions
43
lldb/test/API/commands/frame/var-dil/basics/MemberOf/TestFrameVarDILMemberOf.py
This file contains hidden or 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,43 @@ | ||
""" | ||
Make sure 'frame var' using DIL parser/evaultor works for local variables. | ||
""" | ||
|
||
import lldb | ||
from lldbsuite.test.lldbtest import * | ||
from lldbsuite.test.decorators import * | ||
from lldbsuite.test import lldbutil | ||
|
||
import os | ||
import shutil | ||
import time | ||
|
||
class TestFrameVarDILMemberOf(TestBase): | ||
# If your test case doesn't stress debug info, then | ||
# set this to true. That way it won't be run once for | ||
# each debug info format. | ||
NO_DEBUG_INFO_TESTCASE = True | ||
|
||
def test_frame_var(self): | ||
self.build() | ||
lldbutil.run_to_source_breakpoint(self, "Set a breakpoint here", | ||
lldb.SBFileSpec("main.cpp")) | ||
|
||
self.expect("settings set target.experimental.use-DIL true", | ||
substrs=[""]) | ||
self.expect_var_path("s.x", value="1") | ||
self.expect_var_path("s.r", type="int &") | ||
self.expect_var_path("sr.x", value="1") | ||
self.expect_var_path("sr.r", type="int &") | ||
self.expect_var_path("sp->x", value="1") | ||
self.expect_var_path("sp->r", type="int &") | ||
|
||
self.expect("frame variable 'sp->foo'", error=True, | ||
substrs=["no member named 'foo' in 'Sx *'"]) | ||
|
||
self.expect("frame variable 'sp.x'", error=True, | ||
substrs=["member reference type 'Sx *' is a " | ||
"pointer; did you mean to use '->'"]) | ||
|
||
# Test for record typedefs. | ||
self.expect_var_path("sa.x", value="3") | ||
self.expect_var_path("sa.y", value="'\\x04'") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we discussed this (briefly) at one of the previous PRs, and I think the conclusion was that things like these should be a property of the interpreter rather than of a specific node.
I can sort of imagine a world some parts of an expression are evaluated using dynamic types and some aren't, but I don't think it's your intention to create that world. (And if it is, then these properties (at least some of them), should be other nodes as well, as e.g.
[]
also needs to know whether it should be looking at synthetic children).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.