summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-07-03 12:50:03 -0400
committerShenghou Ma <minux.ma@gmail.com>2012-07-03 12:50:03 -0400
commitd9c4cef67050791892511d1c2cb653dbcb15204c (patch)
treea0f31a42b5f161e3e35450dcf15374bcc5798b36
parent7b6541a5932d72781e215b2e8e77928ec7ef6839 (diff)
downloadgo-git-d9c4cef67050791892511d1c2cb653dbcb15204c.tar.gz
doc/debugging_with_gdb: mention how to disable gc optimization
R=golang-dev, r CC=golang-dev https://golang.org/cl/6353055
-rw-r--r--doc/debugging_with_gdb.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/debugging_with_gdb.html b/doc/debugging_with_gdb.html
index b2683913fc..6b1e2536e0 100644
--- a/doc/debugging_with_gdb.html
+++ b/doc/debugging_with_gdb.html
@@ -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>