From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id AC8303858D34 for ; Sun, 19 Jul 2020 19:08:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AC8303858D34 Received: by mail-oi1-x235.google.com with SMTP id y22so12673599oie.8 for ; Sun, 19 Jul 2020 12:08:59 -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:from:date:message-id:subject:to; bh=MjOJ0V29W/vqfyj0eMMpRhZ9Y93eZ6/PsRBXglNxCcc=; b=TaCXgy9vU1ZeLh+gED674qABNFlHA0FFHrOv8HwcBBAKabEjAOyw5c8pIHq6gARx9v MfPmmZW5J1yEL9gq/3e4VU+TCcupeMXAlQIxR1Z6WpMw3v8/er1PXpT1SCGKFDKvRfVZ 6IQki58wQqa7V0XeaDJB7gtU5uNmgWUVRYNK1znqC3sa1Jj/h5uuK+XtRLauJcuB3Aeg Ll/9mfG1Td5i1IBizu54XOJpFutYS4LhrV35QK3KEXz6NiMmbZoEm23T96XZk9g/Xoem vmIT/T8WIerQ6hlkQKquYSbuVmOzMZzV7N0fPNdhMCaho3MDeRa0Tk7uLgz4A/wdTMlv +tAg== X-Gm-Message-State: AOAM533p0NZxPH+edJjC494Pfnlpp7B+0NUqnCMOSXnf/TINAANuO5Eo x808s17+Z396CV8NNKrGkgKID/BDGIY7WcD/7FHiIdWJkBg= X-Google-Smtp-Source: ABdhPJw0/pbsH1TbRB2beAikk1lDIdL2WVaBZWjTb83wwetpoQ+mp6jHVlRvs57xrpscsH2R/12EvlcZ7qlHI0aPPvE= X-Received: by 2002:aca:d1a:: with SMTP id 26mr14568074oin.11.1595185738750; Sun, 19 Jul 2020 12:08:58 -0700 (PDT) MIME-Version: 1.0 From: Reuben Thomas Date: Sun, 19 Jul 2020 20:08:47 +0100 Message-ID: Subject: Remote protocol question: the documentation says '?' is not required, but maybe it is? To: Reuben Thomas via Gdb X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, HTML_OBFUSCATE_10_20, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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" Content-Transfer-Encoding: quoted-printable 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: Sun, 19 Jul 2020 19:09:01 -0000 In the GDB manual, section E.1 Overview about the Remote Protocol, there is the following text: At a minimum, a stub is required to support the =E2=80=98g=E2=80=99 and =E2= =80=98G=E2=80=99 commands for > register access, and the =E2=80=98m=E2=80=99 and =E2=80=98M=E2=80=99 comm= ands for memory access. Stubs > that only control single-threaded targets can implement run control with > the =E2=80=98c=E2=80=99 (continue), and =E2=80=98s=E2=80=99 (step) comman= ds. Stubs that support > multi-threading targets should support the =E2=80=98vCont=E2=80=99 comman= d. All other > commands are optional. > In particular, this suggests that it is not necessary to support the '?' command, which returns the most recent signal. My simple remote stub indeed implements only 'g', 'G', 'm', 'M', 'c', 'd' and 'k'. It also implements '?', and, on startup, sends a 'T' packet. However, if I remove the implementation of '?', the following conversation ensues with gdb: putpacket: > T0500:f4dff800;01:f4dff800;02:00400000;03:f580a200;04:00001000;05:0000000= 0;06:f5805200;07:00001000;08:00000000;09:ffffffff; > getpacket: > qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork= -events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+ > putpacket: > getpacket: vMustReplyEmpty > putpacket: > getpacket: Hg0 > putpacket: > getpacket: qTStatus > putpacket: > getpacket: ? > putpacket: > getpacket: qfThreadInfo > putpacket: > getpacket: qL1160000000000000000 > putpacket: > getpacket: Hc-1 > putpacket: > getpacket: qC > putpacket: > getpacket: qAttached > putpacket: > warning: Invalid remote reply: > and GDB hangs. It seems that it can't cope with my lack of reply to '?'. Is this a bug in gdb, or should the documentation be updated? I'm using gdb from recent master, commit 360f1cd72d; I have patched it to support my architecture, but I've not touched remote.c or anything else to do with the remote protocol. On the other hand, as you can see from my list above, I do not implement the 's' command, but this does not seem to be a problem. Again, is this an error in the documentation? --=20 https://rrt.sc3d.org