<p dir="auto">by <strong>aChrisSmith</strong>:</p>
<pre class="notranslate">It appears that go does not emit DWARF debugging information when building programs
using cgo. (At least not on OS X / Darwin; haven't checked on another other OS.) Ideally
debugging information would be present regardless of using cgo. And, if I could have a
pony too, I'd love the DWARF information for the C-code as well.

I've included two versions of a toy app (fizzbuzz), one which uses cgo and one which
does not. When using `dwarfdump` to inspect the debugging info, the .debug_contents
section of the Mach-O binary appear to be empty.

go version prints "go version go1.3.3 darwin/amd64"

Repro:

# Verify debugging symbols are generated when not using cgo
1. $ go build without_cgo.go
2. $ dwarfdump without_cgo
3. &lt; Look at all the wonderful debugging symbols &gt;

# Verify debugging symbols NOT generated when using cgo
1. $ go build with_cgo.go
2. $dwarfdump with_cgo
3. &lt;Look in dismay at the lack of precious debugging information &gt;

Output:

----------------------------------------------------------------------
 File: with_cgo (x86_64)
----------------------------------------------------------------------
.debug_info contents:
&lt; EMPTY &gt;</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/9022/0/with_cgo.go" rel="nofollow">with_cgo.go</a> (474 bytes)</li>
<li><a href="https://storage.googleapis.com/go-attachment/9022/0/without_cgo.go" rel="nofollow">without_cgo.go</a> (321 bytes)</li>
</ol>
<p dir="auto">by <strong>xofyarg</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. start a tls server[1] writing in go with tls pkg
2. connect the server using a client built with openssl
3. send something to server

What is the expected output?
client's data is received or error occured.

What do you see instead?
Server got two read event. The former returns no data or error. The latter gets the data
that client sent before.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
OSX Lion/Linux-2.6.32/Linux-3.0

Which version are you using?  (run 'go version')
go1.0.3 and go1.1beta2

Please provide any additional information below.
[1] go server: <a href="http://play.golang.org/p/N_d4hjcRft" rel="nofollow">http://play.golang.org/p/N_d4hjcRft</a>

[2] commands to generate server key pair:
  openssl genrsa 1024 &gt; srv.key
  openssl req -new -x509 -nodes -sha1 -days 365 -key srv.key &gt; srv.cer

[3] client:
  openssl: $ echo -n "hello" | openssl s_client -connect 127.0.0.1:8080 -tls1
  python: 
    import socket
    import ssl
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect(('localhost', 8080))
    ss = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1)
    ss.write('hello')
    ss.close()</pre>