7.7. Displaying Current Values
gdbutility allows you to display the value of almost anything that is relevant to the program, from a variable of any complexity to a valid expression or even a library function. However, the most common task is to display the value of a variable.
To display the current value of a certain variable, run the following command:
Example 7.9. Displaying the Current Values of Variables
Assuming that you have followed the instructions in Example 7.8, “Executing the fibonacci Binary File” and the execution of the
fibonaccibinary stopped after reaching the breakpoint at line 10, you can display the current values of variables
print a$1 = 0 (gdb)
print b$2 = 1