Getting a backtrace with GDB

This is a (very) basic introduction in getting a backtrace using gdb. Feel free to add an advanced chapter with more sophisticated instructions.

Who should read this?
Linux users that are not yet familiar with gdb, in special:
 * Users asked by a developer for a backtrace. Usually that is when experiencing crashes that can't be reproduced (yet) on a developers computer.
 * Experienced Linux users who want to actively help with debugging.
 * New developers.

Install GDB
Usually gdb is installed by default in larger distros, try in a console gdb --version

if it returns a version you already have it

Debian based distros
open a console and type in sudo apt-get install gdb

other distros
(please add instructions)

Run the viewer under GDB
Open a console and navigate to the viewers directory. Start it with:

Imprudence
LL_WRAPPER='gdb --args' ./imprudence

Kokua
LL_WRAPPER='gdb --args' ./kokua

Get GDB output
You'll get a prompt, there type in: run Perform the actions necessary to crash. When you crash the console is back at the gdb prompt, where you type in: backtrace You'll maybe have to hit enter several times until the prompt appears again. Copy all output and send it mail to the developer who asked for a backtrace. Remember to add a description of what you did to crash, even if the crash was seemingly random.

Leave GDB
To leave gdb type in q and confirm with y.