This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: more patches
- To: Philip Blundell <pb@nexus.co.uk>
- Subject: Re: more patches
- From: Zack Weinberg <zack@rabi.phys.columbia.edu>
- Date: Tue, 09 Jun 1998 09:36:34 -0400
- cc: libc-hacker@gnu.org
On Tue, 09 Jun 1998 13:58:54 +0100, Philip Blundell wrote:
>>We know the ranges of address space occupied by program code. We can
>>scan up the stack looking for numbers in those ranges. Those are very
>>likely to be return addresses. We report all those, and then weed out
>>false positives in backtrace_symbols by checking against the symbol
>>table. (It might not be necessary to bother; the programmer can
>>easily spot them.)
>>
>>That should make backtrace() not need frame pointers to work.
>
>I don't think this is a good idea. The most obvious thing that would confuse
>it is a local variable that's a function pointer.
Good point, but I still think it would be useful. If you know the
code you can tell that function X is not called at that point.
>We always say that if you build with -fomit-frame-pointer the resulting code
>will be undebuggable. It seems perfectly reasonable for this to apply to
>backtraces too.
I've never liked that restriction, especially on x86 where registers
are so scarce. Backtraces are likely to be useful in `production'
code (print backtrace on internal error, with request to mail to
author) where you wouldn't need full debuggability and might want the
speed benefits of -fomit-frame-pointer.
It can be an x86 specific hack if there are better ways on other
architectures.
zw