title: Golang debug using GDB?
body: <p>I got 2 questions about GDB + golang?</p>
  
  <pre><code>1) Go build GCC flags 
  </code></pre>
  
  <p>when I run "go build" , which gcc flags do the Go builder use to build a program?  The build value is same as the "GOGCCFLAGS" set in the go envionment?</p>
  
  <pre><code>GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
  </code></pre>
  
  <p>because I don't see any "-g" or "-g3" flags for adding code symbol. If yes, how could the symbol table be compiled ?</p>
  
  <p>2) How to print a value in GDB
      I followed the tutorial here <a href="https://golang.org/doc/gdb" rel="noreferrer">GDB debug go tutorial</a>, but it seems the value is not what I set.</p>
  
  <p><img src="https://i.stack.imgur.com/GiNCe.jpg" alt="The value print 1, while actual is 1024"></p>
  
  <p>By the way, I noticed there is a post about it <a href="https://stackoverflow.com/questions/10693831/go-print-variables-with-gdb?rq=1">gdb debug go</a>
     However, doesn't work for me either.
  <img src="https://i.stack.imgur.com/aQbwO.jpg" alt="the value is not what I set"></p>