From patchwork Mon May 30 14:48:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoine Tremblay X-Patchwork-Id: 12628 Received: (qmail 100977 invoked by alias); 30 May 2016 14:48:15 -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 100964 invoked by uid 89); 30 May 2016 14:48:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy= X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 30 May 2016 14:48:13 +0000 Received: from EUSAAHC002.ericsson.se (Unknown_Domain [147.117.188.78]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id C6.74.09012.7D94C475; Mon, 30 May 2016 16:10:31 +0200 (CEST) Received: from elxa4wqvvz1.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.78) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 30 May 2016 10:48:10 -0400 From: Antoine Tremblay To: , CC: Antoine Tremblay Subject: [PATCH 1/5 v3] Add counter-cases for trace-condition.exp tests Date: Mon, 30 May 2016 10:48:03 -0400 Message-ID: <1464619683-31035-1-git-send-email-antoine.tremblay@ericsson.com> In-Reply-To: <023899bf-b568-f522-be51-734f3ee2d022@redhat.com> References: <023899bf-b568-f522-be51-734f3ee2d022@redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes In this v3: - Fixed test interleaving Note that I also fixed patch 3/5 to match this new setting. --- In trace-condition.exp, tests are done by doing a conditional tracepoint and validating that the trace contains all the frames that could be collected if that condition is true. E.g. test_tracepoints $trace_command "21 + 21 == 42" 10 This will always return true and collect the 10 frames possible to collect with the test program. However, if the condition evaluation is broken such that the condition is unconditional we will not notice this problem. This patch adds counter-cases to such conditions like so: $trace_command "21 + 11 == 42" 0 This way such a problem would be noticed. gdb/testsuite/ChangeLog: * gdb.trace/trace-condition.exp: Add counter-case tests. --- gdb/testsuite/gdb.trace/trace-condition.exp | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp index b7427ca..ca3232f 100644 --- a/gdb/testsuite/gdb.trace/trace-condition.exp +++ b/gdb/testsuite/gdb.trace/trace-condition.exp @@ -138,23 +138,61 @@ foreach trace_command { "trace" "ftrace" } { # Test various operations to cover as many opcodes as possible. test_tracepoints $trace_command "21 + 21 == 42" 10 + test_tracepoints $trace_command "21 + 21 == 11" 0 + test_tracepoints $trace_command "42 - 21 == 21" 10 + test_tracepoints $trace_command "42 - 21 == 11" 0 + test_tracepoints $trace_command "21 * 2 == 42" 10 + test_tracepoints $trace_command "21 * 2 == 11" 0 + test_tracepoints $trace_command "21 << 1 == 42" 10 + test_tracepoints $trace_command "21 << 1 == 11" 0 + test_tracepoints $trace_command "42 >> 1 == 21" 10 + test_tracepoints $trace_command "42 >> 1 == 11" 0 + test_tracepoints $trace_command "-(21 << 1) == -42" 10 + test_tracepoints $trace_command "-(21 << 1) == -11" 0 + test_tracepoints $trace_command "-42 >> 1 == -21" 10 + test_tracepoints $trace_command "-42 >> 1 == -11" 0 + test_tracepoints $trace_command "(0xabababab & 0x0000ffff) == 0xabab" 10 + test_tracepoints $trace_command "(0xabababab & 0x0000ffff) == 0xffff" 0 + test_tracepoints $trace_command "(0xabababab | 0x0000ffff) == 0xababffff" 10 + test_tracepoints $trace_command "(0xabababab | 0x0000ffff) == 0xeeeedddd" 0 + test_tracepoints $trace_command "(0xaaaaaaaa ^ 0x55555555) == 0xffffffff" 10 + test_tracepoints $trace_command "(0xaaaaaaaa ^ 0x55555555) == 0xaaaaaaaa" 0 + test_tracepoints $trace_command "~0xaaaaaaaa == 0x55555555" 10 + test_tracepoints $trace_command "~0xaaaaaaaa == 0x11111111" 0 + test_tracepoints $trace_command "21 < 42" 10 + test_tracepoints $trace_command "61 < 42" 0 + test_tracepoints $trace_command "42 <= 42" 10 + test_tracepoints $trace_command "42 <= 11" 0 + test_tracepoints $trace_command "42 >= 42" 10 + test_tracepoints $trace_command "11 >= 42" 0 + test_tracepoints $trace_command "42 > 21" 10 + test_tracepoints $trace_command "11 > 21" 0 + test_tracepoints $trace_command "(21 < 42 ? 0 : 1) == 0" 10 18955_i386_failure + test_tracepoints $trace_command "(66 < 42 ? 0 : 1) == 0" 0 18955_i386_failure + test_tracepoints $trace_command "(42 <= 42 ? 0 : 1) == 0" 10 + test_tracepoints $trace_command "(66 <= 42 ? 0 : 1) == 0" 0 + test_tracepoints $trace_command "(42 >= 42 ? 0 : 1) == 0" 10 + test_tracepoints $trace_command "(11 >= 42 ? 0 : 1) == 0" 0 + test_tracepoints $trace_command "(42 > 21 ? 0 : 1) == 0" 10 18955_i386_failure + test_tracepoints $trace_command "(11 > 21 ? 0 : 1) == 0" 0 18955_i386_failure + test_tracepoints $trace_command "\$trace_timestamp >= 0" 10 }