From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13305 invoked by alias); 27 Jan 2011 22:59:08 -0000 Received: (qmail 13142 invoked by uid 22791); 27 Jan 2011 22:59:07 -0000 X-SWARE-Spam-Status: No, hits=-1.9 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; Thu, 27 Jan 2011 22:59:02 +0000 Received: (qmail 2140 invoked from network); 27 Jan 2011 22:59:00 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Jan 2011 22:59:00 -0000 From: Pedro Alves To: Paul Pluzhnikov Subject: Re: [patch] Fix leak of bp_jit_event breakpoints Date: Fri, 28 Jan 2011 01:27:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-24-generic; KDE/4.5.1; x86_64; ; ) Cc: gdb-patches@sourceware.org, Yao Qi References: <20110119204315.0A235190C48@elbrus2.mtv.corp.google.com> <201101271244.09767.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201101272259.02058.pedro@codesourcery.com> 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/msg00523.txt.bz2 On Thursday 27 January 2011 21:50:35, Paul Pluzhnikov wrote: > -/* This is the address of the JIT descriptor in the inferior. */ > - > -static CORE_ADDR jit_descriptor_addr = 0; ... > +struct jit_inferior_data > +{ > + CORE_ADDR breakpoint_addr; > + CORE_ADDR descriptor_addr; > +}; You've lost the comment above. It'd be nice to have this structure and its fields documented.. > > But > > if you want to come up with other solutions, I'd be happy > > to consider them. I'm thinking that we should delete the > > jit breakpoint (and perhaps more) whenever the executable > > changes (say, the "file" command), which is kind of > > a similar case of an "exec", so maybe we should install > > an executable_changed observer as well. Not sure that > > covers all we need. > > I think this is covered now -- after "file", if we attach or run, > inferior_create_observer will delete the old breakpoint. The other way around isn't. If e.g., you attach to a process, and notice that the exec is wrongly set --- and then use "file" command to fix it. We'd set a new jit breakpoint before, but we don't now --- I think we should reset the jit state in that case, at least like jit_inferior_created_observer is doing, and that's what I was thinking could be done from the executable_changed observer. Other than that, the patch looks okay. -- Pedro Alves