[Lldb-commits] [PATCH] D100515: [lldb] Add GetCodeAddressMask and GetDataAddressMask to Process
Jason Molenda via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 14 18:00:40 PDT 2021
jasonmolenda added a comment.
Thanks Jonas, I think this change to Process can cover
Omair's use case, where the number of bits are used hardcoded.
The Darwin use case were ProcessGDBRemote, DynamicLoaderDarwinKernel, and ProcessMachCore can all set the number of bits used in addressing programmatically, detected at runtime.
The firmware use case where people (often in a python script in a dSYM) can set the number of bits manually so it is correct in their environment, when the dynamic detection schemes are not available.
Justin's case where ptrace(PTRACE_GETREGSET) gets us a code and data address mask.
Canonicalizing them as masks in Process, accepting either form, and providing the value as a mask, should make it easy to use in the ABI plugins where we have a FixCodeAddress and FixDataAddress.
On Darwin, we use the same number of bits for both code and data, but given the way ptrace() behaves on Linux, I'm guessing this may not be the case everywhere. Should we store both masks, and add FixCodeAddress + FixDataAddress methods in the ABI's, Justin? What do you think?
The Darwin support can be adapted to this centralized scheme that Jonas has written easily. Everyone else OK with this?
I don't feel strongly about the method name. Justin used Process::GetPointerAuthenticationAddressMask which makes it sound specific to ARM v8.3 ptrauth. The ARM v8.5 MTE tagging might be another use case (or TBI as Omair has noted).
CHANGES SINCE LAST ACTION
More information about the lldb-commits