54
edits
Changes
→Added notes for "Pointers in OpenMP Parallel Region" section
* The frame column - indicates the selected frame (Yellow arrow);
* The configurable column - displays value for the expression;
'''Entry on: November 15th 2016 by Vadym Karpenko'''
===Pointers in OpenMP Parallel Region===
When debugging OpenMP in Visual Studio, you may encounter a situation when the values of your pointers in ''Watch'', ''Parallel Watch'', and ''Locals'' windows become either garbage, if debugging in ''Release'' mode, or display ''<Unable to read memory>'' error (With 0xcccccccc memory address), if debugging in ''Debug'' mode (0xcccccccc memory address is a dedicated memory address for uninitialized stack memory, in other words, this is where all uninitialized pointers point to in memory, for more information visit [https://en.wikipedia.org/wiki/Magic_number_(programming) Magic Number (Programming) Wiki]). It can take hours or even days to find the root cause and the solution that can address this unexpected behaviour.
This behaviour is caused, because when entering a parallel region, pointers that were initizalied prior to entering the parallel region now point to new, uninitialized memory address, but only while in parallel region and only for ''Watch'', ''Parallel Watch'', and ''Locals'' windows. Operationally, all pointers will have their initialized values as you would expect. However, such behaviour makes it very hard to monitor pointers while debugging in parallel region.
This is where ''Memory'' window comes to the rescue.