|
|
Use the var and unvar commands to set special debugger variables:
var [name initial value] /* Create debugger variables */ unvar [*|variables...] /* Remove debugger variables */When debugging, certain values come up time and time again, and re-entering the value each time it is needed can be tedious and gives great opportunity for error.
Use the var command to create a variable with an initial value and type:
debug0:1>Variables are also useful for counting iterations in breakpoint commands:var ino (struct inode *)D01401A0
debug0:2>d $ino
...
debug0:3>The number of variables available is a configurable parameter. To reuse variables, unset them using the unvar command:var x 0
debug0:4>$x
0 debug0:5>++$x
1 debug0:5>++$x
2
debug0:9>unvar may be given the ``'' argument, which clears all variables currently set.unvar x
debug0:10>$x
Error: Unknown variable