From patchwork Sun Jun 24 18:37:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 28006 Received: (qmail 41017 invoked by alias); 24 Jun 2018 18:37:46 -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 40916 invoked by uid 89); 24 Jun 2018 18:37:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=simultaneously X-HELO: mailsec106.isp.belgacom.be Received: from mailsec106.isp.belgacom.be (HELO mailsec106.isp.belgacom.be) (195.238.20.102) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 Jun 2018 18:37:44 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2DWBwCk5C9b/+ApQFdcHQEBBQELAYNJg?= =?us-ascii?q?U8SKIxdi2ABgjUBQ5QVgXoLKwGEQAKDAiI2FgECAQEBAQEBAgFsKII1IoJSBlY?= =?us-ascii?q?jED8SOR4ZgyWCBK5ohFuDZoECikI/gQ+CWoIAg3yFCQKZLwcCgWuNGwuNSSuRQ?= =?us-ascii?q?oFIATCBUm2DPIJLjgg9MHgBGgGNVQEB?= X-IPAS-Result: =?us-ascii?q?A2DWBwCk5C9b/+ApQFdcHQEBBQELAYNJgU8SKIxdi2ABgjU?= =?us-ascii?q?BQ5QVgXoLKwGEQAKDAiI2FgECAQEBAQEBAgFsKII1IoJSBlYjED8SOR4ZgyWCB?= =?us-ascii?q?K5ohFuDZoECikI/gQ+CWoIAg3yFCQKZLwcCgWuNGwuNSSuRQoFIATCBUm2DPIJ?= =?us-ascii?q?Ljgg9MHgBGgGNVQEB?= Received: from 224.41-64-87.adsl-dyn.isp.belgacom.be (HELO md.home) ([87.64.41.224]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 24 Jun 2018 20:37:17 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFA_v3 7/8] Modify gdb.threads/pthreads.exp to test FLAG qcs arguments for thread apply Date: Sun, 24 Jun 2018 20:37:07 +0200 Message-Id: <20180624183708.888-8-philippe.waroquiers@skynet.be> In-Reply-To: <20180624183708.888-1-philippe.waroquiers@skynet.be> References: <20180624183708.888-1-philippe.waroquiers@skynet.be> X-IsSubscribed: yes gdb/testsuite/ChangeLog 2018-06-24 Philippe Waroquiers * gdb.threads/pthreads.exp: Test qcs FLAG arguments. --- gdb/testsuite/gdb.threads/pthreads.exp | 65 ++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp index 830432b833..ccd02046f8 100644 --- a/gdb/testsuite/gdb.threads/pthreads.exp +++ b/gdb/testsuite/gdb.threads/pthreads.exp @@ -267,6 +267,70 @@ proc check_backtraces {} { } } +proc check_qcs {} { + set any "\[^\r\n\]*" + set ws "\[ \t\]\+" + set number "\[0-9]\+" + + # check -c (continue) and -s (silently continue) flags + gdb_test "thread apply 2-3 p notfound" \ + [multi_line \ + "" \ + "Thread 2 ${any}" \ + "No symbol \\\"notfound\\\" in current context." \ + ] \ + "Run a failing command that aborts thread apply" + + gdb_test "thread apply 2-3 -c p notfound" \ + [multi_line \ + "" \ + "Thread 2 ${any}" \ + "No symbol \\\"notfound\\\" in current context." \ + "" \ + "Thread 3 ${any}" \ + "No symbol \\\"notfound\\\" in current context." \ + ] \ + "Run a failing command, -c to continue" + + foreach cmd {"thread apply all -s frame apply all -s p i" "tfaas p i" "taas faas p i"} { + gdb_test $cmd \ + [multi_line \ + "" \ + "Thread 3 ${any}" \ + "#${number}${ws}${any} in thread2 ${any}" \ + "\\\$\[0-9]+ = ${number}${any}" \ + "" \ + "Thread 2 ${any}" \ + "#${number}${ws}${any} in thread1 ${any}" \ + "\\\$\[0-9]+ = ${number}${any}" \ + ] \ + "Run a failing command except in one frame of thread 2,3, -s to silently continue" + } + + # Quietness tests + gdb_test "thread apply all -s -q frame apply all -s p i" \ + [multi_line \ + "#${number}${ws}${any} in thread2 ${any}" \ + "\\\$\[0-9]+ = ${number}${any}" \ + "#${number}${ws}${any} in thread1 ${any}" \ + "\\\$\[0-9]+ = ${number}${any}" \ + ] \ + "Run a failing command except in one frame of thread 2,3, -s to silently continue. Do not show thread information" + + gdb_test "thread apply all -s -q frame apply all -s -q p i" \ + [multi_line \ + "\\\$\[0-9]+ = ${number}${any}" \ + "\\\$\[0-9]+ = ${number}${any}" \ + ] \ + "Run a failing command except in one frame of thread 2,3, -s to silently continue. Do not show thread and frame info" + + # check invalid flag combinations + gdb_test "thread apply all -c -s p 1" \ + "thread apply all: -c and -s are mutually exclusive" \ + "Check -c and -s cannot be used simultaneously" + +} + if [runto_main] then { if [test_startup] then { if [check_control_c] then { @@ -274,5 +338,6 @@ if [runto_main] then { return } check_backtraces + check_qcs } }