The purpose of this lab is to review and understand how a debugger can be used in debugging a program. The debugger you will use is gdb.
Here is an outline of what you are to do for this lab:
> cp /cs/cs2005/pub/labs/lab4/* .You will now have a Makefile in your directory (will overwrite if one previously existed) and files beginning with lab4_.
Important:In order to use the debugger on a program it should be compiled with the `` -g'' option which saves symbol table information about the program at compilation time. The Makefile is set up to do so.
Here are a number of gdb commands we think you'll find useful in your quest
h help l give a partial listing of the code p variable_name print the value of the variable b function-name set a break point at the beginning of the function for a C++ member function try "b 'Stack::Push<TAB>" s step to the next line c continue running till the next break point bt backtrace (also called "where") q quit
Turnin the script file using the command
/cs/cs2005/pub/bin/turnin lab4 lab4.script