This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 1/3] Refactor/simplify (+fix) svr4_current_sos
- 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:30:15 +0100
- Subject: Re: [patch 1/3] Refactor/simplify (+fix) svr4_current_sos
- References: <20111003215424.GA20272@host1.jankratochvil.net>
On Monday 03 October 2011 22:54:24, Jan Kratochvil wrote:
> gdb/
> 2011-10-03 Jan Kratochvil <jan.kratochvil@redhat.com>
> Paul Pluzhnikov <ppluzhnikov@google.com>
>
> * defs.h (struct so_list): New forward declaration.
> (make_cleanup_free_so): New declaration.
> * solib-svr4.c (ignore_first_link_map_entry): Remove.
> (svr4_free_so): Move here. Handle NULL so->lm_info.
Move what here? Looks like a stale comment.
> @@ -1029,58 +1028,93 @@ svr4_current_sos (void)
> SVR4, it has no name. For others (Solaris 2.3 for example), it
> does have a name, so we can no longer use a missing name to
> decide when to ignore it. */
> - else if (ignore_first_link_map_entry (new) && ldsomap == 0)
> + if (ignore_first && lm_prev (new) == 0)
> {
> + struct svr4_info *info = get_svr4_info ();
> +
> info->main_lm_addr = new->lm_info->lm_addr;
A shame that this is still hidden here IMO, and dependent on
how you call the function, though not documented in the function
header. An alternative would be to move this "ignore first" logic to
the caller, making the caller itself delete the first entry in the list
if it wanted to, and setting main_lm_addr. We already have to allocate/free
this so_list, so nothing seems be to lost that way.
> - free_so (new);
> + do_cleanups (old_chain);
> + continue;
Otherwise, looks great to me.
--
Pedro Alves