Software development in LINUX/UNIX

From GHER

Revision as of 20:40, 20 March 2012 by Gher (Talk | contribs)
Jump to: navigation, search

Debugging in Linux/UNIX

Debugging run-time errors:

  • recompile your code with "-g -C"
  • enable cores
ulimit -c 10000000

This allows core with a maximum size of 10M.

  • run your program
  • run the debugger
gdb <executable> core

inside the debugger you can use the commands such as "where", "print", "up",... See man gdb.

The command

gdb -p pid#

allows one to see what a program is doing while it executes.

Personal tools