The C++ program in the buggy.c file compiles fine but gives a run-time error. List the steps to debug it using gdb.
First of all the program needs to be compiled with the -ggdb option
gcc -ggdb buggy.c -o buggy
Then it is run in the debugger with the following command:
gdb buggy
Now the program needs to be traced till the bugs have been located. To do so the first of all a break point is inserted on the main function using the command break main Then the program is started using the run command and traced using next and step until the bug is located.
You might also like to view...
Give a command line for displaying the sizes of files that have the .jpg extension and names ending with a digit.
What will be an ideal response?
When you click ________, the email opens in edit mode, which allows you to write a response to the email
A) Forward: B) Send: C)
Dr. Edmond Locard developed a theory known as ________ of Evidence
Fill in the blank(s) with the appropriate word(s).
List at least eight variations of UNIX.
What will be an ideal response?