This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/FreeBSDRemote] Introduce arm (32-bit) support
ClosedPublic

Authored by mgorny on Jan 29 2021, 1:24 PM.

Details

Summary

Introduce a NativeRegisterContextFreeBSD for 32-bit ARM platform.
This includes support for GPR + VFP registers as exposed by FreeBSD's
ptrace(2) API. Hardware breakpoints or watchpoints are not supported
due to missing kernel support. The code is roughly based on the arm64
context.

It also includes an override for GetSoftwareBreakpointTrapOpcode() based
on the matching code in the PlatformFreeBSD plugin.

Diff Detail

Event Timeline

mgorny created this revision.Jan 29 2021, 1:24 PM

Is this for lldb-server or for the ProcessFreeBSD.cpp?

What is missing in the FreeBSD kernel for support of HW breakpoints/watchpoints ?

Is this for lldb-server or for the ProcessFreeBSD.cpp?

lldb-server.

What is missing in the FreeBSD kernel for support of HW breakpoints/watchpoints ?

At the very least, fill_dbregs and set_dbregs are stubs. Were they to be implemented, it would probably make sense to change struct dbreg to be more like arm64. I don't know much additional code this will require.

Oki, I see, thanks for response. Please give me a few days to analyze (and eventually to implement).

Oki, I see, thanks for response. Please give me a few days to analyze (and eventually to implement).

Please also see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252860 ; it would probably make sense to wait to see how that develops.

Oki, I see, thanks for response. Please give me a few days to analyze (and eventually to implement).

Meanwhile, does this patch look fine as is? Hardware assisted watchpoints could be added in a follow up patch.

labath accepted this revision.Jan 31 2021, 5:54 AM
labath added inline comments.
lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h
88

I believe we don't put virtual on overridden methods..

This revision is now accepted and ready to land.Jan 31 2021, 5:54 AM
mgorny marked an inline comment as done.Jan 31 2021, 9:52 AM

Thanks for the review! Fixed the virtual and rebased, will test now and push if it still builds ;-).

lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h
88

Indeed we don't.

This revision was automatically updated to reflect the committed changes.
mgorny marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2021, 10:52 AM