Re: [patch] Fix a crash when displaying variables from shared library.

Joel Brobecker
2009-03-23T17:27:36Z

> But I think we can. After the patch, we don't care about so_name, except
> to print the warning, and we have it readily available in solib->so_name.

After looking deeper into this, I think you are right. But maybe not
for the reason you thought. As far as I can tell, the current solib
mechanism used on AIX remains painfully disconnected to the standard
solib mechanism, and so I'm guessing that the solib list remains
empty.

The function where you're removing the PC_SOLIB is only called as
an observer of the solib_unloaded event. This event is only triggered
from solib.c in clear_solib and update_solib_list. Either way, if
the solib list remains empty as I think it does, then the observer
is never called on AIX. And so the PC_SOLIB thing can indeed be
removed.

(in fact, I just verified this by debugging GDB)

> > In particular, I'm trying to figure out whether
> > it's possible to have a b->type that's not a breakpoint if loc->type
> > is a breakpoint.
>
> Yes, for b->type == bp_shlib_event.

Cool. I was certain that you hadn't added this condition just "because" :-).

> it from there!) and so remains silent. Reverse these lines in clear_solib:
>
> observer_notify_solib_unloaded (so);
> so_list_head = so->next;
>
> and current code will start issuing the warning as well.

Thanks for the explanation.

The patch looks good to me, now. Please go ahead and check it in.
But be careful with the ChangeLog, as the one you sent was incomplete.

--
Joel