Misc Flashcards
What are the 3 steps for running gdb?
1.
2.
3.
- make clean debug
- gdb (executable name)
- gdb run
What do < and > do in terms of redirection
The < symbol tells the shell to perform input redirection:
input is taken from the file infile (which must exist) instead of
from the terminal.
The > symbol tells the shell to perform “output redirection”:
the file outfile is created (or truncated if it already existed – be careful!)
and the output produced by the program is sent to that file instead
of to the terminal.
Redirection
is handled by the shell and that the bin/xyz program never sees any of the redirection arguments; in the above example it sees only bin/xyz …args… and it just reads from stdin and writes to stdout.
How to obtain a ‘Flat Profile’ using gprof?
- bin/xyz < fileName > /dev/null
- gprof bin/xyz
What does a header file define?
Interfaces