[Lldb-commits] [lldb] [lldb] Support DW_AT_address_class in DWARFASTParserClang (PR #230555)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Sun Oct 18 06:03:40 PDT 2026


================
@@ -946,6 +950,25 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
     }
   }
 
+  // A pointer with DW_AT_address_class points into a target address space
+  // (e.g. a GPU, DSP, or accelerator memory). Record it as an address-space
+  // qualifier on the pointee so value objects can map the pointer to a process
+  // address.
+  if (!clang_type && tag == DW_TAG_pointer_type && attrs.address_class != 0 &&
+      attrs.type.IsValid()) {
+    if (Type *pointee_type =
+            dwarf->ResolveTypeUID(attrs.type.Reference(), true)) {
----------------
Michael137 wrote:

Resolving the pointee type here would diverge from how we typically handle pointer types. Might be OK, but also means `DW_AT_address_class` affects the type completion path (and perhaps performance). Are *all* pointers annotated with an address class for the targets you're compiling? Or a small subset of them? Just want to gauage how much of a blast radius this has.

An alternative to this is how the `DW_AT_LLVM_ptrauth_` attributes are handled. There we stuff the attribute values into the `lldb_private::Type` payload. And then we add the ptrauth metadata onto the Clang type when we actually resolve the `CompilerType` (see usage of `AddPtrAuthModifier`).

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


More information about the lldb-commits mailing list