public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [patch] Add tests for JIT debugging interface
Date: Wed, 19 Jan 2011 21:09:00 -0000	[thread overview]
Message-ID: <4D3751B2.20201@codesourcery.com> (raw)
In-Reply-To: <AANLkTi=rBc_piQtpJ5uUO4ObaMGn=PKq3L8LmUnU+fHs@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 705 bytes --]

On 01/19/2011 12:26 PM, Paul Pluzhnikov wrote:
>>>> Cannot remove breakpoints because program is no longer writable.<-- [1]
>>> >>
>>> >>  And that.
>> >
>> >  It's output from infrun.c:normal_stop.  Sounds like a bug somewhere.
> It is a bug. Fix in progress...
>

FYI, I looked at this problem a little bit last week, and found this 
failure is caused by inserting multiple breakpoints at the same location 
in create_jit_event_breakpoint().

Patch attached can fix this failure, but I am not 100% clear why 
inserting multiple breakpoints causes this failure, and still lack of 
big picture of breakpoint.  If this patch helps, take it away.  If this 
patch is wrong, please ignore it. :-)

-- 
Yao Qi

[-- Attachment #2: many_jit_breakpoint.patch --]
[-- Type: text/x-patch, Size: 745 bytes --]

gdb/
	* breakpoint.c (create_jit_event_breakpoint): Only set one
	breakpoint on an address for bp_jit_event.

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 8d0692b..b89118f 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5906,6 +5907,16 @@ create_jit_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address)
 {
   struct breakpoint *b;
 
+  /* Look for jit event breakpoint first.  If there is one set on ADDRESS,
+     don't create new one and return it directly.  */
+
+  ALL_BREAKPOINTS (b)
+  {
+    if (b->type == bp_jit_event && b->loc->requested_address == address)
+      return b;
+  }
+
   b = create_internal_breakpoint (gdbarch, address, bp_jit_event);
   update_global_location_list_nothrow (1);
   return b;

  parent reply	other threads:[~2011-01-19 21:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-11 23:28 Paul Pluzhnikov
2011-01-12  7:02 ` Yao Qi
2011-01-12 10:44   ` Pedro Alves
2011-01-12 15:19     ` Paul Pluzhnikov
2011-01-12 16:12       ` Pedro Alves
2011-01-12 17:23       ` Yao Qi
2011-01-12 17:33         ` Paul Pluzhnikov
2011-01-18 17:07           ` Paul Pluzhnikov
2011-01-19 19:27           ` Pedro Alves
2011-01-19 20:30             ` Paul Pluzhnikov
2011-01-19 21:04               ` Pedro Alves
2011-01-19 21:09               ` Yao Qi [this message]
2011-01-12 10:03 ` Pedro Alves

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=4D3751B2.20201@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=ppluzhnikov@google.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).