Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2023 21:04:36 +0200 (CEST)
From:      electricjozin@tutanota.com
To:        Go <go@freebsd.org>
Subject:   [Patch] to ease debugging of ports utilizing go
Message-ID:  <NdByuf_--3-9@tutanota.com>

next in thread | raw e-mail | index | archive | help
------=_Part_195079_2034813232.1693508676806
Content-Type: multipart/alternative; 
	boundary="----=_Part_195080_2085821375.1693508676806"

------=_Part_195080_2085821375.1693508676806
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi,
I recently needed to debug sysutils/docker (with gdb) utilizing the WITH_DEBUG_PORTS variable and I noticed some variables got "optimized out". In the attachment is a patch (diff for Mk/Uses/go.mk) that fixes just that.
The solution is based on the "Introduction" section here: https://go.dev/doc/gdb

Thanks!

------=_Part_195080_2085821375.1693508676806
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
<div dir="auto">Hi,<br></div><div dir="auto">I recently needed to debug
 sysutils/docker (with gdb) utilizing the WITH_DEBUG_PORTS variable and I
 noticed some variables got "optimized out". In the attachment is a 
patch (diff for Mk/Uses/go.mk) that fixes just that.<br></div><div dir="auto">The solution is based on the "Introduction" section here: <a target="_blank" rel="noopener noreferrer" href="https://go.dev/doc/gdb">https://go.dev/doc/gdb</a><br></div><div dir="auto"><br></div><div dir="auto">Thanks!<br></div>  </body>
</html>

------=_Part_195080_2085821375.1693508676806--

------=_Part_195079_2034813232.1693508676806
Content-Type: text/x-patch; charset=us-ascii; name=go.patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=go.patch

99,100c99,102
< .  if !defined(WITH_DEBUG) && empty(GO_BUILDFLAGS:M-ldflags*)
< GO_BUILDFLAGS+=	-ldflags=-s
---
> .  if defined(WITH_DEBUG)
> GO_BUILDFLAGS+= -gcflags=all="-N -l"
> .  elif empty(GO_BUILDFLAGS:M-ldflags*)
> GO_BUILDFLAGS+=	-ldflags=-s -w

------=_Part_195079_2034813232.1693508676806--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NdByuf_--3-9>