From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iSZ2HGElYWriySYAWB0awg (envelope-from ) for ; Wed, 22 Jul 2026 16:17:37 -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=P/I1PJen; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 61D4C1E033; Wed, 22 Jul 2026 16:17: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=-6.4 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 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 6D29F1E033 for ; Wed, 22 Jul 2026 16:17:36 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 366624BA23C7 for ; Wed, 22 Jul 2026 20:17:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 366624BA23C7 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=P/I1PJen Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 7874C4BA2E3A for ; Wed, 22 Jul 2026 20:17:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7874C4BA2E3A 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 7874C4BA2E3A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784751421; cv=none; b=TGDwYcmXD9lxPZ2oVTC8zlwoX9axkvBMangwBTHbLSH/pZSnjaT2gHJ1/f+2DxCcdx+VEsDER322/e1ZfOj1Ulno5OFugo9vmb+eMG//7bMsXMUKs84UzNo3/iyOJrZIQ1h/kz690oLo86pyj2ocV2ulz0TBt4fCUoW7zbtxPqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784751421; c=relaxed/simple; bh=Fqa8x1MBBAYuRy/JyK67Cg1jJtTdmoRtIOI9D153T5E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Qex0F/F1gNN8q+ibuLkkWwn+juQXAD4/Ypx+QiWPVaQgyc4wJ0m09Pxn9O8ztofiym4ZdyVPmapJjM/Zoe+mONdDa08Q7IOhLpgMs/pHBHT34EHpa+LCqPT4DB21nw2ark78HJeU+vrH+9RRcYKzbu8cl+/lrdjmG7POc6M4R2g= ARC-Authentication-Results: i=1; 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=P/I1PJen DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7874C4BA2E3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784751421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ImmrRzgoFS11AGj2pUgP1rOC7JVxxSTCczIH+oIgiak=; b=P/I1PJeniISVzCzm18TjJWhIOTr6GMbPA12ma1VmKScTGYgVp3T5phYOfOa7rT0lVtk8jX +SAk3GSMb2NYFhb5Zs2Ne7VR0JyG403F9dmCnJIHoHTz/N/5OxXGKbXG4o9xeDQsfG1KpT G76ur5l72KjTWoUvusTIdUXeq2l237M= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-27-OjEcEXE8PK6Up0Xcht_YOQ-1; Wed, 22 Jul 2026 16:16:57 -0400 X-MC-Unique: OjEcEXE8PK6Up0Xcht_YOQ-1 X-Mimecast-MFC-AGG-ID: OjEcEXE8PK6Up0Xcht_YOQ_1784751416 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-475e540a0ffso7459403f8f.3 for ; Wed, 22 Jul 2026 13:16:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784751416; x=1785356216; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ImmrRzgoFS11AGj2pUgP1rOC7JVxxSTCczIH+oIgiak=; b=s4ArVyAU9+QaDqOYh2z7vBDNHmcZeYMGYuwQPF7GOYUYzCGkV3lQNs60jx3PclM9as R6oSuCfw64ok5Z+9gtzqw8HFh1+N0n+4UbHVDA3rM/JrXwrTYtfcIl26gt185Af5qdrY uGoVY3LtXUXei6TSFU+3HrKKdmH1gzz2ymTmfVodyDvxG7hYLcpj+qZ4qFMY41I5ptA2 3TrMX5kPfVc545+OKw5omC7Zy8Jy64Zv+v6BpopGc+ELSwM7A1WNpoadYbu0+v/MEvZJ Md5sO5OeECTucNQeuPqwmaEI2LqNeBzOPObcAvFHAV49vdMjStEleqvlx3UMEv71MGP9 tdrw== X-Forwarded-Encrypted: i=1; AHgh+RobM5kmBKJMIGugQ9wiNj77RRFptUk5GmxM/oZyDHp+280zJredj1GPfCyQM3pBigNy9Z3C1qLD/lweFA==@sourceware.org X-Gm-Message-State: AOJu0Yy6jLT6+zT7X9QpRd5gff7DwqN2MLA4bZLNvn+WsQk5LqgMB/jq /RgyBT+/6lSjhDB3pGzvfG1aANPz15BDMK1u/hYmoGeSaUxcG3CNNNY7QatkRysUOl7CWn2vrEW RlVDhgQ5lMc5es8r+NOLi6keSDS2kVoLfeofBYjZ2Lqy/5XwNkkNYzI1g7cyxWbQ= X-Gm-Gg: AR+sD10h0xo1KdxbmbFr/8zjuZwfFcaMDY46uVGeE09eEl0nWknS3mAMKfiQRbVOuKK 2PGJ9QYgXAVkYZ6D1Y7ilFNbkNkvmG3jhsOSKR8gfeyuXckRhN/G65VqO0ka0rzS/S1StFbspQ6 2N1FUev/sYYxEYh2GHllpGCIfysBf0pSuXzD9Db7Sy0JCy41uT628WcqKfBVK8XJXOusRmYYT+0 3JqkzCBogJRkzXoosMFSGeDWIH7+59XXD2/Adc2iwtr6OpSyGI6L8t7kxpXfoMLHRGr1xEhGfEE U3z7etqIKclP6oCEuQAXLyzIp6ZxWprJvc1ig+oyYLTLF4iDV7pB3U8r7oIBOswiVQfEz433 X-Received: by 2002:a05:6000:25c3:b0:47f:80e5:b9b3 with SMTP id ffacd0b85a97d-47f8dc86499mr367480f8f.33.1784751416458; Wed, 22 Jul 2026 13:16:56 -0700 (PDT) X-Received: by 2002:a05:6000:25c3:b0:47f:80e5:b9b3 with SMTP id ffacd0b85a97d-47f8dc86499mr367459f8f.33.1784751416034; Wed, 22 Jul 2026 13:16:56 -0700 (PDT) Received: from localhost ([31.111.209.233]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85bd77a9sm8651060f8f.14.2026.07.22.13.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 13:16:55 -0700 (PDT) From: Andrew Burgess To: Klaus Gerlicher , gdb-patches@sourceware.org Cc: tom@tromey.com, guinevere@redhat.com, eliz@gnu.org Subject: Re: [PATCH v8 3/6] gdb, cli: pass the argument of a set command to its callback. In-Reply-To: <20260722102746.131536-4-klaus.gerlicher@intel.com> References: <20260722102746.131536-1-klaus.gerlicher@intel.com> <20260722102746.131536-4-klaus.gerlicher@intel.com> Date: Wed, 22 Jul 2026 21:16:54 +0100 Message-ID: <87zeziok3t.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: vPxt7-a2WOJiPzfbb9M1mVzi3ZzmEBvTj-KF2r8Q570_1784751416 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Klaus Gerlicher writes: > From: Natalia Saiapova > > This might be useful, if some commands need to have a special case if > run w/o arguments. The body of a commit message should ideally not run-on from the title line. This first sentence only makes sense after reading the title. Anyway, I think there's a bug in this commit. For the setting types: var_uinteger, var_integer, and var_pinteger we call parse_cli_var_integer which can modify ARG. This means you'll not be passing through the actual argument of the set command in these cases. I think the fix is easy enough, just capture the original ARG near the start of do_set_command. I think all the setting types are fine, but if you just capture the original ARG value and use that in the 'c->func' call you'll be covered. Thanks, Andrew > > I am going to use it in > gdb: refine commands to control scheduler locking. > to keep the old behaviour of the > set scheduler-locking step > which should set both > set scheduler-locking step on > set scheduler-locking replay step on > To do this, the set-command needs to detect that it was issued without > arguments and have a special handling for this. > > Without the special handling, the command > set scheduler-locking step > would set only > set scheduler-locking step on > > Approved-By: Tom Tromey > --- > gdb/cli/cli-setshow.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c > index 7688da015de..f1f313a4cd0 100644 > --- a/gdb/cli/cli-setshow.c > +++ b/gdb/cli/cli-setshow.c > @@ -455,7 +455,7 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c) > error (_("gdb internal error: bad var_type in do_setshow_command")); > } > > - c->func (NULL, from_tty, c); > + c->func (arg, from_tty, c); > > if (notify_command_param_changed_p (option_changed, c)) > { > -- > 2.34.1 > > Intel Deutschland GmbH > > Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany > Tel: +49 89 991 430, www.intel.de > Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell > Chairperson of the Supervisory Board: Nicole Lau > Registered Seat: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928