From patchwork Tue Apr 4 19:12:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aktemur, Tankut Baris" X-Patchwork-Id: 67286 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C6E63858C2F for ; Tue, 4 Apr 2023 19:13:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C6E63858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680635590; bh=67h2BNnGzHZ7BKFPcXm9wBb7dp9QdD1eA+GDeGSyYFE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=tPLpc24RZmAvHYjrb/PWLITCwTZ9NXzHd8PrBzXFl1mYMfqNEBodJEFinzxoVnDsD Sayyop+q8ZAUEXNUQLI5zQohuQ3zeKP2affp65wKwSiGnt0/ZMuXwNJL9hJY4idXT5 IhAD2DXLeuv/EJ+vhJOdf/dPRUQvpNduj3asdMvA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by sourceware.org (Postfix) with ESMTPS id A4F383858C52 for ; Tue, 4 Apr 2023 19:12:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4F383858C52 X-IronPort-AV: E=McAfee;i="6600,9927,10670"; a="428566603" X-IronPort-AV: E=Sophos;i="5.98,318,1673942400"; d="scan'208";a="428566603" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 12:12:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10670"; a="755753025" X-IronPort-AV: E=Sophos;i="5.98,318,1673942400"; d="scan'208";a="755753025" Received: from ultl2604.iul.intel.com (HELO localhost) ([172.28.48.47]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 12:12:39 -0700 To: gdb-patches@sourceware.org Subject: [PATCH] gdb: boolify 'should_print_thread' Date: Tue, 4 Apr 2023 21:12:22 +0200 Message-Id: <20230404191222.3408219-1-tankut.baris.aktemur@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=AC_FROM_MANY_DOTS, BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tankut Baris Aktemur via Gdb-patches From: "Aktemur, Tankut Baris" Reply-To: Tankut Baris Aktemur Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Convert the return type of 'should_print_thread' from int to bool. Reviewed-By: Tom Tromey --- gdb/thread.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/thread.c b/gdb/thread.c index 25d97cd6072..5d5298331bf 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -986,7 +986,7 @@ pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread) and PID is not -1, then the thread is printed if it belongs to the specified process. Otherwise, an error is raised. */ -static int +static bool should_print_thread (const char *requested_threads, int default_inf_num, int global_ids, int pid, struct thread_info *thr) { @@ -1000,20 +1000,20 @@ should_print_thread (const char *requested_threads, int default_inf_num, in_list = tid_is_in_list (requested_threads, default_inf_num, thr->inf->num, thr->per_inf_num); if (!in_list) - return 0; + return false; } if (pid != -1 && thr->ptid.pid () != pid) { if (requested_threads != NULL && *requested_threads != '\0') error (_("Requested thread not found in requested process")); - return 0; + return false; } if (thr->state == THREAD_EXITED) - return 0; + return false; - return 1; + return true; } /* Return the string to display in "info threads"'s "Target Id"