Re: GDB honouring RPATH in binaries.

Kris Warkentin
2003-02-21T15:32:10Z

> > Kevin> For remote targets, you must have solib-absolute-prefix set.
> > Kevin> Searching host libraries (whether found via RPATH or some
> > Kevin> other means) is almost invariably wrong.
> >
> > I'd omit "almost". In fact, it would be useful if gdb could complain
> > for a remote debug when solib-absolute-prefix isn't set. That would
> > eliminate a lot of confusion when people forget to set it. When
> > debugging MIPS code, gdb is perfectly happy to load shared file symbol
> > tables from /usr/lib, even though those are x86 binaries! The result
> > is utter chaos, of course. It would be helpful if gdb prevented that
> > sort of simple user error. (I suppose another way to avoid that is to
> > have gdb check that the shared library it's examining is at least
> > meant for the same processor family, and I suppose the same
> > endianness...)
>
> Yeah, I used to see this a lot too (until we made solib-absolute-prefix
> automatic in our tools). Unfortunately there is no clear hook to
> figure out if a target is remote or local; and a lot of people actually
> do use gdbserver to talk to localhost... and then there's no way to
> know if it's the same root or not.

Aha. Looks like our loader just fills in the basename of the lib it finds.
That explains why we need so much initialization of solib-search-path and so
on. I'm going to get our kernel guy to change that so that we can just use
solib-absolute-prefix.

cheers,

Kris