[Lldb-commits] [PATCH] D118794: [lldb][AArch64] Remove non-address bits from addresses passed to ptrace on Linux

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 2 07:52:40 PST 2022


DavidSpickett added a reviewer: omjavaid.
DavidSpickett added a comment.

Without this change any memory read/write of a pointer with a signature would fail. I found it trying to extend memory find and using a pointer with both a signature and a memory tag.

There's a couple of things I could do but not sure if worth it right now given that AArch64 Linux is the only user of this aside from Mac OS (which has debugserver so that may already be doing this). Those are:

- Sink the application of top byte ignore into NativeRegisterContextLinux_AArch64
- Raise the whole process up to NativeProcessProtocol

The latter would implement this logic for every NativeProcess at once but has the issues that:

- most won't have a named register like linux has, so we end up adding an OS specific branch anyway
- Many more functions at NativeProcessProtocol level take an address. The current way lets us fix the few ptrace calls all those member functions actually end up using.

Or in other words: this is a bit hacky but perhaps it should stay that way until it's more widely needed.

I also thought about fixing this from the lldb end but it seems logical to make the server act correctly even without having lldb clean the addresses up front. (though in a some cases, like memory tags, it will do but for its own reasons)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118794



More information about the lldb-commits mailing list