[Lldb-commits] [PATCH] D91216: [lldb] [Process/FreeBSDRemote] Access GPR via reginfo offsets
Michał Górny via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 10 15:17:38 PST 2020
mgorny created this revision.
mgorny added reviewers: labath, emaste, krytarowski.
Herald added a subscriber: arichardson.
mgorny requested review of this revision.
Read and write registers from m_gpr using offsets from RegisterInfo
rather than explicit switch-case. This eliminates a lot of redundant
code, and avoids mistakes such as type mismatches seen recently (wrt
segment registers). The same logic will be extended to other register
sets in the future.
Make m_gpr an uint8_t std::array to ease accesses. Ideally, we could
avoid including <machine/reg.h> entirely in the future and instead
get the correct GPR size from Utility/RegisterContextFreeBSD_* somehow.
While at it, modify register set logic to use an explicit enum with
llvm::Optional<>, making the code cleaner and at the same time enabling
compiler warnings for unhandled sets.
Since now we're fully relying on 'struct GPR' defined
in Utility/RegisterContextFreeBSD_* being entirely in sync with
the system structure, add a bunch of static_asserts to verify
the field offsets and sizes. This also requires renaming 'struct dbreg'
in i386 context to 'struct DBR' (matching amd64) to avoid name
collisions with system headers.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 18887 bytes
Desc: not available
More information about the lldb-commits