Whidbey Debugger pseudo-register – $user


Today I wanted to talk about my strangest contribution to the Whidbey debugger is a new pseudo-register — $user.

What is $user?

First, I guess I should define what a pseudo-register is. Pseudo-registers are fake variables that can be evaluated in any of the watch windows.  The native debugger has had these forever. For instance, ‘@err,hr’ will give you the last win32 error (formatted as an error message).

$user will give you loads of information about the debuggee user. Here is a screen capture for a process running as my domain account:

You can expand ‘Groups’ or ‘Privileges’ to get a full list of all the groups or privileges that the token has.

Where can you get it?

Whidbey Beta 1 has this feature, so you can have it today if you don’t mind Beta software. Otherwise, it should appear in the final release of Visual Studio 2005, which should be available sometime in 2005.


Comments (7)

  1. Funnish dood says:

    Reading this turned out to be educational beyond the subject. I was going to point out "loggin" and privileges, but a quick check that privileges is actually how it is written! Duh

  2. Pavel Lebedinsky says:

    This is a great feature. In WinDbg I use !token all the time, and it’s really helpful to have something similar when debugging in VS.

    By the way, is "Loggin Id" the same thing as AuthenticationId returned by GetTokenInformation?

  3. Thanks! This could come in quite handy debugging security issues. Do you know if it will give info about the ASP.NET process ID (for ASP.NET)? That’s the impression I’m getting by the "debugee" terminology, but I just wanted to check.

  4. Debugging User Security Context

  5. Brock Allen says:

    This is great! More posts on other pseudo-registers would be appreciated. The one I’m specifically interested in is the equivalent to @EAX where that indicates the return value of a method. Back in the C++/COM days, I’d use this after a method has returned to know what was returned. Something like this would be awesome! 🙂

    Also, on a side note, when will VS.NET C# Ctrl-F5 (Start w/o Debugging) leave the console window up (like it did in VS.NET 2003 and C++ in VS.NET 2005)? This is a feature I’m really missing. 🙂

  6. Gregg Miskelly says:

    Q: Is "Loggin Id" the same thing as AuthenticationId returned by GetTokenInformation?

    A: Yes

    Q: Do you know if it will give info about the ASP.NET process ID (for ASP.NET)?

    A: Yes, this will work for ASP.NET. ‘Debuggee’ is debugger dev speak for ‘the process being debugged’.

    Q: What is the return value pseudo-register?

    A: I think you mean $ReturnValue. This only works for native debugging. You can also see the return value in the autos window. You can also use ‘eax,hr’ to see the eax register formatted as an HRESULT.

Skip to main content