From patchwork Tue Apr 19 07:50:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 11800 Received: (qmail 86124 invoked by alias); 19 Apr 2016 07:50:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 85058 invoked by uid 89); 19 Apr 2016 07:50:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=eh_frame, Append, Hx-languages-length:1645, f77 X-HELO: mail-pf0-f174.google.com Received: from mail-pf0-f174.google.com (HELO mail-pf0-f174.google.com) (209.85.192.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 19 Apr 2016 07:50:42 +0000 Received: by mail-pf0-f174.google.com with SMTP id c20so4299168pfc.1 for ; Tue, 19 Apr 2016 00:50:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=l95czKqrP396Tm3p+7o7vDa/BnkVCQ+cif6xSHEeMb8=; b=X7deI8aJpTXjIOI/16T0QtlZrpUdspuXngYEvgSTJZbxGxP2APHeYgCS9AT8ehP09D +XoPcmh1avIKAwFsQ6sZeBtxSFrd1nnMJFOE51gfBCxa8aub9R9XZ8IelHFmooC5oZ4O lURXvKm5129K9M49IX7qLv3NIGzU96/icymm8SGp/hGpvdlk4kELDLhmjuBSc85nRlxy /ACr2q6Z/+5+JV97xaRtmZJj6/5QY76NtbKrvjIfET5b+hx+J0Vcko2ZO3/kP4K+Htwd o9s8Q6euZq73Lp9wbzyb1Rab3+2xJYf+rxyjxbmsvxi0US4iC7xlZwSfxxvrXkRhn/jo CtmA== X-Gm-Message-State: AOPr4FWCE8eekFAiaIb2YAwncHJIjhbZtQc4L+HGRDSlBnzPNfuPlLTBFW8zRcSF1zHUwg== X-Received: by 10.98.86.77 with SMTP id k74mr2114744pfb.28.1461052240458; Tue, 19 Apr 2016 00:50:40 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id p128sm10125574pfp.59.2016.04.19.00.50.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Apr 2016 00:50:39 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/2] Use -fno-asynchronous-unwind-tables if C program is compiled without debug info on x86 Date: Tue, 19 Apr 2016 08:50:19 +0100 Message-Id: <1461052220-10149-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1461052220-10149-1-git-send-email-yao.qi@linaro.org> References: <1461052220-10149-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes .eh_frame is added in default on x86 and x86_64 so that DWARF unwinder is always used, but prologue unwinders won't be used at all. IOW, prologue unwinders are not tested by regression tests. If the test is intended to compiled *without* debug info, we shouldn't generate any debug info (.eh_frame for example) at all. This patch is to disable async-unwind-tables generation if the C program is intended to compile without debug info on x86-like target. gdb/testsuite: 2016-04-18 Pierre Langlois Yao Qi PR gdb/19947 * lib/gdb.exp (gdb_compile): Append "additional_flags=-fno-asynchronous-unwind-tables" if C program is compiled without debug info on x86. --- gdb/testsuite/lib/gdb.exp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 0d8a3b0..5b789af 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3419,6 +3419,15 @@ proc gdb_compile {source dest type options} { set options [lreplace $options $nowarnings $nowarnings $flag] } + if {([lsearch -exact $options debug] == -1 + || [lsearch -exact $options nodebug] != -1) + && ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) + && ([lsearch -regexp $options {(c\+\+|ada|f77|f90)}] == -1) } { + # C program is intended to compile without debug information + # on x86 target. + lappend options "additional_flags=-fno-asynchronous-unwind-tables" + } + if { $type == "executable" } { if { ([istarget "*-*-mingw*"] || [istarget "*-*-*djgpp"]