From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1069 invoked by alias); 10 Nov 2015 01:15:14 -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 1060 invoked by uid 89); 10 Nov 2015 01:15:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_05,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 01:15:13 +0000 Received: from bogon (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 10 Nov 2015 09:14:58 +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 tAA1EVhV024421; Tue, 10 Nov 2015 09:14:31 +0800 Received: from localhost.localdomain (10.167.226.91) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.181.6; Tue, 10 Nov 2015 09:15:09 +0800 Message-ID: <56414503.3060002@cn.fujitsu.com> Date: Tue, 10 Nov 2015 01:15:00 -0000 From: fj User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Andrew Burgess CC: Subject: Re: [PATCH v2 4/4] Add testcases to break.exp References: <1447057215-7574-1-git-send-email-feij.fnst@cn.fujitsu.com> <1447057215-7574-5-git-send-email-feij.fnst@cn.fujitsu.com> <20151109093650.GA22241@embecosm.com> In-Reply-To: <20151109093650.GA22241@embecosm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00238.txt.bz2 On 11/09/2015 05:36 PM, Andrew Burgess wrote: > * Fei Jie [2015-11-09 16:20:15 +0800]: > >> add testcases to break.exp as follows: >> *break with non-existed condition >> *break with out-ou-ranged address >> *break at offset -1 >> >> gdb/testsuite/ChangeLog: >> >> * gdb.base/break.exp: Add new testcases. >> --- >> gdb/testsuite/gdb.base/break.exp | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp >> index f879bc8..5178773 100644 >> --- a/gdb/testsuite/gdb.base/break.exp >> +++ b/gdb/testsuite/gdb.base/break.exp >> @@ -334,6 +334,11 @@ gdb_test "enable" "" "" >> gdb_test "disable 10" "No breakpoint number 10." \ >> "disable non-existent breakpoint 10" >> >> +gdb_test "break main if donot_exist == 0" \ >> + "No symbol \"donot_exist\" in current context\\." >> +gdb_test "break \*0xfffffffffffffffff" \ >> + "Numeric constant too large\\." >> + >> gdb_test_no_output "set \$baz = 1.234" >> gdb_test "disable \$baz" \ >> "Convenience variable must have integer value.*" \ >> @@ -399,6 +404,10 @@ set bp_location10 [gdb_get_line_number "set breakpoint 10 here"] >> gdb_test "break +1" \ >> "Breakpoint.*at.* file .*$srcfile, line $bp_location10\\." \ >> "breakpoint offset +1" >> +# Test break at offset -1. >> +gdb_test "break -1" \ >> + "Note: breakpoint 6 also set at.*Breakpoint.*at.* file .*$srcfile, line.*" \ >> + "breakpoint offset -1" > > You can't rely on the previous breakpoint being number 6. Some of the > different target types place breakpoints during start up and so the > breakpoint number will be different. This is why non of the other > tests hard code the breakpoint numbers in the expected output. > Thanks for pointing out that. I didn't notice that situation. I'll regexp out the breakpoint number and continue to modify my patches. > You should either just regexp out the breakpoint number, or, capture > the breakpoint number earlier and use that in the expected output, > usually just using a regexp is sufficient. > > Thanks, > Andrew > -- Thanks Fei Jie