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 15:25:00 -0000	[thread overview]
Message-ID: <CAHOBVAeakB6mJBiYU+smKAOYYStrJyNbvy3q=zv8P4X-LV8iYg@mail.gmail.com> (raw)
In-Reply-To: <3f5c4d51-e2e8-835a-af3b-e021866e171b@redhat.com>

> If you don't have software breakpoints in the list, then
> bp_location_has_shadow will return false for all breakpoints?
> Sounds like we could skip most of the work, but that's an
> optimization, not a correctness issue?
Yeah, I guess we can live with the minor performance impact we have for now
(and fix that in the future).

> I can't think of any offhand.  Mainly because it's not usual for me to
> work with targets that don't support sofware breakpoints.  So I'd
> say -- try it and see what breaks.  Which you already did.  :-)
Alright, thanks!

- Ofir Cohen

On 26 October 2016 at 18:13, Pedro Alves <palves@redhat.com> wrote:
> On 10/26/2016 04:02 PM, Ofir Cohen wrote:
>>> I'd rather that upstreaming that bit was done when the
>>> rest of the port is submitted as well.
>> Alright, will do.
>>
>> As a temporary mitigation,
>> Is it OK for the target to return NULL from gdbarch_breakpoint_from_pc
>> to state that it doesn't support software breakpoints ?
>>
>
> I think so.
>
>>
>> There are some places that check that return value, like:
>> /* Software breakpoints unsupported?  */
>> if (bpoint == NULL)
>>   return 0;
>>
>> in bp_loc_is_permanent(), and others that don't, like breakpoint_xfer_memory().
>> Furthermore, it performs pointer arithmetic based on the returned value.
>
> If you don't have software breakpoints in the list, then
> bp_location_has_shadow will return false for all breakpoints?
> Sounds like we could skip most of the work, but that's an
> optimization, not a correctness issue?
>
>>
>> Currently the tests we have pass, but I'm concerned about other corner
>> cases are not covered
>> that might pop up as a result of this change.
>
> I can't think of any offhand.  Mainly because it's not usual for me to
> work with targets that don't support sofware breakpoints.  So I'd
> say -- try it and see what breaks.  Which you already did.  :-)
>
> Thanks,
> Pedro Alves
>


      reply	other threads:[~2016-10-26 15:25 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
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 [this message]

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='CAHOBVAeakB6mJBiYU+smKAOYYStrJyNbvy3q=zv8P4X-LV8iYg@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