help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crash when calling __builtin_return_address


From: Ulrich Lauther
Subject: Re: crash when calling __builtin_return_address
Date: Wed, 14 Jun 2006 22:32:51 +0000 (UTC)

Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> wrote:
: Ulrich Lauther <ulrich.lauther@siemens.com> writes:

: > on a AMD Opteron(tm) Processor 252 with gcc compiled for 
: > x86_64-unknown-linux-gnu my program crashes when __builtin_return_address()
: > is called.

: With what parameter?
: __builtin_return_address(0) should always work

the parameter was "3". I now tried to first call __builtin_frame_address()
and when that returns 0 to reduce the parameter. But then 
__builtin_frame_address crashes.


: With non-zero parameter, the work __builtin_return_address()
: has to do to work correctly (and not crash) is so complicated,
: that you should abandon all hope.

But it seems to work without optimization; and without problems on an Intel
processor and on Suns. I need it to store the program counter at the time
when a piece of memory is allocated for reporting later on memory leaks and
their origin in my memory manager.

Is there another reliable way to access the program counter?

-- 
        -lauther

[nosave]
----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens CT SE 6         Internet: Ulrich.Lauther@siemens.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]