From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id CADD03857020 for ; Tue, 21 Jul 2020 20:49:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CADD03857020 Received: by mail-ot1-x334.google.com with SMTP id 5so161875oty.11 for ; Tue, 21 Jul 2020 13:49:02 -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=Vf44oJd0xnNfS3STKx7PvaQs7LTQTIUxHoTDgLVPLL8=; b=mjOxgD2B0qMhfBX3p1yqsVCFvWTV2tJal2ZAXXEfpdXJBYUBnkCifOsBqjWL0NKRVx /hIuEYix7Ln240raxtnK5AepjSdNyqHtV8XjIuMh+MKsj86ZnFhRcERjdgzeDrJ9fRI4 aSgZSqRzb+JnyddZBpPgq5brXmpuPaf5Z280tO0s58OSe3ZDCnd0Z4tqHcqNPQdHLXce hyBhPLT/WeUjHrv8Gwa7nwqsoRByAkoEz/ovxQeadGVn5HqIVvIOREd5zhg1fgQOq1Im 996oJj3AbHWfH/+NFCg2OOzRkATePpFPGaaa+a//dVXhmN2P0maaIews/qzXm5CbfDxQ EOXw== X-Gm-Message-State: AOAM532mY9KlVoiEdAyzdYWARRdtk07flVwycodY2o8ueD9ovBduMAwl il9lJcmHCSCw6inPjuSSGWvtGQOfU98hZsebT+uZ+w== X-Google-Smtp-Source: ABdhPJzVDjfB4qD5ih4H6cEhzC1MO8ME5WLUPeg0xS0tOpzIAPjTa/5XFzhfMuFQWAitYZREDDffjDN4HwBd+RwGS3Q= X-Received: by 2002:a9d:6c54:: with SMTP id g20mr26177545otq.120.1595364542158; Tue, 21 Jul 2020 13:49:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Reuben Thomas Date: Tue, 21 Jul 2020 21:48:50 +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=-4.1 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:49:04 -0000 On Tue, 21 Jul 2020 at 21:26, Reuben Thomas wrote: > On Tue, 21 Jul 2020 at 21:24, Reuben Thomas wrote: > >> 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. >>> >> > As I mentioned earlier, gdb discards this first 'T' packet, so that > explains why it needs to send '?', even in principle. But that doesn't seem > to be relevant, as gdb always sends '?' at the start of a conversation. > Just to eliminate this source of potential error, I adjusted my stub so that when it first connects to gdb it does not send a packet. This does not change the exchange with gdb in any way, except that the first packet from the stub is not sent. -- https://rrt.sc3d.org