Gdb, The Debugging Tool; Gcov , The Test Coverage Tool; Make, The Gnu Recompiling Tool - Red Hat ENTERPRISE LINUX 3 - DEVELOPER TOOLS GUIDE Manual

Developer tools guide
Hide thumbs Also See for ENTERPRISE LINUX 3 - DEVELOPER TOOLS GUIDE:
Table of Contents

Advertisement

8
The linker uses a default script that compiles into the linker executable, if you do not supply one via
the
command line option. Use the
-T
options (such as
-r
AT&T's Link Editor Command Language syntax.
For more information, refer to Using ld, the Gnu Linker.
2.8.
, the Test Coverage Tool
gcov
, the code coverage/basic block profile display tool, enables you to analyze the basic block profile
gcov
of your program by recording how often each basic block is executed. This information enables you
to determine the sections of code on critical paths and the code blocks that are not executed at all.

2.9. gdb, the Debugging Tool

GDB, the GNU debugger, has the principal purpose of allowing you to stop your program before it
terminates. If your program terminates, the debugger helps you determine where it failed. To debug a
file named
, first compile the file using
file.c
the debugging information. You then run the debugger. Refer to Section 3.4 Debug the Executable,
for the steps involved in debugging.
Set breakpoints with the
Navigate through the program with the
The debugger debugs threads, signals, trace information, and other data in a program. Each time your
program performs a function call, a block of data (the stack frame), which shows the location of the
call, the arguments, and the local variables of the function is generated. The debugger allows you to
examine the stack frame to get your program to work.
For more information, refer to Debugging with GDB.

2.10. make, the GNU Recompiling Tool

, the GNU recompiling tool, determines automatically which pieces of a large program you need
make
to recompile and then issues commands to recompile them.
1992 (POSIX.2) and is compatible with any programming language whose compiler can run with
command line input from a shell.
any task in which some files must update automatically whenever associated files change.
To use
, you must write a file (a
make
program and provides commands for updating each file. In a program, typically, the executable file is
updated from object files, which are in turn made by compiling source files.
When using
to recompile an executable, the result may change source files in a directory. If you
make
changed a header file, to be safe, you must recompile each source file that includes that header file.
Each compilation produces an object file corresponding to the source file. If any source file has been
recompiled, all the object files, whether newly made or saved from previous compilations, must be
linked together to produce the new executable.
uses the
make
makefile
updating. For each of those files,
. The
makefile
makefile
targets of a particular rule. A simple
target... : dependency... command
--verbose
or
) affect the default linker script. Linker scripts are written in a superset of
-N
command.
breakpoint
step
is not limited only to building programs; it can be used for
make
makefile
database and the last modified files to decide which of the other files needs
implements the commands recorded in the data base of the
make
has rules which explain how and when to remake certain files that are the
makefile
Chapter 2. Basic Principles of the Tools
option to display the default linker script. Certain
as a command, where
gcc -g file.c
command or the
next
conforms to IEEE Standard 1003.2-
make
) that describes the relationships among files in your
rule has the following form:
-g
command.
produces

Advertisement

Table of Contents
loading

Table of Contents