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

Re: x86_64 unwinder in libgcc_s

2012-08-16 Thread Ian Lance Taylor
On Thu, Aug 16, 2012 at 1:10 AM, Dmitri Shubin s...@tbricks.com wrote: 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

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, cfa, *(void

Re: x86_64 unwinder in libgcc_s

2012-08-14 Thread Fumiaki Isoya
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, cfa, *(void

Re: x86_64 unwinder in libgcc_s

2012-08-14 Thread Andrew Haley
On 08/14/2012 09:44 AM, Dmitri Shubin wrote: Any thoughts on this? Or maybe it's wrong list for this question? You've already had an answer from Richard Henderson, who is probably the best-placed person to answer you. Please don't top-post. Andrew. On 07.08.2012 12:09, Dmitri Shubin wrote:

Re: x86_64 unwinder in libgcc_s

2012-08-14 Thread Ian Lance Taylor
On Tue, Aug 14, 2012 at 3:02 AM, Fumiaki Isoya iso...@gmail.com wrote: I know nothing about what IP, RA, CFA is, but how about asking Richard Stallman r...@gnu.org? He will probably answer where to write it. RMS hasn't worked on GCC since 1991. He would just refer the question back here.

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 stdio.h #include

Re: x86_64 unwinder in libgcc_s

2012-08-14 Thread Ian Lance Taylor
On Tue, Aug 14, 2012 at 6:14 AM, Dmitri Shubin s...@tbricks.com wrote: On 14.08.2012 14:18, Andrew Haley wrote: My question was: why I get wrong (from my pov) CFA value from GCC unwinder. I rewritten my small test. As one can see here in foo() I placed constant 0x1020304050 right after

Re: x86_64 unwinder in libgcc_s

2012-08-14 Thread Richard Henderson
On 08/14/2012 06:14 AM, Dmitri Shubin wrote: My question was: why I get wrong (from my pov) CFA value from GCC unwinder. While I'll agree that something looks fishy, we can't tell what. You don't actually know what the correct values are. You can guess that they're wrong, based on the curious

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 here, I need some

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 stdio.h #include stdint.h typedef struct _Unwind_Exception { uint64_t exclass; void

Re: x86_64 unwinder in libgcc_s

2012-08-06 Thread Richard Henderson
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. r~

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