From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id knyQOJ1+CmjvpgMAWB0awg (envelope-from ) for ; Thu, 24 Apr 2025 14:10:37 -0400 Received: by simark.ca (Postfix, from userid 112) id D6B391E0C3; Thu, 24 Apr 2025 14:10:37 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 51F2A1E05C for ; Thu, 24 Apr 2025 14:10:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF1613858C50 for ; Thu, 24 Apr 2025 18:10:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF1613858C50 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by sourceware.org (Postfix) with ESMTPS id 954103858C50 for ; Thu, 24 Apr 2025 18:10:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 954103858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 954103858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745518201; cv=none; b=I7VTlhI9gCgy4WYQ3gt36wcM4KRFwMK/cJUnOErmDtnn53fML9EmEdzinWWfyXeRIQZ+n5nHCPouLVoLAlsSIdluIqtBlit4AKuQNUXdUxN0od5oRWDmKQwc+hzyc3KebelABLd9b6Q4VUWlHWMSP8kHu4rqLR3dqID5DKdIJ0M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745518201; c=relaxed/simple; bh=txKQAHLHfWucxJCDK1Rrr+QnMK4KKDZMuS9/eFOuYSU=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=dofyUDZeQFKfFun5SO9xhHqPkEz1vVPRz+15XvRfow3oEMxyXD5qiapnbQKAOVwtGZvhyI9nmw5UdBkW7IWq+JTGh3Hbon96px6CMgoHYDxFWTFMdwROACKjD3OU04BX/fr44SZQF7tHZqwnHOIymZkBEcSzNPQxgvIb+LePtEU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 954103858C50 Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-39c266c1389so960109f8f.1 for ; Thu, 24 Apr 2025 11:10:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745518200; x=1746123000; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=umrKJb7TbH6q58LLduavcrmp++7aad+ss3MASreGaWE=; b=IkS766tilpuuLL+ovaLNgQGiMRmxZVR5dmBLFn7tu9zycpBNmCWWwbCQ16ap+smUjS eK/VscGwHECNjkvr/zHAXQnRJ3bwXiRoddArVe+V/t8W5WhZ+NaJwOv1EjX6LKQLpG9q CyyTeT0OmumTSq6KGvunWe3Nh7830zwNTd4z7RKHXWvjUSvdhm7y45S8CfBWqNkW8yBo IW7na3Q5KGKT3n/BLDrpcGttSZ8dzAErS59iKM5NYKraT8yWZu61F6Dfx6EV8pV3EtPn KpLeoiK+ORyLPGGHqIUrz+Bvz6Trrg9XUGsDALqhnQ7fS40l6PdSaOXor3MdGW079D/V +qbg== X-Forwarded-Encrypted: i=1; AJvYcCXvSI8iPRoiJlVV5CQ2n3Ea2s8vfEqEmi0V6XfpeZcqdkeRYZurlnRCWYhbgqeEw0zuOIRuVul69aRzZw==@sourceware.org X-Gm-Message-State: AOJu0YzLN31cKj6GScEsrqZaiMCADCrbh79Ddib/hSIuYiB2GmUzDyVm kwEaJwLY7MVZZU2sZ/GZCooloI09kKU5fkAB3uiT9uF5hPZYkkJhQN3BAIKZ X-Gm-Gg: ASbGncvyEe9C9S+oq78OOPavjonc9GINkOi4aH3wj5VxUAS7R3n8RN980dFbZAm+dnW B6pKmXNds6d6UuL++QRjerxr8fgEF/H1DJM8xSscBbhpB8O52EOfqq/gv+z1IPJJHI/Omh11jFB KirWPGM+uFlqFVGvDzmsaQUrvevCFMaAc7Pcya9x/zQ5p68oEm+7SqvzrdsUN6gjLHIUWn4s8e3 EAT0Nf2ZwZx+34gFhSX4Cq1YyOkoTQXdeqoUsVWG9cFfuOeeuINjMGtX7D7k4WrToc+5tOJqTOM MY1UWrSOgKAxhzkoQQLkB6C2xkk7gMx1ny7cPdWWi+Jw8r9YvV+MKXG2LOvgukX08eIOBJ5vJBH XQlJAb3DT X-Google-Smtp-Source: AGHT+IG/efwxwsR44n7ye2HMeW+M8aEf0GDVvOFsUb37VT44e83tkxbOR0TP7xxIllM9nHlKjIY2sw== X-Received: by 2002:a05:6000:1785:b0:39c:1257:dbaa with SMTP id ffacd0b85a97d-3a072bfa172mr263537f8f.58.1745518200142; Thu, 24 Apr 2025 11:10:00 -0700 (PDT) Received: from ?IPV6:2001:8a0:4fcf:3e00:704c:2a3a:5212:7960? ([2001:8a0:4fcf:3e00:704c:2a3a:5212:7960]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a073ca5225sm26837f8f.33.2025.04.24.11.09.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Apr 2025 11:09:59 -0700 (PDT) Message-ID: <8a1a0372-a24d-4580-adc3-fc48b1d260f8@palves.net> Date: Thu, 24 Apr 2025 19:09:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/2] gdb: pass info_threads_opts to print_thread_info_1 To: Tankut Baris Aktemur , gdb-patches@sourceware.org Cc: guinevere@redhat.com, eliz@gnu.org References: From: Pedro Alves Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 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 2025-04-04 14:36, Tankut Baris Aktemur wrote: > /* Helper for print_thread_info. Returns true if THR should be > printed. If REQUESTED_THREADS, a list of GDB ids/ranges, is not > NULL, only print THR if its ID is included in the list. GLOBAL_IDS > @@ -1046,11 +1064,13 @@ pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread) > is a thread from the process PID. Otherwise, threads from all > attached PIDs are printed. If both REQUESTED_THREADS is not NULL > and PID is not -1, then the thread is printed if it belongs to the > - specified process. Otherwise, an error is raised. */ > + specified process. Otherwise, an error is raised. OPTS is the > + options of the "info threads" command. */ > > static bool > should_print_thread (const char *requested_threads, int default_inf_num, > - int global_ids, int pid, struct thread_info *thr) > + int global_ids, int pid, thread_info *thr, > + info_threads_opts opts) Would you mind making that argument be the one after "requested_threads"? I.e., make it the second argument. That is so that both user-input arguments are next to one another. And make it a const ref, as this structure will grow other fields and become larger. I.e., write: static bool should_print_thread (const char *requested_threads, const info_threads_opts &opts, int default_inf_num, ... Same logic for the other functions. > /* This end scope restores the current thread and the frame > @@ -1322,27 +1342,10 @@ void > print_thread_info (struct ui_out *uiout, const char *requested_threads, > int pid) > { > - print_thread_info_1 (uiout, requested_threads, 1, pid, 0); > + info_threads_opts opts {false}; This can be just: info_threads_opts opts; as the boolean field has an in-class initializer. With that it LGTM. Pedro Alves