1832304 Members
2195 Online
110041 Solutions
New Discussion

__builtin_return_address

 
chenlf2010
New Member

__builtin_return_address

Does Anyone know print call stack with aCC,just like gcc __builtin_return_address
function.
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: __builtin_return_address

This function is only implemented for the current frame: __builtin_return_address(0)
And you'll need to compile with -Agcc/-Ag++.

You can also get it with inline assembly with:
#include
void *p = _Asm_get_rp();
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=4308e2f5bde02110e2f5bde02110275d6e10RCRD

If you want a stack trace you can call U_STACK_TRACE(3). Or do it yourself with unwind(5)