This is the mail archive of the
mailing list for the GDB project.
Re: [patch 2/3] Drop lazy lm_info reading in solib-svr4.c
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, Paul Pluzhnikov <ppluzhnikov at google dot com>
- Date: Thu, 6 Oct 2011 19:58:51 +0100
- Subject: Re: [patch 2/3] Drop lazy lm_info reading in solib-svr4.c
- References: <20111003215458.GB20272@host1.jankratochvil.net>
On Monday 03 October 2011 22:54:58, Jan Kratochvil wrote:
> This both simplifies the code (minus 19 LoC) and makes the code possible to
> modify for [patch 3/3]. Otherwise [patch 3/3] would have to construct
> lm_info->lm in inferior data format which is just not a viable way.
> I do not understand why the implementation was lazy in the first place.
> It was written so already during the initial import into CVS.
Probably just the result of slow incremental development, as gdb moved
away from native-only debugging. You can look at the sources
much further back than CVS, here: ftp://sourceware.org/pub/gdb/old-releases/ ,
though you're at the mercy of the ChangeLogs only at that point.
> 2011-10-03 Jan Kratochvil <email@example.com>
> Drop lazy lm_info reading.
> * solib-svr4.c (struct lm_info): Remove field lm. New fields l_addr_p,
> l_addr_inferior, l_ld, l_next, l_prev and l_name.
> (lm_info_read): New function.
> (lm_addr_from_link_map, lm_dynamic_from_link_map): Remove.
> (lm_addr_check): Use l_addr_p. No longer use lm_addr_from_link_map and
> (lm_next, lm_prev, lm_name): Remove.
> (svr4_keep_data_in_core): Use lm_info_read, drop the lm_info entries
> initialization incl. read_memory. No longer use lm_name.
> (svr4_free_so): Drop lm_info->lm freeing.
> (svr4_default_sos): Initialize lminfo with zeroes. Use l_addr_p. Drop
> explicit lm_addr and lm initialization.
> (svr4_read_so_list): Use lm_info_read, drop the initailization of
> fields by hand, incl. read_memory. No longer use lm_next, lm_prev and
Looked okay to me.