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 E60A13858D1E for ; Mon, 9 Oct 2023 09:26:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E60A13858D1E 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=1696843564; 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=6V04n+dKeHQWHkXxJ7+SQquS8XrG2BYW/Erk3kLOIyE=; b=GYxXVo6au+RvVTHWdLIMQvFIDI//YqlwIPvLdIEjocEQ90vn9b0hvvXZfD75mrycllbbzG qwF4pqOQ+o3AzgQZbjZ1TIWFta3S+AN/GCcEt1yMgtgoQPCVrktv3+ag2bWpqLEBeUjo5C hlsBJhBGHzpQ5GQcGKAgbrGzo9qu3wA= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-526-z-SkN6cNOtq0wVLqkdUCXQ-1; Mon, 09 Oct 2023 05:25:45 -0400 X-MC-Unique: z-SkN6cNOtq0wVLqkdUCXQ-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-9b822f5c156so353061866b.3 for ; Mon, 09 Oct 2023 02:25:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696843544; x=1697448344; 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=6V04n+dKeHQWHkXxJ7+SQquS8XrG2BYW/Erk3kLOIyE=; b=e6Ndm49K98Kk+d7R/fSPNviTbm2/IeHQ5wDXQZaJyA4tXBoxgJiNjSvOpzHWMfvNwq xooxQnS2h0F+VQ75PzhVLdTN0IN/mZTZhJfFpv61VESEEj1P6SmXucrdlbdhNmugBF+4 aE6qArmK4JkN1y+L2Za2z9SYyTmryFibvdBpedaG9Epbaf1w16Dv0ZHq+MxQWRrP+K4z jwUfkf4W3fEj+JSqW3QM5c19k3pFaL0vGPSv4iCewgnw07JNHvlhuBI0QGhJJNHLKoqe /O8Xm4Fe5Ghxnzzkl5tl8k138GZEbX5yliZgqufwVhzWSM/WoC8ciY5MKcjz9m40mL7u oyCA== X-Gm-Message-State: AOJu0YwVEKWlHohg71LjZfoUodhOCXtTvN4t12eTygBRQdvZRemMA6Dr n98PvalDYLkGovktY8SEObfeylgOot/TLjN3mk+gnW9jWggV7b336982t8BGsuTtno8iDkB22ex cVm/0EJBgQ/5mjaK81hr08Q== X-Received: by 2002:a17:906:20da:b0:9ae:4eb9:e09b with SMTP id c26-20020a17090620da00b009ae4eb9e09bmr13722223ejc.27.1696843543962; Mon, 09 Oct 2023 02:25:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFo231I8M7FTlHzwcZelnKr+pUWIt8jxxocHODkqMt7VV/D3Xt8d/DMPTY5tMz+tRvR/jzh2g== X-Received: by 2002:a17:906:20da:b0:9ae:4eb9:e09b with SMTP id c26-20020a17090620da00b009ae4eb9e09bmr13722205ejc.27.1696843543572; Mon, 09 Oct 2023 02:25:43 -0700 (PDT) Received: from localhost ([31.111.84.209]) by smtp.gmail.com with ESMTPSA id lf18-20020a170906ae5200b009ae5e46210asm6531315ejb.99.2023.10.09.02.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:25:43 -0700 (PDT) From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH 3/3] gdb: add assertion when marking the remote async flag In-Reply-To: <20231004020701.260411-4-simon.marchi@polymtl.ca> References: <20231004020701.260411-1-simon.marchi@polymtl.ca> <20231004020701.260411-4-simon.marchi@polymtl.ca> Date: Mon, 09 Oct 2023 10:25:42 +0100 Message-ID: <87a5ssdu5l.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=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: Simon Marchi via Gdb-patches writes: > From: Simon Marchi > > As reported in bug 30630 [1], we hit a case where the remote target's > async flag is marked while the target is not configured (yet) to work > async. This should not happen. It is caught thanks to this assert in > remote_target::wait: > > /* Start by clearing the flag that asks for our wait method to be called, > we'll mark it again at the end if needed. If the target is not in > async mode then the async token should not be marked. */ > if (target_is_async_p ()) > rs->clear_async_event_handler (); > else > gdb_assert (!rs->async_event_handler_marked ()); > > This is helpful, but I think that we could have caught the problem earlier than > that, at the moment we marked the handler. Catching problems earlier > makes them easier to debug. Agreed. Looked through this series, all looks good. I had a few nits that I reported, but otherwise: Approved-By: Andrew Burgess Thanks, Andrew > > [1] https://sourceware.org/bugzilla/show_bug.cgi?id=30630 > > Change-Id: I7e229c74b04da82bef6a817d5a676be5cf52e833 > --- > gdb/remote.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/gdb/remote.c b/gdb/remote.c > index 38d0027dbf9e..7830b5cec33f 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -424,7 +424,10 @@ class remote_state > } > > void mark_async_event_handler () > - { ::mark_async_event_handler (m_async_event_handler_token); } > + { > + gdb_assert (this->is_async_p ()); > + ::mark_async_event_handler (m_async_event_handler_token); > + } > > void clear_async_event_handler () > { ::clear_async_event_handler (m_async_event_handler_token); } > -- > 2.42.0