From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by sourceware.org (Postfix) with ESMTPS id 534433840C3D for ; Thu, 11 Jun 2020 10:35:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 534433840C3D Received: by mail-qt1-x832.google.com with SMTP id j32so4137790qte.10 for ; Thu, 11 Jun 2020 03:35:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XIWS53N11nwYOmEIhFAi4rLhVfQHzSgDO0KrWGpvkVI=; b=Vm+jlYFMsERx0mD2nJLCYX/v1SRdoPk+FT2b3Zu3COPGgK4arztfIWQgk1Xg7aaPWV Fx9JPBZzwGtYr/8LqChCG6qct+vJKq4LwoX+5y3z25Iqu7Wyc53zbzvE/XZHuCb6p8/t SdCzPQTx+ezTMnKP+OdzYwDlD2hN6qZUry5nMwmVBvKr8kYSGv0WtYn9kSNFVLNrXLgO LTSee1QwVbygEjbDpuJzUlj786kzAXwm99aVY2fMPk/RKnee9QHiZqWmMUVHAJkOIApr QeaOyWh/IEk9YPmbsDHw2SDM3ZXD1+Wf+yD9X/H/fZu9MZ6CXEi2nlGbtK/XbLJWWkZG oPyA== X-Gm-Message-State: AOAM53200AHlaVHvj59wVVAiro1sVRCeXc/25R6R50r8KyAcWtroIEu/ G07Nlcdt1vNSPFzvZWWS7+7Z1I9fwQY= X-Google-Smtp-Source: ABdhPJz9dNXKYQ3LkDz4NuDMmq7pduWAWjVxOv9vu1EsJPvEMNiWtSxw3JNj2BzmQB9f8+3QOky9qA== X-Received: by 2002:ac8:6882:: with SMTP id m2mr7687363qtq.231.1591871737584; Thu, 11 Jun 2020 03:35:37 -0700 (PDT) Received: from [192.168.0.185] ([191.249.234.138]) by smtp.gmail.com with ESMTPSA id o6sm1870046qkh.28.2020.06.11.03.35.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jun 2020 03:35:36 -0700 (PDT) Subject: Re: Why enforcing sw_breakpoint_from_kind() implementation in GDBserver targets To: Shahab Vahedi , Simon Marchi Cc: gdb@sourceware.org, Shahab Vahedi References: <20200610174702.GA3486@gmail.com> <8f80e486-cca4-819b-7316-329832df985f@simark.ca> <20200611094048.GA1270@gmail.com> From: Luis Machado Message-ID: <07362b1e-3b9b-a858-ce7a-9a27daff511a@linaro.org> Date: Thu, 11 Jun 2020 07:35:33 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200611094048.GA1270@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 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, 11 Jun 2020 10:35:40 -0000 On 6/11/20 6:40 AM, Shahab Vahedi via Gdb wrote: > Hi Simon, > > The ARC GDB client inserts the breakpoint by writing to memory (the > legacy way). With your explanations, I plan to add the Z0 packet > support to it. Nevertheless, should it be still necessary to have > "sw_breakpoint_from_kind" in GDBserver as a mandatory method? > > The rest follows: > > On Wed, Jun 10, 2020 at 11:05:38PM -0400, Simon Marchi wrote: >> I don't understand your "This makes sense because we have a setup that looks >> like below", because that looks like a standard GDB/GDBserver setup used for >> other architectures. > > I said it makes sense because the first question that pops into mind is > "If sw_breakpoint_from_kind should have been mandatory all the time, > then how come a debugging session with ARC GDBserver was able to insert > breakpoints?". The answer would be because ARC GDB client takes care of > it. In ARC case, as you concluded as well, the client asks the GDBserver > to write the opcodes to memory. >> When a breakpoint is inserted, what's the remote protocol packet used? Is it >> Z0, or is it a memory write operation that writes the breakpoint's opcode? Z0 >> is the "modern" way that provides more features (like target-side condition >> evaluation) and a memory write is the legacy fallback. >> sw_breakpoint_from_kind would be used if the Z0 packet was used, to translate >> the "kind" into an opcode. Since you claim that sw_breakpoint_from_kind is >> not used, I guess that the breakpoint is inserted with a memory write operation. >> I'd look into why that is the case. GDB tries Z0 first and falls back to the >> memory write if Z0 is not supported, so your GDBserver must not support it for >> some reason. > > I am not sure why this could be the case. I will investigate that. Probably because the ARC port doesn't implement low_insert_point and low_remove_point? There is only a dummy Linux implementation, and Linux implementations for insert_point/remove_point.