From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3112 invoked by alias); 19 Jan 2011 21:04:14 -0000 Received: (qmail 3103 invoked by uid 22791); 19 Jan 2011 21:04:13 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Jan 2011 21:04:04 +0000 Received: (qmail 23607 invoked from network); 19 Jan 2011 21:04:01 -0000 Received: from unknown (HELO ?192.168.1.143?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 19 Jan 2011 21:04:01 -0000 Message-ID: <4D3751B2.20201@codesourcery.com> Date: Wed, 19 Jan 2011 21:09:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Paul Pluzhnikov CC: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [patch] Add tests for JIT debugging interface References: <20110111232641.AE3D5190C55@elbrus2.mtv.corp.google.com> <4D2DDD61.6040101@codesourcery.com> <201101191203.35101.pedro@codesourcery.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------040905090408060300050604" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00412.txt.bz2 This is a multi-part message in MIME format. --------------040905090408060300050604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 705 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 --------------040905090408060300050604 Content-Type: text/x-patch; name="many_jit_breakpoint.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="many_jit_breakpoint.patch" Content-length: 745 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; --------------040905090408060300050604--