From patchwork Thu Jul 3 06:09:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 1873 Received: (qmail 29093 invoked by alias); 3 Jul 2014 06:11:44 -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 29042 invoked by uid 89); 3 Jul 2014 06:11:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Jul 2014 06:11:36 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1X2aF3-0006QM-Qi from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 02 Jul 2014 23:11:33 -0700 Received: from SVR-ORW-FEM-06.mgc.mentorg.com ([147.34.97.120]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 2 Jul 2014 23:11:33 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.2.247.3; Wed, 2 Jul 2014 23:11:33 -0700 From: Yao Qi To: Subject: [PATCH 4/4] Fix gdb.trace/entry-values.exp for thumb mode Date: Thu, 3 Jul 2014 14:09:52 +0800 Message-ID: <1404367792-23234-5-git-send-email-yao@codesourcery.com> In-Reply-To: <1404367792-23234-1-git-send-email-yao@codesourcery.com> References: <1404367792-23234-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes We see some fails in gdb.trace/entry-values.exp in thumb mode (-mthumb -march={armv4t,armv7-a}). In thumb mode, the lsb of references to 'foo' and 'bar' in the assembly (produced by dwarf assember) is set, so the generated debug information is incorrect. This patch copies the approach used by [PATCH 4/4] Fix dw2-ifort-parameter.exp on PPC64 https://sourceware.org/ml/gdb-patches/2014-03/msg00202.html to introduce new labels 'foo_start' and 'bar_start' which are about the correct function address (without lsb set). This patch fixes these fails we've seen. This should also fix the fails on PPC64, but I didn't test. gdb/testsuite: 2014-07-02 Yao Qi * gdb.trace/entry-values.c: Define labels 'foo_start' and 'bar_start' at the beginning of functions 'foo' and 'bar' respectively. * gdb.trace/entry-values.exp: Use 'foo_start' and 'bar_start' instead of 'foo' and 'bar'. --- gdb/testsuite/gdb.trace/entry-values.c | 6 ++++++ gdb/testsuite/gdb.trace/entry-values.exp | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.trace/entry-values.c b/gdb/testsuite/gdb.trace/entry-values.c index 4f80eb0..11bb739 100644 --- a/gdb/testsuite/gdb.trace/entry-values.c +++ b/gdb/testsuite/gdb.trace/entry-values.c @@ -15,12 +15,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +asm (".section \".text\""); +asm (".balign 8"); +asm ("foo_start: .globl foo_start"); + int foo (int i, int j) { return 0; } +asm ("bar_start: .globl bar_start"); + int bar (int i) { diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp index f10ffa6..3ccb4d2 100644 --- a/gdb/testsuite/gdb.trace/entry-values.exp +++ b/gdb/testsuite/gdb.trace/entry-values.exp @@ -145,8 +145,8 @@ Dwarf::assemble $asm_file { foo_label: subprogram { {name foo} {decl_file 1} - {low_pc foo addr} - {high_pc "foo + $foo_length" addr} + {low_pc foo_start addr} + {high_pc "foo_start + $foo_length" addr} } { formal_parameter { {type :$int_label} @@ -163,8 +163,8 @@ Dwarf::assemble $asm_file { subprogram { {name bar} {decl_file 1} - {low_pc bar addr} - {high_pc "bar + $bar_length" addr} + {low_pc bar_start addr} + {high_pc "bar_start + $bar_length" addr} {GNU_all_call_sites 1} } { formal_parameter { @@ -173,7 +173,7 @@ Dwarf::assemble $asm_file { } GNU_call_site { - {low_pc "bar + $bar_call_foo" addr} + {low_pc "bar_start + $bar_call_foo" addr} {abstract_origin :$foo_label} } { # Faked entry values are reference to variables 'global1'