Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you know a managed equivalent to '@eax'?

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?

like image 946
AlfredBr Avatar asked Sep 19 '25 00:09

AlfredBr


2 Answers

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
like image 188
John Mulder Avatar answered Sep 20 '25 16:09

John Mulder


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

like image 21
Steve Steiner Avatar answered Sep 20 '25 16:09

Steve Steiner