From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gDekJevkbGgOli4AWB0awg (envelope-from ) for ; Tue, 08 Jul 2025 05:29:15 -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=bz7ThyBo; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8934D1E11C; Tue, 8 Jul 2025 05:29:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-10.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_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE 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 809B01E089 for ; Tue, 8 Jul 2025 05:29:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB34C3852114 for ; Tue, 8 Jul 2025 09:29:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB34C3852114 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=bz7ThyBo 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 C1B34385ED78 for ; Tue, 8 Jul 2025 09:28:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C1B34385ED78 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 C1B34385ED78 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=1751966887; cv=none; b=t9CJ+kFhuvjLOmJeiZ41ArVPsVUWdbFmi5dDmYSohHgGSVOCiSlgO1WsbRj6KWvNlcOaI5fou6+oGR32mGjrQGaE8CVwlE28Js2+czdIDEsr+R1FgD1FYVGzeoo3QxBGnJBtCjH5Zuz6MGKqplbFVviQXCBqMbwFEXLRj/3t+0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751966887; c=relaxed/simple; bh=/MexQz1niQVy6j3XqPj5xPHG4wzGO0dOiLuN5F1mjUk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mBB3qIw5MmdHU/tyAYTTYFwYRZA107gPbmSOF3DBitnBC7W70XQ+ueDGGXjrUXVhiAM+Qs7znPtKHZbyXVBZEzYnIJk+KPH2iysMGyJX/AsMeKHE3gQKXGVL56NvN55GUFOBdS5pc10Y2ed54baAnT5xJTbt0kUrf05nRkW0Hs4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1B34385ED78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751966887; 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=eSH1dxS0/BxBQGx51Jkl7wLC4T+tjDIAoEYLuG8ii7A=; b=bz7ThyBoAVkcD+jYoYNVuBT5vUSbTEwWapOPRNk/zlH0cER/XeID1FF4NWdXLls5ipOFiN XTwQiWMK5EOcms5LkuiKpLEXccTrKm0plMOJ8fuu/FKPQ799rBnBlUksqn/6OKIC0kE/dz jdB1JG3E9jcp3tpT9OHIcFmzOpStLjE= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-148-unbIoYpRMb2fK0BoEitVBw-1; Tue, 08 Jul 2025 05:28:05 -0400 X-MC-Unique: unbIoYpRMb2fK0BoEitVBw-1 X-Mimecast-MFC-AGG-ID: unbIoYpRMb2fK0BoEitVBw_1751966884 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4a6ef72a544so87516091cf.1 for ; Tue, 08 Jul 2025 02:28:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751966884; x=1752571684; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eSH1dxS0/BxBQGx51Jkl7wLC4T+tjDIAoEYLuG8ii7A=; b=iLQct3I2kfsuuuxYJVKq+GW34vdZyA45NW6FWW8zn50eO9Vg8KLE8qJN6aiM3WpfMg 5lA/j+KO/TLQK1GGsSnSW0sLIMjrwQQVqOYkKzeifhovzXIuL0u0UPzEPfQDr+hy4kse EXqvcamU5BqN7VUDdUJLSxjUzddgGl2oWb2S84TsJyC4akVsZF3yZLspPB02ix/h9/uz Hii+uq9jnDNlrgzuqrPHINFiggTfbpDhMcK8U+AnJ9uqHMACiTQLOWqOQmnDFl98TPq1 3LVmdYH3qAk1zmNLQKvWKbgGAcUM3E9rchN0NiJsRWcjCCMsjXrNVPpup745ja89DFS+ MLDA== X-Forwarded-Encrypted: i=1; AJvYcCXdDO4p5QKI/RsnfCdRu0DTVwcWEiOdslJLgtATV2UR6OWwjuEDdz0h6WnSYEo15ZzMPusPA+YUs4kVlw==@sourceware.org X-Gm-Message-State: AOJu0Yz2LF/7gDsgvkCU9V3/JxkySEgPWvey/5wYl8tWSm3BSV+InAg6 Aa+UOqHmYVCMEPbG3C5MwzkuwYJD/l8PC3X6eKVXgbn17Z2W53sn2M2n0Jl01v30Wk07C6VhQD8 kP+p+LWgCgdIkE1zvBsSXn4+UTPyuV4/HCnF07ak6Hc1CW004xnVKaT6NttMJ2RdB0YYNhuM= X-Gm-Gg: ASbGncv9jiKX6MSjCy/6V5ihO/+GxBzC7SbxALoaUi3hOnKzWeDlQ0uwVnQOb3upsDa ZsoomAWSZLah660jG+AI3chCR6sBJ7Q9SJjnrKsMKHY6y9Z9V5YzhzndVdNB0SoIbzA7VUOAYtl ZUJbCjRNCjTk+PPRDF8qM5qLE0gBABP/1vCx7S+JgjQSwUw6LTEHIJoH4zARdvAOIR/I1bOrmRg lgWGNtDcxzGWrURt+dFiMjy9r/1gQRLmKa3nO7RfzjZaRcwAhbI9ZFD8Aok6BNgmxeBm50a3rJR hPLVXwRLD0tZXu2ymho1B+5W1ctvZOu3Rm2UYXAvrUHVWOA= X-Received: by 2002:a05:6214:2684:b0:704:84de:9640 with SMTP id 6a1803df08f44-70484de9762mr6688036d6.18.1751966884237; Tue, 08 Jul 2025 02:28:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5gb1BdijrbHqOiwZjdjrhHDOKoN7bK0whOTolXlbbeNMqnxRme19grBlObYzIOmEOA1oJBA== X-Received: by 2002:a05:6214:2684:b0:704:84de:9640 with SMTP id 6a1803df08f44-70484de9762mr6687726d6.18.1751966883756; Tue, 08 Jul 2025 02:28:03 -0700 (PDT) Received: from localhost (75.226.159.143.dyn.plus.net. [143.159.226.75]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-702c4d50e45sm72959926d6.76.2025.07.08.02.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jul 2025 02:28:03 -0700 (PDT) From: Andrew Burgess To: "Kartik K. Agaram" , gdb-patches@sourceware.org Cc: guinevere@redhat.com, "Kartik K. Agaram" Subject: Re: [PATCH v4] gdb: redo whitespace-stripping from commands In-Reply-To: <20250606161014.1367913-2-ak@akkartik.com> References: <20250602233957.1130697-2-ak@akkartik.com> <20250606161014.1367913-2-ak@akkartik.com> Date: Tue, 08 Jul 2025 10:27:55 +0100 Message-ID: <87plebm3qc.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: BPz8b4bsCr6p-qnA4lpny-ojxo6TzZwobo1-j7YXWd0_1751966884 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 "Kartik K. Agaram" writes: > Before this patch, trailing whitespace was not stripped from 'set' and > 'complete' commands. Now I've added 'with' to that list of commands > because it may contain one of those commands. To accomplish this, I'm > fixing an ancient TODO to provide a per-command flag controlling > whitespace-stripping. > > Any subcommands of 'with' besides 'complete' or 'set' will continue to > strip whitespace as before, because they go through a recursive call to > execute_command. The outer call for 'with' won't strip whitespace, then > the recursive call will. > > I've also cleaned up 2 obsolete TODOs and NOTEs in related code. > > Tested on x86_64-linux. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29784 > Reviewed-By: Guinevere Larsen > --- > Changes for v4: > * Ugh, removed a stray quote character from the commit description. > > gdb/cli/cli-cmds.c | 11 ++++------- > gdb/cli/cli-cmds.h | 4 ---- > gdb/cli/cli-decode.c | 1 + > gdb/cli/cli-decode.h | 8 ++++---- > gdb/top.c | 12 +----------- > 5 files changed, 10 insertions(+), 26 deletions(-) It feels like this commit could have some tests added. There is a support library 'completion-support.exp', if you look for the pattern 'load_lib completion-support.exp' in the testsuite then you'll find plenty of examples of its use. Do take care though, there are some completion tests that pre-date the completion-support.exp library -- if you find a test that is manually sending tabs to GDB without using the support library, then it's probably an older test, and not a good example to learn from. Unfortunately, completion tests are towards the harder end of tests to write (I find anyway), but I think it is worth doing. Do feel free to ask if you get stuck. Thanks, Andrew