From patchwork Mon Dec 29 07:41: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: 4451 Received: (qmail 9735 invoked by alias); 29 Dec 2014 07:42:40 -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 9721 invoked by uid 89); 29 Dec 2014 07:42:38 -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, RCVD_IN_DNSWL_NONE, SPF_PASS 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; Mon, 29 Dec 2014 07:42:36 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1Y5UyH-0003YJ-LW from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Sun, 28 Dec 2014 23:42:33 -0800 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.3.224.2; Sun, 28 Dec 2014 23:42:32 -0800 From: Yao Qi To: Subject: [OBV] Clean up gdb.trace/entry-values.exp Date: Mon, 29 Dec 2014 15:41:52 +0800 Message-ID: <1419838912-8732-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes This patch is to clean up gdb.trace/entry-values.exp as a preparation of the next patch. It updates the comments to reflect the code. One DIE generated in dwarf assembler is GNU_call_site { {low_pc "$bar_start + $bar_call_foo" addr} {abstract_origin :$foo_label} the DW_AT_low_pc attribute is the return address after the call, so I rename variable bar_call_foo to returned_from_foo. It is obvious, and I've pushed it in. gdb/testsuite: 2014-12-29 Yao Qi * gdb.trace/entry-values.exp: Update comments. Rename variable bar_call_foo to returned_from_foo. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.trace/entry-values.exp | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1f08d80..b8cfe33 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-29 Yao Qi + + * gdb.trace/entry-values.exp: Update comments. Rename variable + bar_call_foo to returned_from_foo. + 2014-12-20 Mihail-Marian Nistor PR gdb/17394 diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp index 1b4d5cd..6bb0514 100644 --- a/gdb/testsuite/gdb.trace/entry-values.exp +++ b/gdb/testsuite/gdb.trace/entry-values.exp @@ -26,16 +26,16 @@ if {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \ return -1 } -# Start GDB and load object file, compute the function length and -# the offset of branch instruction in function. They are needed -# in the Dwarf Assembler below. +# Start GDB and load object file, compute the offset of the +# instruction in bar returned from foo. It is needed in the Dwarf +# Assembler. gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile}1.o -set bar_call_foo "" +set returned_from_foo "" if { [istarget "arm*-*-*"] || [istarget "aarch64*-*-*"] } { set call_insn "bl" @@ -47,18 +47,18 @@ if { [istarget "arm*-*-*"] || [istarget "aarch64*-*-*"] } { set call_insn "call" } -# Calculate the offset of the instruction bar calls foo. +# Calculate the offset of the instruction in bar returned from foo. set test "disassemble bar" gdb_test_multiple $test $test { -re ".*$hex <\\+$decimal>:\[ \t\]+$call_insn\[^\r\n\]+\r\n\[ \]+$hex <\\+($decimal)>:.*$gdb_prompt $" { - set bar_call_foo $expect_out(1,string) + set returned_from_foo $expect_out(1,string) } -re ".*$gdb_prompt $" { fail $test } } -if { [string equal $bar_call_foo ""] } { +if { [string equal $returned_from_foo ""] } { fail "Find the call or branch instruction offset in bar" # The following test makes no sense if the offset is unknown. We need # to update the pattern above to match call or branch instruction for @@ -72,7 +72,7 @@ gdb_exit set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { declare_labels int_label foo_label - global bar_call_foo + global returned_from_foo global srcdir subdir srcfile set bar_result [function_range bar ${srcdir}/${subdir}/${srcfile}] @@ -116,7 +116,7 @@ Dwarf::assemble $asm_file { } GNU_call_site { - {low_pc "$bar_start + $bar_call_foo" addr} + {low_pc "$bar_start + $returned_from_foo" addr} {abstract_origin :$foo_label} } { # Faked entry values are reference to variables 'global1'