|Exception Handling email@example.com (David Jobet) (2002-07-21)|
|Re: Exception Handling firstname.lastname@example.org (VBDis) (2002-07-24)|
|Re: Exception Handling email@example.com (Casse Hugues) (2002-07-24)|
|Re: Exception Handling firstname.lastname@example.org (jacob navia) (2002-07-24)|
|Re: Exception Handling email@example.com (David Jobet) (2002-07-25)|
|Re: Exception Handling firstname.lastname@example.org (journeyman) (2002-08-04)|
|Re: Exception Handling email@example.com (Nick Maclaren) (2002-08-10)|
|Re: Exception Handling firstname.lastname@example.org (Marco van de Voort) (2002-08-10)|
|Re: Exception Handling email@example.com (Maxim Reznik) (2002-08-10)|
|Re: Exception Handling firstname.lastname@example.org.OZ.AU (Fergus Henderson) (2002-08-14)|
|Exception Handling email@example.com (Bernhard Tschirren) (1998-09-13)|
|[4 later articles]|
|From:||"David Jobet" <firstname.lastname@example.org>|
|Date:||25 Jul 2002 23:21:59 -0400|
|Organization:||Next generation market|
|Posted-Date:||25 Jul 2002 23:21:59 EDT|
Well, OK, this is all about getting the return address of the function being
called. As you mention, it's often something like
mov esp, ebp
However, my question was about predicting the PC address of a particular
line of code :
B b = new B();
f(); // may throw
// some code
f can throw an exception, I can in f (before longjumping to
someFunction's handler) get the return address (that will correspond
to f_addr in someFunction). The problem is in someFunction, I'd like
to have the PC address of f_addr.
In Visual C, it appears you can use the &f_addr notation to handle
this. However this is not true with ANSI C.
So my question is : is there a way (probably in assembly) to get the
address of a particular label (here f_addr) inside someFunction (I
will probably be able to get the return address in f)
Sorry for my precedent formulation, it was not clear enough.
jacob navia wrote:
>> Problem is I don't know how to get this return address in order to
>> produce the good case (here h_addr and f_addr).
>> Is there any way to get them using assembly ?
[I suspect you find that for any given compiler, there's some way to
do it, but you're unlikely to find anything portable beyond setjmp().
Return to the
Search the comp.compilers archives again.