This is an archive of the discontinued LLVM Phabricator instance.

Use the `addressing_bits` kv in the stop packet from the remote stub, if present
ClosedPublic

Authored by jasonmolenda on May 3 2023, 5:35 PM.

Details

Summary

On an AArch64 system using pointer authentication, where lldb needs to disregard signing in the top bits, lldb needs to know how many bits are used for addressing (and therefore are significant). This is normally a fixed value, and can be communicated in the qHostInfo packet's addressing_bits kv pair.

On a firmware debug session with early startup code that is setting up the page tables, the value will change during the lifetime of the process. To support this correctly, the remote stub (a JTAG type debugger) can specify the current number of addressing bits in every stop packet, or include it in the stop packet when the value has changed. It's a bit of a specialized environment where this is needed -- for all user process debugging, the value will not change during the lifetime of the process.

This patch has lldb read the value from the stop packet and set the Process addressing masks if it is present.

Diff Detail

Event Timeline

jasonmolenda created this revision.May 3 2023, 5:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2023, 5:35 PM
jasonmolenda requested review of this revision.May 3 2023, 5:35 PM
bulbazord accepted this revision.May 3 2023, 5:52 PM

Makes sense to me!

This revision is now accepted and ready to land.May 3 2023, 5:52 PM
This revision was automatically updated to reflect the committed changes.