This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix 4K leak in open_source_file each time next/step changes of function.
- From: Tom Tromey <tom at tromey dot com>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 05 Nov 2018 13:02:52 -0700
- Subject: Re: [RFA] Fix 4K leak in open_source_file each time next/step changes of function.
- References: <20181104165507.24341-1-philippe.waroquiers@skynet.be>
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
Philippe> Note that I do not understand why find_and_open_source always tries to
Philippe> re-execute the substitution rules on the provided fullname, as source.c
Philippe> symtab_to_fullname just blindly returns a non NULL s->fullname, counting on
Philippe> forget_cached_source_info to be called if search dir or substitution rules are
Philippe> changed. Similarly, psymtab_to_fullname also just returns a non NULL
Philippe> ps-> fullname.
It would be good to investigate & maybe remove this.
Philippe> 2018-11-04 Philippe Waroquiers <philippe.waroquiers@skynet.be>
Philippe> * source.c (open_source_file): Fix leak by transferring the
Philippe> current s->fullname to the unique_xmalloc_ptr fullname given
Philippe> to find_and_open_source.
Thanks, this is ok.
Tom