Changing variable values

While debugging a program, you may wish to manually change the value of a variable to test how your program handles the setting or to speed through a loop.
To change a variable value while debugging:
  1. In the Variables view, right-click the variable and select the Change Value… item.

    Changing a variable's value

  2. Enter the new value in the field.
Note: You can also change a variable's value in the Detail pane at the bottom of the Variables view. Click the value, change it, and then press Ctrl S to save the new value.
Related concepts
Using breakpoints and watchpoints
Inspecting your registers
Inspecting a process's memory
Inspecting shared-library usage
Monitoring signal handling
Viewing your output
Interacting with GDB
Related tasks
Inspecting variables
Controlling the display of variables
Changing variable to a different type
Viewing variables in memory
Evaluating your expressions