goland调试时断点跳转到asm_amd64.s文件

1. 运行环境

  • 电脑操作系统:

goland调试时断点跳转到asm_amd64.s文件

  • goland环境:
    GoLand 2024.3.5
    Build #GO-243.26053.20, built on March 13, 2025
    Runtime version: 21.0.6+8-b631.39 x86_64 (JCEF 122.1.9)
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    Toolkit: sun.lwawt.macosx.LWCToolkit
    macOS 15.4
    GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
    Memory: 2048M
    Cores: 8
    Metal Rendering is ON
    Registry:
    ide.completion.variant.limit=500
    suggest.all.run.configurations.from.context=FALSE
    ide.experimental.ui=true
    Non-Bundled Plugins:
    org.toml.lang (243.23654.183)
    com.jetbrains.space (243.25659.54)
    com.intellij.ml.llm (243.23654.270.16)
    ru.adelf.idea.dotenv (2024.3)
  • go版本:go version go1.21.6 darwin/amd64

2. 问题描述?

最简单的调试代码:

package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello World")
}

goland调试时断点跳转到asm_amd64.s文件

调试运行到断点到时候会跳转到asm_amd64.s文件,如下图所示,文件路径是/usr/local/go/src/runtime/asm_amd64.s

goland调试时断点跳转到asm_amd64.s文件

点击恢复程序后代码可以正常运行,正确输出helloworld:

goland调试时断点跳转到asm_amd64.s文件

  • go.mod的内容:

goland调试时断点跳转到asm_amd64.s文件

  • go env内容:
    GO111MODULE='on'
    GOARCH='amd64'
    GOBIN=''
    GOCACHE='/Users/xxxx/Library/Caches/go-build'
    GOENV='/Users/xxxx/Library/Application Support/go/env'
    GOEXE=''
    GOEXPERIMENT=''
    GOFLAGS=''
    GOHOSTARCH='amd64'
    GOHOSTOS='darwin'
    GOMODCACHE='/Users/xxxx/go/pkg/mod'
    GOOS='darwin'
    GOPATH='/Users/xxxx/go'
    GOPROXY='https://goproxy.cn,direct'
    GOROOT='/usr/local/go'
    GOSUMDB='sum.golang.org'
    GOTMPDIR=''
    GOTOOLCHAIN='auto'
    GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
    GOVCS=''
    GOVERSION='go1.21.6'
    GCCGO='gccgo'
    GOAMD64='v1'
    AR='ar'
    CC='clang'
    CXX='clang++'
    CGO_ENABLED='1'
    GOMOD='/dev/null'
    GOWORK=''
    CGO_CFLAGS='-O2 -g'
    CGO_CPPFLAGS=''
    CGO_CXXFLAGS='-O2 -g'
    CGO_FFLAGS='-O2 -g'
    CGO_LDFLAGS='-O2 -g'
    PKG_CONFIG='pkg-config'
    GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/_m/8kx_mlsd5tb10r29yf02j2k80000gn/T/go-build718675287=/tmp/go-build -gno-record-gcc-switches -fno-common'

我重新安装了goland,使用go install github.com/go-delve/delve/cmd/dlv@latest命令更新了Delve,但是问题还是没有解决,依旧跳转到asm_amd64.s文件。

3. 您期望得到的结果?

希望进入正常的调试断点内容。

4. 您实际得到的结果?

断点到asm_amd64.s文件的栈信息如下:

runtime.systemstack_switch (asm_amd64.s:474) runtime
runtime.exitsyscall (proc.go:4187) runtime
syscall.syscall (sys_darwin.go:25) syscall
syscall.Stat (zsyscall_darwin_amd64.go:1962) syscall
os.statNolog.func1 (stat_unix.go:32) os
?:0
:1
 - 异步堆栈跟踪
<autogenerated>:2

goland调试时断点跳转到asm_amd64.s文件

最佳答案

最新版本的command line tool 有问题,降级到16.2版本可以解决,亲测有效

3周前 评论
讨论数量: 5

遇到同样问题,升级dlv也不好用,感觉是升级了 macos15.4搞出的问题。求解法

3周前 评论

同样的问题,重装了go和goland都不行,debug不了直接跳转

3周前 评论

最新版本的command line tool 有问题,降级到16.2版本可以解决,亲测有效

3周前 评论

@fbcorz 谢谢,我把Command Line Tools for Xcode降级到了16.2,确实解决了这个问题,非常感谢你的帮助!!!

3周前 评论

@fbcorz 感谢,Command Line Tools降级到16.2确实解决了这个问题,感谢 :+1: :+1: :+1:

2周前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!