Commands to learn p b d bt l whatis run n s c b XXX if YYY up down set xxx = yyy 1) Log into euclid 2) Make a temporary working directory off your home directory. mkdir tmp 3) CD into that new temporary directory cd tmp 5) Make sure you are in the right directory pwd 6) Copy all the files from my assignment folder into your new temp directory. cp /staff/randy/pub/Classes/CS228/GDB/* . 7) Make sure you are in the right directory. ls -l 8) Run the good version of the head tester program. ./head_tester.good www.nmu.edu 80 8) Compile the head_tester program using the debugger flag. g++ -g head_tester.bad.cc -o htb 9) Run the program. ./htb www.nmu.edu 80 10) It crashed!!! Dang! Fire up the debugger on it. gdb htb 11) List lines 10-30 of the source code. l 10,30 12) Run the program agains run www.nmu.edu 80 13) It crashed again! Ask the debugger where it crashed. bt 14) Find the line that it crashed on. Fix it. Here are some hints. Don't go past the edge of an array. gethostbyname needs a char pointer as it's argument. scanf needs a pointer as it's third argument. bcopy needs void pointers as it's first wo arguments. 15) Recompile and run again. It should work. 16) Start up the debugger again with htb (fixed version) working. 17) Using the debugger, find the return value of MakeSocket(). 18) Using the debugger, find the return value of write(). 19) Using the debugger, find the return value of read(). 20) Using the debugger, fix the program 'prob4.c'.