From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117364 invoked by alias); 26 Oct 2016 14:42:47 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 117350 invoked by uid 89); 26 Oct 2016 14:42:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:b125mr2, Integrated, Details, our X-HELO: mail-it0-f45.google.com Received: from mail-it0-f45.google.com (HELO mail-it0-f45.google.com) (209.85.214.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Oct 2016 14:42:36 +0000 Received: by mail-it0-f45.google.com with SMTP id u205so36859741itc.0 for ; Wed, 26 Oct 2016 07:42:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TPXyg/QdBB4hWfBfqZ0HUVgQ5/TDkGigF2wjOs+zr90=; b=Y/5sOHaVcgtKd74eXpGQrzTj1z0nrHTG3Cq9UvAZXMCmfbTIZB8pB11rNxoGf4vfX+ olIF3Hrvn7qaIWdptFDTYayLF8F9e5knyWxU1gb8WTCrtw4htie64GbIGYP5o7DyJLLI xWc6w9zG4yTFqZp560J1i5FWk+E+CmYwFPKLuNiHa/ng84j438tFwEuAPzk3KWfFSXet hTutQOw5xbZ3o48QHXN5CAB89nL4oq7Tf0OQ+FcjFmxzTjDpJge1qUrDZr3zjGD36JVB g4U5rXAWO4ITElJc0ZJEuSAYF0DUEpBruWqAjsH7DcdGtIZzdavcJBnQkAQ/GEhDKTbD Ovaw== X-Gm-Message-State: ABUngveG3agjAU7rqfaosPIMr/1OzZOwsvr6/7QE9EB0rZqqpNIwG/zw5eTHPwPt4u+iJGh1XLKwUhHdE0gZeg== X-Received: by 10.36.238.131 with SMTP id b125mr2555547iti.4.1477492954969; Wed, 26 Oct 2016 07:42:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.16 with HTTP; Wed, 26 Oct 2016 07:42:34 -0700 (PDT) In-Reply-To: <651566f6-e57a-f816-8012-4080d7bc865c@redhat.com> References: <651566f6-e57a-f816-8012-4080d7bc865c@redhat.com> From: Ofir Cohen Date: Wed, 26 Oct 2016 14:42:00 -0000 Message-ID: Subject: Re: False positive permanent breakpoints To: Pedro Alves Cc: "gdb@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00049.txt.bz2 Hi Pedro, Thanks for the reply. Let me provide some clarifications :-). 1) The product is part of the "Intel SDK for OpenCL" [1] for Windows and Linux. You can see how it looks in [2]. 2) iGPU - Yes, Integrated GPU 3) Upstream is in our plans and actually we are preparing a clean series of patches on top of 7.12 (currently we are rebased on top of 7.6, yeah I know...). 4) Software breakpoints are officially supported by the HW, but haven't been tested and used yet, so we're OK with them being "disabled" at the moment. The sources for gdb (as well as other components) are provided with the installer script, which can be downloaded _free of charge_ via [1] --> "Download" . Is that good enough for making an upstream change? I can try and prepare a small patch. - Ofir [1] https://software.intel.com/en-us/intel-opencl [2] https://software.intel.com/en-us/node/671873 On 26 October 2016 at 17:28, Pedro Alves wrote: > On 10/26/2016 03:04 PM, Ofir Cohen wrote: >> Hello, >> We have debugging support for code running on the iGPU, and we've encountered >> something that looks like a limitation of gdb. > > What's "the iGPU" ? An integrated GPU? > >> Problem: gdb freaks out on the iGPU when trying to step over/continue when >> stopped on a permanent breakpoint. >> >> Root-cause: gdb *falsely* identifies some instructions as permanent breakpoints. >> >> >> Details >> ====== >> We don't call set_gdbarch_skip_permanent_breakpoint() on our target, so there >> is no support for stepping over permanent breakpoints. Which is fine >> since software breakpoints is not something that we support at the >> moment. >> >> While trying to fix the root-cause, >> i.e. let gdb determine that instruction is indeed a breakpoint instruction, >> I ran into a wall. >> >> Looks like gdb is being too *coarse* for the check (whether it is a >> breakpoint instruction): >> if (err || memcmp (buf, bp_opcode (bp), bp_size (bp)) != 0) >> >> in validate_inserted_breakpoint() function. > > So this is in gdbserver, not gdb. > >> >> I'm saying coarse here because on the iGPU the breakpoint thingy is mandated >> by a single bit, and does not have a unique *opcode*. > >> Proposed solution >> ============== >> Could we abstract (delegate away) this predicate to the _target_ ? > > All can be done, it's just software. :-) But not if no port > in the tree is using it... Otherwise it'll just look like > unnecessary complication and will likely be "cleaned up" again > Are you planning on contributing your port upstream? > > I'm a bit confused since you said you don't support software > breakpoints... > >> Perhaps setting a default handler for other targets. > > Thanks, > Pedro Alves >