]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ddb: add ability to print user registers
authormhorne <mhorne@FreeBSD.org>
Fri, 18 Dec 2020 20:06:46 +0000 (16:06 -0400)
committerMitchell Horne <mhorne@FreeBSD.org>
Fri, 8 Jan 2021 18:53:06 +0000 (14:53 -0400)
commit088a7eef95b1f1919fe6eee722a57c4d4e1e0656
tree10dcdbf82f79e5f5d0feafdc1ce4ab2cfbe4ea0d
parent52cd25eb1aa75a28f6d3c3eb4757242c1f55d6cc
ddb: add ability to print user registers

The debugger is always entered after some kind of kernel trap, often a
breakpoint in kdb_enter(). This means that the most recent trapframe
will include kernel state at the time of the trap, when often it is
desirable to the developer to view the contents of the previous
trapframe. This trapframe often corresponds to the entry from userspace.

The ddb(4) man page claims the ability to display user register state
via the 'u' modifier to `show registers`, but this appears untrue. It is
not obvious from a quick search of the history when this feature was
added, or when it was removed. (Re)implement this feature in
db_show_regs, noting that it is not necessarily populated with userspace
state.

Reviewed by: jhb (earlier version), markj, bcr (manpages)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27705
share/man/man4/ddb.4
sys/ddb/db_print.c