 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Sally Guest
|
Posted: Thu Aug 04, 2005 8:26 am Post subject: Getting caller function's address |
|
|
During runtime, without Borland IDE, I would like to get the caller
function's address (or the exact address where the function was called
from), mainly so that my error popups can show not only the address of
the exception (which is often useless if in a low level function like
"lock" which is used for many things) but also the address of the
caller.
If I can crawl even further up the chain that would be great, but at
least 1 up the chain is enough for now.
|
|
| Back to top |
|
 |
Tales Aguiar Guest
|
Posted: Thu Aug 04, 2005 10:02 pm Post subject: Re: Getting caller function's address |
|
|
You can get this information examining the stack. But it's not easy because
the stack frame that sometimes are created.
The function that catch the exception always have stack frame, in this
function you can do it:
void *Caller;
asm
{
mov eax, [ebp+4]
mov Caller, eax
}
something like it. I don't test.
See http://www.codeproject.com/cpp/exceptionhandler.asp for more
information, this talk about handling exception and stack frame for VC. I
don't found nothing for borland.
Tales Aguiar
"Sally" <nospamforme (AT) spamme (DOT) com> wrote
| Quote: | During runtime, without Borland IDE, I would like to get the caller
function's address (or the exact address where the function was called
from), mainly so that my error popups can show not only the address of
the exception (which is often useless if in a low level function like
"lock" which is used for many things) but also the address of the
caller.
If I can crawl even further up the chain that would be great, but at
least 1 up the chain is enough for now.
|
|
|
| Back to top |
|
 |
tinyabs Guest
|
Posted: Fri Aug 05, 2005 5:47 am Post subject: Re: Getting caller function's address |
|
|
www.madshi.net - for Delphi and BCB
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|