]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Various fixes for the MIPS DDB stack unwinder.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 4 Dec 2020 20:14:25 +0000 (20:14 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 4 Dec 2020 20:14:25 +0000 (20:14 +0000)
commita1d505eabad931bf7e7953e5a11f3c48c3eedaee
treea658983970c467624129de7ec2756d49ea86ea6b
parent353ce816878c17e4367280f178d9cb521cc3d616
Various fixes for the MIPS DDB stack unwinder.

- Fix kernel stack unwinding end-of-function false-positive

  The kernel stack unwinder assumes that any jr $ra indicates the end
  of the current function. However, modern compilers generate code
  that contains jr $ra at various places inside the function.

- Handle LLD inter-function padding when looking for the start of a
  function.

- Use call site for symbol name/offset when unwinding

  Currently we use the return address, which will normally just give
  an output that's off by 8 from the actual call site.  However, for
  tail calls, this is particularly bad, as we end up printing the
  symbol name for the function that comes after the one that made the
  call.  Instead we should go back two instructions from the return
  address for the unwound program counter.

Submitted by:   arichardson (1, 2), jrtc27 (3)
Reviewed by: arichardson
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D27363
sys/mips/mips/db_trace.c