[Lldb-commits] [PATCH] D100515: [lldb] Add GetCodeAddressMask and GetDataAddressMask to Process

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 15 11:05:08 PDT 2021


jasonmolenda added a comment.

In D100515#2690972 <https://reviews.llvm.org/D100515#2690972>, @omjavaid wrote:

> 



> This looks very good and I have couple of highlights to make from Linux/AArch64 perspective:
> qHostInfo is not sufficient for mask calculation on Linux because both data/code ptr auth masks are read by thread register context (both masks are currently same and they same for all the threads of a process).

Jonas was handling the Darwin case where debugserver returns the number of bits used in addressing in the qHostInfo packet here -- and we use the same value for both.  On Linux, we would want lldb-server to fetch the masks and send them up as well.  Given that they are fetched with ptrace(), it would make more sense to put these masks in the qProcessInfo response where we're attached to a process.  I think we always send that packet after we've launched/attached to something.

You would get masks, so those would be set in Process directly.

> IMO moving the mask calculation to ABI GetCodeAddress method may be a better option.

I believe Jonas still wants to have an ABI::FixCodeAddress and ABI::FixDataAddress (I'm still not SUPER thrilled with the name "Fix", but whatever, we can refine it easily if someone has a better suggestion that isn't super long).  But the Process will maintain the dynamically-determined masks and the user-specified override setting.  The ABI will get the current mask from Process when running these methods.

We're going to have the mask format be the canonical one in Process, so FixCodeAddress and FixDataAddress methods in ABI will get it in that form from Process.


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

https://reviews.llvm.org/D100515



More information about the lldb-commits mailing list