Fix incomplete stack traces by gdb.
authorSimon Schubert <corecode@dragonflybsd.org>
Thu, 14 Feb 2008 00:24:24 +0000 (00:24 +0000)
committerSimon Schubert <corecode@dragonflybsd.org>
Thu, 14 Feb 2008 00:24:24 +0000 (00:24 +0000)
commit434ffe7d9d428d375626f00ae610cbd09da8d6ce
treeed3f012ecb5227430cc9e4806a320b4da6e2112a
parent64d68b44969b18b5e27c5b09c48c04b1eca27b75
Fix incomplete stack traces by gdb.

Gdb tries unwinding a stack frame by analyzing the function prologue.
If it can not find the beginning of the function, which happens for
stripped binaries, etc., it will resort to guessing.  It then assumes
that the function is a frame-less function without any local stack
variables.  This of course is wrong for almost all functions.

We work around this problem by assuming a valid stack frame.

Previous versions of gdb were broken the same way, but libbfd would
actually compensate with another bug which would simply report a wrong
function start address -- the address of a preceding, known function.
Because most functions indeed use a proper stack frame, this would
trick gdb into doing the unwinding properly.
contrib/gdb-6/gdb/i386-tdep.c