Date: Sun, 18 Jun 2006 12:07:00 +0000 (UTC) From: Yar Tikhiy <yar@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/i386/i386 db_trace.c trap.c Message-ID: <200606181207.k5IC70Xl002796@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
yar 2006-06-18 12:07:00 UTC FreeBSD src repository Modified files: sys/i386/i386 db_trace.c trap.c Log: The i386 "call" instruction works as follows: it pushes the return address on the stack and only then "dereferences" %pc. Therefore, in the case of a call to an invalid address, we arrive to the trap handler with the invalid value in tf_eip. This used to prevent db_backtrace() from assigning the most recent and interesting frame on the stack to the right spot in the right function, from which the invalid call was attempted. Try to detect and work around that by recovering the return address from the stack. The work-around requires the fault address be passed to db_backtrace(). Smuggle it as tf_err. MFC after: 1 month Sponsored by: RiNet (Cronyx Plus LLC) Revision Changes Path 1.73 +25 -3 src/sys/i386/i386/db_trace.c 1.290 +3 -0 src/sys/i386/i386/trap.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606181207.k5IC70Xl002796>