See the manual page (man gdb) for complete information.
To use gdb to debug an application, first determine the location of the binary. For example xchat:
% which xchat /usr/X11R6/bin/xchat
Start the application:
% gdb xchat
Next the application is run:
(gdb) run
Use the application normally until you get a crash. Then run the gdb backtrace:
(gdb) bt
Capture the output of the backtrace to include with any problem report or questions to a mailing list. To quit the debugger:
(gdb) quit