How to debug autopilot firmware?

1] I just want to build/compile code for specific vehicle ( like copter, rover) to debug.
Is there any cmake command to build code in debug mode.

2] how to setup debug environment for Px4 autopilot in eclipse/stm32cubeide ?

Please help me for this.

Have you seen these docs?

It’s not exactly what you’re trying to do but that’s what we have got generally working.