Lab Assignment--Compile and Debug
Part 1-Makefile
Write a Makefile for the oneline program from last/this week's lab.
- Do not forget the options to debug the program later.
- Use at least one variable in your Makefile.
- Include a clean target.
Part 2-Memory Leak
If you submitted code with a memory leak, here is your opportunity to fix
your code.
- Run the code through valgrind and document what you think the problem is.
- Document any changes that you make to the code and why you have done that
- Once you have no memory leaks, capture it in a script or by using >& valgrind.out after the valgrind command.
If you had no memory leaks:
- Capture it in a script or by using >& valgrind.out after the valgrind command.
- Document challenges you faced
and what solutions you found.
Part 3-Debugging
- Capture a script of you running the debugger on the command-line:
- Set a breakpoint within breakLine
- Within the breakLine, once variables are set, print
your temporary string, your oneLine,
words, and wordCount.
Deliverables: 3 code files, 1 makefile, 1 text file, and 1 to 3 script files
- Makefile for the oneline project.
- with at least one variable
- with a clean target
- Script of the building and running the oneline program using the
makefile.
- Make the program using: make clean; make
- Script or file of valgrind output with no errors or memory leaks
- Script of gdb
- Set a breakpoint within breakLine
- Within the breakLine, once variables are set, print
your temporary string, your oneLine,
words, and wordCount.
- Text document explaining challenges you faced or what you have fixed in the code to get
rid of memory leaks and/or core dumps
- Code for the oneline project (with no core dumps or memory leaks).
Notes
- Do not create a zip file
- Submission is on UR Courses
- Submit your own work
- Be mindful that your assignment is due two hours before the start of your next lab