title: Why gdb failed to print array elements?
body: <p>I wish to use gdb to print all array elements of allocated memory.</p>
  
  <pre><code>int main() {
     int* p=(int*)malloc(7*sizeof(int)); 
     for(size_t j=0;j&lt;7;++j) {
           p[j]=j; 
     } 
     return 0; 
  } 
  </code></pre>
  
  <p>So I compiled this program with -g3, use gdb to start it, and set break</p>
  
  <pre><code>&gt; print p@7 
  </code></pre>
  
  <p>I expected with will print out 1-7, but the actual output was</p>
  
  <pre><code>$1 = {0x6160b0, 0x5, 0xff00000000, 0x615c60, 0x615c80, 0x615c20, 0x615c40} 
  </code></pre>
  
  <p>Why my expectation!=actual result, anything wrong with my program?</p>