An Example Session
Consider the following source-code written in C:
#includeUsing the GCC compiler on GNU/Linux, the code above must be compiled using the -g
flag in order to include appropriate debug information on the binary generated, thus making it possible to inspect it using GDB. Assuming that the file containing the code above is named example.c
, the command for the compilation could be:
And the binary can now be run:
# ./example Segmentation faultSince the example code, when executed, generates a segmentation fault, GDB can be used to inspect the problem.
# gdb ./example GNU gdb (GDB) Fedora (7.3.50.20110722-13.fc16) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or laterRead more about this topic: GNU Debugger
Famous quotes containing the word session:
“I need not tell you of the inadequacy of the American shipping marine on the Pacific Coast.... For this reason it seems to me that there is no subject to which Congress can better devote its attention in the coming session than the passage of a bill which shall encourage our merchant marine in such a way as to establish American lines directly between New York and the eastern ports and South American ports, and both our Pacific Coast ports and the Orient and the Philippines.”
—William Howard Taft (18571930)