How to add source code of some_shared_library.so into gdb.
I've tried to use dir command but it has not helped.
In order for GDB to know what sources match your some_shared_library.so, you must build it with debugging info (usually -g flag).
Once you've done that (and it sounds like you haven't), on many platforms (e.g. Linux) GDB will find the sources automatically. On other platforms, dir is the right command to tell GDB where the sources are.
gdb