Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GDB - debug external library, have source code

Tags:

debugging

gdb

I am using gdb to debug a package that is using an external library. I have the source code of the external library. How do I make gdb load this source code as well? Thank you!

like image 921
gewizz Avatar asked Oct 26 '25 16:10

gewizz


2 Answers

To make GDB find sources for the library, use the dir command. More info here.

like image 156
Employed Russian Avatar answered Oct 28 '25 07:10

Employed Russian


Do you know if the external library was compiled with the "include debugging symbols" flag set? I assume it was not. If you can recompile with that flag set it will make debugging easier.

like image 37
Jay Avatar answered Oct 28 '25 07:10

Jay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!