Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Sep 2023 12:20:16 +0200 (CEST)
From:      electricjozin@tutanota.com
To:        Go <go@freebsd.org>
Subject:   [Path] to ease debugging of ports utilizing go
Message-ID:  <NdKP4GS--3-9@tutanota.com>

next in thread | raw e-mail | index | archive | help
------=_Part_288106_788768906.1693650016136
Content-Type: multipart/alternative; 
	boundary="----=_Part_288107_1374960687.1693650016136"

------=_Part_288107_1374960687.1693650016136
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_288107_1374960687.1693650016136
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_288107_1374960687.1693650016136--

------=_Part_288106_788768906.1693650016136
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_288106_788768906.1693650016136--



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