Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Ofir Cohen <ofircohenn@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: False positive permanent breakpoints
Date: Wed, 26 Oct 2016 14:42:00 -0000	[thread overview]
Message-ID: <CAHOBVAfaS61M8Gb9ZzgpGM65RNnXN0jcoRwxq4=2jnKVgvZOOA@mail.gmail.com> (raw)
In-Reply-To: <651566f6-e57a-f816-8012-4080d7bc865c@redhat.com>

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 <palves@redhat.com> 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
>


  reply	other threads:[~2016-10-26 14:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 14:04 Ofir Cohen
2016-10-26 14:28 ` Pedro Alves
2016-10-26 14:42   ` Ofir Cohen [this message]
2016-10-26 14:50     ` Pedro Alves
2016-10-26 15:02       ` Ofir Cohen
2016-10-26 15:14         ` Pedro Alves
2016-10-26 15:25           ` Ofir Cohen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHOBVAfaS61M8Gb9ZzgpGM65RNnXN0jcoRwxq4=2jnKVgvZOOA@mail.gmail.com' \
    --to=ofircohenn@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox