FpDebug is the default and recommended. But there may be some cases where gdb still has the edge (debugging libraries for example).
On a new install (with no old config present) FpDebug should be selected automatically.
(The initial setup dialog however is still behind, and may look for gdb. That can be ignored.)
A general overview is here:
https://wiki.lazarus.freepascal.org/Debugger_Status
The problem with recommendation of course is that people use the debugger in vastly different ways. And sometimes have grown fond of small details that I would not even be aware of. FpDebug was present (and use-able) since 2.0. But little feedback has come in since.
Based on my own debugging experience FpDebug beats gdb. A few points I am aware of:
- Debugging libraries. FpDebug does not support that yet.
- Stacktraces in system dll or kernel. GDB is better on unrolling the stack.
- cross bitness debugging => fpdebug in a 64bit IDE can debug 32 bit projects on Windows. But not the other way round. On Linux cross bitness has yet to be tested.
- remote debugging is still gdb only (except avr, thanks to ccrause)
- gdb has a better disassemble, if you need to go to asm level.
- support for external debug info was just added to fpdebug. Not sure if I did merge it to 2.2
However if you take your average project fpdebug should do all you need.
And it has better understanding of the data types and Pascal syntax. For complex types it will often show better values in watches.
With dwarf3 it also shows the names of locals correctly capitalized. (gdb does too, but gdb has a tenancy to crash with dwarf 3).
Fpdebug even has very initial (and very limited) support for function/method calling.
I have used FpDebug myself since before 2.0. Mainly on Windows. And it has worked very well for me.