From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by sourceware.org (Postfix) with ESMTPS id 109E4396E858 for ; Thu, 18 Jun 2020 09:13:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 109E4396E858 IronPort-SDR: BrPEQSqbkmUqLbUBTnwf67B7o5FnR0xmcwQu4EhdmjguAIyBNDepoBSPWUpSTZYzQyfW7/GvIB udpZEJOlRrha9Wrq0P+7AtUp2dOIDUajIavI0MA+/lo3/97f3E2jp8QbzrzIw6u4XOr/WcA8AW 8izQ+rHhAU/oksPncy13uWq1EavSZYr9AIIJaz+cPnsvjlVDBPwBWYlg3BfSWSV0g/Na/ekLdq FlL0uO9lL2Z2+wIiTGi9zVSqDNpsRjL1WKUQodGF0ggITe9JYwAeqJf0hLfY830X1cBls/gWwl L5Q= X-IronPort-AV: E=Sophos;i="5.73,526,1583164800"; d="scan'208";a="140306518" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2020 17:13:52 +0800 IronPort-SDR: gobiEPNaxhb+WEpjFxAx6/BY7RHjNX6YBGNSKH/HZ3doG/uUIf0epWX1lBginbxS3t6OqoJ7hl ckUM/XAzCxQgKwvRa9vmmHRLrG29gvI0U= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2020 02:02:32 -0700 IronPort-SDR: eVaV1VYr2Rm8y0OcKoBOuTDSFN02HMl5bm30+XGdcqiujIlxF1/xkzsAulod7ucv1pq0oL7uDq biwiq5uKkP9w== WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2020 02:13:51 -0700 Date: Thu, 18 Jun 2020 10:13:47 +0100 (BST) From: "Maciej W. Rozycki" To: "Metzger, Markus T" cc: Simon Marchi , Shahab Vahedi , Luis Machado , "gdb@sourceware.org" , Shahab Vahedi Subject: RE: Why enforcing sw_breakpoint_from_kind() implementation in GDBserver targets In-Reply-To: Message-ID: References: <20200610174702.GA3486@gmail.com> <8f80e486-cca4-819b-7316-329832df985f@simark.ca> <20200611094048.GA1270@gmail.com> <07362b1e-3b9b-a858-ce7a-9a27daff511a@linaro.org> <20200611110053.GD1270@gmail.com> <335e5978-4893-b355-69cd-98a101f8dd2e@simark.ca> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, 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 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: Thu, 18 Jun 2020 09:13:54 -0000 Hi Markus, > > > > Note that this would only concern GDBserver, other server implementations > > > > of the remote protocol are free to support Z0 or not. But we could decide > > > > that all GDBserver ports have to support it. > > > > > > The Intel Graphics architecture uses breakpoint bits inside instructions. There > > > is no single breakpoint opcode as there is INT3 on IA, for example. > > > > > > The breakpoint can be ignored one time, which allows stepping over > > breakpoints > > > without having to remove them. This obviously only works if the breakpoint bit > > > in the original instruction is set and the instruction is not replaced with a fixed > > > breakpoint pattern. > > > > Hmm, it seems to me like a use case for the breakpoint kind. > > That's the only kind of breakpoint this architecture supports. As far as I understand, > the kind is per-target and used to distinguish different kinds of breakpoints supported > by this target. From your description I infer you do have different kinds of breakpoints, one (or more?) for each instruction. > The points I was trying to make is that we're also using gdbarch breakpoints and that > in order to use z packets, we'd need insert_point() to be able to store shadow copies. > I have not looked into that since gdbarch breakpoints worked for me and would also > allow sharing the code between a native target and gdbserver. Why do you need to store any copy in `gdbserver'? GDB keeps a record of replaced instructions, so you can use it instead. Just send the original instruction as the breakpoint kind. For consistency you can do it with both `z0' and `Z0' packets. If you need to encode further choices (you write plural "breakpoint bits"), then include them with the rest of data in the breakpoint kind field (i.e. either set the breakpoint bits within the encoding sent or concat the information required with the instruction data). Maciej