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

Dave Anderson anderson at redhat.com
Wed May 14 15:51:44 UTC 2008


Bernhard Walle wrote:
> 
> * Dave Anderson [2008-05-14 11:11]:
>> I suppose we could go with 5 instead of 4, and have dump_trace()
>> skip the first one, presuming that this anomoly is not architecture-
>> or compiler-dependent.  Or maybe make it macro?
> 
> Did you compile with some optimisation? I think I remember that gcc
> only inlines code with optimisation turned on.
> 

No -- the Makefile is used as is -- you're the one modifying things...  ;-)

> I think it makes sense to use
> 
> `always_inline'
>      Generally, functions are not inlined unless optimization is
>      specified.  For functions declared inline, this attribute inlines
>      the function even if no optimization level was specified.
> 
> here, i.e. __attribute__((always_inline)). I personally prefer inline
> functions over macros.
> 
> 
> 	Bernhard

Well, I don't have that personal preference, ;-) and after making it a macro,
it works as expected.  At least with the macro, I *know* what's going to
happen...

Dave




More information about the Crash-utility mailing list