Not all bugs are equal. Some are easily located by just looking at the code, some by watching the execution flow. Some bugs are really hard to locate and a debugger can help in tracing those.
When you're working on a project which involves modifying Linux kernel code, you'll have to be able to debug the Linux kernel. This is harder then debugging normal userspace applications. But luckily, the Linux community has provided some decent tools such as the various kernel debuggers and f.e. DProbes.
When you're programming RTAI, and you're bitten by an RTAI kernel bug, you're in big trouble. The Linux kernel debugging tools in general don't just work together with RTAI's ADEOS patch. So, there's no real tool to aid you. The best thing that might happen if something goes wrong is a kernel Oops, which you can try to trace and fix (See this Oops tracing howto).
Unfortunately, some bugs are really mean. They might cause a crash without an Oops or they might for example give you no backtrace at all.
One possibility for debugging such ugly beasts is a PC emulator such as Bochs. The Bochs PC-emulator has an integrated debugger. Unfortunately, Bochs is really slow. Some say, the emulation system runs about two hundred times slower then your real system.
Nevertheless, I tried to use it to debug RTAI/LXRT applications, but unfortunately, RTAI/LXRT applications don't run stable yet using Bochs.