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
    }

  • 相关阅读:
    Nginx之——日志按日期分割的实现(基于CentOS操作系统)
    git忽略已加入到版本库的文件
    Linux系统下查看已经登录用户并踢出的方法
    nginx代理后,获取request的ip
    Spring Aop 修改目标方法参数和返回值
    nginx防止DDOS攻击配置
    SQL Server 合并复制遇到identity range check报错的解决
    SQL Saturday 北京将于7月25日举办线下活动,欢迎参加
    T-SQL检查停止的复制作业代理,并启动
    揭开SQL注入的神秘面纱PPT分享
  • 原文地址:https://www.cnblogs.com/it-tsz/p/9017338.html
Copyright © 2011-2022 走看看