how to set breakpoint on function in a shared library which has not been loaded in gdb

Posted by pierr on Stack Overflow See other posts from Stack Overflow or by pierr
Published on 2010-04-15T05:39:31Z Indexed on 2010/04/15 5:43 UTC
Read the original article Hit count: 349

Hi, I have a shared library libtest.so which will be loaded into the the main program using dlopen. Function test() reside in libtest.so and will be called in the main program through dlsym. Is there any way I could set up a break point on test?

Please note that the main programm has not been linked to libtest.so during linking time. Otherwise , I should be able to set the break point although it is a pending action. In my case, when I do b test, gdb will tell me Function "test" not defined.

© Stack Overflow or respective owner

Related posts about gdb

Related posts about breakpoints