Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VsCode 单步调试时报错 #265

Open
PetterZhukov opened this issue Oct 14, 2024 · 3 comments
Open

VsCode 单步调试时报错 #265

PetterZhukov opened this issue Oct 14, 2024 · 3 comments

Comments

@PetterZhukov
Copy link

macOS:14.6.1 (23G93)
go version: go version go1.23.1 darwin/arm64

vscode 运行单测时,“run test” 不报错,正常pass
“debug test”报错:
WARNING: xgo toolchain: failed to detect xgo version, consider install xgo: go install github.com/xhd2015/xgo/cmd/xgo@latest note: this message can be turned off by setting XGO_CHECK_TOOLCHAIN_VERSION=false WARNING: failed to link __xgo_link_retrieve_all_funcs_and_clear(requires xgo). WARNING: failed to link __xgo_link_on_goexit(requires xgo). WARNING: failed to link __xgo_link_on_gonewproc(requires xgo).

我猜测是由于dlv的什么配置不对导致的 (或者是需要shadow版本的dlv)

@PetterZhukov
Copy link
Author

settings.json:
{
"go.alternateTools": {
"go": "/Users/xxx/.xgo/shadow/go",
}
}

xgo版本:1.0.49

@PetterZhukov
Copy link
Author

命令行执行dlv可以正常运行

$ dlv test ./dir1/dir2/xxx -- -test.run TestXxxxxxxx
Type 'help' for list of commands.
(dlv) c
//(输出省略)
PASS
Process 69337 has exited with status 0

@xhd2015
Copy link
Owner

xhd2015 commented Oct 14, 2024

Shadow现在还不是完全正常,可以尝试通过 xgo e的debug来进行调试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants