From patchwork Fri Aug 11 15:30:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 22100 Received: (qmail 93597 invoked by alias); 11 Aug 2017 15:31:21 -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 92480 invoked by uid 89); 11 Aug 2017 15:30:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Self, H*r:sk:static. X-HELO: mail-io0-f174.google.com Received: from mail-io0-f174.google.com (HELO mail-io0-f174.google.com) (209.85.223.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Aug 2017 15:30:24 +0000 Received: by mail-io0-f174.google.com with SMTP id o9so21462450iod.1 for ; Fri, 11 Aug 2017 08:30:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=PsdULDyTG6gw61D7HEkFqkpM5hJx2Nvq/NqPRu8D5/s=; b=WLmAGkPf+/rAX/zqCS/icSThBIBxYnb8yYvf4LJNA7g7274Cm1Nsjw5YDq05o6TXR6 Eb9+ZtI6aBCigZl2Ts4PfhpZQpHnfL9rO2sFhMR0dgA/BykLOibQfzu3QEJbZnm3LSTd EidsV9QSSoCYfvC3sd1nSSfteOi2vp5RcKFMIVhTn1GcidA5JnnVHcgfwPYL8fVVvWJz Pwv0L6xnDZcZuFt/N8CMbjuxLj2jk55MDJt0GPuHM/A52LBjcwt3QmjwzuRxKsrfbBFD fT9K5I10hs0sE0wSvqUuaBquoqcdfzXyNgKYsPLrfZDCN24QIhOVXsdiNYq+azG0H5uW mj2Q== X-Gm-Message-State: AIVw110NbpvcXr6o1KGjRqT/A8+FuAIf13l3jHZJjesPoQnVL5Spa/OZ Tx4AQeI2LOIZvTzk X-Received: by 10.107.33.204 with SMTP id h195mr12920359ioh.93.1502465416079; Fri, 11 Aug 2017 08:30:16 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id q19sm495501iod.10.2017.08.11.08.30.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Aug 2017 08:30:15 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 2/3] Remove some GDB specific stuff from selftest.c Date: Fri, 11 Aug 2017 16:30:07 +0100 Message-Id: <1502465408-24668-3-git-send-email-yao.qi@linaro.org> In-Reply-To: <1502465408-24668-1-git-send-email-yao.qi@linaro.org> References: <1502465408-24668-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes The next patch moves selftest.c to common/selftest.c, so that GDBserver can use it as well. However selftest.c uses something isn't "portable" on GDB and GDBserver. First, this patch removes QUIT. I don't expect that we type ctrl-c during self/unit tests, and each test shouldn't take long time. Secondly, I replace exception_fprintf and printf_filtered with debug_printf. Verified that unit tests still catch fails. gdb: 2017-08-09 Yao Qi * selftest.c (run_tests): Don't call QUIT. Call debug_printf instead of exception_fprintf and printf_filtered. --- gdb/selftest.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gdb/selftest.c b/gdb/selftest.c index 31d16af..eb7728b 100644 --- a/gdb/selftest.c +++ b/gdb/selftest.c @@ -44,8 +44,6 @@ run_tests (void) for (int i = 0; i < tests.size (); ++i) { - QUIT; - TRY { tests[i] (); @@ -53,7 +51,7 @@ run_tests (void) CATCH (ex, RETURN_MASK_ERROR) { ++failed; - exception_fprintf (gdb_stderr, ex, _("Self test failed: ")); + debug_printf ("Self test failed: %s\n", ex.message); } END_CATCH @@ -62,7 +60,7 @@ run_tests (void) reinit_frame_cache (); } - printf_filtered (_("Ran %lu unit tests, %d failed\n"), - (long) tests.size (), failed); + debug_printf ("Ran %lu unit tests, %d failed\n", + (long) tests.size (), failed); } } // namespace selftests