您的位置:首页 > 其它

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);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: