Source Insight Utils.em里快速宏定义
2015-08-09 11:59
351 查看
快速插入如下语句
1.printk(KERN_SELF"F:%s(L:%d@%s) \n", __FUNCTION__, __LINE__,__FILE__);
2.printk(KERN_SELF" ,0x%08x \n", );
将以下内容拷贝到Source Insight/Project/Base里的Utils.em里,打开Base工程,在Macro:insert里查找到选项,自定义两个快捷键,就可以快速插入想要的内容了。
macro InsertPrintk()
{
// Get a handle to the current file buffer and the name
// and location of the current symbol where the cursor is.
hbuf = GetCurrentBuf()
szFunc=" printk(KERN_SELF\"F:%s(L:%d\@%s) \\n\", __FUNCTION__, __LINE__,__FILE__);"
hwnd=GetCurrentWnd()
sel=GetWndSel(hwnd)
lnFirst=GetWndSelLnFirst(hwnd)
//szFunc = GetCurSymbol()
//ln = GetSymbolLine(szFunc)
InsBufLine(hbuf, lnFirst, szFunc);
}
macro InsertPrintkHex()
{
// Get a handle to the current file buffer and the name
// and location of the current symbol where the cursor is.
hbuf = GetCurrentBuf()
szFunc=" printk(KERN_SELF\" ,0x%08x \\n\", );"
hwnd=GetCurrentWnd()
sel=GetWndSel(hwnd)
lnFirst=GetWndSelLnFirst(hwnd)
//szFunc = GetCurSymbol()
//ln = GetSymbolLine(szFunc)
InsBufLine(hbuf, lnFirst, szFunc);
}
1.printk(KERN_SELF"F:%s(L:%d@%s) \n", __FUNCTION__, __LINE__,__FILE__);
2.printk(KERN_SELF" ,0x%08x \n", );
将以下内容拷贝到Source Insight/Project/Base里的Utils.em里,打开Base工程,在Macro:insert里查找到选项,自定义两个快捷键,就可以快速插入想要的内容了。
macro InsertPrintk()
{
// Get a handle to the current file buffer and the name
// and location of the current symbol where the cursor is.
hbuf = GetCurrentBuf()
szFunc=" printk(KERN_SELF\"F:%s(L:%d\@%s) \\n\", __FUNCTION__, __LINE__,__FILE__);"
hwnd=GetCurrentWnd()
sel=GetWndSel(hwnd)
lnFirst=GetWndSelLnFirst(hwnd)
//szFunc = GetCurSymbol()
//ln = GetSymbolLine(szFunc)
InsBufLine(hbuf, lnFirst, szFunc);
}
macro InsertPrintkHex()
{
// Get a handle to the current file buffer and the name
// and location of the current symbol where the cursor is.
hbuf = GetCurrentBuf()
szFunc=" printk(KERN_SELF\" ,0x%08x \\n\", );"
hwnd=GetCurrentWnd()
sel=GetWndSel(hwnd)
lnFirst=GetWndSelLnFirst(hwnd)
//szFunc = GetCurSymbol()
//ln = GetSymbolLine(szFunc)
InsBufLine(hbuf, lnFirst, szFunc);
}
相关文章推荐
- Android Handler的使用(2)
- C++学习
- AOP annotation
- 链表逆序
- 梳排序
- 《python标准库》--string
- OFBIZ工具类 (转载:chinaUnix.net 帖子作者 :surpass_li )
- test
- shell中的read
- Android之——常用手机号码功能
- 软件版本命名规范
- JAVA连接ACCESS、MYSQL、SQLSEVER、ORACLE数据库
- java中的UDP总结
- python学习笔记1.1
- Shell特殊变量
- proguard 原理
- 机器学习(二)——K-均值聚类(K-means)算法
- MVC框架与三层架构
- Change Layout in Controllers and Actions in Zend Framework 2
- 重载一些常见的运算符