From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19101 invoked by alias); 9 Nov 2015 08:20:49 -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 19023 invoked by uid 89); 9 Nov 2015 08:20:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 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; Mon, 09 Nov 2015 08:20:45 +0000 Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 09 Nov 2015 16:20:29 +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 tA98K2gN024772 for ; Mon, 9 Nov 2015 16:20:02 +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; Mon, 9 Nov 2015 16:20:40 +0800 From: Fei Jie To: Subject: [PATCH v2 2/4] Add testcases to display.exp Date: Mon, 09 Nov 2015 08:20:00 -0000 Message-ID: <1447057215-7574-3-git-send-email-feij.fnst@cn.fujitsu.com> In-Reply-To: <1447057215-7574-1-git-send-email-feij.fnst@cn.fujitsu.com> References: <1447057215-7574-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/msg00220.txt.bz2 add testcases to display different types of data and variables *display/d/u/o/t/a/c *display array and structure gdb/testsuite/ChangeLog: * gdb.base/display.c: Add variable types. * gdb.base/display.exp: Add testcases to test display. --- gdb/testsuite/gdb.base/display.c | 6 ++++++ gdb/testsuite/gdb.base/display.exp | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c index cd833e2..2ade4d7 100644 --- a/gdb/testsuite/gdb.base/display.c +++ b/gdb/testsuite/gdb.base/display.c @@ -4,6 +4,12 @@ #define LOOP 10 int sum = 0; +int int_array[2] = {0, 1}; +struct + { + char name; + int age; + } human; /* Call to force a variable onto the stack so we can see its address. */ void force_mem (int *arg) { } diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp index 6e21d9e..8cbf875 100644 --- a/gdb/testsuite/gdb.base/display.exp +++ b/gdb/testsuite/gdb.base/display.exp @@ -80,13 +80,24 @@ gdb_test "disp/x j" ".*2: /x j = 0x0.*" "display j" gdb_test "disp/i &k" ".*3: x/i &k(\r\n| ) $hex:.*" "display &k" gdb_test "disp/f f" ".*4: /f f = 3.1415*" "display/f f" gdb_test "disp/s &sum" ".*5: x/s &sum $hex.*sum.:.*" "display/s &sum" +gdb_test "disp/d f" "6: /d f = 3" "display/d f" +gdb_test "disp/u f" "7: /u f = 3" "display/u f" +gdb_test "disp/o f" "8: /o f = 03" "display/o f" +gdb_test "disp/t f" "9: /t f = 11" "display/t f" +gdb_test "disp/a f" "10: /a f = 0x3" "display/a f" +gdb_test "disp/c f" "11: /c f = 3\ \'\\\\003\'" "display/c f" + +gdb_test "disp int_array" \ + "12: int_array = \\{0, 1\\}" "display array" +gdb_test "disp human" \ + "13: human = {name = 0 '\\\\000', age = 0}" "display struct" # Hit the displays # -gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp" -gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp" +gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: human.*\[1-9\]*: int_array.*\[1-9\]*: /c f = 3 \'\\\\003\'\r\n\[0-9\]*: /a f = 0x3\r\n\[1-9\]*: /t f = 11\r\n\[1-9\]*: /o f = 03\r\n\[1-9\]*: /u f = 3\r\n\[1-9\]*: /d f = 3\r\n\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp" +gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: human.*\[1-9\]*: int_array.*\[1-9\]*: /c f = 4 \'\\\\004\'\r\n\[0-9\]*: /a f = 0x4\r\n\[1-9\]*: /t f = 100\r\n\[1-9\]*: /o f = 04\r\n\[1-9\]*: /u f = 4\r\n\[1-9\]*: /d f = 4\r\n\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "second disp" -gdb_test "enab disp 6" ".*No display number 6..*" "catch err" +gdb_test "enab disp 14" ".*No display number 14..*" "catch err" gdb_test_no_output "disab disp 1" "disab disp 1" gdb_test_no_output "disab disp 2" "disab disp 2" gdb_test_no_output "enab disp 1" "re-enab" -- 1.8.3.1