This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix leak of bp_jit_event breakpoints


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]