From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /FC+M+TZYWrCeygAWB0awg (envelope-from ) for ; Thu, 23 Jul 2026 05:07:48 -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=WXY5wWGs; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C007E1E09E; Thu, 23 Jul 2026 05:07:48 -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 [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 2D8EE1E099 for ; Thu, 23 Jul 2026 05:07:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A33B64BA23FA for ; Thu, 23 Jul 2026 09:07:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A33B64BA23FA 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=WXY5wWGs 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 F376B4BA2E04 for ; Thu, 23 Jul 2026 09:07:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F376B4BA2E04 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 F376B4BA2E04 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=1784797642; cv=none; b=A5RwDGXvVBHXvcxCRnp1wRoqSBSzLAiR55Lb1SxXFPBo0b2KEd0cZpbjOH92JcBe2Q54Px+U5MWqVu53PyBgCgZlJjCx/f+CTJKVVd/3f/NSZBjSotYdVnBIK0CSIKYB3eAi8DEheXYWOEayJWkVvFYfabQ7QqpZZqOzW65y/g8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784797642; c=relaxed/simple; bh=KyoHmI03sW1QsWk0p0iOh/H6XZimGUTD7iHOR35rmQg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CnQIuijpN0R3oLXyAuQbWCslSQFwCK6dRQLyRQj0ZjpK6Ec8Wh1quCLmTkj6hRDNdQfz4b6M786vju9hp0mDrBImMKvf+yRraizxb4BUDtAimUVBbsc0mZ4FRNTyy7wZJh+HRmWP9XI9hxWG40k7QPBfesw//nqZjOxtKDY+lgQ= 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=WXY5wWGs DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F376B4BA2E04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784797641; 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=U47W9uvzUvyHwV4oHoGstW7FekB9kMgC+R9i2RsoB4s=; b=WXY5wWGs/p4Dw/QmWxhfjdtrR+1jRrrR8nC084IzQshT4aPO01owbg5oIlxdJdpBRA/M5O n8ofuds42UkQV5ycaSxL+9FpJDfjcwdE6tTt78+9ykY4RiMqLe/B+s++8JO734OXN2Gbym rLiHAomMomZHIHzjIXy+q2CQ5fAHzWY= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-259-gU6xvqHvNzSc7Bt_8wuS-w-1; Thu, 23 Jul 2026 05:07:20 -0400 X-MC-Unique: gU6xvqHvNzSc7Bt_8wuS-w-1 X-Mimecast-MFC-AGG-ID: gU6xvqHvNzSc7Bt_8wuS-w_1784797639 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-476608a9fefso236959f8f.1 for ; Thu, 23 Jul 2026 02:07:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784797619; x=1785402419; 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=U47W9uvzUvyHwV4oHoGstW7FekB9kMgC+R9i2RsoB4s=; b=sLrAWDA5C+05Zf0Ln3Q7s5pL71GkDG7A0YV9BSGx+M8kk4U/oZauAM6Ol1QOMcj9zJ o0MXB2NjCBMDUS4BXkVUW7yLBa7ixsI3k0acNCiH2SYeuIeEF08I0Dnon8n9QxBSFprA F0U4M/lwhMfdloGqeHC4hPeyFbsXPHai32/M2A++9aUO7d/Tmrw9ye6lHv1GAg84QPKg OrhYmY9Rn/XRMvLCwnDLMl4deZaWMsff+oLxmApT1STKED4YGSVgOBqsvFx7JESRzDNk 2td4GJfLqBcGixwtDUar74U1NLoV1ZtOEag1iQgNnIpEZrLS4wGzJDF6EX88hgOcr277 Ef5w== X-Forwarded-Encrypted: i=1; AHgh+RqqXRKw07NO7kJK31ysCzvdzzygNzcefD/UdunSCz1EA4LJMYKR4sDQe9V2XExRN8xmlVdsrJP32Qakrg==@sourceware.org X-Gm-Message-State: AOJu0YxGqUNHQ1D1zzc3pD6zS2l4yvX/bbc9CFZQxjik/H9j4PJiPEa0 6LUMtXZpn43jYpwEA3PSos0HbNXzFpprhB+T60AnoWOuxuygAxXR3d8LGIF7BZ/gTjQ8/EIbbM9 wvDd/BKFZXQGBKtI/ETQ4aXdCRN+nGC7qzNy+cjNAXc8H0F6GPR1S/IoWaxagsn4= X-Gm-Gg: AR+sD10jB9et4lI01nUyWs8vK7RRx66kBkVXmvP40cC8n/2hyasJq1zQXlSGve5b9ED /+Z9tvQdsOnBX+Amxsc5W2CGjJEWlyDn9/mISOenAeFNf0dsZod4p/uxNd1tmdL2INb3nFErySq Yw/40KtfcBQ1l24d1/ngK/U+ZjonJ6OD22WzcSznJXGFOT+rkibviee8IE7vVxxElPD+bKwN6il ju9SugFw9kMBSJZNGGGvSZaxgS5GjyggwkEJc0ejXT+LZhmHwCqaMX+10D+J/MdJP8mO3//V4qd ZnNRuvC7uSIGVbu3A7o5PWtXyuPVij1p2lkezKjsq3ux8azaM/1VPz8FNi72Uw7CXL35Qjbu X-Received: by 2002:a05:6000:2211:b0:475:da0e:744d with SMTP id ffacd0b85a97d-47f90235847mr2177889f8f.8.1784797619167; Thu, 23 Jul 2026 02:06:59 -0700 (PDT) X-Received: by 2002:a05:6000:2211:b0:475:da0e:744d with SMTP id ffacd0b85a97d-47f90235847mr2177838f8f.8.1784797618694; Thu, 23 Jul 2026 02:06:58 -0700 (PDT) Received: from localhost ([31.111.209.233]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85bb81dcsm13416717f8f.12.2026.07.23.02.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 02:06:57 -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: <87zeziok3t.fsf@redhat.com> References: <20260722102746.131536-1-klaus.gerlicher@intel.com> <20260722102746.131536-4-klaus.gerlicher@intel.com> <87zeziok3t.fsf@redhat.com> Date: Thu, 23 Jul 2026 10:06:56 +0100 Message-ID: <87wlumnkgf.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: mhdeuZ8FIO00PbYvonpjxIvemtJdEri4DQOYLJYiXHo_1784797639 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 Andrew Burgess writes: > 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. It occurred to me that we can easily add some tests for this new feature. If you checkout gdb/maint-test-settings.c and look for the "test-settings" you'll see a bunch of dummy maintenance settings. These are used by a number of tests, like gdb.base/settings.exp. Could we not add a set callback to each of these settings that just prints the value that you're now passing through? Then the tests, like settings.exp can be updated to check that we print back the expected string. Thanks, Andrew