Page MenuHomeFreeBSD

ddb: add ability to print user registers
ClosedPublic

Authored by mhorne on Dec 21 2020, 8:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 9 2024, 12:30 PM
Unknown Object (File)
Feb 10 2024, 2:43 AM
Unknown Object (File)
Feb 10 2024, 2:43 AM
Unknown Object (File)
Feb 10 2024, 2:43 AM
Unknown Object (File)
Feb 10 2024, 2:43 AM
Unknown Object (File)
Feb 10 2024, 2:32 AM
Unknown Object (File)
Jan 18 2024, 7:15 PM
Unknown Object (File)
Dec 20 2023, 7:09 PM
Subscribers

Details

Summary

The debugger is always entered for the first time via breakpoint in
kdb_enter(). This means that the most recent trapframe will include
kernel state at the time of the breakpoint instruction, when often it is
desirable to the developer to view the contents of the previous
trapframe. This usually (always?) corresponds to the entry from
userspace.

I discovered that the ddb(4) man page claims this is already supported,
via the 'u' modifier to show registers. It may have been at one time,
but I found no evidence of this now, nor could I find exactly when it
might have been removed. Implement this in an architecture agnostic way,
by temporarily swapping out kdb_thread for the body of the db_show_regs
function.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/ddb/db_print.c
63

s/kdb_frame/kdb_thread/?

bcr added a subscriber: bcr.

OK from manpages.

It's a bit odd in that this doesn't always show user registers, but that is ok. It might be worth documenting that this really just shows the previous trap frame's registers.

This revision is now accepted and ready to land.Dec 30 2020, 10:17 PM

Fix typo, kdb_frame -> kdb_thread. Make it a little clearer that this is the
previous trapframe and not necissarily the user trapframe.

This revision now requires review to proceed.Jan 4 2021, 2:49 PM
This revision is now accepted and ready to land.Jan 4 2021, 3:13 PM
This revision was automatically updated to reflect the committed changes.