zoukankan      html  css  js  c++  java
  • macos 下通过sublime text 3 + gosublime+sublimegdb 开发注意事项

    1.macos系统10.13.4下

      安装gdb8.0可以正常调试,而gdb8.1不能正常调试,需要跳过这个坑

    2.需要对gdb 8.0进行软件签名

    3.通过gosublime 运行(cmd+b),添加如下命令

    关闭内联优化
    go build -gcflags "-N -l" xxx.go

    先生成可执行文件,然后sublimegdb 设置中在

    才能正常调试

    配置调试的可执行文件工作路径

    "workingdir": "/Users/duanguanjun/work/gospace/src/awesomeProject/src",
    // "workingdir": "${folder:${file}}",

    添加命令行命令
    // NOTE: You MUST provide --interpreter=mi for the plugin to work
    // "commandline": "gdb --interpreter=mi ./executable",
    "commandline": "gdb --interpreter=mi ./hello",

    //"commandline": "/usr/local/bin/gdb --interpreter=mi --args ./${file_base_name}",
    // Environments for running gdb and gdb server
    // Example: "env": {"DISPLAY": ":100"}
    "env": {"PATH":"/usr/local/bin:/usr/local/go/bin"},

    指定命令行用户输入参数

    // Arguments for the program.
    // Example: to run "./executable foo bar"
    // "arguments": "foo bar"
    // To provide user input (stdin) use
    // "arguments": "< input.dat"
    "arguments": "AA BB CC",

    gosublime default setting参数如下:

    指定用户工程的gopath和goroot环境参数

    // you may set specific environment variables here
    // e.g "env": { "PATH": "$HOME/go/bin:$PATH" }
    // in values, $PATH and ${PATH} are replaced with
    // the corresponding environment(PATH) variable, if it exists.
    "env": {"GOPATH":"/Users/x x x/work/gospace/src/awesomeProject:/Users/x x x/work/gospace/src/awesomeProject/src/testcall",
    "GOROOT":"/usr/local/go"
    },

    关闭use_gs_gopath,设置为false

    // if set, whenever possible `GOPATH` will be set to `GS_GOPATH`.
    // please see `Usage & Tips` `ctrl+dot,ctrl+2`
    // section `Per-project settings & Project-based GOPATH` for details about `GS_GOPATH`
    "use_gs_gopath": false,

    gosublime 用户配置参数添加如下

    {
    "font_size": 18,
    "highlight_line": true,
    "highlight_modified_tabs": true,
    "ignored_packages":
    [
    "Vintage"
    ],
    "soda_classic_tabs": true,
    "soda_folder_icons": true,
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "update_check": false,
    "word_wrap": true
    }

  • 相关阅读:
    C#,调用dll产生 "尝试读取或写入受保护的内存 。这通常指示其他内存已损坏。"的问题
    【调试输出】与【输出调试文本】的区别
    二、易语言 api 相关
    E4A 与JS交互事件无反应
    变量循环首、判断循环首、枚举循环首
    文本的操作:子文本替换、分割文本、取文本中间、取指定文本
    变量、&连接、函数与过程、按下某键
    淘宝客推广链接如何转换?
    淘宝客知道这几个ID,收入将会提高50%
    文件已经加入.gitignore但是vs并没有显示文件处于ignore状态
  • 原文地址:https://www.cnblogs.com/it-tsz/p/9017338.html
Copyright © 2011-2022 走看看