From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124039 invoked by alias); 10 Nov 2015 07:57:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 123963 invoked by uid 89); 10 Nov 2015 07:57:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: heian.cn.fujitsu.com Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Nov 2015 07:56:58 +0000 Received: from bogon (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 10 Nov 2015 15:56:43 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id tAA7uGB6018358 for ; Tue, 10 Nov 2015 15:56:16 +0800 Received: from localhost.localdomain (10.167.226.91) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 10 Nov 2015 15:56:54 +0800 From: Fei Jie To: Subject: [PATCH v3 3/4] Add testcases to list.exp and dfp-test.exp Date: Tue, 10 Nov 2015 07:57:00 -0000 Message-ID: <1447142188-20759-4-git-send-email-feij.fnst@cn.fujitsu.com> In-Reply-To: <1447142188-20759-1-git-send-email-feij.fnst@cn.fujitsu.com> References: <1447142188-20759-1-git-send-email-feij.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00249.txt.bz2 add testcases which test list with more paraments to list.exp, and backtrace with parament '-1' to dfp-test.exp gdb/testsuite/ChangeLog: *gdb.base/list.exp: Add new testcases. *gdb.base/dfp-test.exp: Likewise. --- gdb/testsuite/gdb.base/dfp-test.exp | 1 + gdb/testsuite/gdb.base/list.exp | 49 +++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp index e648a6b..4caa50e 100644 --- a/gdb/testsuite/gdb.base/dfp-test.exp +++ b/gdb/testsuite/gdb.base/dfp-test.exp @@ -220,6 +220,7 @@ gdb_test "backtrace" ".*arg0_64 \\(arg0=0.1, arg1=1.0, arg2=2.0, arg3=3.0, arg4= gdb_breakpoint arg0_128 gdb_continue_to_breakpoint "entry to arg0_128" gdb_test "backtrace" ".*arg0_128 \\(arg0=0.1, arg1=1.0, arg2=2.0, arg3=3.0, arg4=4.0, arg5=5.0\\).*" "backtrace at arg0_128" +gdb_test "backtrace -1" ".*0x\[0-9\]\{1,16\}.*at\ .*${srcfile}.*" # Test calling inferior function with DFP arguments or return value. diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index 2aea9a3..c79369e 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -624,4 +624,53 @@ test_list "list -" 10 2 "7-8" "5-6" # the current line. test_list "list -" 10 1 "7" "6" +# Get main address. +set main_addr "" +gdb_test_multiple "print/x &main" "getting main's address" { + -re "$decimal = \($hex\)\r\n$gdb_prompt $" { + set main_addr $expect_out(1, string) + } +} +# Test set listsize to -1. +set_listsize -1 + +set_listsize 10 +# Test list with line number. +gdb_test "list 12" \ + "7\\s+x = 0.*16\\s+foo \\(x\\+\\+\\);" + +# Test list with +. +gdb_test "list +" \ + "17\\s+foo \\(x\\+\\+\\).*26\\s+foo \\(x\\+\\+\\);" + +# Test list with '+' number. +gdb_test "list +1" \ + "23\\s+foo \\(x\\+\\+\\).*32\\s+foo \\(x\\+\\+\\);" + +# Test list with starting line number and ','. +gdb_test "list 20," \ + "20\\s+foo \\(x\\+\\+\\).*29\\s+foo \\(x\\+\\+\\);" + +# Test list with ',' and ending line number. +gdb_test "list ,25" \ + "16\\s+foo \\(x\\+\\+\\).*25\\s+foo \\(x\\+\\+\\);" + +# Test list with address. +gdb_test "list *${main_addr}" \ + "${main_addr} is in main.*${srcfile}.*" + +# Test list with '-' last line number. +gdb_test "list -${last_line}" \ + "1\\s+#include \"list0.h\".*10\\s+foo \\(x\\+\\+\\);" + +# Test list with ',' and a little-out-of-ranged line number. +set little_past_end [expr ${last_line} + 5 ] +gdb_test "list ,${little_past_end}" \ + ".*43\\s+\\} \\/\\* last line \\*\\/" + +# Test list with ',' and a much-out-of-ranged line number. +set much_past_end [expr ${last_line} + 10 ] +gdb_test "list ,${much_past_end}" \ + "Line number 44 out of range.*" + remote_exec build "rm -f list0.h" -- 1.8.3.1