]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r332752: set kdb_why to "trap" when calling kdb_trap from trap_fatal
authoravg <avg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 3 May 2018 07:57:08 +0000 (07:57 +0000)
committeravg <avg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 3 May 2018 07:57:08 +0000 (07:57 +0000)
commitb2513454bcec911525ff0335f6135b9be2439b6d
tree1f9b3230049595698a07aac664f97154d3479177
parent418e79653fce96fd9aff90583a8acbacbe4cac92
MFC r332752: set kdb_why to "trap" when calling kdb_trap from trap_fatal

This will allow to hook a ddb script to "kdb.enter.trap" event.
Previously there was no specific name for this event, so it could only
be handled by either "kdb.enter.unknown" or "kdb.enter.default" hooks.
Both are very unspecific.

Having a specific event is useful because the fatal trap condition is
very similar to panic but it has an additional property that the current
stack frame is the frame where the trap occurred.  So, both a register
dump and a stack bottom dump have additional information that can help
analyze the problem.

I have added the event only on architectures that have trap_fatal()
function defined.  I haven't looked at other architectures.  Their
maintainers can add support for the event later.

Sample script:
kdb.enter.trap=bt; show reg; x/aS $rsp,20; x/agx $rsp,20

Note: changes to powerpc/aim/trap.c and powerpc/booke/trap.c are direct
changes.

Sponsored by: Panzura

git-svn-id: svn://svn.freebsd.org/base/stable/10@333205 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/amd64/amd64/trap.c
sys/i386/i386/trap.c
sys/powerpc/aim/trap.c
sys/powerpc/booke/trap.c
sys/sys/kdb.h