[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: crash when calling __builtin_return_address
From: |
Paul Pluzhnikov |
Subject: |
Re: crash when calling __builtin_return_address |
Date: |
Thu, 15 Jun 2006 09:49:21 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux) |
Ulrich Lauther <ulrich.lauther@siemens.com> writes:
> : If it's your own memory manager, just pass the info (e.g. file,
> : line) into the allocation routine(s).
>
> that simple solution doesn't help: it would indicate the source line in my
> memory manager (always the same),
Why? There is an entry point into your memory manager.
Pass file/line info to *it*.
> : Alternatively, compile with '-O2 -fno-omit-frame-pointer'
>
> I'll try that. Hopefully it can be done just for the part of the program
> involved.
To be able to unwind through your memory manager, all of its routines
must have a frame.
> If one would write a procedure in assembler, would that have easy access to
> the PC?
Which PC? The immediate caller is already accessible via
__builtin_return_address(0). All other PCs must be deduced using
unwind descriptors, so writing this in assembly doesn't gain you
anything.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.