[Lldb-commits] [lldb] [lldb] Resolve ObjC property backing storage in dwim-print (PR #225204)

Piotr Jeremicz via lldb-commits lldb-commits at lists.llvm.org
Sun Oct 4 06:17:09 PDT 2026


================
@@ -7090,6 +7090,40 @@ TypeSystemClang::GetDirectNestedTypeWithName(lldb::opaque_compiler_type_t type,
   return CompilerType();
 }
 
+llvm::StringRef TypeSystemClang::GetPropertyBackingStorageName(
+    lldb::opaque_compiler_type_t type, llvm::StringRef property_name) {
+  if (!type || property_name.empty())
+    return llvm::StringRef();
+
+  CompilerType compiler_type(weak_from_this(), type);
+
+  CompilerType class_type;
+  if (IsObjCObjectPointerType(compiler_type, &class_type))
----------------
piotrekjeremicz wrote:

`GetAsObjCInterfaceDecl` only understands the interface type itself, not a pointer to it.

It does a `dyn_cast<ObjCObjectType>`. But the type of a local like `C *obj` is the pointer, so without stripping it the lookup returns null and the rewrite silently never fires.

Verified: `test_property_backing_storage` fails with the frame variable note missing, and p just falls back to expression.

https://github.com/llvm/llvm-project/pull/225204


More information about the lldb-commits mailing list