From 7d1ddf2b28e18b8a3681700a6e13da75b71b5fa5 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Sat, 22 Sep 2012 05:53:58 +1000 Subject: [PATCH] [release-branch.go1] doc/debugging_with_gdb: mention how to disable gc optimization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ««« 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 | 8 ++++++++ 1 file changed, 8 insertions(+) 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 '-s' flag to the linker to omit the debug information (for example, go build -ldflags "-s" prog.go).

+

+The code generated by the gc compiler includes inlining of +function invocations and registerization of variables. These optimizations +can sometimes make debugging with gdb harder. To disable them +when debugging, pass the flags -gcflags "-N -l" to the +go command used to build the code being +debugged. +

Common Operations

-- 2.50.0