I would like to monitor(debug) a linux dynamic library written in C.
I want to see when and what parameters are passed to it.
The library to monitor ‘X’, is invoked by another dynamic library ‘Y’.
Both ‘X and ‘Y’ appear in /proc/pid/maps of the executable ‘A’.
Using ltrace, on the executable did not show lib X or Y.
The executable is using multiple threads.
Also, when using ldd command on the exec it doesn’t mention anything about libs X or Y.
ldd Y, shows that Y needs X.
Using ldd on all the libs, execs in the project doesn’t mention anyone who would need Y.
Yet Y appears to be loaded in the /proc/pid/maps of the exec.
I’m not sure what steps I could take in order to debug the X lib, any advice is appreciated.
If user756235 can run it under gdb then this is an approach using this and this. The only question is to make a full list of functions in a shared library X:
nm ./libX.so | grep "T "And then create .gdbinit (in my case I control args of
print_in_lib):And when I run
gdb: