debug RT code within the IDE
Debugging RT code is done the same way like host code. There are the same tools available. A difference is the real time behaviour and the weak CPU of the cRIO. A lot of code can be tested on the host.
debug an RT executable
The application builder provides the possibility to compile the RT executable with debug informations. See AppBuilder RTexe Properties Advanced
Once the debuggable RT executable is deployed and running on the target (cRIO here) you are able to connect to the running instance. Open your project in LabVIEW and see Operate -> Debug Application or shared Library. Use the IP of your cRIO target and the LabVIEW IDE will detect the running RT executable and link it to the sources. Be aware that debugging actions affect the real time behaviour and keep an eye on the CPU load of the cRIO, otherwise you may loose communication on 100% load.
FPGA targets can only be simulated. Parts of code can be tested on the host.
Hope it helps
Christian