Skip to content

Commit

Permalink
Add comments to r39808
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Mar 18, 2013
1 parent 357b8c0 commit ab31e97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vm_dump.c
Expand Up @@ -452,8 +452,13 @@ int backtrace (void **trace, int size) {
} }
return n; return n;
darwin_sigtramp: darwin_sigtramp:
/* darwin's bundled libunwind doesn't support signal trampoline */
{ {
ucontext_t *uctx; 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); unw_get_reg(&cursor, UNW_X86_64_RBX, &ip);
uctx = (ucontext_t *)ip; uctx = (ucontext_t *)ip;
unw_set_reg(&cursor, UNW_X86_64_RAX, uctx->uc_mcontext->__ss.__rax); unw_set_reg(&cursor, UNW_X86_64_RAX, uctx->uc_mcontext->__ss.__rax);
Expand All @@ -474,7 +479,7 @@ int backtrace (void **trace, int size) {
unw_set_reg(&cursor, UNW_X86_64_R15, uctx->uc_mcontext->__ss.__r15); unw_set_reg(&cursor, UNW_X86_64_R15, uctx->uc_mcontext->__ss.__r15);
ip = *(unw_word_t*)uctx->uc_mcontext->__ss.__rsp; ip = *(unw_word_t*)uctx->uc_mcontext->__ss.__rsp;
unw_set_reg(&cursor, UNW_REG_IP, ip); 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; trace[n++] = (void *)ip;
} }
while (unw_step(&cursor) > 0) { while (unw_step(&cursor) > 0) {
Expand Down

0 comments on commit ab31e97

Please sign in to comment.