This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: more patches


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]