This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add tests for JIT debugging interface
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
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;