How to enter the source file of a dynamic lib (.so) when debugging

91 Views Asked by At

Recently, I want to add some breakpoints and debug some ROS libraries step by step to learn how these functions are called. These ROS libraries have been built from source.

However, I found that all the member functions of libraries are linked to .h files and I cannot see what's inside these functions and the breakpoint inside the member functions are useless.

Is there any way to add breakpoints inside a library member function and observe how the library member function is running?

1

There are 1 best solutions below

1
KKKmelody On BEST ANSWER

Following the instructions from @jabba, I built the current main.cpp and the third-party library with -DCMAKE_BUILD_TYPE=Debug, and the breakpoints worked,

EDIT

i.e.,

catkin build main_node -DCMAKE_BUILD_TYPE=Debug