Debug a HeapBlock in VS 2017


#1

Hi everyone,

I’m developing an app that should run on Mac, Linux and Windows. Let me first describe my problem:
I do the main development work on my Mac, where everything works as it should. My application uses the asio library to access a serial port which is used to connect a hardware controller to my application. A juce::HeapBlock is used as the receive buffer, passed to the asio::async_read_some() method. The received data is then copied from the HeapBlock to a vector and processed by a class parsing the data. While on Mac this works fine, on Windows the class fails finding the start bytes of the communication protocol. While debugging, I found out, that somehow the first three bits of each byte received seem to be lost, so for an example 0xFE translates to 0x1E.

Now for debugging purposes, I’d like to view the data inside the HeapBlocks array just after it got filled by the asio methods. Sadly it seems to me, as if there is no option of viewing the HeapBlock’s content in the debugger like it would be possible with a simple array or a std::vector. Is this really impossible or is there any option I just haven’t found out until now?
By the way, I don’t suspect this to be a juce-specific problem, but if anyone has an idea of what could possibly go wrong causing this behavior, your ideas are also welcome :wink:


#2

You can inspect the process memory while debugging by opening a memory window in VS2017:

Then inside the memory window type in the expression you want to examine. Assuming your HeapBlock is called MyHeapBlock, type in the following into the memory window:


#3

Great! That seems to be exactly what I was looking for.