File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
lldb/source/Plugins/Language/CPlusPlus Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,16 @@ ValueObjectSP GenericOptionalFrontend::GetChildAtIndex(uint32_t _idx) {
117117 ValueObjectSP candidate = val_sp->GetChildMemberWithName (" _M_value" );
118118 if (candidate)
119119 val_sp = candidate;
120- } else if (m_stdlib == StdLib::MsvcStl)
121- // Same issue as with LibCxx
122- val_sp = m_backend.GetChildMemberWithName (" _Has_value" )
123- ->GetParent ()
124- ->GetChildAtIndex (0 )
125- ->GetChildMemberWithName (" _Value" );
120+ } else if (m_stdlib == StdLib::MsvcStl) {
121+ // PDB flattens anonymous unions to the parent
122+ val_sp = m_backend.GetChildMemberWithName (" _Value" );
123+ // With DWARF and NativePDB, same issue as with LibCxx
124+ if (!val_sp)
125+ val_sp = m_backend.GetChildMemberWithName (" _Has_value" )
126+ ->GetParent ()
127+ ->GetChildAtIndex (0 )
128+ ->GetChildMemberWithName (" _Value" );
129+ }
126130
127131 if (!val_sp)
128132 return ValueObjectSP ();
You can’t perform that action at this time.
0 commit comments