From 04b08da9af0c450d645ab7389d1467308cfc2db8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 4 Mar 2013 21:27:36 +0100 Subject: Imported Upstream version 1.1~hg20130304 --- doc/debugging_with_gdb.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'doc/debugging_with_gdb.html') diff --git a/doc/debugging_with_gdb.html b/doc/debugging_with_gdb.html index b2683913f..b893f931a 100644 --- a/doc/debugging_with_gdb.html +++ b/doc/debugging_with_gdb.html @@ -13,7 +13,7 @@ Besides this overview you might want to consult the

When you compile and link your Go programs with the gc toolchain -on Linux, Mac OS X or FreeBSD, the resulting binaries contain DWARFv3 +on Linux, Mac OS X, FreeBSD or NetBSD, the resulting binaries contain DWARFv3 debugging information that recent versions (>7.1) of the GDB debugger can use to inspect a live process or a core dump.

@@ -23,13 +23,20 @@ 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