[Crash-utility] [PATCH] Use backtrace() instead of __builtin_return_address()

Dave Anderson anderson at redhat.com
Wed May 14 14:11:33 UTC 2008


Bernhard Walle wrote:
> Hi,
> 
> * Dave Anderson [2008-05-14 08:56]:
>> Thanks for digging into this.  I agree with you on all counts.
>>
>> One final question: does the remaining call to __builtin_return_address(0)
>> in tools.c:getbuf() fail in your configuration as well?
> 
> Yes. __builtin_return_address(0) works in all configurations and is
> also guaranteed to work with gcc. Only __builtin_return_address(n) with
> n > 0 makes problems when the frame pointer is omitted (which is the
> default with -O2).
> 

I'm confused -- you say it fails in your configuration, but then say that
passing an argument of 0 (like getbuf() does) works in all configurations.

Dave




More information about the Crash-utility mailing list