When stepping through tail-call restore stubs the debugger has to assume that rsp - 8 is the CFA, although it is not. This is because I did not explicitly add any .cfi directives. This patch adds them to the tail-call restore stubs, but this is new territory for me, so I would appreciate feedback.
I've reg-tested on x86_64, but I still need to test on Solaris and Darwin. OK to commit after those tests? Thanks, Daniel Signed-off-by: Daniel Santos <daniel.san...@pobox.com> --- libgcc/config/i386/resms64fx.h | 19 +++++++++++++++++++ libgcc/config/i386/resms64x.h | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/libgcc/config/i386/resms64fx.h b/libgcc/config/i386/resms64fx.h index c5f63d879fe..7dc8c7d89ed 100644 --- a/libgcc/config/i386/resms64fx.h +++ b/libgcc/config/i386/resms64fx.h @@ -34,21 +34,40 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .text MS2SYSV_STUB_BEGIN(resms64fx_17) +.cfi_startproc +.cfi_def_cfa %rbp, 16 mov -0x68(%rsi),%r15 +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64fx_16) +.cfi_startproc +.cfi_def_cfa %rbp, 16 mov -0x60(%rsi),%r14 +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64fx_15) +.cfi_startproc +.cfi_def_cfa %rbp, 16 mov -0x58(%rsi),%r13 +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64fx_14) +.cfi_startproc +.cfi_def_cfa %rbp, 16 mov -0x50(%rsi),%r12 +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64fx_13) +.cfi_startproc +.cfi_def_cfa %rbp, 16 mov -0x48(%rsi),%rbx +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64fx_12) +.cfi_startproc +.cfi_def_cfa %rbp, 16 mov -0x40(%rsi),%rdi SSE_RESTORE mov -0x38(%rsi),%rsi leaveq +.cfi_def_cfa %rsp, 8 ret +.cfi_endproc MS2SYSV_STUB_END(resms64fx_12) MS2SYSV_STUB_END(resms64fx_13) MS2SYSV_STUB_END(resms64fx_14) diff --git a/libgcc/config/i386/resms64x.h b/libgcc/config/i386/resms64x.h index 1b44938ae7c..753be1f4c52 100644 --- a/libgcc/config/i386/resms64x.h +++ b/libgcc/config/i386/resms64x.h @@ -33,23 +33,45 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .text MS2SYSV_STUB_BEGIN(resms64x_18) +.cfi_startproc +.cfi_def_cfa %r10, 8 mov -0x70(%rsi),%r15 +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64x_17) +.cfi_startproc +.cfi_def_cfa %r10, 8 mov -0x68(%rsi),%r14 +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64x_16) +.cfi_startproc +.cfi_def_cfa %r10, 8 mov -0x60(%rsi),%r13 +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64x_15) +.cfi_startproc +.cfi_def_cfa %r10, 8 mov -0x58(%rsi),%r12 +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64x_14) +.cfi_startproc +.cfi_def_cfa %r10, 8 mov -0x50(%rsi),%rbp +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64x_13) +.cfi_startproc +.cfi_def_cfa %r10, 8 mov -0x48(%rsi),%rbx +.cfi_endproc MS2SYSV_STUB_BEGIN(resms64x_12) +.cfi_startproc +.cfi_def_cfa %r10, 8 mov -0x40(%rsi),%rdi SSE_RESTORE mov -0x38(%rsi),%rsi mov %r10,%rsp +.cfi_def_cfa_register %rsp ret +.cfi_endproc MS2SYSV_STUB_END(resms64x_12) MS2SYSV_STUB_END(resms64x_13) MS2SYSV_STUB_END(resms64x_14) -- 2.15.0