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 Wed, Jan 19, 2011 at 9:57 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:

> Would recording the current jit_event breakpoint in inferior (via
> register_inferior_data_with_cleanup ()) be a good solution?

That appears to work reasonably well.

It fixes both the gdbserver failure in jit.exp, and also as yet undiscovered
problem: the old static/global jit_descriptor_addr couldn't possibly work
for more than one inferior.

Thanks,
-- 
Paul Pluzhnikov


2011-01-20  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* jit.c (jit_descriptor_addr): Delete.
       	(registering_code): Delete.
       	(clear_int): Delete.
	(jit_inferior_data): New variable.
	(struct jit_inferior_data): New type.
	(get_jit_inferior_data): New function.
	(jit_inferior_data_cleanup): New function.
	(jit_read_descriptor): Adjust.
       	(jit_register_code): Adjust.
       	(jit_breakpoint_re_set_internal): New function; move code here ...
       	(jit_inferior_init): ... from here.
       	(jit_breakpoint_re_set): Adjust.
	(jit_inferior_exit_hook): Adjust.
	(jit_event_handler): Adjust.
	(_initialize_jit): Adjust.

Attachment: gdb-jit-leak-20110120.txt
Description: Text document


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