This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] solib do not add ldd if in libc
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Aleksandar Ristovski <aristovski at qnx dot com>
- Date: Mon, 20 Jul 2009 14:59:02 +0100
- Subject: Re: [patch] solib do not add ldd if in libc
- References: <h2vs39$pvq$1@ger.gmane.org>
On Tuesday 07 July 2009 17:11:21, Aleksandar Ristovski wrote:
> ? ? ? ?if (lm == 0 && ldsomap == 0)
> -???????lm = ldsomap = solib_svr4_r_ldsomap (info);
> +???????{
> +??????? ?struct so_list *so = head;
> +
> +??????? ?lm = ldsomap = solib_svr4_r_ldsomap (info);
> +
> +??????? ?/* On some other systems, dynamic linker resides in libc.
> +??????? ? ? Make sure we do not add duplicated entry for it. ?*/
> +??????? ?while (so)
> +??????? ? ?{
> +??????? ? ? ?if (so->lm_info->lm_addr == lm)
> +???????????????lm = ldsomap = 0;
> +??????? ? ? ?break;
> +??????? ? ?}
> +???????}
[This is not a formal review, just a quick note: ] did you post the
patch you intended to post? That while loop looks wrong.
I note that solib_svr4_r_ldsomap's describing comment seems to
indicate that a fix there would fit better with its design.
/* Find the link map for the dynamic linker (if it is not in the
normal list of loaded shared objects). */
static CORE_ADDR
solib_svr4_r_ldsomap (struct svr4_info *info)
{
--
Pedro Alves