title: gdb: <error reading variable> in array while debugging VS code
body: <p>I'm having trouble trying to view the contents of an array during debugging. Instead of characters I see .</p>
  <p>My code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      char str[100] = {0};
      fgets(str, 100, stdin);
  
      return 0;
  }
  </code></pre>
  <p>What I see in the <code>VARIABLES</code> window:</p>
  <p><a href="https://i.stack.imgur.com/ZiAEF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZiAEF.png" alt="enter image description here" /></a></p>
  <p>But when I try to debug <code>int</code> arrays everything works fine.</p>
  <p>Exemple:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int str[100];
      for (int i = 0; i &lt; 100; i++)
      {
          str[i] = i+1;
      }
      
  
      return 0;
  }
  </code></pre>
  <p>What I see:</p>
  <p><a href="https://i.stack.imgur.com/gw29r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gw29r.png" alt="enter image description here" /></a></p>
  <p>tasks.json:</p>
  <pre><code>{
      &quot;version&quot;: &quot;2.0.0&quot;,
      &quot;tasks&quot;: [
          {
              &quot;type&quot;: &quot;cppbuild&quot;,
              &quot;label&quot;: &quot;C/C++: gcc.exe build active file&quot;,
              &quot;command&quot;: &quot;C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe&quot;,
              &quot;args&quot;: [
                  &quot;-g&quot;,
                  &quot;${file}&quot;,
                  &quot;-o&quot;,
                  &quot;${fileDirname}\\${fileBasenameNoExtension}.exe&quot;
              ],
              &quot;options&quot;: {
                  &quot;cwd&quot;: &quot;C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin&quot;
              },
              &quot;problemMatcher&quot;: [
                  &quot;$gcc&quot;
              ],
              &quot;group&quot;: {
                  &quot;kind&quot;: &quot;build&quot;,
                  &quot;isDefault&quot;: true
              },
              &quot;detail&quot;: &quot;compiler: \&quot;C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe\&quot;&quot;
          }
      ]
  }
  </code></pre>
  <p>launch.json:</p>
  <pre><code>{
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      &quot;version&quot;: &quot;0.2.0&quot;,
      &quot;configurations&quot;: [
          {
              &quot;name&quot;: &quot;gcc.exe - Build and debug active file&quot;,
              &quot;type&quot;: &quot;cppdbg&quot;,
              &quot;request&quot;: &quot;launch&quot;,
              &quot;program&quot;: &quot;${fileDirname}\\${fileBasenameNoExtension}.exe&quot;,
              &quot;args&quot;: [],
              &quot;stopAtEntry&quot;: false,
              &quot;cwd&quot;: &quot;${workspaceFolder}&quot;,
              &quot;environment&quot;: [],
              &quot;externalConsole&quot;: false,
              &quot;MIMode&quot;: &quot;gdb&quot;,
              &quot;miDebuggerPath&quot;: &quot;C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gdb.exe&quot;,
              &quot;setupCommands&quot;: [
                  {
                      &quot;description&quot;: &quot;Enable pretty-printing for gdb&quot;,
                      &quot;text&quot;: &quot;-enable-pretty-printing&quot;,
                      &quot;ignoreFailures&quot;: true
                  }
              ],
              &quot;preLaunchTask&quot;: &quot;C/C++: gcc.exe build active file&quot;
          }
      ]
  }
  </code></pre>
  <p>What can I do to see the characters in the array?</p>