Tutorial :gcc: Enabling debug symbols in shared library



Question:

I am creating a shared library using gcc and suspect that there may be some memory leaks from the shared library. To debug, I need to enable debug symbols when creating the shared library.

To build, I am using gcc -g ... [-g is for enabling debug information] But the library [.so file] size is not changing for both -g, and without -g. Besides, I am not getting any useful information from tools like VALGRIND.

Can anyone point me the mistake?


Solution:1

You need to use "-g" for all the steps (compiling your source files and linking).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »