From patchwork Thu Aug 2 21:26:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 28745 Received: (qmail 99582 invoked by alias); 2 Aug 2018 21:26:29 -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 99479 invoked by uid 89); 2 Aug 2018 21:26:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 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=breakpoint.*at.*, Breakpoint.*at.*, Hx-languages-length:2208, Breakpoint*at* 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; Thu, 02 Aug 2018 21:26:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1533245187; x=1564781187; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=EyH95tEkvGYUtWbwmgOzc1ZPDfctxrCmQycSreDCcss=; b=wH5SOa3Qx6WNKpDyZUEoWX9rBfMAyPOJ3PxiA8LbS/8bThRqF1hhr9kg uUdMn+jSbavsM0bJ8a6bUYW9nhqgGw==; Received: from 145.43-64-87.adsl-dyn.isp.belgacom.be (HELO md.home) ([87.64.43.145]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 02 Aug 2018 23:26:23 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFA 2/2] Modify gdb.base/commands.exp to test multi breakpoint command setting/clearing. Date: Thu, 2 Aug 2018 23:26:13 +0200 Message-Id: <20180802212613.29813-3-philippe.waroquiers@skynet.be> In-Reply-To: <20180802212613.29813-1-philippe.waroquiers@skynet.be> References: <20180802212613.29813-1-philippe.waroquiers@skynet.be> X-IsSubscribed: yes gdb/testsuite/ChangeLog 2018-08-02 Philippe Waroquiers * gdb.base/commands.exp: Test multi breakpoints setting and clearing. --- gdb/testsuite/gdb.base/commands.exp | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp index 259b89b803..57d9348244 100644 --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -281,6 +281,49 @@ proc_with_prefix breakpoint_command_test {} { gdb_test "print value" " = 5" } +# Test clearing the commands of several breakpoints with one single "end". +# As this test uses breakpoint numbers, we better run it first to ensure +# the breakpoint numbers are not changing if other tests are added/changed +# so that breakpoint numbers are also changed. +proc_with_prefix run_me_first_breakpoint_clear_command_test {} { + # The below creates breakpoint nr 1. + runto_or_return factorial + + set any "\[^\r\n\]*" + delete_breakpoints + gdb_test "break factorial" "Breakpoint.*at.*" + gdb_test "break main" "Breakpoint.*at.*" + gdb_test \ + [multi_line_input \ + {commands 2 3} \ + { print 1234321} \ + {end}] \ + "End with.*" \ + "commands" + 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}" \ + ] \ + "check print 1234321 is there." + gdb_test \ + [multi_line_input \ + {commands 2 3} \ + {end}] \ + "End with.*" \ + "commands" + gdb_test "info breakpoints" \ + [multi_line \ + "${any}What${any}" \ + "${any}in factorial${any}" \ + "${any}in main${any}" \ + ] \ + "check print 1234321 is not there anymore." + } + # Test a simple user defined command (with arguments) proc_with_prefix user_defined_command_test {} { global valnum_re @@ -1125,6 +1168,7 @@ proc_with_prefix backslash_in_multi_line_command_test {} { gdb_test "print 1" "" "run command" } +run_me_first_breakpoint_clear_command_test gdbvar_simple_if_test gdbvar_simple_while_test gdbvar_complex_if_while_test