This revision was automatically updated to reflect the committed changes.
Closed by commit rGc08f61b45e3b: [lldb] Instantiate lazily named classes on 
macOS Ventura. (authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128306/new/

https://reviews.llvm.org/D128306

Files:
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp


Index: 
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
===================================================================
--- 
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ 
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -205,7 +205,7 @@
         {
             Class isa = realized_class_list[i];
             const char *name_ptr = objc_debug_class_getNameRaw(isa);
-            if (name_ptr == NULL)
+            if (!name_ptr)
                 continue;
             const char *s = name_ptr;
             uint32_t h = 5381;
@@ -239,6 +239,7 @@
     void free(void *ptr);
     size_t objc_getRealizedClassList_trylock(Class *buffer, size_t len);
     const char* objc_debug_class_getNameRaw(Class cls);
+    const char* class_getName(Class cls);
 }
 
 #define DEBUG_PRINTF(fmt, ...) if (should_log) printf(fmt, ## __VA_ARGS__)
@@ -278,7 +279,11 @@
         {
             Class isa = realized_class_list[i];
             const char *name_ptr = objc_debug_class_getNameRaw(isa);
-            if (name_ptr == NULL)
+            if (!name_ptr) {
+               class_getName(isa); // Realize name of lazy classes.
+               name_ptr = objc_debug_class_getNameRaw(isa);
+            }
+            if (!name_ptr)
                 continue;
             const char *s = name_ptr;
             uint32_t h = 5381;


Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
===================================================================
--- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -205,7 +205,7 @@
         {
             Class isa = realized_class_list[i];
             const char *name_ptr = objc_debug_class_getNameRaw(isa);
-            if (name_ptr == NULL)
+            if (!name_ptr)
                 continue;
             const char *s = name_ptr;
             uint32_t h = 5381;
@@ -239,6 +239,7 @@
     void free(void *ptr);
     size_t objc_getRealizedClassList_trylock(Class *buffer, size_t len);
     const char* objc_debug_class_getNameRaw(Class cls);
+    const char* class_getName(Class cls);
 }
 
 #define DEBUG_PRINTF(fmt, ...) if (should_log) printf(fmt, ## __VA_ARGS__)
@@ -278,7 +279,11 @@
         {
             Class isa = realized_class_list[i];
             const char *name_ptr = objc_debug_class_getNameRaw(isa);
-            if (name_ptr == NULL)
+            if (!name_ptr) {
+               class_getName(isa); // Realize name of lazy classes.
+               name_ptr = objc_debug_class_getNameRaw(isa);
+            }
+            if (!name_ptr)
                 continue;
             const char *s = name_ptr;
             uint32_t h = 5381;
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to