Requirement
You want to visualize a call hierarchy of a C function.
Solution
Utilities you need are listed below:
Take ‘rdbSaveBackground’ (redis/rdb.c) for example:
Source: unix diary
The post is brought to you by lekhonee v0.7
You want to visualize a call hierarchy of a C function.
Utilities you need are listed below:
Take ‘rdbSaveBackground’ (redis/rdb.c) for example:
Source: unix diary
The post is brought to you by lekhonee v0.7
When editing when Geany, you need some document of system library functions at hand. So you want to browse manpage at any time.
Just two lines:
Make sure you have geany-plugin-lua installed:
sudo apt-get install geany-plugin-lua
Create a lua source file named ‘ShowMan.lua’ in ~/.config/geany/plugins/geanylua/ . If the direcotry does not exist, you should create it first.
Copy two lines of lua code into this file, save and close.
Create a file named hotkeys.cfg in ~/.config/geany/plugins/geanylua/, add following content:
ShowMan.lua
Restart geany, then open Preferences->Keybindings, Lua Script-> ShowMan, bind a key, for example, Alt+m
Select the function name, and press Alt+m (or from menu Tools->Lua Scripts->ShowMan), then you see the terminal and the manpage.
The post is brought to you by lekhonee v0.7
想了解一个C程序的运行,打算用gdb来单步看一下流程,发现直接用gdb不太方便,然后模仿偶像用emacs的gdb支持(M-x gdb)。但是境界实在是比不上偶像,emacs的操作都还不熟练。最后选择了geany。geany是一个简单的C/C++ IDE,它有一个geanygdb插件可以帮助你在geany的图形界面里调试。
但是最近安装在仓库里的geanygdb插件有一些问题,会导致很高的CPU占用。不过这个问题被报告在这里,现在已经修复了。因为新版本还没有release,所以如果急着用的话,可以从svn签出代码:
svn co https://geany-plugins.svn.sourceforge.net/svnroot/geany-plugins/trunk/geany-plugins
然后执行:
重启geany,打开plugin manager,看到geanygdb的版本已经变成0.20就可以使用了。
geany现在还不支持ctags,是因为它内部有一套自己的tags实现。代码导航可以用过上下文菜单 Go to tag Definition 或者 Go to tag Declaration 实现,最好是到Preference中给这两个命令设置一个快捷键,比如Ctrl+],再对Navigate back 设置一个Ctrl+t,就如同vim+ctags一样了。
实际上在GNOME桌面还有一个专门的GDB图形界面,叫做Nemiver。Nemiver对gdb的常用命令都有快捷键操作,把鼠标移动到代码上还可以查看变量的值,效果和eclipse调试java程序一样,非常强大。
The post is brought to you by lekhonee v0.7
Get artificial301 at:
http://github.com/sunng87/Artificial301/downloads
The post is brought to you by lekhonee v0.7
Hudson的项目有三种状态,分别是failed, Success, Unstable。当单元测试未能通过时,Hudson不会fail掉整个build而是设置为ubstable,并且继续执行post build scripts和actions。这就为集成的版本带来了一些不可知因素。取消这个设置,可以通过在maven options中添加一个 -Dmaven.test.failure.ignore=false。或者在全局设置,manage hudson -> configure hudson -> Global MAVEN_OPTS。这个方法来自:http://stackoverflow.com/questions/1004540/fail-hudson-build-on-single-unit-test-failure
此外,我们借助hudson来自动完成开发环境的部署。从hudson的插件列表中安装ssh plugin和scp plugin。对打包项目新增一个post build action,使用SCP插件把打包生成的压缩文件上传到开发机上。本想同时配置一个build script,在开发环境机器上执行一个自动化部署脚本,但是使用发现ssh plugin的操作居然先于scp操作,而且这个顺序无法配置!不过不要紧,新建一个freestyle项目,项目只利用ssh插件运行远程脚本,再在打包项目配置中新增一个post build action -> build other project,填写前者的项目名,使之成为打包项目的downstream project即可。
The post is brought to you by lekhonee v0.7