From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id AEAC93858C83 for ; Mon, 28 Feb 2022 15:41:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AEAC93858C83 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-JQQM2RrnPI2q-0tN5FeMqg-1; Mon, 28 Feb 2022 10:41:28 -0500 X-MC-Unique: JQQM2RrnPI2q-0tN5FeMqg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D0D11006AA7 for ; Mon, 28 Feb 2022 15:41:28 +0000 (UTC) Received: from [10.2.17.55] (unknown [10.2.17.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF25583C12 for ; Mon, 28 Feb 2022 15:41:27 +0000 (UTC) Message-ID: <005b94d1-fa7b-0da2-66a7-ad6752d4f04c@redhat.com> Date: Mon, 28 Feb 2022 07:41:26 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] Error when gdb_is_target_1 is called without running gdb instance To: Keith Seitz via Gdb-patches References: <20220224174106.1620437-1-keiths@redhat.com> <87fso6oq06.fsf@tromey.com> From: Keith Seitz In-Reply-To: <87fso6oq06.fsf@tromey.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2022 15:41:31 -0000 On 2/25/22 08:44, Tom Tromey wrote: >>>>>> "Keith" == Keith Seitz via Gdb-patches writes: > > Keith> This patch adds appropriate warning comments to these procs and > Keith> causes gdb_is_target_1 to issue a Tcl error if it is called without a > Keith> gdb instance already running. This should prevent unwitting callers > Keith> from using this at the wrong time. > > Looks good. > > This is one thing I really like about the mythical internal AdaCore test > suite: in it, when you start gdb, you get an object back, and so > something like this would be a method on the object -- impossible to > call without it. I think that's a great way to deal with issues like this. I wonder if we could piecemeal implement a holistic change such as this, though? Given the size of our test suite, that would be a *lot* of auditing! From where I sit, though, there are "bigger fish" to go after. :-( Thank you for the review, I've pushed this change. Keith