This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] solib-svr4.c fetch link map address
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Elena Zannoni <ezannoni at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Wed, 2 Oct 2002 10:28:05 -0700
- Subject: Re: [RFA] solib-svr4.c fetch link map address
- References: <15770.22961.366656.980373@localhost.redhat.com>
On Oct 1, 10:28pm, Elena Zannoni wrote:
> + discard_cleanups (old_chain);
> + return lm;
> + }
> + }
> + /* Not the file we wanted, continue checking. */
> + lm = extract_address (objfile_lm_info.lm + lmo->l_next_offset,
> + lmo->l_next_size);
> + discard_cleanups (old_chain);
> + }
Why are the cleanups being discarded? Won't this result in a memory
leak?
Another concern is that there appears to be some duplication of code
between svr4_current_sos() and the function that you've just written.
I'm wondering if some sort of factoring could be done to minimize
duplication.
Finally, I'm curious about how often we'll be fetching the link
map address. Is it the case that it'll be fetched once (per
objfile) and never fetched again? Or will it be fetched repeatedly?
If it's the former, I think your approach is fine. If the latter, we
should consider saving the link map address so that it can be supplied
to glibc without having to read the target.
Kevin