getting the adjusted object pointer

Richard Henderson rth at redhat.com
Sun Mar 4 09:54:07 UTC 2001


	struct A { int one; };
	struct B { int two; };
	struct C : public A, public B { };
	extern C c;
	int foo()
	{
	  try {
	    throw c;
	  } catch (const B &b) {
	    return b.two;
	  }
	}

It is clear that the handler should match.  It is also clear that a
pointer adjustment is required in initializing the user variable,
and that this adjusted pointer can be computed by the personality
routine.

What is not clear is how to get at this adjusted pointer.  If we
install this adjusted value in gr15, then we pass a effectively 
random value to __cxa_begin_catch, and it becomes very difficult
to manage the caughtExceptions stack.

The most obvious solution is to have __cxa_begin_catch receive the
unadjusted pointer (at __cxa_exception+1) and return the cached
adjustedPtr.  But in the current documents, __cxa_begin_catch 
returns void.

What is intended behaviour here?


r~




More information about the cxx-abi-dev mailing list