Page MenuHomeFreeBSD

arm64: don't pass user trapframe to kdb_trap()
Needs ReviewPublic

Authored by mhorne on Dec 22 2020, 2:30 PM.
Tags
None
Referenced Files
F132966071: D27719.id81698.diff
Tue, Oct 21, 3:30 PM
F132966061: D27719.id.diff
Tue, Oct 21, 3:29 PM
F132912909: D27719.id81048.diff
Tue, Oct 21, 3:19 AM
Unknown Object (File)
Mon, Oct 20, 5:16 PM
Unknown Object (File)
Sat, Oct 18, 7:54 PM
Unknown Object (File)
Tue, Oct 7, 12:00 AM
Unknown Object (File)
Sun, Oct 5, 4:32 AM
Unknown Object (File)
Thu, Oct 2, 6:10 AM
Subscribers

Details

Summary

This effectively undoes the changes made in r321571. While useful, it is
inconsistent with how other architectures handle trapframes. This change
is required to get a working gdb(4) stub on arm64, as otherwise the
backtrace will begin one frame too early.

With D27705, this information can still be obtained via show registers/u.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35608
Build 32508: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Dec 30 2020, 9:23 PM
sys/arm64/arm64/trap.c
423

You need to remove this so the next instruction is executed

Remove the tf_elr manipulation.

This revision now requires review to proceed.Jan 5 2021, 9:39 PM
jrtc27 added inline comments.
sys/arm64/arm64/trap.c
423

Is it not now going to just return and immediately re-trap on the same breakpoint instruction?

sys/arm64/arm64/trap.c
423

For ddb, tf_elr is advanced by BKPT_SKIP in db_stop_at_pc. For gdb, the client advances the PC.

Previously this would have been applied to td->td_frame, not frame, hence the need for the manual increment here.

sys/arm64/arm64/trap.c
423

Ok thanks