From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kc5zJPI0+mnGGRcAWB0awg (envelope-from ) for ; Tue, 05 May 2026 14:20:34 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a/VEhpKg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 82C6E1E067; Tue, 05 May 2026 14:20:34 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BA0B81E067 for ; Tue, 05 May 2026 14:20:33 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 1E4004BAD146 for ; Tue, 5 May 2026 18:20:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E4004BAD146 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a/VEhpKg Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 1B2E94BA2E24 for ; Tue, 5 May 2026 18:19:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B2E94BA2E24 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1B2E94BA2E24 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778005199; cv=none; b=ICzCJp7ROGCDOhtDg2HXBqOoYWL7cS/Oh38/jnajFsy/JYuKOGMD7xwc39IhpsgX6YVrizsDuJCWT9qkVObMFFkDmNo+E7d1djHKZiF1QDUhrDuFEqo4Ytb+6tItocEliMWIm0ojrw4P/1RgDST1TJ4xTNZtPXUV3NTH+sxfVDA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778005199; c=relaxed/simple; bh=fmWs5e1cmtkSZsA7R4xj0hzXg4kiUNgzu9Z+t5FDdzA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=TQeWUOGPGOTYMIlbDwyY7Y9gsUisK4kU9AOTyD946bQcsAWKWJ9Z4dX2lCzWH4L1yYdJ2wIZn0B9uQSA6VPkmB8f9nA/1KqV4ygkOLbvYYAj99bLRcXsc1u2f/1O70EfG//nK/XSVDLw7Xn3hDBmGpFtCLS2KI71reW9zZKGa9I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B2E94BA2E24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778005198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=skUILIluxR8bLIMdVz/COq9VGA8EZNpXF437dU2tJqU=; b=a/VEhpKgZvVOpOSSxtqiLCeF5Si5GUE1M9PqF41JEm/5RJmt6uCLG1zSic0d3zt/UkgQtW JEj4tp0VBJiK1McS8adJRE0ymZLLcoBUxLgDILHBEKxGrpdVpSJRaIzgJepAJHvFF9daLL XVJkLX0LG+WeRNd9/XC3dS+qcxbJ364= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-182-kLB1d9fTP66jm32iNU6Pww-1; Tue, 05 May 2026 14:19:55 -0400 X-MC-Unique: kLB1d9fTP66jm32iNU6Pww-1 X-Mimecast-MFC-AGG-ID: kLB1d9fTP66jm32iNU6Pww_1778005195 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8fcc3e2a3baso739138585a.0 for ; Tue, 05 May 2026 11:19:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778005194; x=1778609994; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=skUILIluxR8bLIMdVz/COq9VGA8EZNpXF437dU2tJqU=; b=fwJAfBCW4sWdXpzZksn7oHdCyzB9UGkBXQjiQTC4hZ3oMHpdFMXD6vGJwMSCl5j7s2 185FMLm83EusZv4L5PMM2kDWqE5yQyo4PLjsC0zJOr0Y6SeOH0j5VlhscWFc6kDnmLQF DNVuRsQ7L87t3hYxjD7sBGdrBarPHIFyvXXIHVP2DOfiFZZ+/gnIeDaylzo/UiorSv+P zA668JW/ufxWDjyDR4DrLXOiEN9jGcyPhUu9m+jPTcsxzIRuOH+eeNPkxrCLp1lcQpAI 95XyJFhtdU+oN/AnpqmyD5+RGYbbiFTEwBmd1G9YGA9EyOjgcqZdOV3Mu2t6VJ0ho3v8 we7A== X-Forwarded-Encrypted: i=1; AFNElJ9gls1cc2hY9c7skNmNfu3iOpgDAuF1ICDln+U0Gj/VdiYWSx0afFV/XT1E5gz6MzUeKEime7I1VMMELA==@sourceware.org X-Gm-Message-State: AOJu0Yxh7wUYdbCgRMD9f49XMgUO1Pc0JBowfjuyBgeNbfrSIphFBpas UVjts8kQHhCZaCUMfDCeSSmy4DFZJRBhrQukbSPptuoW8EtOBPpPz8o/q2X2coiuqt8kf2hxgy3 0LiktdYArGcJCx1kCtZIUjoe3i3j4NmAIVGXadwu8n9ovJf1jeV+AczfOe+WKhXg/FSIQZ+c= X-Gm-Gg: AeBDiettL9qL6/o3EPE9tFOtecOWmyrkeWuHMU7ysyqhlUQk1fWHYklGEQmQRGu+eKk X0lnaJRrh47U4Zh7t8jNLqbDYlcBEslvGmfUTXXacp2lR+uHQoSopJxmcTJhGQjTLsrp108j5Pv KcBvHDhTzxyLStLb69oz2MDOi8zeJnV2VrtUwQHiBgOIcycePSYi9VR9xdrbCvDtFmX5cC1f/RN lZhJkv7zSzCqDlZ2zOLJG+0h8TbNErWr/yEpfqoyrsWNdkigSFZukzkJwN9fLi2wR3FrQKh9Bo4 rDMdACsnWD1Cxp8QWfjjVoRbR3jLTxwPmy27ZeJdpjB9K+Mpj578fwQUk7GLnLj0QK1T851mG1m Fyvjp7n563XLIeXi9Xsx7QQlOIDVTrd+msOEh/q4= X-Received: by 2002:a05:620a:7017:b0:8cd:8751:2b26 with SMTP id af79cd13be357-904d70c2d69mr17215285a.58.1778005194366; Tue, 05 May 2026 11:19:54 -0700 (PDT) X-Received: by 2002:a05:620a:7017:b0:8cd:8751:2b26 with SMTP id af79cd13be357-904d70c2d69mr17207585a.58.1778005193728; Tue, 05 May 2026 11:19:53 -0700 (PDT) Received: from [150.1.200.157] ([172.56.105.115]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8fc2c34a0d4sm1384216085a.25.2026.05.05.11.19.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 May 2026 11:19:53 -0700 (PDT) Message-ID: <0e60778e-c58e-41f4-a30f-af9897272b0f@redhat.com> Date: Tue, 5 May 2026 11:19:51 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] gdb: int to bool conversion in linux-thread-db.c To: Andrew Burgess , gdb-patches@sourceware.org References: <06e340b55f36093000d86d6da7dc6c71910223ca.1775557188.git.aburgess@redhat.com> From: Keith Seitz In-Reply-To: <06e340b55f36093000d86d6da7dc6c71910223ca.1775557188.git.aburgess@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 0GMzJeR_2RfytmgNKBHSvHe-dRombs9vtOfwEkiUvGs_1778005195 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 4/7/26 3:22 AM, Andrew Burgess wrote: > Some 'int' to 'bool' cleanup in linux-thread-db.c. There should be no > user visible changes after this commit. More int -> bool +1000! Reviewed-By: Keith Seitz Keith > --- > gdb/linux-nat.h | 2 +- > gdb/linux-thread-db.c | 40 ++++++++++++++++++++-------------------- > 2 files changed, 21 insertions(+), 21 deletions(-) > > diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h > index 0f128892735..180059a9496 100644 > --- a/gdb/linux-nat.h > +++ b/gdb/linux-nat.h > @@ -316,7 +316,7 @@ lwp_info_safe_range all_lwps_safe (); > does whatever is required to have the child LWP under the > thread_db's control --- e.g., enabling event reporting. Returns > true on success, false if the process isn't using libpthread. */ > -extern int thread_db_notice_clone (ptid_t parent, ptid_t child); > +extern bool thread_db_notice_clone (ptid_t parent, ptid_t child); > > /* Return the number of signals used by the threads library. */ > extern unsigned int lin_thread_get_thread_signal_num (void); > diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c > index 0753d2e7915..cd25c55a898 100644 > --- a/gdb/linux-thread-db.c > +++ b/gdb/linux-thread-db.c > @@ -429,7 +429,7 @@ thread_from_lwp (thread_info *stopped, ptid_t ptid) > > /* See linux-nat.h. */ > > -int > +bool > thread_db_notice_clone (ptid_t parent, ptid_t child) > { > struct thread_db_info *info; > @@ -437,7 +437,7 @@ thread_db_notice_clone (ptid_t parent, ptid_t child) > info = get_thread_db_info (linux_target, child.pid ()); > > if (info == NULL) > - return 0; > + return false; > > thread_info *stopped = linux_target->find_thread (parent); > > @@ -446,7 +446,7 @@ thread_db_notice_clone (ptid_t parent, ptid_t child) > /* If we do not know about the main thread's pthread info yet, this > would be a good time to find it. */ > thread_from_lwp (stopped, parent); > - return 1; > + return true; > } > > static void * > @@ -460,10 +460,10 @@ verbose_dlsym (void *handle, const char *name) > } > > /* Verify inferior's '\0'-terminated symbol VER_SYMBOL starts with "%d.%d" and > - return 1 if this version is lower (and not equal) to > - VER_MAJOR_MIN.VER_MINOR_MIN. Return 0 in all other cases. */ > + return true if this version is lower (and not equal) to > + VER_MAJOR_MIN.VER_MINOR_MIN. Return false in all other cases. */ > > -static int > +static bool > inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min) > { > CORE_ADDR version_addr; > @@ -472,7 +472,7 @@ inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min) > bound_minimal_symbol version_msym > = lookup_minimal_symbol (current_program_space, ver_symbol); > if (version_msym.minsym == NULL) > - return 0; > + return false; > > version_addr = version_msym.value_address (); > gdb::unique_xmalloc_ptr version > @@ -493,10 +493,10 @@ inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min) > /* Similar as thread_db_find_new_threads_1, but try to silently ignore errors > if appropriate. > > - Return 1 if the caller should abort libthread_db initialization. Return 0 > - otherwise. */ > + Return true if the caller should abort libthread_db initialization. > + Return false otherwise. */ > > -static int > +static bool > thread_db_find_new_threads_silently (thread_info *stopped) > { > > @@ -518,25 +518,25 @@ thread_db_find_new_threads_silently (thread_info *stopped) > itself. > > If the nptl bug is NOT present in the inferior and still thread_db > - reports an error return 1. It means the inferior has corrupted thread > - list and GDB should fall back only to LWPs. > + reports an error return true. It means the inferior has corrupted > + thread list and GDB should fall back only to LWPs. > > - If the nptl bug is present in the inferior return 0 to silently ignore > - such errors, and let gdb enumerate threads again later. In such case > - GDB cannot properly display LWPs if the inferior thread list is > - corrupted. For core files it does not apply, no 'later enumeration' > - is possible. */ > + If the nptl bug is present in the inferior return false to > + silently ignore such errors, and let gdb enumerate threads again > + later. In such case GDB cannot properly display LWPs if the > + inferior thread list is corrupted. For core files it does not > + apply, no 'later enumeration' is possible. */ > > if (!target_has_execution () || !inferior_has_bug ("nptl_version", 2, 7)) > { > exception_fprintf (gdb_stderr, except, > _("Warning: couldn't activate thread debugging " > "using libthread_db: ")); > - return 1; > + return true; > } > } > > - return 0; > + return false; > } > > /* Lookup a library in which given symbol resides. > @@ -924,7 +924,7 @@ try_thread_db_load_1 (struct thread_db_info *info) > > linux_unstop_all_lwps (); > } > - else if (thread_db_find_new_threads_silently (inferior_thread ()) != 0) > + else if (thread_db_find_new_threads_silently (inferior_thread ())) > { > /* Even if libthread_db initializes, if the thread list is > corrupted, we'd not manage to list any threads. Better reject this