LiteIDE調試Go提示 No executable specified, use `target exec'

問題

當創建好一個 Go1 Command Project之後,當我們想調試main.go時, 進行以下配置:
liteIDE工具欄 編譯(B) ---- > 編譯配置 ---- > 自定義
將BUILDARGS 值設置爲 -gcflags "-N -l"

F5 報錯,如下圖:
go debugger error

控制檯提示:

=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.7\n"
~"Copyright (C) 2014 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"x86_64-w64-mingw32\".\nType \"show configuration\" for configuration details."
~"\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
~"For help, type \"help\".\n"
~"Type \"apropos word\" to search for commands related to \"word\"...\n"
&"\"D:/work_go/src/demo/demo.debug.exe\": not in executable format: Invalid operation\n"
(gdb) 
&"set unwindonsignal on\n"
=cmd-param-changed,param="unwindonsignal",value="on"
10000001^done
(gdb) 
&"set overload-resolution off\n"
=cmd-param-changed,param="overload-resolution",value="off"
10000002^done
(gdb) 
&"handle SIGSEGV nopass stop print\n"
~"Signal        Stop\tPrint\tPass to program\tDescription\n"
~"SIGSEGV       Yes\tYes\tNo\t\tSegmentation fault\n"
10000003^done
(gdb) 
&"set breakpoint pending on\n"
=cmd-param-changed,param="breakpoint pending",value="on"
10000004^done
(gdb) 
&"set width 0\n"
=cmd-param-changed,param="width",value="4294967295"
10000005^done
(gdb) 
&"set height 0\n"
10000006^done
(gdb) 
&"set auto-solib-add on\n"
10000007^done
(gdb) 
&"Warning: D:/software/Go/src/pkg/runtime: No such file or directory.\n"
10000008^done,source-path="D:/software/Go/src/pkg/runtime;$cdir;$cwd"
(gdb) 
&"set substitute-path /go/src/pkg/runtime D:/software/Go/src/pkg/runtime\n"
10000009^done
(gdb) 
10000010^error,msg="No executable specified, use `target exec'."
(gdb) 

調試輸出提示:

Program exited with code 0
./gdb64.exe --tty=\\.\pipe\liteide-33608-9100 --interpreter=mi --args  D:/work_go/src/demo/demo.debug.exe [D:/work_go/src/demo]
BFD: D:\work_go\src\demo\demo.debug.exe: unable to initialize decompress status for section .zdebug_abbrev

解決辦法

工具欄 調試(D) -----> 選中 debugger/delve
將debugger 從 gdb 切換成 delve 就可以正常debug了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章