Development Tools
Development Tools
link
compile
baz.y
original generated
Makefile Format
• Rule Syntax:
<target>: <dependency list>
<command>
clean:
rm foo.o bar.o foobar
Make Power Features
• Many built-in rules
– e.g. C compilation
• “Fake” targets
– Targets that are not actually files
– Can do just about anything, not just compile
– Like the “clean” target
• Forcing re-compiles
– touch the required files
– touch the Makefile to rebuild everything
Version Control
• Provide the ability to store/access and protect all
of the versions of source code files
• Provides the following benefits:
– If program has multiple versions, it keeps track only of
differences between multiple versions.
– Multi-user support. Allows only one person at the
time to do the editing.
– Provides a way to look at the history of program
development.
Version Control Systems
• SCCS: UNIX Source Code Control System
– Rochkind, Bell Labs, 1972.
• RCS: Revision Control System
– Tichy, Purdue, 1980s.
• CVS: Concurrent Versions System
– Grune, 1986, Berliner, 1989.
RCS Basic Operations
• Set up a directory for RCS:
– mkdir RCS
• Check in a new file into the repository
– ci filename
• Check out a file from the repository for reading
– co filename
• Check out a file from the repository for writing
– co –l filename
– Acquires lock
• Compare local copy of file to version in repository
– rcsdiff [–r<ID>] filename
RCS Keywords
• Keywords in source files are expanded to contain RCS
info at checkout
– $keyword$ → $keyword: value $
– Use ident to extract RCS keyword info
• $Author$ Username of person checked in the revision
• $Date$ Date and time of check-in
• $Id$ A title that includes the RCS filename,
revision number, date, author, state, and (if
locked) the person who locked the file
• $Revision$ The revision number assigned
SCCS Equivalents
Function RCS SCCS
• Argument descriptions:
<programfile> executable program file
<corefile> core dump of program
<pid> process id of already running program
• Example:
gdb ./hello
• Compile <programfile> with –g for debug info
Basic GDB Commands
• General Commands:
file [<file>] selects <file> as the program to debug
run [<args>] runs selected program with arguments
<args>
attach <pid> attach gdb to a running process <pid>
kill kills the process being debugged
quit quits the gdb program
help [<topic>] accesses the internal help documentation