mac下配置gdb调试golang

ziyouchutuwenwu ·
重新安安装gdb brew reinstall gdb 根据提示添加~/.gdbinit文件 echo "set startup-with-shell off" >> ~/.gdbinit 然后签名 codesig -s gdb-cert /usr/local/bin/gdb 再通过liteide 选择gdb调试还是会报错,信息提示如下: =thread-group-added,id="i1" ~"GNU gdb (GDB) 8.1\n" ~"Copyright (C) 2018 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-apple-darwin17.3.0\".\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" =cmd-param-changed,param="startup-with-shell",value="off" ~"Reading symbols from /Users/duanguanjun/work/gospace/src/awesomeProject/src/src.debug..." >>> 10000010-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:23>>> 10000011-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:17>>> 10000012-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:16>>> 10000013-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:23>>> 10000014-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:17>>> 10000015-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:16>>> 10000016-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:23>>> 10000017-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:17>>> 10000018-break-insert /Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:16~"done.\n" &"Loading Go Runtime support.\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: /usr/local/go/src/pkg/runtime: No such file or directory.\n" 10000008^done,source-path="/usr/local/go/src/pkg/runtime:$cdir:$cwd" (gdb) &"set substitute-path /go/src/pkg/runtime /usr/local/go/src/pkg/runtime\n" 10000009^done (gdb) 10000010^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0f44",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="23",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:23"} (gdb) 10000011^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0b54",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="17",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:17"} (gdb) 10000012^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0ad2",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="16",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:16"} (gdb) 10000013^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0f44",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="23",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:23"} (gdb) 10000014^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0b54",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="17",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:17"} (gdb) 10000015^done,bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0ad2",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="16",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:16"} (gdb) 10000016^done,bkpt={number="7",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0f44",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="23",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:23"} (gdb) 10000017^done,bkpt={number="8",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0b54",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="17",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:17"} (gdb) 10000018^done,bkpt={number="9",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0ad2",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="16",thread-groups=["i1"],times="0",original-location="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go:16"} (gdb) 10000019^done,bkpt={number="10",type="breakpoint",disp="keep",enabled="y",addr="0x00000000010b0aa0",func="main.main",file="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",fullname="/Users/duanguanjun/work/gospace/src/awesomeProject/src/hello.go",line="15",thread-groups=["i1"],times="0",original-location="main.main"} (gdb) =thread-group-started,id="i1",pid="3944" =thread-created,id="1",group-id="i1" ~"[New Thread 0x1003 of process 3944]\n" =thread-created,id="2",group-id="i1" ~"[New Thread 0xe03 of process 3944]\n" =thread-exited,id="1",group-id="i1" =thread-exited,id="2",group-id="i1" =thread-group-exited,id="i1" 10000020^error,msg="During startup program terminated with signal SIGTRAP, Trace/breakpoint trap." (gdb) 请各位前辈大虾多多指点,先谢谢了!
#5
更多评论
**"liteide里面配置gdb为新的路径即可" -- 这是神马意思?**
#1