From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84923 invoked by alias); 19 Jan 2018 23:25:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 84908 invoked by uid 89); 19 Jan 2018 23:25:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:3000, resms64fxh, cfi_endproc, H*F:D*pobox.com X-HELO: pb-smtp1.pobox.com Received: from pb-smtp1.pobox.com (HELO pb-smtp1.pobox.com) (64.147.108.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Jan 2018 23:25:51 +0000 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id E24D3CC457; Fri, 19 Jan 2018 18:25:49 -0500 (EST) Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id DA79DCC455; Fri, 19 Jan 2018 18:25:49 -0500 (EST) Received: from loudmouth.attlocal.net (unknown [76.215.41.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 0FAE7CC453; Fri, 19 Jan 2018 18:25:49 -0500 (EST) From: Daniel Santos To: gcc-patches , Uros Bizjak , Jason Merril , Cary Coutant Cc: Ian Lance Taylor Subject: [PATCH, x86, libgcc] PR target/83917 Correct debug for -mcall-ms2sysv-xlogues stubs Date: Fri, 19 Jan 2018 23:35:00 -0000 Message-Id: <20180119233310.19670-1-daniel.santos@pobox.com> X-Pobox-Relay-ID: 15515E70-FD70-11E7-BA0D-8EF31968708C-06139138!pb-smtp1.pobox.com X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg01782.txt.bz2 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 --- 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