discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Problem with ffi/forwardInvocation and exception handling on OpenSol


From: David Chisnall
Subject: Re: Problem with ffi/forwardInvocation and exception handling on OpenSolaris
Date: Mon, 28 Jun 2010 10:53:38 +0100

On 28 Jun 2010, at 10:46, Saso Kiselkov wrote:

> How can I make sure that sysv.S is being used to generate the necessary
> DWARF data?


This one looks slightly different.  Presumably the error is in the the 
ffi_closure functions.  It would help debugging if, rather than throwing an 
exception, you could tell the unwind library to print a backtrace, and then see 
where it failed.  You can do this by defining this function:


static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c)
{
    void *ip = (void*)_Unwind_GetIP(context);
    Dl_info info;
    dladdr(ip, &info);
    printf("%p:%s() in %s\n", ip, info.dli_sname, info.dli_fname);
    return _URC_CONTINUE_UNWIND;
}

And then calling this:

_Unwind_Backtrace(trace, 0);

You will need to include dlfcn.h and also the unwind.h header for your platform 
(if you don't have one, grab the one from libunwind - the functions are in 
libgcc_s or similar, so you don't need any extra libraries).

Did you compile libffi with -fexceptions?  If not, then it may simply be that 
the trampoline function did not get unwind tables generated for it.

David

-- Send from my Jacquard Loom


reply via email to

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