https://github.com/felipepiovezan updated 
https://github.com/llvm/llvm-project/pull/201578

>From 262b71b239f854d80ddaba06ebb82fb14d4d7a3f Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <[email protected]>
Date: Wed, 3 Jun 2026 09:36:32 +0100
Subject: [PATCH 1/2] [lldb] Use batched string reading in
 ClassDescriptorV2::ivar_t::Read

---
 .../AppleObjCClassDescriptorV2.cpp            | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
index 38481ff9e6cfd..ace0bac9a25b2 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
@@ -383,13 +383,20 @@ ClassDescriptorV2::ivar_t::Read(Process *process, 
lldb::addr_t addr) {
   result.m_alignment = extractor.GetU32_unchecked(&cursor);
   result.m_size = extractor.GetU32_unchecked(&cursor);
 
-  process->ReadCStringFromMemory(result.m_name_ptr, result.m_name, error);
-  if (error.Fail())
-    return error.takeError();
+  llvm::SmallVector<std::optional<std::string>> strs =
+      process->ReadCStringsFromMemory({result.m_name_ptr, result.m_type_ptr});
 
-  process->ReadCStringFromMemory(result.m_type_ptr, result.m_type, error);
-  if (error.Fail())
-    return error.takeError();
+  if (!strs[0])
+    return llvm::createStringErrorV(
+        "Failed to read ivar_t::m_name_str at address {0:x}",
+        result.m_name_ptr);
+  if (!strs[1])
+    return llvm::createStringErrorV(
+        "Failed to read ivar_t::m_type_str at address {0:x}",
+        result.m_type_ptr);
+
+  result.m_name = std::move(*strs[0]);
+  result.m_type = std::move(*strs[1]);
   return result;
 }
 

>From 66ecb0a6c9a57cec88fbc44422a2507642f3cc60 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <[email protected]>
Date: Mon, 8 Jun 2026 11:07:36 +0100
Subject: [PATCH 2/2] Update
 
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp

Co-authored-by: Jonas Devlieghere <[email protected]>
---
 .../ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
index ace0bac9a25b2..d1341f60f73b1 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
@@ -388,7 +388,7 @@ ClassDescriptorV2::ivar_t::Read(Process *process, 
lldb::addr_t addr) {
 
   if (!strs[0])
     return llvm::createStringErrorV(
-        "Failed to read ivar_t::m_name_str at address {0:x}",
+        "failed to read ivar_t::m_name_str at address {0:x}",
         result.m_name_ptr);
   if (!strs[1])
     return llvm::createStringErrorV(

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to