In my case the debug info symbol files for my uClibc lib are in /opt/STM/STLinux-2.3/devkit/sh4_uclibc/target/usr/lib/debug, so, as you can see I’ve added that dir to the beginning of my LD_LIBRARY_PATH var.

2. Use the directory command in gdb to examine and set the path to your sorce files:

My uClibc sources are kept in directory /data/downloads/st/libc/uClibc-0.9.30-svn, more particularly in the libc folder, so that is what I’ve prepended to the gdb “directory”. It may be enough to add just the top directory (e.g. /data/downloads/st/libc/uClibc-0.9.30-svn) or youmay need to be more specific, adding the libc sub-directory like I did, or you may even need to add the specific sub0system directory, (e.g. /data/downloads/st/libc/uClibc-0.9.30-svn/libc/stdio if you want to debug stdio). You’ll need to experiment with that and see what works in your case.

3. Tell gdb to step into .so’s:

(gdb) set step-mode on

———

The above should do it. Now if you set a breakpoint in a libc function, e.g. fopen gdb should tell you where it put he breakpoint iun the source files, so instead of seeing something like:

(gdb) b fopen
Breakpoint 3 at 0x400a50

, you should now see the file name and line number of the uClibc source file reported by gdb: