在 OSX 上安装 go 调试器

发布于 2024-11-18 07:55:59 字数 218 浏览 2 评论 0原文

安装 go 后,我得到以下几行:

在 OS X 上,调试器必须安装 setgrp procmod。 阅读并运行 ./sudo.bash 以安装调试器。

很抱歉提出这个初学者的问题,但这到底意味着什么?我需要做什么才能安装调试器?

我运行了 ./sudo.bash 但什么也没发生。我读这篇文章是不是太字面意思了?

After installing go, I got the following lines:

On OS X the debuggers must be installed setgrp procmod.
Read and run ./sudo.bash to install the debuggers.

Sorry for the beginner question, but what exactly does this mean? What do I have to do to install the debuggers?

I ran ./sudo.bash but nothing happened. Am I reading this too literally?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我为君王 2024-11-25 07:55:59

理论上,您只需按照您所做的操作,它将二进制文件从构建区域复制到 /usr/local/bin ,然后使它们属于组 procmod 和 SetGID 。

考虑运行:

sh -x sudo.bash

这应该向您展示它正在做什么。

我不完全同意该脚本的作用;我希望 Go 调试器不在 /usr/local/bin 中,谢谢,而是在 $GOROOT 下,所以我不使用官方的 sudo.bash 而是创建我自己的 sudo.bash.goroot 包含:

#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

set -e
. ./env.bash

case "`uname`" in
Darwin)
    ;;
*)
    exit 0
esac

for i in prof cov
do
    sudo cp "$GOROOT"/src/cmd/$i/6$i $GOROOT/bin/6$i
    sudo chgrp procmod $GOROOT/bin/6$i
    sudo chmod g+s $GOROOT/bin/6$i
done

这对我来说效果很好。

In theory, you simply do as you did, and it copies the binaries from the build area to /usr/local/bin and then makes them belong to group procmod and SetGID.

Consider running:

sh -x sudo.bash

That should show you what it is doing as it does it.

I don't entirely agree with what that script does; I want the Go debuggers not in /usr/local/bin, thank you, but under $GOROOT, so I don't use the official sudo.bash but instead created my own sudo.bash.goroot which contains:

#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

set -e
. ./env.bash

case "`uname`" in
Darwin)
    ;;
*)
    exit 0
esac

for i in prof cov
do
    sudo cp "$GOROOT"/src/cmd/$i/6$i $GOROOT/bin/6$i
    sudo chgrp procmod $GOROOT/bin/6$i
    sudo chmod g+s $GOROOT/bin/6$i
done

That works fine for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文