01:198:211 Lecture 8: Debugging and more Numerics
Document Summary
Cs211-lecture 7-debugging and more numerics: debugging, the make command creates an object file based on what the makefile dictates. Generally, the object file is based off of your program code. To run the object file, input . /[file_name], followed by whatever command line argument you want to send to the program: alternatively, one can compile the code through gcc, like: gcc [file_name. c] This results in an a. out file, which functions similarly to a object file in how you run it. Examples are: -g: adds additional debugging information, -fsanitize=address: if there is a memory leak, the output from a. out will contain information regarding it, -wall: enable all compiler warning messages, valgrind is software that inspects code for us. Prior to running gdb, you must create an a. out file using gcc: next, run the command: gdb a. out. Afterwards, simply input run into the command line, and the program will run until it reaches a segmentation fault or similar error.