views:

58

answers:

4

Hi all:

Did you ever use Memory Window to go about debugging? If yes, can you provide some scenarios?

Thanks

+3  A: 

It's most useful in unmanaged (C++) development, where you tend to care more about the exact contents of memory than when doing .NET work.

Any time you have large blocks of data which you're working with directly it's useful - much better than presenting it as an array of bytes, for example - think bitmap image files or audio files, for example, where you want to look at headers and precise data layout.

Will Dean
+3  A: 

I used it alot when I was working with SSE and SSE2 instructions. There are C++ equivalents for the assembler instructions which take variables instead of plain registers. That made programming a lot easier.

The memory window was useful in combination with the disassembly window. I wanted to know which instruction loaded my data and I wanted to know where it was.

The whole thing was an implementation of a complex image filtering system, where speed was crucial. Optimizing a few dozens of lines of code took weeks, so I would recommend it only for a few scenarios.

+2  A: 

C++ project crashed or worked depending on the order of include statements. Used the memory window to have a look at the structures accessed leading to the crash, saw that they were aligned in one version of the code, but not in the other. Solution: 3rd party library used #pragma pack in the header, sometimes undone later, sometimes not.

lbruder
+2  A: 

I use it all the time.

Some concrete examples of things I do there:

  • Once I suspect a memory corruption, observe memory chunks to see if they change when not expected. This is usually followed by a data breakpoint pretty quickly.
  • use the various views of memory to reinterpret whole arrays of data (useful for arrays of unions in particular).
  • manipulate the binary of my exe (usually to nop something that's not of direct interest to my debugging. Most often done on 3rd party dlls)
Bahbar