Readings

The focus of this week's readings are developer tools, that is applications that will help with programming C/C++ on a typical Unix system.

The readings for Monday, February 1 are:

  1. Compiling and Building:

  2. Debugging and Profiling:

Optional:

  1. Compiling and Building:

  2. Debugging and Profiling:

Also, please take a look at the manual pages linked below.

Questions

In your reading03 folder write a simple hello.c program that prints "Hello, World". Next create a Makefile that compiles your hello.c with six different targets:

  1. hello-dynamic: Compiles hello.c into a dynamic executable

  2. hello-static: Compiles hello.c into a static executable

  3. hello-debug: Compiles hello.c into an executable with debugging symbols enabled

  4. hello-profile: Compiles hello.c into an executable with profiling information enabled

  5. all: Builds all of the hello-* executables (this should be the default target)

  6. clean: Removes all the hello-* executables

In your reading03/README.md file, describe what command you would use to accomplish the following:

  1. View all the text in ls.

  2. Determine which shared libraries ls requires.

  3. View all the system calls made during an invocation of ls.

  4. Debug the hello-debug program to fix errors.

  5. Check the hello-dynamic program for memory leaks or errors.

  6. Profile the hello-profile program to find any bottlenecks.

Commands

In the reading03 folder, write at least five summary pages for the following commands (since some of the commands perform similar functions, only choose one from each set):

  1. gcc

  2. strings

  3. ldd

  4. ar

  5. readelf

  6. make

  7. valgrind

  8. gdb

  9. gprof

  10. strace

Summaries

Note, your summaries should be in your own words and not simply copy and pasted from the manual pages. They should be short and concise and only include common use cases.

Feedback

If you have any questions, comments, or concerns regarding the course, please provide your feedback at the end of your response.

Submission

To submit your assignment, please commit your work to the reading03 folder in your Assignments Bitbucket repository by the beginning of class on Monday, February 1.