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 10ACB3858D33 for ; Wed, 15 Feb 2023 12:56:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10ACB3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676465797; 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=WuuVbD0XFmnPlEpAeMnZbT4Ei64+EgNus2gwZd8eJSI=; b=UT39aR47I9r0Lqa8E7XuqzvhXYEH4DFX883Lw3Cia6fy5LTRHFtOAoxgDmrM9wGce5x1E9 l9LwV113CiNASj2KK9h2wez6XGc3Q7UUj3MgeiPY5R+K6KpVG7NQX7gzjWYwn8M38/mrYx FZiW2xWluyv0t7ATX96EvKAVlBhLZ2g= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-404-CJkRMUUhN_KpZFXEohczEA-1; Wed, 15 Feb 2023 07:56:35 -0500 X-MC-Unique: CJkRMUUhN_KpZFXEohczEA-1 Received: by mail-qt1-f198.google.com with SMTP id v3-20020a05622a188300b003ba183e8272so11028067qtc.0 for ; Wed, 15 Feb 2023 04:56:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WuuVbD0XFmnPlEpAeMnZbT4Ei64+EgNus2gwZd8eJSI=; b=vsR/QYtyOXeTxZ0e/Oi895LIWj7HJ/9z02O62ZGDZsv6TG/9hxoTj9lN/wXBcyD0d0 rYfKjN6hO1XQ163rW2mPpb9QfW2sCV8z5JEm3f3/spvvErLxiKCZKN/tnEsSkO8MA9Tn VWAplj8no+kocz7/2/+k/cPIu8vf1bkxOpGZxF02aCFKe1YWRDlipWOTOMNSKpjzJOlg PjIpx5T2lrypHiAaW6OMioxgZ0Vb+kfLT4ScxVvBoa3/izEAi3tJ7ONPmSzcGF4RUEAe LiA+Mf57vCSJG+x21/rr+DhwwbfpO5UPdwKojvuq+qh6VFxqDBysMRT5jbopF7CdoXsk xGWQ== X-Gm-Message-State: AO0yUKU18PNfulyjd/OKZbcb5GMRk4ywhuoMwqVKW5qvFJJzfIzwyrNs WVcx9Zd3FlUtVsgMtp17c3hnhglMHcUkQxhYV6W+EabwGWiwcWpsCW46mSCqOT3TktX1AHZ8NQ0 dMhqRetVsCP2rmnlmw7t6LF4uUtc= X-Received: by 2002:a05:622a:1a27:b0:3a7:e619:61a with SMTP id f39-20020a05622a1a2700b003a7e619061amr2720971qtb.37.1676465794471; Wed, 15 Feb 2023 04:56:34 -0800 (PST) X-Google-Smtp-Source: AK7set96h8S/ch720E61Js9qkzVuG04wJJHotcJLYeRq9f+DsdXbYcO3Kcb8yQJvO5le1wp2C27slw== X-Received: by 2002:a05:622a:1a27:b0:3a7:e619:61a with SMTP id f39-20020a05622a1a2700b003a7e619061amr2720956qtb.37.1676465794252; Wed, 15 Feb 2023 04:56:34 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id t71-20020a37aa4a000000b006fc2f74ad12sm13954749qke.92.2023.02.15.04.56.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 04:56:33 -0800 (PST) From: Andrew Burgess To: Tom Tromey Cc: Tom Tromey via Gdb-patches , Tom Tromey Subject: Re: [PATCH] Do not record a rejected target description In-Reply-To: <875yc4tawn.fsf@tromey.com> References: <20230112193356.1133696-1-tromey@adacore.com> <87bklwmenh.fsf@redhat.com> <875yc4tawn.fsf@tromey.com> Date: Wed, 15 Feb 2023 12:56:32 +0000 Message-ID: <875yc3m6in.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tom Tromey writes: >>>>>> "Andrew" == Andrew Burgess writes: > >>> info.target_desc = tdesc_info->tdesc; >>> if (!gdbarch_update_p (info)) >>> - warning (_("Architecture rejected target-supplied description")); >>> + { >>> + warning (_("Architecture rejected target-supplied description")); >>> + tdesc_info->tdesc = nullptr; >>> + } > > Andrew> This seems fine, but it is possible that an exception could take us out > Andrew> of this function too, for example, a misbehaving remote target can cause > Andrew> target_read_description_xml to throw an exception. I guess that any of > Andrew> the issues you were originally seeing would also trigger if we throw an > Andrew> exception. > > I don't think this can really happen, because that call is part of the > assignment to the field in question: > > if (tdesc_info->tdesc == nullptr) > tdesc_info->tdesc = target_read_description > (current_inferior ()->top_target ()); > > So, if it does throw, the tdesc_info won't be updated. You are, of course, correct. I guess given we know nothing after the assignment can throw the what you have is fine. Hopefully we'll not add an error() call later. Sorry for the noise. Andrew