This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/FreeBSDRemote] Introduce arm64 support
ClosedPublic

Authored by mgorny on Jan 23 2021, 2:56 PM.

Details

Summary

Introduce arm64 support in the FreeBSDRemote plugin. The code
is roughly based on Linux and reuses the same POSIX RegisterInfos
(but the buffers need to be a few bytes larger due to stricter struct
member alignment in FreeBSD structures -- luckily, they do not affect
the actual member offsets). It supports reading and writing
general-purpose and FPU registers. SVE and hardware watchpoint support
is missing due to the limitations of FreeBSD ptrace(2) API.

Diff Detail

Event Timeline

mgorny created this revision.Jan 23 2021, 2:56 PM
mgorny requested review of this revision.Jan 23 2021, 2:56 PM
mgorny updated this revision to Diff 319121.Jan 25 2021, 2:21 PM

Removed unused REG_CONTEXT_SIZE.

mgorny updated this revision to Diff 319562.Jan 27 2021, 7:01 AM

Remove unused copy-pasted class method declarations.

@clayborg please have a look!

Is this code used by lldb-server or the native Free BSD plug-in?

Is this code used by lldb-server or the native Free BSD plug-in?

lldb-server. We're aiming towards removing the native plug-in soon.

lldb-server. We're aiming towards removing the native plug-in soon.

To add a little background, the FreeBSD Foundation is funding this effort to move all FreeBSD targets to lldb-server; amd64 and arm64 are our primary targets of interest while other supported FreeBSD architectures (32-bit arm, 32- and 64-bit mips, 32- and 64-bit powerpc, 64-bit risc-v) are intended to be handled on a best-effort basis, depending in part on whether FreeBSD folks with an interest in those platforms are available to help test.

labath accepted this revision.Jan 31 2021, 5:50 AM

This looks fine to me (and sorry about the delay). There are some defensive checks that I think could be upgraded to asserts (or even deleted), but these are consistent with the other register contexts, so I am not going to make a fuss about it.

This revision is now accepted and ready to land.Jan 31 2021, 5:50 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2021, 10:52 AM