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 592093858D38 for ; Mon, 9 Jan 2023 12:55:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 592093858D38 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=1673268950; 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=dhB4uubD4GKNEGvuf2pyPzbql/4xQ6IJrlv3//VLjHU=; b=AlpzrxZ7nfVGkWOO6K6JrpdMD14Ar43/DI/Db54tbg2fUdBl1jqjoJkF85B4M5HKXLrFai ADFJYuJBK2PIGOu8DixIW5tdQYzme9ON7wXYuqouy+1oyTWHerRpwuwsWXFIjcEcHfokjB yO6lyFDYDpLrP5frYl9uFatFmaLSFwU= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-70-BZNFXiolPTudwIGFTcWplg-1; Mon, 09 Jan 2023 07:55:48 -0500 X-MC-Unique: BZNFXiolPTudwIGFTcWplg-1 Received: by mail-pl1-f197.google.com with SMTP id p14-20020a170902e74e00b00192f6d0600eso6236197plf.3 for ; Mon, 09 Jan 2023 04:55:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dhB4uubD4GKNEGvuf2pyPzbql/4xQ6IJrlv3//VLjHU=; b=QQwB1p3571Fm08kRTlfyKtxRuvAoVZKw7tVeFA1HfZOXVmyKJMuCP9IJVrPnSGAJ9N XGjerxnS8YPV7bJmiNUf2CXrK1AJLMCQ2mRrpb6RfRkoo+jvT2HRsf9HyoWDUp3Hw42O +uRR/b0RqsAcRj4p3dctcFZJPFUqipnEuRKTz7jgR1ToxIpC8TwjsvUGULlEzaVfInpb XfqgHU2PG3IXxkCdWO4lipD5dzlwFnU72KkfuCEroguz5V3Mil1ZOlpxMzyyYEP8xA1L 7Q2aF0jOmvhjsZ3NZkanPB9UC09EhcvLlD7dlA+McvkLkqChxUxMnV8l/CQwZL004t8k sR2Q== X-Gm-Message-State: AFqh2kr4ZB1thDObStuljZ8F7G02TcvIv3Pj1AZQlPjyV4JfwBjaaZYr mouMnfwkr8yRE70GNPLQ70kZYRcYkKbuX8geF21FMAjuEowQfeN2s4YZ7jnV69sjPv+w61EDbzd MupImV5qa5mOXp9hxTDd08MRmZia5IU/988O4pg== X-Received: by 2002:a63:551f:0:b0:4a4:2e22:7535 with SMTP id j31-20020a63551f000000b004a42e227535mr1326017pgb.570.1673268947508; Mon, 09 Jan 2023 04:55:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXtRDiuN5mJRbcSW4J8VBb6+p5vgyzAZSWnSvPlQMHG8oThJMtE4D7MnUYpk6UQs2/FoD4iScJ7+qFxtUVPrVLI= X-Received: by 2002:a63:551f:0:b0:4a4:2e22:7535 with SMTP id j31-20020a63551f000000b004a42e227535mr1326014pgb.570.1673268947201; Mon, 09 Jan 2023 04:55:47 -0800 (PST) MIME-Version: 1.0 References: <20230104113909.1395263-1-ahajkova@redhat.com> In-Reply-To: <20230104113909.1395263-1-ahajkova@redhat.com> From: Alexandra Petlanova Hajkova Date: Mon, 9 Jan 2023 13:55:36 +0100 Message-ID: Subject: Re: [PATCH] remote.c: Allow inferior to reply with an error To: AlexandraH=?UTF-8?B?w6E=?=jkov=?UTF-8?B?w6E=?=@sourceware.org Cc: gdb-patches@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000036438805f1d4498c" X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,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: --00000000000036438805f1d4498c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Ping On Wed, Jan 4, 2023 at 12:39 PM wrote: > From: Alexandra Hájková > > When gdb communicates with the inferior with the remote > protocol, the only possible response to the QSetWorkingDir > packet is "OK". If the inferior will reply with anything > else, gdb will complain about the unexpected reply and stop > its communication with the inferior. > > [remote] Sending packet: $QSetWorkingDir:2f746d70#bb > [remote] Packet received: E00 > Remote replied unexpectedly while setting the inferior's working > directory: E00 > (gdb) > > But setting the inferior's working dir is not always possible due > to various reasons and we may not want to always stop the communication. > This patch proposes to just warn the user in a case it wasn't possible > to set the working dir but proceed without an error. > > [remote] Sending packet: $QSetWorkingDir:2f746d70#bb > remote] Packet received: E00 > warning: Remote failed to set the inferior's working directory: E00 > [remote] Sending packet: $vRun;2f7573722f62696e2f6563686f#3d > --- > gdb/doc/gdb.texinfo | 3 +++ > gdb/remote.c | 8 +++----- > 2 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index dd8f8bc757c..54cab3afa9c 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -42515,6 +42515,9 @@ Reply: > @table @samp > @item OK > The request succeeded. > + > +@item E @var{nn} > +An error occurred. The error number @var{nn} is given as hex digits. > @end table > > @item qfThreadInfo > diff --git a/gdb/remote.c b/gdb/remote.c > index 218bca30d04..db5b949a28b 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -10421,11 +10421,9 @@ remote_target::extended_remote_set_inferior_cwd () > if (packet_ok (rs->buf, > &remote_protocol_packets[PACKET_QSetWorkingDir]) > != PACKET_OK) > - error (_("\ > -Remote replied unexpectedly while setting the inferior's working\n\ > -directory: %s"), > - rs->buf.data ()); > - > + warning (_("\ > +Remote failed to set the inferior's working directory: %s"), > + rs->buf.data ()); > } > } > > -- > 2.38.1 > > --00000000000036438805f1d4498c--