From patchwork Sun Aug 26 15:47:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 29053 Received: (qmail 126605 invoked by alias); 26 Aug 2018 15:47:24 -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 126526 invoked by uid 89); 26 Aug 2018 15:47:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mailsec113.isp.belgacom.be Received: from mailsec113.isp.belgacom.be (HELO mailsec113.isp.belgacom.be) (195.238.20.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 26 Aug 2018 15:47:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1535298443; x=1566834443; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Wp4+gPYBh1bOx9S0Mwp/IPUGqdBu9h2d/9C2swsXEww=; b=p8Kqxp7Rg1UMK+O+WmDh0ykhCTC96cw9z97Uni5pm0HY4PAb3C6nvMsz cq4AxPdWbo7dODpl0HkQ3IUqGhKKJA==; Received: from 217.24-133-109.adsl-dyn.isp.belgacom.be (HELO md.home) ([109.133.24.217]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 26 Aug 2018 17:47:19 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFAv2 2/2] Modify gdb.base/commands.exp to test multi breakpoints command clearing. Date: Sun, 26 Aug 2018 17:47:08 +0200 Message-Id: <20180826154708.28601-3-philippe.waroquiers@skynet.be> In-Reply-To: <20180826154708.28601-1-philippe.waroquiers@skynet.be> References: <20180826154708.28601-1-philippe.waroquiers@skynet.be> X-IsSubscribed: yes gdb/testsuite/ChangeLog 2018-08-26 Philippe Waroquiers * gdb.base/commands.exp: Test multi breakpoints command clearing. --- gdb/testsuite/gdb.base/commands.exp | 47 +++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp index 259b89b803..52a22bb5dd 100644 --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -281,6 +281,48 @@ proc_with_prefix breakpoint_command_test {} { gdb_test "print value" " = 5" } +# Test clearing the commands of several breakpoints with one single "end". +proc_with_prefix breakpoint_clear_command_test {} { + runto_or_return factorial + + set any "\[^\r\n\]*" + delete_breakpoints + gdb_test "break factorial" "Breakpoint.*at.*" + gdb_test_no_output "set \$bpnumfactorial = \$bpnum" + gdb_test "break main" "Breakpoint.*at.*" + gdb_test_no_output "set \$bpnummain = \$bpnum" + + gdb_test \ + [multi_line_input \ + {commands $bpnumfactorial $bpnummain} \ + { print 1234321} \ + {end}] \ + "End with.*" \ + "set commands of two breakpoints to print 1234321" + gdb_test "info breakpoints" \ + [multi_line \ + "${any}What${any}" \ + "${any}in factorial${any}" \ + "${any}print 1234321${any}" \ + "${any}in main${any}" \ + "${any}print 1234321${any}" \ + ] \ + "print 1234321 command present in the two breakpoints" + gdb_test \ + [multi_line_input \ + {commands $bpnumfactorial $bpnummain} \ + {end}] \ + "End with.*" \ + "clear the command list of the two breakpoints" + gdb_test "info breakpoints" \ + [multi_line \ + "${any}What${any}" \ + "${any}in factorial${any}" \ + "${any}in main${any}" \ + ] \ + "print 1234321 command is not present anymore in the two breakpoints" + } + # Test a simple user defined command (with arguments) proc_with_prefix user_defined_command_test {} { global valnum_re @@ -368,8 +410,8 @@ proc_with_prefix user_defined_command_case_sensitivity {} { gdb_test "print 456\nend" "" "enter commands 2" - gdb_test "Homer-Simpson" " = 123" "execute command" - gdb_test "HomeR-SimpsoN" " = 456" "execute command" + gdb_test "Homer-Simpson" " = 123" "execute command Homer-Simpson" + gdb_test "HomeR-SimpsoN" " = 456" "execute command HomeR-SimpsoN" gdb_test "HOMER-SIMPSON" "Undefined command.*" "try to call in upper case" gdb_test "homer-simpson" "Undefined command.*" "try to call in lower case" } @@ -1134,6 +1176,7 @@ progvar_complex_if_while_test if_while_breakpoint_command_test infrun_breakpoint_command_test breakpoint_command_test +breakpoint_clear_command_test user_defined_command_test user_defined_command_case_sensitivity user_defined_command_args_eval