This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: interesting solib-absolute-prefix problem


On Dec 3,  2:48pm, Kris Warkentin wrote:

> One would think that not initializing solib-absolute-prefix when doing
> native debugging would work but the problem for us is that we need to find
> /x86/usr/lib/ldqnx.so (our linker) rather than /proc/boot/libc.so since our
> image builder strips all the section information from binaries and gdb uses
> the .dynamic section.
> 
> To make a long story short, I put an 'open() of last resort' in solib_open
> right at the end where if all else fails, it tries to open the exact path it
> was given.  It would seem to me that this is probably not too dangerous but
> someone might be able to comment on this better than I.

I don't really like this patch.  If someone sets solib-absolute-prefix
incorrectly - a quite common occurrence, I've found - we don't want to
inadverently open the host's /lib/libc.so (or the like).  In this case,
it's preferable for gdb to print an error message.

It would, perhaps, be less misleading if GDB were to list the paths
that it tried (and failed) to open.

It's still not clear to me why you need solib-absolute-prefix set when
doing native debugging.  (You explained it above, but I don't understand
your environment well enough to comprehend the explanation.)

Kevin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]