x86_64 unwinder in libgcc_s

2012-08-02 Thread Dmitri Shubin
Hello! I got strange problem in LuaJIT [1] stack unwinding on Solaris x64. If I build everything using GCC with unwinder from libgcc_s everything works fine. But when I try to use GCC-built libluajit.a in executable built using Sun Studio 12.2 with standard solaris unwinder from libc I got a cr

Re: x86_64 unwinder in libgcc_s

2012-08-06 Thread Dmitri Shubin
On 02.08.2012 20:05, Dmitri Shubin wrote: Hello! I got strange problem in LuaJIT [1] stack unwinding on Solaris x64. I wrote minimal test that reproduces the problem: $ cat main.c #include #include typedef struct _Unwind_Exception { uint64_t exclass; void (*excleanup)(int, struct

Re: x86_64 unwinder in libgcc_s

2012-08-07 Thread Dmitri Shubin
On 06.08.2012 21:13, Richard Henderson wrote: On 08/06/2012 08:23 AM, Dmitri Shubin wrote: char *cfa = (char *) _Unwind_GetCFA(ctx); printf("cfa = %p\nra = %p\n", cfa, *(void **)(cfa - 8)); Use _Unwind_GetIP here, for one. In fact I'm not interested in IP or RA he

Re: x86_64 unwinder in libgcc_s

2012-08-14 Thread Dmitri Shubin
Any thoughts on this? Or maybe it's wrong list for this question? On 07.08.2012 12:09, Dmitri Shubin wrote: On 06.08.2012 21:13, Richard Henderson wrote: On 08/06/2012 08:23 AM, Dmitri Shubin wrote: char *cfa = (char *) _Unwind_GetCFA(ctx); printf("cfa = %p\nra = %p\n&quo

Re: x86_64 unwinder in libgcc_s

2012-08-14 Thread Dmitri Shubin
On 14.08.2012 14:18, Andrew Haley wrote: You've already had an answer from Richard Henderson, who is probably the best-placed person to answer you. My question was: why I get wrong (from my pov) CFA value from GCC unwinder. I rewritten my small test. $ cat main.c #include #include typedef

Re: x86_64 unwinder in libgcc_s

2012-08-16 Thread Dmitri Shubin
On 14.08.2012 17:58, Ian Lance Taylor wrote: unwinder is right and libgcc_s one is wrong. I think the definition of _Unwind_GetCFA is ambiguous. It says "the value of %rsp at the call site in the previous frame." GCC is returning the value of %rsp at the point of the call to throw. Solaris is r