ruby-changes:27764
From: naruse <ko1@a...>
Date: Tue, 19 Mar 2013 02:40:19 +0900 (JST)
Subject: [ruby-changes:27764] naruse:r39816 (trunk): Add comments to r39808
naruse 2013-03-19 02:39:39 +0900 (Tue, 19 Mar 2013) New Revision: 39816 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39816 Log: Add comments to r39808 Modified files: trunk/vm_dump.c Index: vm_dump.c =================================================================== --- vm_dump.c (revision 39815) +++ vm_dump.c (revision 39816) @@ -452,8 +452,13 @@ int backtrace (void **trace, int size) { https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L452 } return n; darwin_sigtramp: + /* darwin's bundled libunwind doesn't support signal trampoline */ { ucontext_t *uctx; + /* get _sigtramp's ucontext_t and set values to cursor + * http://www.opensource.apple.com/source/Libc/Libc-825.25/i386/sys/_sigtramp.s + * http://www.opensource.apple.com/source/libunwind/libunwind-35.1/src/unw_getcontext.s + */ unw_get_reg(&cursor, UNW_X86_64_RBX, &ip); uctx = (ucontext_t *)ip; unw_set_reg(&cursor, UNW_X86_64_RAX, uctx->uc_mcontext->__ss.__rax); @@ -474,7 +479,7 @@ darwin_sigtramp: https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L479 unw_set_reg(&cursor, UNW_X86_64_R15, uctx->uc_mcontext->__ss.__r15); ip = *(unw_word_t*)uctx->uc_mcontext->__ss.__rsp; unw_set_reg(&cursor, UNW_REG_IP, ip); - trace[n++] = (void *)(unw_word_t)uctx->uc_mcontext->__ss.__rip; + trace[n++] = (void *)uctx->uc_mcontext->__ss.__rip; trace[n++] = (void *)ip; } while (unw_step(&cursor) > 0) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/