This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: Exception propagation ffi_call
- From: Andrew Haley <aph at redhat dot com>
- To: libffi-discuss at sourceware dot org
- Date: Sat, 09 Jun 2012 16:25:58 +0100
- Subject: Re: Exception propagation ffi_call
- References: <2C3F779D-D5C0-4B27-A10A-E3C953F4F7C5@me.com>
On 06/09/2012 10:58 AM, Pascal Vantrepote wrote:
> Hi,
>
> I am using libffi for an Objective-c Application framework that I am writing. It seems the exception are getting lost in the ffi_call.
>
> This is my source:
>
> void clothureMethod(ffi_cif *cif, void* ret, void* args[], void* userData) {
> @try {
> for (id<IMessageBeforeAdvice> advice in beforeAdvices) {
> [advice beforeInvocation:methodName
> withTarget:(__bridge id)target];
> }
>
> ffi_call(cif, FFI_FN(originalImplementation), ret, args);
>
> for (id<IMessageAfterAdvice> advice in afterAdvices) {
> [advice afterInvocation:methodName
> withTarget:(__bridge id)target];
> }
> }
> @catch (NSException* exception) {
> for (id<IMessageExceptionAdvice> advice in exceptionAdvices) {
> [advice exception:exception
> duringInvocation:methodName
> withTarget:(__bridge id)target];
> }
> }
> @finally {
> }
> }
>
> Let me know if I am doing something wrong.
Probably not. It sometimes happens that there isn't sufficient information
to unwind through the asm portion of ffi_call. I think you'd have to debug
libffi to know for sure. What target is this?
Andrew.