public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "palves at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/7143] Watchpoint does not trigger when first set
Date: Thu, 29 May 2014 18:04:00 -0000	[thread overview]
Message-ID: <bug-7143-4717-ZLcQGuTTY0@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-7143-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=7143

--- Comment #16 from Pedro Alves <palves at redhat dot com> ---
On 05/29/2014 06:47 PM, brobecker at adacore dot com wrote:>>>> >>> And thus
insert the userr breakpoints again, except we're not
>>>> >>> inserting the second breakpoint?!? I bet this is because we think
>>>> >>> it's still inserted, but in fact it got removed by the SSS bp
>>>> >>> removal earlier.

Yeah, sounds like that's it, because removing a breakpoint
bypasses the shadow buffer overlaying (breakpoint_xfer_memory):

int
default_memory_remove_breakpoint (struct gdbarch *gdbarch,
                  struct bp_target_info *bp_tgt)
{
  return target_write_raw_memory (bp_tgt->placed_address,
bp_tgt->shadow_contents,
                  bp_tgt->placed_size);
}

This is the sort of thing that'd be fixed if software
single-step breakpoints were in the generic global location
list framework, but, they're not.

I guess the simplest is to do something like:

int
deprecated_remove_raw_breakpoint (struct gdbarch *gdbarch, void *bp)
{
  struct bp_target_info *bp_tgt = bp;
-  int ret;
+  int ret = 0;

-  ret = target_remove_breakpoint (gdbarch, bp_tgt);
+  if (!software_breakpoint_inserted_here_p (bp_tgt->placed_aspace, 
+                                           bp_tgt->placed_address)
+    ret = target_remove_breakpoint (gdbarch, bp_tgt);
  xfree (bp_tgt);

  return ret;
}

But note software_breakpoint_inserted_here_p checks for software single-step
breakpoints too, so obviously a little refactoring is necessary.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


  parent reply	other threads:[~2014-05-29 18:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-7143-4717@http.sourceware.org/bugzilla/>
2012-01-25 16:29 ` tromey at redhat dot com
2012-01-25 16:34 ` tromey at redhat dot com
2012-01-25 16:58 ` palves at redhat dot com
2012-03-30 13:46 ` eager at eagercon dot com
2012-09-25 21:09 ` palves at redhat dot com
2014-02-24 17:23 ` palves at redhat dot com
2014-03-20 13:49 ` cvs-commit at gcc dot gnu.org
2014-03-20 13:53 ` palves at redhat dot com
2014-05-20 18:02 ` cvs-commit at gcc dot gnu.org
2014-05-29 13:28 ` brobecker at gnat dot com
2014-05-29 15:01 ` palves at redhat dot com
2014-05-29 15:02 ` palves at redhat dot com
2014-05-29 17:47 ` brobecker at adacore dot com
2014-05-29 18:04 ` palves at redhat dot com [this message]
2014-05-29 18:35 ` brobecker at adacore dot com
2014-05-29 22:22 ` palves at redhat dot com
2014-05-30 16:09 ` palves at redhat dot com
2014-05-30 16:21 ` brobecker at adacore dot com
2014-08-19 17:19 ` cvs-commit at gcc dot gnu.org
     [not found] <20010311215800.7143.chastain@redhat.com>
2009-01-09 16:48 ` naaaag at gmail dot com

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=bug-7143-4717-ZLcQGuTTY0@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).