Visual Studio 2008 - show a bunch

Is it possible to view heap and stack during debugging?

+7
stack heap visual-studio-2008 visual-studio
source share
5 answers

AFAIK, the main windows you want to use are Locals ( Ctrl + Alt + V , L ) and Autos ( Ctrl + Alt + V , L ), which MSDN has as:

The Locals window displays variables local to the current context or region. This usually means that you are executing a procedure or function. The debugger automatically populates this window. In Visual C #, when the Exception Assistant is disabled, the Locales window also displays a pseudo-$ exception whenever there is an active exception. You can expand pseudo-variant information about the details of the exception.

The Autos window displays the variables used in the current line of code and the previous line of code. For embedded C ++, the Autos window also displays the return values โ€‹โ€‹of the function. Like the Locals window, the Autos window is automatically populated by the debugger.

... and for Stack there is a call window window (Debug -> Windows -> Call Stack) or Ctl + Alt + C.

However, I feel that this is not what you need.

If you are looking for an in-memory view, you can use the Visual Studio Memory windows, which can be accessed from the menu "Debug โ†’ Windows โ†’ Memory โ†’ Memory x" (where x is 1-4) or Ctrl + Alt + M , 1 -4.

As several people have already mentioned, there are several other external tools that are very useful for debugging memory (I mainly use SysInternals tools and debugging tools for Windows).

+10
source share

You need a "Call Stack Window" ... http://msdn.microsoft.com/en-us/library/a3694ts5.aspx

Using the Call Stack window, you can view calls to functions or procedures that are currently on the stack.

And for the heap, the "Memory Window" ... http://msdn.microsoft.com/en-us/library/s3aw423e(VS.80).aspx

The Memory window provides a view of the memory space used by your application.

"Restoring hidden debugger commands" can also be useful ... http://msdn.microsoft.com/en-us/library/9k643651(VS.80).aspx

When you get into debugging memory, other debuggers will be more useful. As someone suggested, WinDbg is great for debugging memory. I often use the IDA Pro disassembler.

+6
source share

You can view the call stack during debugging, but I assume that is not what you are looking for. You might want to try Windbg and SOS, which are BIG for debugging memory issues. A bit steep on the learning curve, but the payback is HUGE.

Microsoft Debugging Tools for Windows

0
source share

If you really want to see the raw memory, for some reason you can open the "Memory" debug window from " Debug->Windows->Memory " and write the address that you want to see in the editing window. You can also write in the edit box any expression that evaluates the address, and it will show you that address, for example &variable

This is not very useful for a real variable search, because it will be difficult for you to parse the raw bytes into meaningful values, but it can be useful for debugging situations when you suspect that buffer overflows or memory are overwritten unexpectedly. This is especially useful when used in conjunction with data points .

0
source share

I know this is an old question, but I decided that I was updating it anyway ...

Visual Studio 2015 comes with a memory usage monitor built right into the Diagnostic Tools panel. If you take pictures before, during and after what you want to check, you can look retroactively into a bunch of these pictures.

Hope this helps someone.

0
source share

All Articles