This is the mail archive of the gdb-patches@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]

Cross solib support; viable at all?


Sorry for repeating the question, but I thought it might be necessary to
ask this question on a higher level.  My target is running Linux
2.4(.12), with shared libraries (glibc 2.2.3-ish), and debugging is done
via a gdbserver.  I would like gdb to automatically load so-files when
they are opened, and whatever else might happen when run in a host
environment.

Reading the lengthy comment preceding enable_break in solib-svr4.c, I
understand that gdb must be able to put a breakpoint in the linker to
intercept the loading and unloading of shared libraries.  This obviously
becomes a problem when the linker isn't run native.  Besides that, I
need to tell gdb where it should fetch the libraries from, since it's
not from /lib.  And I'm sure there are more issues to be resolved. 
Question is, is this viable at all?  I'm thinking the remote protocol
would need extensions to deal with this.

Is there any target that has this functionality yet?  I was thinking
mips-linux did, but I can't tell for sure from the code (and I don't
have a machine to try it on).

Until now, I've just read in the symbol tables manually in gdb by
checking /proc/<pid>/maps for where the so-files are loaded and then
adding the offset for the .text section.  Since I don't get the data
section, I can't set breakpoints there, or debug a core dump that
happened in the library.

If it can't be done automatically for a cross environment, manually will
do.  Is there a way to manually load so-files the way that they are done
in a native environment?  The sharedlibrary command doesn't allow me to
specify a file to load.

-- 
Orjan Friberg              E-mail: orjan.friberg@axis.com
Axis Communications AB     Phone:  +46 46 272 17 68


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