1

How to add source code of some_shared_library.so into gdb.

I've tried to use dir command but it has not helped.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks but i've alredy tried it. And i'm still unable to see sources of shared library in gdb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.