IDE : build WDK Code on sourceInsight
2013-07-09 14:41
176 查看
在sourceinsight中使用 Custom Commands 的官方说明:
http://www.sourceinsight.com/docs35/ad1036756.htm
使用 sourceinsight 集成WDK工具来编译WDK程序是轻量级的选择.
sourceinsight 在非Windows平台也有版本, 在sourceinsight中集成外部工具以后也能用到.
* 由于 sourceinsight 强大的代码分析能力, 不比"VS编辑编译WDK代码"逊色
cmd中的 %1 代表批处理文件的参数1
这个批处理文件在本地只有一个
rem @file BuildWdkCode.cmd
发现 BuildWdkCode-win7X86.cmd 编译出来的驱动,在WinXpSp3下也跑的很好.
![](http://img.blog.csdn.net/20130709140215859)
![](http://img.blog.csdn.net/20130709140630781)
![](http://img.blog.csdn.net/20130709140817640)
BuildWdkCode.cmd 中用到了当前工程路径, 所以编译不同的WDK工程时, 需要设置当前WDK工程路径.
![](http://img.blog.csdn.net/20130709140036484)
![](http://img.blog.csdn.net/20130709140917687)
![](http://img.blog.csdn.net/20130709141200609)
在弹出的已有模板上, 随意选择一个进行编辑, 然后保存成我们的扩展菜单
![](http://img.blog.csdn.net/20130709141807906)
![](http://img.blog.csdn.net/20130709142013125)
Run 参数中的 %j 代表当前工程路径.
![](http://img.blog.csdn.net/20130709142243968)
![](http://img.blog.csdn.net/20130709142511625)
![](http://img.blog.csdn.net/20130709142650390)
![](http://img.blog.csdn.net/20130709142830437)
![](http://img.blog.csdn.net/20130709142926296)
![](http://img.blog.csdn.net/20130709143222218)
如果WDK程序本身有语法错误, 编译有错, 在SourceInsight中找到那个文件, 组合键 CTRL + G 转到出错代码, 进行修正.
![](http://img.blog.csdn.net/20130709143525734)
相对于"VS2008中浏览修改代码 + WDK编译工具", 方便很多
传说中的VS11自带WDK编译功能, 没用过.
SourceInsight 有跨平台的版本, 这样加扩展命令有通用性
很多程序编译都能用命令行实现
以后换个操作系统编程, 可以少学一个代码编辑器~
设置空格代替Tab键, 防止到不同编译器上代码格式不对齐
![](http://img.blog.csdn.net/20130712162814546)
sourceInsight 其他设置 => SourceInsight 操作整理
http://www.sourceinsight.com/docs35/ad1036756.htm
使用 sourceinsight 集成WDK工具来编译WDK程序是轻量级的选择.
sourceinsight 在非Windows平台也有版本, 在sourceinsight中集成外部工具以后也能用到.
优点
* 比 "记事本编辑代码 + WDK工具编译代码" 好* 由于 sourceinsight 强大的代码分析能力, 不比"VS编辑编译WDK代码"逊色
搭建WDK编译环境
在本地的固定目录中编辑一个批处理文件 BuildWdkCode.cmd, e.g. my file is D:\LsWorkDir\BuildWdkCode.cmdcmd中的 %1 代表批处理文件的参数1
这个批处理文件在本地只有一个
rem @file BuildWdkCode.cmd
call D:\WinDDK\7600.16385.1\bin\setenv.bat D:\WinDDK\7600.16385.1\ chk x86 WXP cd %1 build
编译Win7X86和Win7X64的批处理
整理了2个.cmd, 用于编译X86和X64 驱动,发现 BuildWdkCode-win7X86.cmd 编译出来的驱动,在WinXpSp3下也跑的很好.
rem @file BuildWdkCode-win7X86.cmd call D:\WinDDK\7600.16385.1\bin\setenv.bat D:\WinDDK\7600.16385.1\ chk x86 WIN7 cd %1 build -ceZ
rem @file BuildWdkCode-win7X64.cmd call D:\WinDDK\7600.16385.1\bin\setenv.bat D:\WinDDK\7600.16385.1\ chk x64 WIN7 cd %1 build -ceZ
当WDK和工程不在一个分区时的批处理
e.g. WDK 在C盘根目录, 工程在D盘子目录echo on rem @file BuildWdkCode-winxpX86.cmd call C:\WinDDK\7600.16385.1\bin\setenv.bat C:\WinDDK\7600.16385.1\ chk x86 WXP rem 分区不同, 手工切过来 pushd %1 build -ceZ
设置工程路径
我们用SourceInsight时, 有可能是浏览一个庞杂的WDK工程文件夹(e.g. x:\WinDDK\7600.16385.1\src), 有可能需要编译不同的WDK工程.找到要编译的WDK工程路径
在要编译的工程中的一个文件上右击, 选择新建文件, 弹出的对话框上有该文件的全路径, 拷贝下来BuildWdkCode.cmd 中用到了当前工程路径, 所以编译不同的WDK工程时, 需要设置当前WDK工程路径.
增加扩展菜单
在弹出的已有模板上, 随意选择一个进行编辑, 然后保存成我们的扩展菜单
Run 参数中的 %j 代表当前工程路径.
调整我们新增的扩展菜单到想要的菜单位置
运行扩展命令
运行后的效果
如果WDK程序本身有语法错误, 编译有错, 在SourceInsight中找到那个文件, 组合键 CTRL + G 转到出错代码, 进行修正.
在SourceInsight中浏览编译WDK程序的感受
相对于"记事本 + WDK 编译工具", 感觉好很多.相对于"VS2008中浏览修改代码 + WDK编译工具", 方便很多
传说中的VS11自带WDK编译功能, 没用过.
SourceInsight 有跨平台的版本, 这样加扩展命令有通用性
很多程序编译都能用命令行实现
以后换个操作系统编程, 可以少学一个代码编辑器~
在SourceInsight中设置文档编辑格式
设置编辑器右边界, 防止写出超长代码设置空格代替Tab键, 防止到不同编译器上代码格式不对齐
sourceInsight 其他设置 => SourceInsight 操作整理
相关文章推荐
- How to compile and debug VLC player source code in eclipse IDE on Ubuntu 10.04 (lucid)
- How to build the Robotics Library from source code on Windows
- How to compile and debug VLC player source code in eclipse IDE on Ubuntu 10.04 (lucid)?
- wine on ubuntu linux, and source insight 绿色版的安装
- Attach Android Source Code To Eclipse IDE–将Android 源码和Eclipse IDE 关联绑定起来
- 将vim打造成类似source insight的IDE
- How To Make Bootanimation (Base on Android Source Code)
- [IDE][2013-5-13] source insight 设置 函数 括号 智能缩进 设置
- The APK file D:\Code\Air\app\build\outputs\apk\.apk does not exist on disk.
- 将vim打造成类似source insight的IDE
- Understand and code analayise software the same as sourceinsight
- study on source code of Tcmalloc
- Atlas Control Toolkit and Source Code for the Build-in Asp.Net 2.0 Providers
- Manage Android source code like sourceinsight in MotoDev Studio or Eclipse
- Installing_Code::Blocks_from_source_on_Linux
- Linux Systemcall By INT 0x80、Llinux Kernel Debug Based On Sourcecode
- Android kernel build from source code and from prebuilt
- Build update.zip from your own android source code
- install mysql from source code on ubuntu system.
- Build RPM package from source code