From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id F26933857C45 for ; Tue, 21 Jul 2020 20:24:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F26933857C45 Received: by mail-ot1-x331.google.com with SMTP id a21so126770otq.8 for ; Tue, 21 Jul 2020 13:24:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4GNja7jd691gCPJgFk2aXTU/cVSbbhoxe87c72gyJz8=; b=SBQ1K7bAh4fF18nbE8Bh2DC/LE9dmkcz2jX1uMVLfZOvrLJt5nyYEhAb4ohikS+vAG EDK4jrF54ZQstaiHmv/htYP2U+mwojU2ppzJmi0OsE5V0brRQxHFlBjtT3O8ptX2PVdg gAcWLqDCLYtJfrPUma5vWzbJzk6ZFwn2Fdj6LjMd4fNzbRX5dZUq4oof7c6+6TkQEw7W Pt00TjQav8CQml5ptyXUFWjkzUmIbPCZpG5/voBaDfsv2WbHX2t/lDUpSsR8x452V2bJ i43VkQNFsU34aSEmJ1GiAmGINnQ3GGQ9n3UeffvlBVib/Xamm9YLTnwOMq+3ckgW++aR 5bNA== X-Gm-Message-State: AOAM532zdCx77gGYn0axvdz8CaOa+DeNK/pKlIQ4POj4cwnNIJvmCoSw t3qfiXwc2VvQ+PszB9fpeUsm9Zj7Ca1Fut/F8pMvgA== X-Google-Smtp-Source: ABdhPJz7wB2L6bkYvQTUB3Zgoesbs8VUoJsirNTNjruzwkJc9jvPeQBpqfRJ24dEp24xc6507P54J9uQTIr3wpjfUOo= X-Received: by 2002:a9d:6c54:: with SMTP id g20mr26109949otq.120.1595363051284; Tue, 21 Jul 2020 13:24:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Reuben Thomas Date: Tue, 21 Jul 2020 21:24:00 +0100 Message-ID: Subject: Re: Remote protocol question: the documentation says '?' is not required, but maybe it is? To: "Maciej W. Rozycki" Cc: Christo Crause , Reuben Thomas via Gdb X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 20:24:13 -0000 On Tue, 21 Jul 2020 at 20:34, Maciej W. Rozycki wrote: > On Tue, 21 Jul 2020, Reuben Thomas wrote: > > > > FYI, I do believe `?' is indeed mandatory, as GDB needs to figure out > the > > > initial state of the remote target as it has connected to it, and > there is > > > no other way. > > > > It seems to be more complicated than that. In principle, '?' isn't needed > > in principle to figure out the initial state: the T packet, or in my > > current case, the S packet tells GDB the signal, and yet GDB still asks > for > > it again with '?'. The signal that caused the remote to halt is not going > > to change until the next 'c', so there's no need for GDB to ask for it > > again; and yet it does. > > I take you mean a `T' or `S' stop reply, right? > > Well, such replies are only expected by GDB in response to specific > packets, which are all listed at the top of Section E.3 "Stop Reply > Packets". If you issue an unsolicited stop reply from your debug stub, > then at best GDB will ignore it and at worst GDB will get confused. > Sorry, I didn't explain this clearly enough before. As you can see in section E.3, T is an allowed reply to the 'c' command. As I explained in my previous message, the first packet that the debug stub sends is discarded by gdb. Therefore, the stub is only sending the T packet when it is allowed: the first time, it is discarded, and every other time, it is in response to a 'c' command. -- https://rrt.sc3d.org