]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r332752: set kdb_why to "trap" when calling kdb_trap from trap_fatal
authoravg <avg@FreeBSD.org>
Thu, 3 May 2018 07:47:03 +0000 (07:47 +0000)
committeravg <avg@FreeBSD.org>
Thu, 3 May 2018 07:47:03 +0000 (07:47 +0000)
commit60ce6f943f0956c28f5f2becc495ea9421a4fe02
tree70fbdf8dfadd94044a4c48b9cf31a48cbfec0dd2
parent9e24ade5fe773c0680a14d29f4599709c5911ff0
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

Sponsored by: Panzura
sys/amd64/amd64/trap.c
sys/i386/i386/trap.c
sys/powerpc/powerpc/trap.c
sys/sys/kdb.h