Windbg: How to show thread details inside thread execute command?

Viewed 203

In Windbg, I'm trying to run a set of commands on all threads with ~*e and I want the first command to show the same details I get with ~.

I attempted ~*e .echo DETAILS:; ~. but it give me this output:

DETAILS:
Ignoring recursive thread command
DETAILS:
Ignoring recursive thread command
DETAILS:
...

Yes, I already know about ~*, but I want to show custom information with each thread, and I need this to work inside of ~*e

1 Answers

if it is just the thread identifier you need then use @$thread Pseudo Register instead of ~.

0:035> ~*e .printf "DETAILS:%I64x\n" , @$thread
DETAILS:d54d765000
DETAILS:d54d767000
DETAILS:d54d769000
DETAILS:d54d76b000

or write a script that uses @$thread

0:035>

 ~*e .printf "%-4x:%-4x TEB:%I64x\n" , @@c++(@$thread->ClientId.UniqueProcess), @@c++(@$thread->ClientId.UniqueThread),@@c++(@$thread->NtTib.Self)
eec :18f8 TEB:d54d765000
eec :f98  TEB:d54d767000
eec :25c4 TEB:d54d769000
eec :2f10 TEB:d54d76b000
eec :1edc TEB:d54d76d000
eec :26a4 TEB:d54d771000
eec :1934 TEB:d54d773000
eec :26fc TEB:d54d775000
eec :2dcc TEB:d54d777000
eec :c50  TEB:d54d779000
eec :5b4  TEB:d54d77d000
Related