In the unmanaged development world, you could observe the DWORD return value of a method by typing '@eax' into the watch window of the debugger.
Does anyone know of an equivalent shortcut in managed code?
Related point: I have learned that VS2008 SP1 supports $exception as a magic word in the watch window. Are there any other shortcuts that you know of?
I'm not sure if this is quite what you mean, but there are some other keywords that you can have printed out for tracepoints:
$ADDRESS address of current instruction
$CALLER name of the previous function on the call stack
$CALLSTACK entire call stack
$FUNCTION name of the current function
$PID process ID for current process
$PNAME name of the current process
$TID thread ID for current thread
$TNAME name of the current thread
The watch window tricks like @eax are called [Psuedovariables]. They are actually documented. I wrote a blog post about this and some other VS debugging items a few years ago. Format specifiers are typically highly useful.
For your specific question there is no psuedo variable for eax in managed code. There is however a register window which will actually have EAX and the other registers in it. It is questionable that this will be useful in many situations as I don't believe there is any way to cast the address to a managed type. You can however look at the layout in the memory window
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