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)
Tue, Oct 29, 9:15 AM
Unknown Object (File)
Oct 6 2024, 9:45 PM
Unknown Object (File)
Oct 3 2024, 8:02 PM
Unknown Object (File)
Oct 1 2024, 7:17 PM
Unknown Object (File)
Sep 29 2024, 1:19 PM
Unknown Object (File)
Sep 28 2024, 1:09 AM
Unknown Object (File)
Sep 25 2024, 7:17 PM
Unknown Object (File)
Sep 25 2024, 10:48 AM
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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35923
Build 32812: arc lint + arc unit

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.