在OSX上安装go调试器

huangapple go评论102阅读模式
英文:

Installing go debuggers on OSX

问题

在安装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?

答案1

得分: 4

理论上,你只需按照你所做的那样操作,它会将二进制文件从构建区域复制到/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.

huangapple
  • 本文由 发表于 2011年7月4日 09:14:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/6566540.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定