SHARED LIBS
Takis Psarogiannakopoulos
takis@XFree86.org
Fri Dec 17 16:00:00 GMT 1999
Hello,
I want an opinion from somebody that is familiar
with gdb shared libs code.
I apologize if this message is a bit larger than
normal.
We trying to debug mozilla M11 with gdb:
bash# ldd mozilla-bin
dynamic linker: mozilla-bin: file loaded: /dist/bin/libraptorgfx.so
dynamic linker: mozilla-bin: file loaded: /dist/bin/libmozjs.so
dynamic linker: mozilla-bin: file loaded: /dist/bin/libxpcom.so
dynamic linker: mozilla-bin: file loaded: /dist/bin/libplds3.so
dynamic linker: mozilla-bin: file loaded: /dist/bin/libplc3.so
dynamic linker: mozilla-bin: file loaded: /dist/bin/libnspr3.so
dynamic linker: mozilla-bin: file loaded: /lib/libgtk-1.2.so.0.5.0
dynamic linker: mozilla-bin: file loaded: /lib/libgdk-1.2.so.0.5.0
dynamic linker: mozilla-bin: file loaded: /usr/X11R6.3/lib/libXext.so.6.3
dynamic linker: mozilla-bin: file loaded: /usr/X11R6.3/lib/libX11.so.6.1
dynamic linker: mozilla-bin: file loaded: /usr/dglib/libsocket.so.1
dynamic linker: mozilla-bin: file loaded: /usr/dglib/libnsl.so.1
dynamic linker: mozilla-bin: file loaded: /usr/dglib/libthread.so.1
dynamic linker: mozilla-bin: file loaded: /usr/dglib/librte.so.1
dynamic linker: mozilla-bin: file loaded: /usr/dglib/libresolv.so.1
dynamic linker: mozilla-bin: file loaded: /usr/local/lib/libstdc++.so
dynamic linker: mozilla-bin: file loaded: /usr/dglib/libc.so.1
Start GDB
bash# gdb
GNU gdb 19990928 (DGUX version 4.18.3 (DG/UX 19990928))
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are welcome to change it and/or distribute copies of it under certain
conditions. Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details. This GDB was configured as "i586-dg-dguxR4.20MU05
(Build date Oct 20 1999)".
(mozilla-bin is in gstabs+ (GNU as) debug format;also all shared objects
are compiled with -fPIC , then ld -G these .o files and -gstabs+ debug.
ld is not the GNU ld for DG/UX.)
(gdb) set language c++
(gdb) file mozilla-bin
Reading symbols from mozilla-bin...done.
(gdb) info share
Cannot access memory at address 0x80081498.
(gdb) info sharedlibrary
Cannot access memory at address 0x80081498.
(gdb) break main
Breakpoint 1 at 0x804d30e: file nsAppRunner.cpp, line 653.
************************************
(gdb) sharedlibrary libraptorgfx.so
***********************************
Cannot access memory at address 0x80081498.
(gdb) run
Starting program: /dist/bin/mozilla-bin
Breakpoint 1, main (argc=1, argv=0x8047800) at nsAppRunner.cpp:653
653 if (argc == 2) {
(gdb) info sharedlibrary
>From To Syms Read Shared Object Library
0x8008c000 0x800b8994 Yes /dist/bin/libraptorgfx.so
0x800ba000 0x801290a0 Yes /dist/bin/libmozjs.so
0x8012b000 0x801d5a58 Yes /dist/bin/libxpcom.so
0x801d7000 0x801dc068 Yes /dist/bin/libplds3.so
0x801de000 0x801e2ae9 Yes /dist/bin/libplc3.so
0x801e4000 0x8022a544 Yes /dist/bin/libnspr3.so
0x8022c000 0x8036d5e0 Yes /lib/libgtk-1.2.so.0.5.0
0x8036f000 0x803a53dc Yes /lib/libgdk-1.2.so.0.5.0
0x803a7000 0x803b3d64 Yes /usr/X11R6.3/lib/libXext.so.6.3
0x803b5000 0x804752a8 Yes /usr/X11R6.3/lib/libX11.so.6.1
0x80477000 0x8048065c Yes /usr/dglib/libsocket.so.1
0x80482000 0x804b5580 Yes /usr/dglib/libnsl.so.1
0x804b9000 0x804c924c Yes /usr/dglib/libthread.so.1
0x804cb000 0x804cda68 Yes /usr/dglib/librte.so.1
0x804cf000 0x804d1684 Yes /usr/dglib/libresolv.so.1
0x804d3000 0x80524a24 Yes /usr/local/lib/libstdc++.so
0x80000000 0x80086310 Yes /usr/dglib/libc.so.1
(gdb) shared libtestdynamic.so (TRY to load this shared object)
(gdb) info shared
>From To Syms Read Shared Object Library
0x8008c000 0x800b8994 Yes /dist/bin/libraptorgfx.so
0x800ba000 0x801290a0 Yes /dist/bin/libmozjs.so
0x8012b000 0x801d5a58 Yes /dist/bin/libxpcom.so
0x801d7000 0x801dc068 Yes /dist/bin/libplds3.so
0x801de000 0x801e2ae9 Yes /dist/bin/libplc3.so
0x801e4000 0x8022a544 Yes /dist/bin/libnspr3.so
0x8022c000 0x8036d5e0 Yes /lib/libgtk-1.2.so.0.5.0
0x8036f000 0x803a53dc Yes /lib/libgdk-1.2.so.0.5.0
0x803a7000 0x803b3d64 Yes /usr/X11R6.3/lib/libXext.so.6.3
0x803b5000 0x804752a8 Yes /usr/X11R6.3/lib/libX11.so.6.1
0x80477000 0x8048065c Yes /usr/dglib/libsocket.so.1
0x80482000 0x804b5580 Yes /usr/dglib/libnsl.so.1
0x804b9000 0x804c924c Yes /usr/dglib/libthread.so.1
0x804cb000 0x804cda68 Yes /usr/dglib/librte.so.1
0x804cf000 0x804d1684 Yes /usr/dglib/libresolv.so.1
0x804d3000 0x80524a24 Yes /usr/local/lib/libstdc++.so
0x80000000 0x80086310 Yes /usr/dglib/libc.so.1
It didnt load the shared object requested!
(gdb) info sharedlibrary
>From To Syms Read Shared Object Library
0x8008c000 0x800b8994 Yes /dist/bin/libraptorgfx.so
0x800ba000 0x801290a0 Yes /dist/bin/libmozjs.so
0x8012b000 0x801d5a58 Yes /dist/bin/libxpcom.so
0x801d7000 0x801dc068 Yes /dist/bin/libplds3.so
0x801de000 0x801e2ae9 Yes /dist/bin/libplc3.so
0x801e4000 0x8022a544 Yes /dist/bin/libnspr3.so
0x8022c000 0x8036d5e0 Yes /lib/libgtk-1.2.so.0.5.0
0x8036f000 0x803a53dc Yes /lib/libgdk-1.2.so.0.5.0
0x803a7000 0x803b3d64 Yes /usr/X11R6.3/lib/libXext.so.6.3
0x803b5000 0x804752a8 Yes /usr/X11R6.3/lib/libX11.so.6.1
0x80477000 0x8048065c Yes /usr/dglib/libsocket.so.1
0x80482000 0x804b5580 Yes /usr/dglib/libnsl.so.1
0x804b9000 0x804c924c Yes /usr/dglib/libthread.so.1
0x804cb000 0x804cda68 Yes /usr/dglib/librte.so.1
0x804cf000 0x804d1684 Yes /usr/dglib/libresolv.so.1
0x804d3000 0x80524a24 Yes /usr/local/lib/libstdc++.so
0x80000000 0x80086310 Yes /usr/dglib/libc.so.1
info sharedlibrary also doesnt show the requested shared object
loaded.
Now I have this general problem: If I have mozilla-bin (as above)
depending (say look above ldd) from libmozjs.so and I do
gdb mozilla-bin
....
No breakpoint main, no run
and we give
gdb shared libmozjs.so
or
gdb sharedlibrary libmozjs.so
gdb answers with an error like
Cannot access memory at address 0x80081498.
However a breakpoint in main and a run will load libmozjs.so
as well all other shared objects that mozilla-bin depends
upon. I am attaching with this e-mail file the gdb/solib.c
Inside there is a small mod SVR4_SHARED_LIBS_DGUX_FLAVOR
(and we define SVR4_SHARED_LIBS_DGUX_FLAVOR 1 in the nm-dgux.h)
Can anybody with familarity on this file have a look on that mod?
I suspect that maybe the reason for not allowing me to load shared
libs manually. Any ideas what I can do alternatively in solib.c
so that I correct this functionality for the DG/UX OS?
Regards,
Takis
More information about the Gdb
mailing list