golang debug with LiteIDE
2015-09-06 15:21
411 查看
golang 的调试比较麻烦,debug stop into 无法跳转到自己写的代码,但是能够跳转到系统提供的代码。
以下是简单的测试代码:
这个情况太诡异了,网上到处是对golang gdb的吐槽。详情可以看这里:
不过好在最后有人提供了LiteIDE里面设置的方式。
以下是简单的测试代码:
package main import ( "fmt" ) func main() { i := 5 even(i) b := 1 fmt.Printf("Is %d even? %v\n", i, b) } func even(i int) bool { a := 1 b := a + 1 b = b + 1 return i%2 == 0 }
这个情况太诡异了,网上到处是对golang gdb的吐槽。详情可以看这里:
http://grokbase.com/t/gg/golang-nuts/1443r0vch8/go-nuts-debugging-in-go-seems-to-be-a-very-difficult-task-to-accomplish
不过好在最后有人提供了LiteIDE里面设置的方式。
1 - Open your project in LiteIDE2 - Select "Build" menu and under it select "Build Configuration..."3 - A dialog shows up. Select "Custom" tab. It contains a list of key/valuepairs4 - Double click the space reserved for the value of "BUILDARGS"5 - write -gcflags "-N -l"6 - close the dialog by clicking Ok button7 - rebuild your project (Ctrl+B)8 - press F5 to start debugging9 - put some breakpoints wherever you wish10 - press f5 again to reach the first breakpoint
解决方案:
1 - 打开LiteIDE Build设置2 - 修改BUILDARGS 变量,添加参数 -gcflags "-N -l" 注意这里有引号3 - 保存后即可4 - enjoy it
相关文章推荐
- Goods:购物车模块之全选按钮与条目之复选按钮的click事件
- Go环境搭建
- UVA 11292 - Dragon of Loowater
- 奇虎360 和 Go
- Google也许要重回中国市场了
- mongo中$push的$slice子操作符的理解
- leetcode: (35) Search Insert Position
- Algorithms - Week 3-0 Mergesort
- Algorithms - Week 2-1 Elementary Sorts
- Goods:查询某个用户的购物车条目以及添加购物车条目
- Intent中的四个重要属性——Action、Data、Category、Extras
- go-tour-zh离线安装
- golang-反射机制
- godaddy.com 注册域名 买卖域名
- [转]为什么GOF的23种设计模式里面没有MVC?
- mongo备份与恢复工具的对比与说明
- 外媒:Google Play将重返中国大陆
- leetcode: (94) Binary Tree Inorder Traversal
- Django:手把手带你入门
- Go基本语句