Call into the ABI to fixup code addresses in RegisterContextUnwind. We need this in order to debug on Apple Silicon where libraries like libSystem are arm64e even when the inferior is arm64.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This looks good. Jonas, what do you think about having FixDataAddress() methods in the ABI's. We're going to be quickly sprinkling FixCodeAddress calls throughout lldb at places where Linux/Darwin ABI need them, and it'd be nice if we have the FixDataAddress method available (even if they're identical right now) so someone doesn't need to audit all the calls in the future and adjust them as appropriate.
Or we can go with FixCodeAddress and leave this for someone to do when it actually matters -- some people will probably pick the wrong call as we add them, so it's not going to work bug-free when such a system exists. I'm honestly fine with just landing this and leaving that work for when it would actually be exercised.
(the two cases I can think of, where you'd call FixDataAddress, on Darwin might be where we get the vtable pointer, and when a ptrauth qualifier has been added to a type by the user in their program.)
Yep, that all makes sense. I added the method and implemented both in terms of FixAddress (which takes a pc and a mask) allowing me to avoid the some of the code duplication.