Skip to content

0x03d-macos15版本上goland无法debug的问题

macos版本15.0.1,使用Goland debug程序报错如下:

bash
API server listening at: 127.0.0.1:61934
debugserver-@(#)PROGRAM:LLDB  PROJECT:lldb-1600.0.36.3
 for arm64.
Got a connection, launched process /Users/mistj/Library/Caches/JetBrains/GoLand2023.1/tmp/GoLand/___go_build_bill (pid = 8826).
2024-10-29T15:40:59+08:00 error layer=debugger error loading binary "/Users/mistj/Library/Caches/JetBrains/GoLand2023.1/tmp/GoLand/___go_build_bill": error reading debug_info: decoding dwarf section info at offset 0x1660a9: DW_FORM_strx with no .debug_str_offsets section
Exiting.
could not launch process: error reading debug_info: decoding dwarf section info at offset 0x1660a9: DW_FORM_strx with no .debug_str_offsets section
API server listening at: 127.0.0.1:61934
debugserver-@(#)PROGRAM:LLDB  PROJECT:lldb-1600.0.36.3
 for arm64.
Got a connection, launched process /Users/mistj/Library/Caches/JetBrains/GoLand2023.1/tmp/GoLand/___go_build_bill (pid = 8826).
2024-10-29T15:40:59+08:00 error layer=debugger error loading binary "/Users/mistj/Library/Caches/JetBrains/GoLand2023.1/tmp/GoLand/___go_build_bill": error reading debug_info: decoding dwarf section info at offset 0x1660a9: DW_FORM_strx with no .debug_str_offsets section
Exiting.
could not launch process: error reading debug_info: decoding dwarf section info at offset 0x1660a9: DW_FORM_strx with no .debug_str_offsets section

如何处理:

保证go版本>=1.21,否则装不上dlv(依赖slices包)。随后按如下进行替换

Note

  1. go install github.com/go-delve/delve/cmd/dlv@master install latest dlv
  2. copy /Users/{YOUR_HOME_NAME}/go/bin/dlv to /Users/{YOUR_HOME_NAME}/Applications/GoLand.app/Contents/plugins/go-plugin/lib/dlv/macarm/dlv replace dlv
  3. then reopen the Goland

似乎是macos15的bug/兼容性问题。