]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1] doc/debugging_with_gdb: mention how to disable gc optimization
authorShenghou Ma <minux.ma@gmail.com>
Fri, 21 Sep 2012 19:53:58 +0000 (05:53 +1000)
committerShenghou Ma <minux.ma@gmail.com>
Fri, 21 Sep 2012 19:53:58 +0000 (05:53 +1000)
««« backport be7e338a8960
doc/debugging_with_gdb: mention how to disable gc optimization

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6353055

»»»

doc/debugging_with_gdb.html

index b2683913fc7b9694be92440cfbd136d8d844e4ff..6b1e2536e010b93f04b748bdfc617a29a7e8c098 100644 (file)
@@ -23,6 +23,14 @@ Pass the <code>'-s'</code> flag to the linker to omit the debug information
 (for example, <code>go build -ldflags "-s" prog.go</code>).
 </p>
 
+<p>
+The code generated by the <code>gc</code> compiler includes inlining of
+function invocations and registerization of variables. These optimizations
+can sometimes make debugging with <code>gdb</code> harder. To disable them
+when debugging, pass the flags <code>-gcflags "-N -l"</code> to the
+<a href="/cmd/go"><code>go</code></a> command used to build the code being
+debugged.
+</p>
 
 <h3 id="Common_Operations">Common Operations</h3>