The file /usr/lib/debug/lib/libc-2.11.1.so
does not contain a debug version of glibc. It contains only debug parts of libc, but no actual executable code. Putting it into LD_PRELOAD
or LD_LIBRARY_PATH
is the wrong thing to do. Do not do that.
You can read about separate debug files here.
(gdb) print errno
Cannot find shared library `/usr/lib/debug/lib/libc-2.11.1.so' in dynamic linker's load module list
This is a buglet in GDB.
You should know that GDB will look for a variable errno
, but your application does not use any such variable. Rather, errno
is a #define
d macro, that expands to *(__errno_location())
, and GDB doesn't know about this.
Try this instead:
(gdb) p __errno_location()
$1 = (int *) 0x7ffff78396a8
(gdb) x/x $1
0x7ffff78396a8: 0x00000000