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: Saso Kiselkov
Subject: Re: Problem with ffi/forwardInvocation and exception handling on OpenSolaris
Date: Mon, 28 Jun 2010 12:59:24 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So if I understand correct, instead of doing an [exception raise], I
should call the _Unwind_Backtrace function below? I tried it and it
generated:

40157e:do_throw() in /export/home/diablos/excp_fail/obj/excp_fail

The libffi was compiled with -fexceptions, I just checked.

BR,
- --
Saso

On 06/28/2010 11:53 AM, David Chisnall wrote:
> 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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwogIcACgkQRO8UcfzpOHDpLgCgjEmWDMmR/vUmszoAF4v9f9qh
e1gAnjv5DUcCKuFUB2Z5+uLuOPzfRZxB
=DkDE
-----END PGP SIGNATURE-----



reply via email to

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