Skip to content

[lldb] Use the static value in lldbutil.check_variable when use_dynam… #10547

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 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lldb/packages/Python/lldbsuite/test/lldbutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,8 @@ def check_variable(
valobj.IsDynamic(),
"dynamic value of %s is not dynamic" % (name if valobj else "<unknown>"),
)
else:
valobj = valobj.GetStaticValue()
Comment on lines +1582 to +1583

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this go upstream?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function doesn't exit upstream.

if use_synthetic:
valobj.SetPreferSyntheticValue(True)
if summary:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test(self):
b = frame.FindVariable("b")
self.assertFalse(b.IsValid())
d = frame.FindVariable("d")
lldbutil.check_variable(self, d, False, value='23')
lldbutil.check_variable(self, d, use_dynamic=True, value='23')

# The first breakpoint resolves to multiple locations, but only the
# first location is needed. Now that we've stopped, delete it to
Expand All @@ -46,4 +46,4 @@ def test(self):
self.assertTrue(b.IsValid())
self.assertGreater(b.unsigned, 0)
d = frame.FindVariable("d")
lldbutil.check_variable(self, d, False, value='23')
lldbutil.check_variable(self, d, use_dynamic=True, value='23')
2 changes: 1 addition & 1 deletion lldb/test/API/lang/swift/metatype/TestSwiftMetatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ def test_metatype(self):
var_p = frame.FindVariable("p")
lldbutil.check_variable(self, var_s, False, "String")
lldbutil.check_variable(self, var_c, False, "@thick a.D.Type")
lldbutil.check_variable(self, var_f, False, '@thick ((Int) -> Int).Type')
lldbutil.check_variable(self, var_f, True, '@thick ((Int) -> Int).Type')
lldbutil.check_variable(self, var_t, False, "(Int, Int, String)")
lldbutil.check_variable(self, var_p, False, "a.P")