This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

__builtin_return_address and stacktraces on Alpha


Hi,
Sorry, if this is not directly gcc related, but i don't have any clue,
where else to look.
Since this is a compiler list there should be some people
with deeper knowledge of asm internals.

I want to port a prog from intel x86 to alpha.
This prog prints stack traces at runtime.

Up to now, it runs along the frame pointers and checks the return
address there to determine which functions called this one.

In the alpha asm manual, there is a remark, that there isn't something
like a frame pointer there, instead you must use .frame directives.
Unfortunately, they only tell me, that .frame is important for
stack traces, but not, how you can take advantage of its infos.
I don't have any clue, where the info of .frame gets to inside the executable.
Can you get it by a libbfd call or something like that?

I tried gcc's  __builtin_return_address(...), which works wonderful on x68,
but on alpha, you can only get the return address of this function, not
some of the functions further away (calls with args > 0 return nil).
So it seems, that gcc can't figure them out at compile time, but somehow
it should be possible at least at runtime, shouldn't it?

Does anybody have any URL's,  hints or functions, which do something like
that on alphas?

Thanks in advance for any help,
Martin.

PS: Could such a function be helpfull inside libgcc.a?
    (__builtin_return_address can only be called with const arguments)


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