Let the unwinder handle faults during function prologues or epilogues.
authormarkj <markj@FreeBSD.org>
Tue, 21 Jul 2015 23:22:23 +0000 (23:22 +0000)
committermarkj <markj@FreeBSD.org>
Tue, 21 Jul 2015 23:22:23 +0000 (23:22 +0000)
commit825752c2e5da64b6d05edbaff1e98564e7d674a4
treee5e9283b09f56c0a2f01121708a046eabf630e15
parent0f1eab2023e1ad414373aabc266d58e7ab218c82
Let the unwinder handle faults during function prologues or epilogues.

The i386 and amd64 DDB stack unwinders contain code to detect and handle
the case where the first frame is not completely set up or torn down. This
code was accidentally unused however, since db_backtrace() was never called
with a non-NULL trap frame. This change fixes that.

Also remove get_rsp() from the amd64 code. It appears to have come from
i386, which needs to take into account whether the exception triggered a
CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64,
SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for
kernel-mode exceptions. As a result, we can also remove custom print
functions for these registers.

Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D2881
sys/amd64/amd64/db_trace.c
sys/i386/i386/db_trace.c