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.

Computer Science & Information Technology

You might also like to view...

An Access database can MOST accurately be described as a structured collection of:

A) tables. B) modules. C) objects. D) records.

Computer Science & Information Technology

Which of the following statements regarding variance is FALSE?

A) Variance provides a more accurate picture of the dispersion of a data set than a range B) Due to the way variance is calculated, the value is not in the same units as the mean. C) Variance is most useful because its value is in the same unit as the median and therefore easier to interpret. D) The higher the variance calculation the more dispersed the data set.

Computer Science & Information Technology