I have a windbg script that I plan on assigned to run via a breakpoint. In this script I want to tokenize a command using .foreach, but I want to be able to assign a variable to remember something about a current token for the next time around the for loop.
For example, something like this (written in psuedo windbg-script-code):
$thistokenisinteresting = false
.foreach (line {k100})
{
.if ($thistokenisinteresting)
{
.printf line
$thistokenisinteresting = false
}
.if ($SPAT("line","*SomeToken*"))
{
$thistokenisinteresting = true
}
}
I can't figure out how to assign a variable like $thistokenisinteresting . Do I use a register? Won't that screw up my debugging?