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 C93FE385840E for ; Wed, 24 Nov 2021 10:14:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C93FE385840E Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-124-JM07b_bjMziKthfNH4btpg-1; Wed, 24 Nov 2021 05:14:49 -0500 X-MC-Unique: JM07b_bjMziKthfNH4btpg-1 Received: by mail-wr1-f70.google.com with SMTP id o4-20020adfca04000000b0018f07ad171aso368760wrh.20 for ; Wed, 24 Nov 2021 02:14:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=MI5nNztPVtuiE3geaTKDWQLV/+uAINBqNH6BB1gs7mg=; b=y++AGk+tjdwFWaGNoq3lp6GKzsTTGH3SpjZ/e2D8qD+Lud6a3eeOsSgLz4CMYPZr2a 5cI1eC3WJKXqbs787EOvXv2u3GQkmosmyG92iXHZkVf8AMtQpnVa1TMusVPqROAB4Zf9 Ks95EPrLNCvpggSFaahXH/6cXz4u6imKEOGO4Hd9p00yEBZnrBEJzro7s/HxJHrFGrzG mQVW6NmuVQm4Tx82sU36zjWHd09fqob/NDLaJdE+8jdZEoQpcHBrOGalZd1kUDY5MpM4 q5akKXou/Fk/QowAxl0Cu2zhXvja3X3m3v4fi56u7Gsj7ra+UGme3SsxnN/G/d3qpVO9 4l/g== X-Gm-Message-State: AOAM5320cI8FBacj7S4lD85svqHv5F5Go5O/KJRevF1oLCea38oVxxhy wfmVk5rmeGbdmtrkmdq4rv31p2yvYvhXsNkF00T4W3H15TFW+T+babelCMbDmUFE2Y09ZEc0gdp La36evIz6apOtmdSrdA1FjA== X-Received: by 2002:a7b:c742:: with SMTP id w2mr13521330wmk.65.1637748887966; Wed, 24 Nov 2021 02:14:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUYGi7DJx1pe42boRy33E/xDw3crhR9BVajwyg3DrMgBer6yP6H7WPseT+S65BAY9wpfKtDw== X-Received: by 2002:a7b:c742:: with SMTP id w2mr13521301wmk.65.1637748887759; Wed, 24 Nov 2021 02:14:47 -0800 (PST) Received: from localhost (host86-166-129-255.range86-166.btcentralplus.com. [86.166.129.255]) by smtp.gmail.com with ESMTPSA id z8sm14920280wrh.54.2021.11.24.02.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 02:14:47 -0800 (PST) From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH 2/4] gdb/remote: merge ::is_async_p and ::can_async_p methods In-Reply-To: References: <9c8428eee795182bb60ed37752e48db404ea9307.1637676250.git.aburgess@redhat.com> Date: Wed, 24 Nov 2021 10:14:45 +0000 Message-ID: <87ilwhg8ru.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=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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: Wed, 24 Nov 2021 10:14:55 -0000 Simon Marchi writes: > On 2021-11-23 9:08 a.m., Andrew Burgess via Gdb-patches wrote: >> I spotted in passing that remote_target::is_async_p and >> remote_target::can_async_p are identical. This commit just makes >> ::is_async_p call ::can_async_p, removing some duplicate code. >> >> There should be no user visible changes after this commit. >> --- >> gdb/remote.c | 18 ++++-------------- >> 1 file changed, 4 insertions(+), 14 deletions(-) >> >> diff --git a/gdb/remote.c b/gdb/remote.c >> index 61bde5aaa94..0c4cc6bad0b 100644 >> --- a/gdb/remote.c >> +++ b/gdb/remote.c >> @@ -546,7 +546,10 @@ class remote_target : public process_stratum_target >> >> bool can_async_p () override; >> >> - bool is_async_p () override; >> + bool is_async_p () override >> + { >> + return can_async_p (); >> + } >> >> void async (int) override; >> >> @@ -14390,19 +14393,6 @@ remote_target::can_async_p () >> return serial_can_async_p (rs->remote_desc); >> } >> >> -bool >> -remote_target::is_async_p () >> -{ >> - struct remote_state *rs = get_remote_state (); >> - >> - if (!target_async_permitted) >> - /* We only enable async when the user specifically asks for it. */ >> - return false; >> - >> - /* We're async whenever the serial device is. */ >> - return serial_is_async_p (rs->remote_desc); >> -} >> - >> /* Pass the SERIAL event on and up to the client. One day this code >> will be able to delay notifying the client of an event until the >> point where an entire packet has been received. */ >> -- >> 2.25.4 >> > > Hmm, one calls serial_can_async_p and the other calls serial_is_async_p, > I would guess that the distinction is important. Thank you for spotting this. I'm embarrassed that I missed that. This patch is withdrawn. The rest of the series is still fine though. Thanks, Andrew