@@ -247,6 +247,29 @@ bool SwiftArraySliceBufferHandler::IsValid() {
247247 return m_first_elem_ptr != LLDB_INVALID_ADDRESS && m_elem_type.IsValid ();
248248}
249249
250+ size_t SwiftArrayInlineBufferHandler::GetCount () { return m_size; }
251+
252+ size_t SwiftArrayInlineBufferHandler::GetCapacity () { return GetCount (); }
253+
254+ lldb_private::CompilerType SwiftArrayInlineBufferHandler::GetElementType () {
255+ return m_elem_type;
256+ }
257+
258+ ValueObjectSP SwiftArrayInlineBufferHandler::GetElementAtIndex (size_t idx) {
259+ if (idx >= m_size)
260+ return {};
261+ return m_valobj_sp->GetChildAtIndex (idx);
262+ }
263+
264+ SwiftArrayInlineBufferHandler::SwiftArrayInlineBufferHandler (
265+ ValueObjectSP valobj, lldb::addr_t native_ptr, CompilerType elem_type)
266+ : m_valobj_sp(valobj),
267+ m_size(
268+ llvm::expectedToOptional (m_valobj_sp->GetNumChildren ()).value_or(0 )) {
269+ }
270+
271+ bool SwiftArrayInlineBufferHandler::IsValid () { return m_valobj_sp.get (); }
272+
250273size_t SwiftSyntheticFrontEndBufferHandler::GetCount () {
251274 return m_frontend->CalculateNumChildrenIgnoringErrors ();
252275}
@@ -395,6 +418,28 @@ SwiftArrayBufferHandler::CreateBufferHandler(ValueObject &static_valobj) {
395418 if (handler && handler->IsValid ())
396419 return handler;
397420 return nullptr ;
421+ } else if (valobj_typename.starts_with (" Swift.InlineArray<" )) {
422+ CompilerType elem_type (
423+ valobj.GetCompilerType ().GetArrayElementType (exe_scope));
424+ if (!elem_type)
425+ return nullptr ;
426+
427+ static ConstString g__storage (" _storage" );
428+ auto nonsynth_sp = valobj.GetNonSyntheticValue ();
429+ if (!nonsynth_sp)
430+ return nullptr ;
431+ ValueObjectSP storage_sp (nonsynth_sp->GetChildMemberWithName (g__storage));
432+
433+ lldb::addr_t storage_location =
434+ storage_sp->GetValueAsUnsigned (LLDB_INVALID_ADDRESS);
435+ if (auto process_sp = valobj.GetProcessSP ())
436+ if (auto *swift_runtime = SwiftLanguageRuntime::Get (process_sp))
437+ storage_location =
438+ swift_runtime->MaskMaybeBridgedPointer (storage_location);
439+ std::unique_ptr<SwiftArrayBufferHandler> handler;
440+ handler.reset (new SwiftArrayInlineBufferHandler (
441+ storage_sp, storage_location, elem_type));
442+ return handler;
398443 } else {
399444 // Swift.Array
400445 static ConstString g_buffer (" _buffer" );
0 commit comments