[Lldb-commits] [PATCH] D142792: Add SBValue::GetValueAsAddress(), strip off ptrauth, TBI, MTE bits on AArch64 systems

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 9 18:41:59 PST 2023


jasonmolenda planned changes to this revision.
jasonmolenda added a comment.

OK, I understand the objc testsuite failures.  ObjC has tagged pointers, where the address of an object is either a virtual address, or a big old bag of bits that can contain a small value, like instead of a pointer to an NSObject object, you'll have a uint64_t that can be decoded to represent a small integer value without existing in memory.  In `ValueObject::GetPointerValue()`, I clear non-addressable bits, which destroys the tagged pointer values.  In the apple internal version of this, we have some additional code that checks the clang type of the ValueObject to see if pointer auth is used for this type before we clear them.  But with TBI/MTE values, we need to clear it regardless of type.  The correct fix is to audit the objc type formatters for uses of ValueObject::GetPointerValue and have them fetch an unsigned value if there's any possibility of a tagged pointer being used, this is probably going to be a little bit of work.

This is specifically causing fails in TestDataFormatterObjCCF.py, TestDataFormatterObjCNSDate.py, TestDataFormatterObjCNSNumber.py, TestDataFormatterNSIndexPath.py, TestNSArraySynthetic.py, TestPrintObjectArray.py.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142792



More information about the lldb-commits mailing list