Filter non-external static members from SBType::GetFieldAtIndex.
authorSigurur sgeirsson <siggi@alpheus.dev>
Mon, 9 May 2022 09:53:23 +0000 (11:53 +0200)
committerPavel Labath <pavel@labath.sk>
Mon, 9 May 2022 10:34:13 +0000 (12:34 +0200)
commitfc440f27cd50e48e1f9ebe6e56febe2823e59de4
tree07bfcad0d60c4096bd3dd9754a8448d5e5dd2a83
parentfef81131d92ef71f43640667b6fc88b241aebe50
Filter non-external static members from SBType::GetFieldAtIndex.

See [[ https://github.com/llvm/llvm-project/issues/55040 | issue 55040 ]] where static members of classes declared in the anonymous namespace are incorrectly returned as member fields from lldb::SBType::GetFieldAtIndex(). It appears that attrs.member_byte_offset contains a sentinel value for members that don't have a DW_AT_data_member_location.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D124409
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/test/Shell/SymbolFile/DWARF/x86/debug_static-member-anonymous-namespace.s [new file with mode: 0644]