Commit acc1ec9b authored by Hana Kim's avatar Hana Kim Committed by Hyang-Ah Hana Kim

doc/debugging_with_gdb: mention delve as an alternative.

Fixes #23108

Change-Id: I9b3d0f0c399c0b4cb488adaf3c002bc55d5d21d9
Reviewed-on: https://go-review.googlesource.com/84795Reviewed-by: default avatarHeschi Kreinick <heschi@google.com>
parent 010d8948
...@@ -3,28 +3,47 @@ ...@@ -3,28 +3,47 @@
"Path": "/doc/gdb" "Path": "/doc/gdb"
}--> }-->
<p><i> <i>
This applies to the standard toolchain (the <code>gc</code> Go <p>
compiler and tools). Gccgo has native gdb support. The following instructions apply to the standard toolchain
Besides this overview you might want to consult the (the <code>gc</code> Go compiler and tools).
<a href="http://sourceware.org/gdb/current/onlinedocs/gdb/">GDB manual</a>. Gccgo has native gdb support.
</i></p> </p>
<p>
Note that
<a href="https://github.com/derekparker/delve">Delve</a> is a better
alternative to GDB when debugging Go programs built with the standard
tool chain. It understands the Go runtime, data structures, and
expressions better than GDB. Delve currently supports Linux, OSX,
and Windows on <code>amd64</code>.
For the most up-to-date list of supported platforms, please see
<a href="https://github.com/derekparker/delve/tree/master/Documentation/installation">
the Delve documentation</a>.
</p>
</i>
<p> <p>
GDB does not understand Go programs well. GDB does not understand Go programs well.
The stack management, threading, and runtime contain aspects that differ The stack management, threading, and runtime contain aspects that differ
enough from the execution model GDB expects that they can confuse enough from the execution model GDB expects that they can confuse
the debugger, even when the program is compiled with gccgo. the debugger and cause incorrect results even when the program is
As a consequence, although GDB can be useful in some situations, it is compiled with gccgo.
not a reliable debugger for Go programs, particularly heavily concurrent ones. As a consequence, although GDB can be useful in some situations (e.g.,
Moreover, it is not a priority for the Go project to address these issues, which debugging Cgo code, or debugging the runtime itself), it is not
are difficult. a reliable debugger for Go programs, particularly heavily concurrent
ones. Moreover, it is not a priority for the Go project to address
these issues, which are difficult.
</p>
<p>
In short, the instructions below should be taken only as a guide to how In short, the instructions below should be taken only as a guide to how
to use GDB when it works, not as a guarantee of success. to use GDB when it works, not as a guarantee of success.
Besides this overview you might want to consult the
<a href="http://sourceware.org/gdb/current/onlinedocs/gdb/">GDB manual</a>.
</p> </p>
<p> <p>
In time, a more Go-centric debugging architecture may be required.
</p> </p>
<h2 id="Introduction">Introduction</h2> <h2 id="Introduction">Introduction</h2>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment