How to debug the source code?

Hello everyone, I want to learn the source code of gazebo, but I can’t find the tutorial of debugging the source code. I hope you can help me, thank you very much.

The easiest way is to launch the application and then attach gdb to the running app via gdb -p <Process-id>.