Format Specifier in Watch Window

Does anyone know if there are format specifiers that can be applied to
variables in the WinDbg Watch Window similar to Visual Studio? For
instance, if I am looking at a unicode string variable type, I would like to
see the value of that unicode string in a readable format. In Visual Studio
I would type “variable,u” where the “,u” is the format specifier.

David Voeller

Assuming that the type of the variable is already a ptr to a Unicode
string (unsigned short *) but not wchar_t* then “.enable_unicode 1” in
the command window should enable the string being displayed pretty much
everywhere, including the watch window.

If you want to do it on a variable-by-variable basis, just type in the C
you’d use to cast to whatever type you want. The watch window uses the
C++ expression evaluator. For instance
argv[1]
would display the second command line argument, and
(DWORD)*argv[1]
would display the first character of it cast as a DWORD.

Jason

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Voeller
Sent: Friday, March 11, 2005 12:01 PM
To: Kernel Debugging Interest List
Subject: [windbg] Format Specifier in Watch Window

Does anyone know if there are format specifiers that can be applied to
variables in the WinDbg Watch Window similar to Visual Studio? For
instance, if I am looking at a unicode string variable type, I would
like to
see the value of that unicode string in a readable format. In Visual
Studio
I would type “variable,u” where the “,u” is the format specifier.

David Voeller


Thanks Jason

I had used the “.enable_unicode 1” before to display Unicode strings. I
actually like to put WinDbg in this state before I even get started with a
debugging session. It can be very handy at times.

I also use the C++ expression evaluator. I typically use it for casting
various pointers. It doesn’t look like the WinDbg watch window has a
format specifier like I was thinking
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcug98/h
tml/_asug_symbols_for_watch_variables.asp).

When I’m debugging user mode programs I’ve found the format specifiers to
be useful at times.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jason Cunningham
Sent: Friday, March 11, 2005 3:27 PM
To: Kernel Debugging Interest List
Subject: RE: [windbg] Format Specifier in Watch Window

Assuming that the type of the variable is already a ptr to a Unicode
string (unsigned short *) but not wchar_t* then “.enable_unicode 1” in
the command window should enable the string being displayed pretty much
everywhere, including the watch window.

If you want to do it on a variable-by-variable basis, just type in the C
you’d use to cast to whatever type you want. The watch window uses the
C++ expression evaluator. For instance
argv[1]
would display the second command line argument, and
(DWORD)*argv[1]
would display the first character of it cast as a DWORD.

Jason

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Voeller
Sent: Friday, March 11, 2005 12:01 PM
To: Kernel Debugging Interest List
Subject: [windbg] Format Specifier in Watch Window

Does anyone know if there are format specifiers that can be applied to
variables in the WinDbg Watch Window similar to Visual Studio? For
instance, if I am looking at a unicode string variable type, I would
like to
see the value of that unicode string in a readable format. In Visual
Studio
I would type “variable,u” where the “,u” is the format specifier.

David Voeller



You are currently subscribed to windbg as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com