diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp @@ -624,11 +624,17 @@ ValueObjectSP short_sp(dataval_sp->GetChildAtIndex(1, true)); if (!short_sp) return {}; - ValueObjectSP location_sp = short_sp->GetChildAtIndex( + + // After D128285, we need to access the size from a packed anonymous struct + ValueObjectSP packed_fields_sp = short_sp->GetChildAtIndex(0, true); + if (!packed_fields_sp) + return {}; + + ValueObjectSP location_sp = packed_fields_sp->GetChildAtIndex( (layout == eLibcxxStringLayoutModeDSC) ? 0 : 1, true); // After D125496, there is a flat layout. if (location_sp->GetName() == g_size_name) - location_sp = short_sp->GetChildAtIndex(3, true); + location_sp = short_sp->GetChildAtIndex(2, true); if (using_bitmasks) size = (layout == eLibcxxStringLayoutModeDSC) ? size_mode_value