My objective is to store the class name of the object called this
found in a frame's locals. When you look at this sequence of commands, am I falling foul of some Windbg syntax rules that mean the as
command doesn't seem to throw any error, but also doesn't set the alias as I would like?
This confuses me a bit because the alias was demonstrably set in the isolated .foreach
command I used earlier and now I am just nesting that (although I'd also tried as /c
coupled with a .printf
) further along...
0:133> ad /q *
0:133> al
No aliases
0:133> .foreach /pS 1 /ps 4 (Token {dv /t this}) { as myClass Token }
0:133> al
Alias Value
------- -------
myClass foo
0:133> ad /q *
0:133> al
No aliases
0:133> !for_each_local .if ($spat ("@#Local","this") == 1) { .foreach /pS 1 /ps 4 (Token { dv /t this }) { .printf "${Token}\n" } }
foo
0:133> !for_each_local .if ($spat ("@#Local","this") == 1) { .foreach /pS 1 /ps 4 (Token { dv /t this }) { as myClass Token } }
0:133> al
No aliases
0:133> !for_each_local .if ($spat ("@#Local","this") == 1) { .foreach /pS 1 /ps 4 (Token { dv /t this }) { as /c myClass .printf "${Token}" } }
0:133> al
No aliases
It seems like an intricacy of as
, I can use .echo ${Token}
happily too, but I can't use as
with ${Token}
. I've tried combinations of aS
and semicolons to no avail and I'm sure it's just a syntax question and this is documented but I can no longer see the wood for the trees.
Last attempt, I tried - !for_each_local .if ($spat ("@#Local","this") == 1) { .foreach /pS 1 /ps 4 (Token { dv /t this }) { as /c myClass .echo ${Token} } }
- bah!!!