This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Detect loops in the solib chain
On Thu, Jul 17, 2008 at 02:57:03PM -0700, Paul Pluzhnikov wrote:
> On Thu, Jul 17, 2008 at 2:40 PM, Daniel Jacobowitz <drow@false.org> wrote:
>
> > @@ -784,14 +792,21 @@ svr4_current_sos (void)
> >
> > read_memory (lm, new->lm_info->lm, lmo->link_map_size);
> >
> > - lm = LM_NEXT (new);
> > + next_lm = LM_NEXT (new);
> > +
> > + if (prev_lm != 0 && LM_PREV (new) != prev_lm && ldsomap == 0)
>
> I think you want just:
>
> + if (LM_PREV (new) != prev_lm)
>
> First entry on the list should also be properly terminated, and
> ldsomap has nothing to do with whether the list is corrupt or not.
You're right about prev_lm, thanks. The ldsomap check is necessary,
because that entry may not be on the list (see down below).
--
Daniel Jacobowitz
CodeSourcery