Page MenuHomeFreeBSD

trap_cfi(9): add assembly interface for powerpc
Needs ReviewPublic

Authored by mchoo on Sun, Sep 13, 6:19 PM.
Tags
None
Referenced Files
F171853347: D59651.diff
Mon, Sep 14, 2:19 AM
F171836623: D59651.diff
Sun, Sep 13, 10:43 PM
F171836551: D59651.id186621.diff
Sun, Sep 13, 10:43 PM
Subscribers

Details

Reviewers
jhb
jhibbits
adrian
Group Reviewers
PowerPC
Summary

MFC after: 2 weeks
MFC to: stable/14, stable/15
Sponsored by: FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76858
Build 73741: arc lint + arc unit

Event Timeline

mchoo requested review of this revision.Sun, Sep 13, 6:19 PM

ooo whats this do!

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)