[Lldb-commits] [lldb] [PAC][lldb][Dwarf] Support `__ptrauth`-qualified types in user expressions (PR #84387)

Daniil Kovalev via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 28 03:06:12 PDT 2024


================
@@ -664,6 +685,17 @@ CompilerType CompilerType::GetPointerType() const {
   return CompilerType();
 }
 
+CompilerType
+CompilerType::AddPtrAuthModifier(unsigned key, bool isAddressDiscriminated,
----------------
kovdan01 wrote:

> Also, whose this user of this API?

I've updated this PR with eecbb370d3d0257a5a4ffb644448219d41aa5426 which implements lazy resolve of ptrauth types. Since then, `CompilerType::AddPtrAuthModifier` is used in `Type::ResolveCompilerType`. So, this API is "indirectly" tested in DWARFASTParserClangTests.TestPtrAuthParsing unit test.

> Can we add an API test that tests this API? E.g., running `frame var`/`expr` on ptrauth types?

Probably later, when `__ptrauth` qualifier support in upstream llvm is more complete. As far as I see from existing API tests (e.g. API/lang/c/const_variables/TestConstVariables.py), we need to compile code with desired features first, and then run it under debugger and test stuff that we want to. Since the compiler does not seem to fully support `__ptrauth`-related features yet, implementing the corresponding API test does not currently seem viable.

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


More information about the lldb-commits mailing list