MFC after: 2 weeks
MFC to: stable/14, stable/15
Sponsored by: FreeBSD Foundation
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
No Test Coverage - Build Status
Buildable 76952 Build 73835: arc lint + arc unit
Event Timeline
Early in this year, I created a PR on lldb side that does trapframe unwinding similar to what KGDB does, but one contributors from Apple was against it. Instead, he suggested using CFI directives for unwinding special frames which is what Apple folks do for debugging Darwin. I thought it was a good idea because a) no major changes needed on LLDB side and b) this is more "standard" (DWARF) way of debugging across call frames.
I've tested trapframe unwinding on amd64 with fully CFI-patched kernel and lldb. It gives equivalent result to KGDB for backtrace and more accurate result for inspecting registers as KGDB displays some amd64 GPRs with values from earlier frames instead of marking them unavailable. I haven't tested the fully CFI-patched kernel for other architectures, but this revision only introduces necessary helpers and doesn't add anything to the kernel binary, so I think it's fine. If you want to see the full series of patches, see here. I'll upstream these once I finish all the tests (currently CFI looks fine on ELF inspection, but I need to run the kernels)
- trap_cfi(9): add assembly interface for powerpc
- trap_cfi(9): add exception handler CFI for powerpc
I could not open HPT mmu minidump through libkvm, so this hasn't been tested yet similar to armv7 (D59650)
Applying D59719 lets me extract and debug ppc64le dumps. I can confirm frame unwinding works. Ready for review.