This is an archive of the discontinued LLVM Phabricator instance.

Fix SBValue::FindValue for file static variables
ClosedPublic

Authored by jingham on May 24 2023, 6:19 PM.

Details

Summary

This was just a thinko. The API StackFrame::GetVariableList takes a bool for "get_file_globals" which if true will also find file statics and file globals. But we only were passing that as true if the ValueType was eValueTypeVariableGlobal, which meant that we never find file statics. It's okay if we cast too wide a net when we do GetVariableList as later on we check against the ValueType to filter globals from statics.

There was a test that had a whole bunch of globals and tested FindValue on all of them, but had no statics. So I just made one of the globals a file static, which verifies the fix.

Diff Detail

Event Timeline

jingham created this revision.May 24 2023, 6:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 6:19 PM
jingham requested review of this revision.May 24 2023, 6:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 6:19 PM
This revision is now accepted and ready to land.May 24 2023, 6:24 PM
mib accepted this revision.May 25 2023, 4:09 PM

LGTM!

This revision was automatically updated to reflect the committed changes.