[Lldb-commits] [PATCH] D155905: lldb RFC: Exposing set/get address masks, Fix*Address methods in SBProcess

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 27 01:24:03 PDT 2023


DavidSpickett added a comment.

> but I could imagine some harvard architecture target that behaved differently (surely this is why Linux has two address masks)

I'm not privy to the exact reasoning, but at least part of it comes from the architecture itself. You could have a target that enables top byte ignore and pointer authentication for data addresses, but only enables pointer authentication for code addresses. So ptrace will show you different values for the pointer authentication masks in that case. I'm not sure you can actually configure a kernel that way today, but it's viable.

For the debugger, the result is the same. When top byte ignore is off, pointer authentication just uses that free space for itself. We end up removing the same set of bits either way.

For very specific tools you might want to only remove pointer authentication bits. Making this up, but maybe you want to take pointers from a pointer authenticated ABI application and pass them to a shared library without those protections. Niche, but ptrace leaves the door open for that rather than breaking userspace later by adding it.

Finally, you are right that one day there may be some scheme that truly does need different handling for code and data and again, let's keep the door open for that up here in lldb (though such an architecture would be major surgery in lldb anyway).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155905



More information about the lldb-commits mailing list