I am trying to enumerate in a Windbg script a list of objects and perform an operation on.
So i get the Directory objects then i do a foreach on each object in that directory.
.foreach /pS 19 /ps 1 (Address {!object @$t7}) {!object Address}
The problem is that "Address" is not always an address token. I need to skip non-numeric tokens. I can't do that using /ps , without skipping some valid addresses and screwing up the tokens.
I tries something like .if ($spat(Address, "-")) != 1 { }
but that did not work.
Can i not perform operations on the Variable "Address" before actually passing it to the OutCommand ?
Thanks.
I tries something like .if ($spat(Address, "-")) != 1 { }
This should work, but your syntax is slightly incorrect. You will need something like this:
.if ( $spat( "Address","[0-f][0-f][0-f][0-f][0-f][0-f][0-f][0-f]" ) )
{
some code;
};
This will match addresses. See the String Wildcard Syntax page in windbg help for more details on matching.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With