Lab Assignment--Compile and Debug


Part 1-Linux/Unix Commands

Follow all of the steps:
  1. log onto Linux
  2. start a script in your home directory (hint: script commands.log will start the script and save it to commands.log)
  3. in your cs330 lab directory create three new directories named 'weather', 'assignment', and 'web'
  4. change the permissions of the directory 'web' to -rwx r-x r-x using the octal form of chmod
  5. change your working directory to weather
  6. without using a text editor create three files called 'today', 'tomorrow', and 'deer'
  7. check the permissions with ls -l
  8. change the permissions of 'deer' to -rwx r-- r--
  9. change the permissions of 'today' to -rw- r-- r--
  10. check the permissions with ls -l
  11. copy 'deer' to a file called 'good'
  12. create a directory named 'cars'
  13. move the file 'good' to the directory 'cars' and rename it 'today2'
  14. change working directory to 'cars'
  15. check permissions with ls -l
  16. move up one directory
  17. remove the directory 'cars' and its contents
  18. exit from the script

Part 2--A Linked List Project

  1. Copy three files using the following command
    cp /net/data/ftp/pub/class/330/CompileDebug/Exercise/* .
  2. Write the Makefile for the Linked List program. Do not forget the options to debug the program later. Define variables for the object files, compiler name, preprocesor, compile and link options. Note that options that are not needed at this time can be defined as null values. eg. CPPFLAGS = . Do not forget the options to debug the program later.
  3. In addition to the targets referred to in the notes, large projects (like the one your class project is becoming) typically have targets for install: and uninstall:. Create these targets.
  4. Run the program. Try inserting numbers into the linked list and printing the resulting list.
  5. Insert a 0 into the list, you will get a segmentation fault (core dump). Remember to remove the core file.
  6. Use gdb to debug the program.
  7. Use strace to show the system call in your program.

Deliverables: