]> Cypherpunks repositories - gostls13.git/commitdiff
doc/diagnostics: update gc flags recommended for debugging
authorHana Kim <hakim@google.com>
Tue, 19 Dec 2017 20:06:57 +0000 (15:06 -0500)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Thu, 4 Jan 2018 16:01:57 +0000 (16:01 +0000)
After 1.10, gcflags apply to only the immediate target.

Change-Id: I3bf331c76041e7b533076cb2f3274e44aafff58a
Reviewed-on: https://go-review.googlesource.com/84775
Reviewed-by: Heschi Kreinick <heschi@google.com>
doc/diagnostics.html

index f9d230e6bc1847e03002bb92da89abda73d8e93d..5f82fadcbda7b45c683201ec56ae50806c11b8f4 100644 (file)
@@ -317,25 +317,25 @@ create confusion.
 <p><strong>How well do debuggers work with Go programs?</strong></p>
 
 <p>
-As of Go 1.9, the DWARF info generated by the gc compiler is not complete
-and sometimes makes debugging harder. There is an ongoing effort to improve the
-DWARF information to help the debuggers display more accurate information.
-Until those improvements are in you may prefer to disable compiler
-optimizations during development for more accuracy. To disable optimizations,
-use the "-N -l" compiler flags. For example, the following command builds
-a package with no compiler optimizations:
+The <code>gc</code> compiler performs optimizations such as
+function inlining and variable registerization. These optimizations
+sometimes make debugging with debuggers harder. There is an ongoing
+effort to improve the quality of the DWARF information generated for
+optimized binaries. Until those improvements are available, we recommend
+disabling optimizations when building the code being debugged. The following
+command builds a package with no compiler optimizations:
 
 <p>
 <pre>
-$ go build -gcflags="-N -l"
+$ go build -gcflags=all="-N -l"
 </pre>
 </p>
 
-<p>
-As of Go 1.10, the Go binaries will have the required DWARF information
-for accurate debugging. To enable the DWARF improvements, use the following
-compiler flags and use GDB until Delve supports location lists:
-</p>
+As part of the improvement effort, Go 1.10 introduced a new compiler
+flag <code>-dwarflocationlists</code>. The flag causes the compiler to
+add location lists that helps debuggers work with optimized binaries.
+The following command builds a package with optimizations but with
+the DWARF location lists:
 
 <p>
 <pre>