source insight解析命令行
SourceInsight常用功能设置
![SourceInsight常用功能设置](https://img.taocdn.com/s3/m/d751691d53d380eb6294dd88d0d233d4b14e3f1b.png)
SourceInsight常⽤功能设置 熟悉⼯具的使⽤能在⼀定程度上提⾼⼯作效率,但⼯具永远只是⼯具,⼤家要把重点放在内功的修炼上。
符号导航 符号(变量、宏定义、结构定义、枚举、函数等等)在SI 中的检索⾮常⽅便。
Ctrl+⿏标左键或Ctrl+=可以⽴即转到符号的定义处,Alt+/可以打开⼀个窗⼝查看符号的定义。
F7 浏览或查找⼯程的全局变量和函数,F8 浏览查找当前⽂件的全局变量和函数。
Ctrl+/打开 Lookup Reference 窗⼝⽤于搜索符号在⼯程中的索引,所有搜索结果在搜索窗⼝中显⽰,点击搜索结果左边的红⾊源链接即可打开其所在位置。
Lookup Reference 是在整个⼯程⽂件中进⾏搜索,要只在当前⽂件或特定的⽬录下进⾏搜索,使⽤ Ctrl+H 或Ctrl+Shfit+H 进⾏搜索,F3 和F4 是上⼀个、下⼀个搜索结果的快捷键。
使⽤Shift+F8 可以让当前的符号在整个⼯程⽂件中⾼亮显⽰。
参数设置 SI 有很⾃由的⾃定义功能,⼏乎所有的窗⼝都可以⾃定义字体、颜⾊,可以轻松地把各种类型关键字、变量、标志符、函数、宏、注释等定义为不同的颜⾊和显⽰⽅式(正体或斜体、加粗或正常、加下划线、放⼤显⽰等),可以随意的增加修改删除菜单项和快捷键。
更重要的是,可以通过⾃定义命令执⾏外部程序,也可以通过 SI ⾃⼰的宏语⾔,⾃⼰写⼀段程序实现特定的功能,这些可以提⾼我们⼯作的效率,从重复繁琐的⼯作中解脱出来。
字体选择 在 SI 中样式是可以被继承,如果要从根本上改变字体,最简单的⽅式就是直接修改根样式中的字体,因为其它样式都会由此继承⽽来。
选择 Options/Document Options 页⾯内的 Font Options 中的Screen Fonts 字体,即可改变根样式中的字体。
SI 中的默认配置为Verdana 字体,是⼀种⾮等宽字体,为了使编写的代码在各种编辑器中看起来都有良好的对齐效果,强烈建议使⽤等宽字体,Courier、New Courier 和宋体等都是较好的选择。
SourceInsight使用技巧
![SourceInsight使用技巧](https://img.taocdn.com/s3/m/2ff7f5010740be1e650e9aff.png)
SourceInsight 使用技巧 转) 使用技巧(转配置成简单好用的 c/java 代码编辑器1、缩进与 tab 、(1)Options 菜单 Preferences Typing 卡,勾掉下面两项∶ Typing tab indents line,regardless of selection,空行按 tab 无法前进 Typing tab replaces current selection,选定部分内容、再按 tab 时会清除所选 (2)Options 菜单 Document Options(针对不同文件类型,分别进行设置) 下拉左上 文件类型框、选择合适类型(c 源文件) Editing Options 框中,tab width=2 框中,勾选 Expand tabs(这样,按 tab 键、等价于输入 2 个空格) (3)Options 菜单 Document Options 选择合适的文件类型 点击右边中间的 Auto Indent 钮 在弹出的框中, 左边一定要点 Smart, 右边有两个复选框 Indent Open Brace 和 Indent Close Brace,具体效果可以看 SIS 的 HELP。
按照部门里的编程风格要求,最方便的就是把两个 复选框都取消掉,然后点 OK。
勾选 Auto Indent 之 SMART 的效果∶在 C 程序里, 如果遇到行末没有分号的语句,如 IF, WHILE, SWITCH 等, 写到该行末按回车,则新行自动相对上一行缩进两列。
勾掉 Indent Open Brace 和 Indent Close Brace 的效果∶继上一段,在相对缩进行里, 如果 输入"}", 则自动和上一行列对齐(好像勾不勾都会有这个功能);而输入"{"时,不会与下面的 行对齐(这是勾上 Indent Open Brace 时的效果)。
source insight relation进阶用法
![source insight relation进阶用法](https://img.taocdn.com/s3/m/8f1031b2bb0d4a7302768e9951e79b8969026815.png)
source insight relation进阶用法1. 引言1.1 概述本文旨在介绍和探讨Source Insight的进阶用法,以帮助读者更好地利用这一强大的源代码阅读和导航工具。
通过深入了解Source Insight的各项功能和技巧,开发人员可以提高自己的编程效率,并更加轻松地理解和修改复杂代码。
1.2 文章结构文章主要分为五个部分:引言、正文、Source Insight介绍、Source Insight 进阶使用技巧以及结论。
在“引言”部分中,我们将进行概述,并说明本文的结构和目的。
接下来的章节将详细介绍Source Insight以及如何进一步优化使用该软件。
1.3 目的本文旨在向读者展示如何充分利用Source Insight这一工具,在源代码分析和编辑过程中提高效率。
通过学习本文所述的基本功能和进阶用法,读者将能够更加灵活地浏览、导航和编辑源代码。
同时,我们还将提供一些定制化配置和高级功能应用技巧,以帮助开发人员根据自身需求进行个性化设置,并实现更高效的开发过程。
请注意,所有内容均以原创思路呈现,并未涉及任何外部链接或引用,以确保文章的完整性和独立性。
现在让我们进入正文,探索Source Insight这一强大工具的奥秘。
2. 正文:正文部分将详细介绍和讨论Source Insight relation的进阶用法。
在这一部分中,我们将探讨Source Insight relation的高级功能以及它在开发中的实际应用。
首先,我们会介绍如何利用Source Insight relation进行代码导航与浏览技巧。
通过使用relation工具,我们可以快速定位特定函数或变量的定义、引用和调用位置。
这项功能对于大型项目的代码阅读和理解非常有帮助。
我们将讨论如何利用relation工具来实现代码跳转、查找相关函数和变量,并且展示如何在代码中快速浏览和选择不同的声明。
接下来,我们将探讨Source Insight relation的快捷键和命令行操作技巧。
集成开发环境之Source Insight使用教程
![集成开发环境之Source Insight使用教程](https://img.taocdn.com/s3/m/6d52663910a6f524ccbf85dc.png)
它编辑器产品不同,Source Insight能在你编辑的同时分析你的源代码,为你
提供实用的信息并立即进行分析。
让编程更简单更高效更规范
项目管理(1)
①
新建一个项目
快捷键 Alt + Shift + N 可以打开新建项目对话框,然后根据提示填好项目存
文档窗口-文档类型选项窗口
Alt + Y 打开文 档类型选项窗 口,修改字体 显示大小、是
否显示行号、
解析语言选择、 工程文件过滤、 扩展tab键、 是否显示符号 窗口等。
文档窗口(3)
扩充1:Source Insight可以定义风格,菜单栏->选项->风格,即可以打开风
格窗口,可以新建一个风格或修改一个风格。风格可以继承(和C++继承差 不多)。
储位置,源文件位置等。然后会出现添加删除项目文件对话框,选中自己
想要编辑和浏览的文件添加即可,这样就建好了一个项目。
②
添加和删除项目文件
①
在添加删除文件前,可以先设置文件过滤器,菜单栏->选项->文档选项, 就可以看到文件过滤器了,怎么设置应该是一目了然的。
②
菜单栏->项目->添加或删除文件,即可打开添加和删除项目文件对话框。
quicker.em的使用
首先将这个文件加载到Base工程中,其次要定义一个快捷键调用
quicker.em中的宏 AutoExpand。
调用 AutoExpand 宏后,AutoExpand会根据当前文本内容自动调用
其他宏。
一般情况下都用快捷键 Ctrl + Enter 调用AutoExpand宏。 quicker.em 包括标准C语言扩展,标准说明生成,代码修改注释等。 quicker.em 的使用参考《Quicker使用说明.doc》
source insight命令_vim待续中
![source insight命令_vim待续中](https://img.taocdn.com/s3/m/fdf2c4eafab069dc502201a9.png)
UNDO/REDO: Ctrl+Z/YLeft/Right 缩进:F9/F10显示/隐藏行号:Alt+V, Shift+L跳行:Ctrl+G跳到原型:Alt+0跳到定义:Ctrl+=跳到引用:Ctrl+/ 回跳/前进:Alt+,/.左/右单词:Ctrl+Left/Right行首/尾: Home/End文件顶部/尾部: Ctrl+Home/End块上方/下方: Ctrl+Shift+[/]选择块:Ctrl+-左/右滚:Alt+Left/Right剪切一个单词:Ctrl+,选择一个单词:Shift+F5选择一行:Shift+F6插入一行:Ctrl+I剪切一行:Ctrl+U合并一行:Ctrl+J复制一行:Ctrl+K复制到行尾:Shift+Ctrl+K剪切到行尾:Ctrl+;选择到行首:Shift+Home选择到行尾:Shift+End选择到文件顶部:Shift+Ctrl+Home选择到文件底部:Shift+Ctrl+End选择左边单词:Shift+Ctrl+Left选择右边单词:Shift+Ctrl+Right选择上页/下页:Shift+PgUp/PgDown替换:Ctrl+H替换多个文件:Shift+Ctrl+H关闭文件:Ctrl+W关闭所有文件:Shift+Ctrl+W保存:Ctrl+S另存为:Shift+Ctrl+S搜素:Ctrl+F搜素多个文件:Shift+Ctrl+F向后搜素:F3向前搜索:F4增量搜素:F12关闭窗口:Ctrl+F4遍历窗口:Ctrl+Tab书签:Ctrl+M函数遍历:+/- (小键盘)列选择:Alt+鼠标缩进F9、F10交叉编译host,build,target的含义具体解释一下,build就是你正在使用的机器,host就是你编译好的程序可以运行的平台,target就是你编译的程序可以处理的平台.这个build和host比较好理解,但是target就不好办了,到底什么意思呢?一般来说,我们平时所说的交差编译用不到他target的,比如./configure --build=i386-linux,--host=arm-linux就可以了,在386的平台上编译可以运行在arm板的程序.但是,一般我们都是编译程序,而不是编译工具,如果我们编译工具,比如gcc,这个target就有用了.如果我们需要在一个我们的机器上为arm开发板编译一个可以处理mips程序的gcc,那么target就是mips了.不知道我的解释是否正确,如果大家看到了这篇帖子,觉得不对,批评指正.整行补全CTRL-X CTRL-L根据当前文件里关键字补全CTRL-X CTRL-N根据字典补全CTRL-X CTRL-K根据同义词字典补全CTRL-X CTRL-T根据头文件内关键字补全CTRL-X CTRL-I根据标签补全CTRL-X CTRL-]补全文件名CTRL-X CTRL-F补全宏定义CTRL-X CTRL-D补全vim命令CTRL-X CTRL-V用户自定义补全方式CTRL-X CTRL-U拼写建议CTRL-X CTRL-S命令状态下左右缩进>> 右缩进<< 左缩进n<< 或n>> 缩进多行,如4>>可视状态下的缩进使用<或>进行缩进,也可使用n<或n>多节缩进可以用= 对选中的部分进行自动缩进。
让sourceinsight支持查看makefile、kconfig以及.s代码方法
![让sourceinsight支持查看makefile、kconfig以及.s代码方法](https://img.taocdn.com/s3/m/19d067941b37f111f18583d049649b6648d709b8.png)
让sourceinsight支持查看makefile、kconfig以及.s代码方法让sourceinsight支持查看makefile、kconfig以及.s代码方法在用sourceinsight查看linux内核源码的时候,大家会发现不能查看源码中的makefile和kconfig代码,即不能搜索到makefile和kconfig文件。
这是因为source insight默认是不选makefile的,也没有konfig这种类型的文件。
下面就说如何让sourceinsight支持查看makefile和kconfig代码:(1)添加makefile:进入Options -> Document Options-> 点击Document Type 的下拉框,然后选择Make File,在右边的File Filter中,在原先的*.mak后面加上一个分号,即多个不同过滤规则以分号间隔开,再加上*makefile,变成*.mak;*makefile,并且选中Include when adding to projects就行了。
(2)添加kconfig:点击Add Type,填入新文件类型的名字kconfig,File Filter中写上*kconfig;kconfig*,再选中下面的Include when adding to projects就行了。
(3)添加支持.s:进入Options -> Document Options-> 点击Document Type 的下拉框,然后选择x86 Asm Source File,在右边的File Filter中,在原先的*.asm;*.inc加上*.s和*.S,即变成*.asm;*.inc;*.s;*.S,并且选中Include when adding to projects就行了。
最经典的Source Insight完整使用教程
![最经典的Source Insight完整使用教程](https://img.taocdn.com/s3/m/0e907b6914791711cd791704.png)
手段来弄清楚整
个程序的组织结构, 使得 Linux 内核源代码的阅读变得尤为
困难。
当然了 Linux 下的 vim 和 emacs 编辑程序并不是没有提
供 变量、函数搜索,彩色显示程序语句等功能。它们的功
能是非常强大的。比如, vim 和 emacs 就各自内嵌了一个标
记程序, 分别叫做 ctag 和 etag ,通 过配置这两个程序, 也
一遍才能把这些汇编加到 PROJECT 里面。
3 、去掉功能强大但是无用的自动完成功能
Options Completion
菜单 Preferences
Typing
框,勾掉 Use automatic symbol
卡 Auto
completion window
(这里是 SIS 的全局设置)
Options 菜单 Document Options
4
所示,其中,右边的那个窗口( Linux Project ,即工程窗
口)缺省按照字母顺序列出当前工程中所有的文件。
图 4 工作窗口
点击一个文件就可以打开该文件,显示如图
5 所示,进
入到右边的那个窗口分别可以以文件列表的方式,
列出所有
的文件, 每个窗体下边有一排按钮, 左边的窗口 ( 21142.c )
勾掉 Indent Open Brace
和 Indent Close Brace
的效果∶继上一段,在相对缩进行里 , 如果输入 "}", 则自
动和上一行列对齐(好像勾不勾都会有这个功能);而输入
"{" 时,不会与下面的行对齐(这是勾上 Indent Open
Brace 时的效果)。
2 、向项目中添加文件时,只添加特定类型的文件(文件类 型过滤器)
source insight 技巧
![source insight 技巧](https://img.taocdn.com/s3/m/1179e71a650e52ea55189838.png)
Source Insight 使用技巧标签:使用说明使用技巧文件快捷键分类:技术点滴2007-01-12 10:39 Source Insight是阅读和编写代码的好东东,基本上也算得上是经典之作了,虽然还有一点点小bug,不过对于我们这些C程序员来说可是一旦拥有别无所求。
下列小技巧是在工作中同事整理总结的,对提高工作效率多少有点帮助,其中有些是对应于SVN的,没有使用SVN做版本管理的人就不要白费力气了。
Option—>custom commands→run中填写下面的命令。
在commands中填写命令的标识(如Jonathan)选择RUN。
1.ShellExecute open explorer /e,/select,%f/*作用是在资源管理器中打开当前编辑文件并选中*//*可以设置快捷键如ctrl+e,(option→key assignments→选择刚添加的命令更改其快捷方式)这样能很方便的在资源管理器打开对应的文件,并进行tortoiseSVN的相关操作*/2.X:\Progra~1\T ortoiseSVN\bin\T ortoiseProc.exe /command:log /path:% /notempfile /closeonend/*使用前注意更改对应的bin安装路径*//*作用是直接查看当前文件的svn log*//*可以设置快捷键如ctrl+l*/3.X:\Progra~1\T ortoiseSVN\bin\T ortoiseProc.exe /command:diff /path:%f /notempfile /closeonend/*使用前注意更改对应的bin安装路径*//*作用是直接查看当前文件和基准版本的比较*//*可以设置快捷键如ctrl+d*/4.在Source Insight中快速添加注释将以下代码保存成Utils.em,详细使用说明看文章结尾。
效果如下图/* Utils.em - a small collection of useful editing macros *//*-------------------------------------------------------------------------I N S E R T H E A D E RInserts a comment header block at the top of the current function.This actually works on any type of symbol, not just functions.T o use this, define an environment variable "MYNAME" and set itto your email name. eg. set MYNAME=raygr-------------------------------------------------------------------------*/ macro InsertHeader(){// Get the owner's name from the environment variable: MYNAME.// If the variable doesn't exist, then the owner field is skipped.szMyName = getenv(MYNAME)// Get a handle to the current file buffer and the name// and location of the current symbol where the cursor is.hbuf = GetCurrentBuf()szFunc = GetCurSymbol()ln = GetSymbolLine(szFunc)// begin assembling the title stringsz = "/* "/* convert symbol name to T E X T L I K E T H I S */cch = strlen(szFunc)ich = 0while (ich < cch){ch = szFunc[ich]if (isupper(ch))sz = cat(sz, " ")elsesz = cat(sz, " ")sz = Cat(sz, toupper(ch))ich = ich + 1}sz = Cat(sz, " */")InsBufLine(hbuf, ln, sz)InsBufLine(hbuf, ln+1, "/*-------------------------------------------------------------------------")/* if owner variable exists, insert Owner: name */if (strlen(szMyName) > 0){InsBufLine(hbuf, ln+2, " Owner: @szMyName@")InsBufLine(hbuf, ln+3, " ")ln = ln + 4}elseInsBufLine(hbuf, ln, " ") // provide an indent alreadyInsBufLine(hbuf, ln+1, "-------------------------------------------------------------------------*/")// put the insertion point inside the header commentSetBufIns(hbuf, ln, 4)}/* InsertFileHeader:Inserts a comment header block at the top of the current function.This actually works on any type of symbol, not just functions.T o use this, define an environment variable "MYNAME" and set itto your email name. eg. set MYNAME=raygr*/macro InsertFileHeader(){szMyName = getenv(MYNAME)hbuf = GetCurrentBuf()InsBufLine(hbuf, 0, "/*-------------------------------------------------------------------------")/* if owner variable exists, insert Owner: name */InsBufLine(hbuf, 1, " ")if (strlen(szMyName) > 0){sz = " Owner: @szMyName@"InsBufLine(hbuf, 2, " ")InsBufLine(hbuf, 3, sz)ln = 4}elseln = 2InsBufLine(hbuf, ln, "-------------------------------------------------------------------------*/")}// Inserts "Returns True .. or False..." at the current linemacro ReturnTrueOrFalse(){hbuf = GetCurrentBuf()ln = GetBufLineCur(hbuf)InsBufLine(hbuf, ln, " Returns True if successful or False if errors.") }/* Inserts ifdef REVIEW around the selection */macro IfdefReview(){IfdefSz("REVIEW");}/* Inserts ifdef BOGUS around the selection */macro IfdefBogus(){IfdefSz("BOGUS");}/* Inserts ifdef NEVER around the selection */macro IfdefNever(){IfdefSz("NEVER");}// Ask user for ifdef condition and wrap it around current // selection.macro InsertIfdef(){sz = Ask("Enter ifdef condition:")if (sz != "")IfdefSz(sz);}macro InsertCPlusPlus(){IfdefSz("__cplusplus");}// Wrap ifdef <sz> .. endif around the current selection macro IfdefSz(sz){hwnd = GetCurrentWnd()lnFirst = GetWndSelLnFirst(hwnd)lnLast = GetWndSelLnLast(hwnd)hbuf = GetCurrentBuf()InsBufLine(hbuf, lnFirst, "#ifdef @sz@")InsBufLine(hbuf, lnLast+2, "#endif /* @sz@ */")}// Delete the current line and appends it to the clipboard buffer macro KillLine(){hbufCur = GetCurrentBuf();lnCur = GetBufLnCur(hbufCur)hbufClip = GetBufHandle("Clipboard")AppendBufLine(hbufClip, GetBufLine(hbufCur, lnCur)) DelBufLine(hbufCur, lnCur)}// Paste lines killed with KillLine (clipboard is emptied) macro PasteKillLine(){PasteEmptyBuf(GetBufHandle("Clipboard"))}// delete all lines in the buffermacro EmptyBuf(hbuf){lnMax = GetBufLineCount(hbuf)while (lnMax > 0){DelBufLine(hbuf, 0)lnMax = lnMax - 1}}// Ask the user for a symbol name, then jump to its declaration macro JumpAnywhere(){symbol = Ask("What declaration would you like to see?")JumpT oSymbolDef(symbol)}// list all siblings of a user specified symbol// A sibling is any other symbol declared in the same file.macro OutputSiblingSymbols(){symbol = Ask("What symbol would you like to list siblings for?") hbuf = ListAllSiblings(symbol)SetCurrentBuf(hbuf)}// Given a symbol name, open the file its declared in and// create a new output buffer listing all of the symbols declared // in that file. Returns the new buffer handle.macro ListAllSiblings(symbol){loc = GetSymbolLocation(symbol)if (loc == ""){msg ("@symbol@ not found.")stop}hbufOutput = NewBuf("Results")hbuf = OpenBuf(loc.file)if (hbuf == 0){msg ("Can't open file.")stop}isymMax = GetBufSymCount(hbuf)isym = 0;while (isym < isymMax){AppendBufLine(hbufOutput, GetBufSymName(hbuf, isym))isym = isym + 1}CloseBuf(hbuf)return hbufOutput}/*written by yubind*/macro SingleLineComment(){szMyName = "chenjsa"// Get a handle to the current file buffer and the name // and location of the current symbol where the cursor is. hbuf = GetCurrentBuf()ln = GetBufLnCur(hbuf)// Get current timeszTime = GetSysTime(1)Hour = szTime.HourMinute = szTime.MinuteSecond = szTime.SecondDay = szTime.DayMonth = szTime.MonthYear = szTime.Yearif (Day < 10)szDay = "0@Day@"elseszDay = Day//szMonth = NumT oName(Month)if (Month < 10)szMonth = "0@Month@"elseszMonth = MonthszDescription = Ask("请输入修改原因")// begin assembling the title stringInsBufLine(hbuf, ln+1, "/*@szDescription@ @szMyName@.xmyanfa @Year@-@szMonth@-@szDay@*/")}macro MultiLineCommentHeader(){szMyName = "chenjsa"// Get a handle to the current file buffer and the name// and location of the current symbol where the cursor is.hbuf = GetCurrentBuf()ln = GetBufLnCur(hbuf)// Get current timeszTime = GetSysTime(1)Hour = szTime.HourMinute = szTime.MinuteSecond = szTime.SecondDay = szTime.DayMonth = szTime.MonthYear = szTime.Yearif (Day < 10)szDay = "0@Day@"elseszDay = Day//szMonth = NumT oName(Month)if (Month < 10)szMonth = "0@Month@"elseszMonth = MonthszDescription = Ask("请输入修改原因:")// begin assembling the title stringInsBufLine(hbuf, ln + 1, "/*@szDescription@ @szMyName@.xmyanfa @Year@-@szMonth@-@szDay@ begin*/")}macro MultiLineCommentEnd(){szMyName = "chenjsa"// Get a handle to the current file buffer and the name // and location of the current symbol where the cursor is. hbuf = GetCurrentBuf()ln = GetBufLnCur(hbuf)// Get current timeszTime = GetSysTime(1)Hour = szTime.HourMinute = szTime.MinuteSecond = szTime.SecondDay = szTime.DayMonth = szTime.MonthYear = szTime.Yearif (Day < 10)szDay = "0@Day@"elseszDay = Day//szMonth = NumT oName(Month)if (Month < 10)szMonth = "0@Month@"elseszMonth = MonthInsBufLine(hbuf, ln + 1, "/*@szMyName@.xmyanfa @Year@-@szMonth@-@szDay@ end*/")}使用说明:可以实现在sourceinsight中快速添加修改注释。
source insight 基本用法
![source insight 基本用法](https://img.taocdn.com/s3/m/a44fd50ace84b9d528ea81c758f5f61fb73628c9.png)
source insight 基本用法Source Insight是一款功能强大的源代码阅读工具,主要用于浏览、编辑和分析源代码。
以下是一些Source Insight的基本用法:1. 源代码导入:在Source Insight中,可以通过选择“File”菜单中的“Open”选项来导入源代码文件或整个项目文件夹。
支持多种编程语言,例如C/C++、Java、Python等。
2. 导航和搜索:Source Insight提供了强大的导航和搜索功能,您可以使用快捷键或菜单导航到特定的函数、变量或文件。
此外,还可以使用“Find”功能进行全局搜索和替换。
3. 代码浏览:Source Insight支持以树形或层次结构的方式浏览代码,可以方便地查看和导航代码的层次结构、类和函数之间的关系。
还可以通过点击函数或变量来查看其定义和引用。
4. 项目管理:Source Insight允许您创建和管理多个项目,可以将源代码文件组织成目录结构,并设置文件过滤器来过滤特定类型的文件。
此外,还可以对文件进行版本控制和比较。
5. 语法高亮和自动完成:Source Insight支持源代码的语法高亮显示,不同的关键字、运算符和注释会以不同的颜色显示。
同时,也提供了自动完成功能,方便您快速输入代码并预测常见代码段。
6. 代码分析:Source Insight可以对源代码进行静态分析并生成一些关于代码质量和性能的报告。
还提供了代码度量工具,可以统计代码行数、函数数、文件大小等指标。
7. 代码调试:如果集成了调试器,Source Insight还可以进行代码调试,包括设置断点、单步执行代码、查看变量值等。
除了上述基本用法,Source Insight还具有许多高级功能,如代码片段管理、代码注释、代码重构等。
尽管Source Insight界面复杂,但熟悉了基本操作后,可以更高效地阅读和编辑源代码。
source insight 高级用法
![source insight 高级用法](https://img.taocdn.com/s3/m/90b5e1395bcfa1c7aa00b52acfc789eb162d9e13.png)
source insight 高级用法
Source Insight 是一款功能强大的代码阅读和编辑工具,主要用于C、C++ 和汇编语言的开发。
以下是一些Source Insight 的高级用法:
1. 多光标编辑:你可以在多个位置放置光标,然后同时编辑文本。
这对于同时修改多个地方非常有用。
2. 查找和替换:你可以在整个项目或当前文件中查找和替换文本或符号。
这个功能在重构代码时非常有用。
3. 代码折叠:你可以折叠或展开代码块,以更好地理解代码结构。
4. 自动完成:Source Insight 可以自动完成你的代码,这可以大大提高编程效率。
5. 导航:你可以快速导航到任何符号或函数的定义处,也可以快速浏览项目的层次结构。
6. 注释和取消注释:你可以选择注释或取消注释代码块,这对于理解代码逻辑非常有用。
7. 显示行号:你可以在编辑器中显示行号,这有助于快速定位代码。
8. 语法高亮:Source Insight 可以根据语法高亮显示代码,这有助于快速理解代码结构。
9. 自定义设*:你可以根据自己的喜好自定义Source Insight 的界面和编辑器设置。
10. 集成版本控制:Source Insight 支持与Git、CVS 等版本控制系统集成,可以方便地查看和管理版本历史。
这些只是一些基本的Source Insight 高级用法,还有更多高级功能等待你去探索。
source insight的用法
![source insight的用法](https://img.taocdn.com/s3/m/29cb43215e0e7cd184254b35eefdc8d377ee1441.png)
source insight的用法
以下是source insight的基本用法:
1. 打开文件:在菜单栏中选择File -> Open,或者在工具栏中点击Open File图标,选择要打开的文件。
2. 导航代码:使用快捷键Ctrl+Alt+鼠标左键,可以跳转到代码的定义处;使用快捷键Ctrl+Shift+鼠标左键,可以查看函数的调用处。
3. 搜索代码:在菜单栏中选择Search -> Find Symbol,在弹出的搜索对话框中输入要查找的关键字,可以搜索项目中的所有文件。
4. 编辑代码:在菜单栏中选择Edit -> Insert Mode,设置为插入模式后可以进行编辑;使用快捷键Ctrl+D可以快速复制一行代码;使用快捷键Ctrl+/可以注释一行或多行代码。
5. 分析代码:在菜单栏中选择Analyze -> Project,可以进行代码结构分析,生成函数调用图等。
6. 自定义配置:在菜单栏中选择Options -> Preferences,可以根据个人需求自定义设置,包括颜色显示、代码提示等。
7. 查看文件结构:在菜单栏中选择View -> Symbol Window,可以查看当前文件的函数列表、全局变量、宏定义等。
8. 快速切换文件:在菜单栏中选择Window -> Document List,可以查看已打开的文件列表,快速切换文件。
9. 保存文件:在菜单栏中选择File -> Save,或者使用快捷键Ctrl+S,保存当前文件。
source insight的使用
![source insight的使用](https://img.taocdn.com/s3/m/64f18254804d2b160b4ec0e1.png)
大家用source insight看linux源码的时候都遇到这么一个麻烦,makefile和kconfig中的文字在搜索的时候不能找到,这是因为source insight默认是不选makefile的,也没有konfig这种类型的文件。
下面就讲一下如何添加makefile:打开Source Insight,在新建工程之前,进入Options -> Document Options-> 点击Document Type的下拉框,然后选择Make File,在右边的File Filter中,在原先的*.mak后面加上一个分号,即多个不同过滤规则以分号间隔开,再加上*makefile,变成*.mak;*makefile,并且选中Include when adding to projects,这样,以后再新建工程的时候(当前工程同步下makefile就有了),就可以识别makefile或Makefile了(好像此处Source Insight 并不区分大小写)。
如何添加kconfig:由于kconfig是sourceinsight默认不支持的格式,所以我们现在先要加入一个类型。
点击Add Type,填入新文件类型的名字kconfig,File Filter中写上*kconfig,最好再加上kconfig*(因为在linux中有些kconfig是以kconfig.*的形式出现),注意再选中下面的Include when adding to projects,这样就建立了一个新的文件类型,以后新建工程加入文件时候,系统就能够识别kconfig的文件了。
//===========================================用汇编定义了该函数的。
去网上查了一下,发现原因是*.S文件并没有添加到改工程中来。
为了用source insight能搜索到.S的汇编文件,必须把该文件添加进来。
SourceInsight教程及技巧(大全)
![SourceInsight教程及技巧(大全)](https://img.taocdn.com/s3/m/a689073259fb770bf78a6529647d27284b73378c.png)
sourcei nsight使用技巧1 sourcei nsight screenfont的默认字体是V erdana的,它是一直变宽字体。
在Docume nt style中可以将字体改为定宽的Cou rier2 勾掉inden t Open Brace和I ndentClose Brace的效果: 继上一段,在相对缩进行里, 如果输入"{"或"}", 则自动和上一行列对齐3 今天把一个用s ourcei nsight排版整齐的C文件,偶然用VC打开一看,全乱了。
研究了半天,发现SI对每个字符的宽度不太一致。
发现选上"view --> draft view",就可以让每个字符的宽度一致了。
快捷键是"Alt + F12"4 选中几行代码按tab键或者shift+tab可以左右移动代码,调整代码时很有用。
配置成简单好用的c/java代码编辑器1、缩进与tab(1)Options菜单àPre ferenc esàTyp ing卡,勾掉下面两项∶Typingtab indents line,regardl ess of selecti on,空行按tab无法前进Typingtab replace s current selecti on,选定部分内容、再按tab时会清除所选(2)Options菜单àDoc umentOptions(针对不同文件类型,分别进行设置)à下拉左上文件类型框、选择合适类型(c源文件)àEditin g Options框中,tab width=2à Editing Options框中,勾选Expan d tabs(这样,按tab键、等价于输入2个空格)(3)Options菜单àDoc umentOptionsà选择合适的文件类型à点击右边中间的Auto Indent钮à在弹出的框中,左边一定要点S mart,右边有两个复选框Inden t Open Brace和I ndentClose Brace,具体效果可以看SIS的HE LP。
SOURCEINSIGHT应用技巧与宏功能
![SOURCEINSIGHT应用技巧与宏功能](https://img.taocdn.com/s3/m/c622442e3169a4517723a386.png)
目录1 简介 (3)2 搭建我们的SI环境 (3)2.1 搭建步骤 (3)2.2 说明 (4)3 应用技巧 (4)3.1 初级应用技巧 (4)3.1.1 解决字体不等宽与对齐的问题 (4)3.1.2 把TAB变成4个空格 (4)3.1.3 更改背景色 (5)3.1.4 自动对齐设置: (5)3.1.5 显示坐标 (5)3.1.6 创建快捷键快乐工作 (5)3.2 中级应用技巧 (6)3.2.1 查找 (6)3.2.2 替换 (7)3.2.3 列操作 (7)3.2.4 Edit Condition (7)3.3 高级应用技巧 (8)3.3.1 Source Link (8)3.3.2 智能重命名(Smart Rename) (9)3.3.3 Renumber (9)3.3.4 SI中正则表达式 (9)4 Quicker宏在SI中的使用 (10)4.1 如何配置 Quicker 宏 (11)4.2 几个常用的 Quicker 宏 (11)4.2.1 标准说明生成 (11)4.2.2 代码修改注释 (12)4.2.3 其余几个常用宏 (14)5 附录 (17)5.1 SI默认快捷键汇总 (17)5.2 推荐格式 (21)6 参考文献 (21)7 联系方式 (21)1 简介套用下网上有人对SI(即Source Insight)的评价:Windows下开发人员的至爱,功能强大,界面友好。
支持语法高亮、符号跳转,还支持函数调用关系图显示。
这是一个专业的编程环境,很多大公司都是使用它的。
这个编辑器除支持完善的自定义功能外,几乎所有配置都能作个性化配置。
除此之外,它本身带有一套功能强大的宏语言(Macro Language),借助这种语言可以很方便的编程实现各种特殊功能,非一般编辑器所能比拟。
查找功能支持得也很不错。
虽然在工程较大时,查找起来有点慢。
但是它除了一般编辑器所支持的普通字符串查找、正则表达式查找外,还能支持关键字查找-这种方式比前两者快得多,也算是一个弥补。
SourceInsight使用技巧(强大的编程必备工具)
![SourceInsight使用技巧(强大的编程必备工具)](https://img.taocdn.com/s3/m/8dc000d526fff705cc170ae3.png)
开胃菜-初级应用Source Insight常用的快捷键:Ctrl+= :Jump to definitionAlt+/ :Look up referenceF3 : search backwardF4 : search forwardF5: go to LineF7 :Look up symbolsF8 :Look up local symbolsF9 :Ident leftF10 :Ident rightAlt+, :Jump backwordAlt+. : Jump forwardShift+F3 : search the word under cusor backwardShift+F4 : search the word under cusor forwardF12 : incremental searchShift+Ctrl+f: search in projectshift+F8 : hilight word选择美丽的界面享受工作字体选择在SI中样式是可以被继承,如果要从根本上改变字体,最简单的方式就是直接修改根样式中的字体,因为其它样式都会由此继承而来。
选择Options/Document Options页面内的Font Options中的Screen Fonts字体,即可改变根样式中的字体。
SI中的默认配置为Verdana字体,是一种非等宽字体,为了使编写的代码在各种编辑器中看起来都有良好的对齐效果,这里强烈建议使用等宽字体,Courier、New Courier、宋体等都是较好的选择。
颜色定义选择Options/Style Properties页面,就可以在其中修改所有样式了。
选择等号(=)表示继承Parent Style,也可以选择Pick(或者ON/OFF等)去配置一个新值。
标识符样式选择在与颜色定义一节同样的界面内即可完成此项配置。
背景色选择在希望要改变背景色的窗口点击鼠标右键(假定使用的是右手鼠标 ),选择上下文菜单的xxx Window Properties 项,然后点击弹出窗口的Back Color按钮,即可修改该窗口背景色。
sourceInsight常用自定义命令和一些小技巧
![sourceInsight常用自定义命令和一些小技巧](https://img.taocdn.com/s3/m/7855001a7fd5360cbb1adb65.png)
在Source Insight中添加自定义功能的步骤如下:1.Source Insight中,Options->Custom Commands...->Add...,New Command name 随便写,我的是"Edit with Vim"2.Run中写入: "C:\Program Files\Vim\vim63\gvim.exe" --remote-silent +%l %f意思是在当前已经打开的gvim窗口里面打开当前的文件,并且跳转到指定行%l为当前的行号,%f为文件名使用--remote-silent 的作用是,如果已经打开了对应文件,就不会打开第二次,而是在已经打开的文件里跳转到对应行3.还是同一个对话框里面,选择Keys->Assign New Key...->按F12,如果你已经将F12设置给其他命令,选择其他的按键就行了下面是一些常用自定义功能:( CUSTOM COMMANDS )打开资源管理器并选中当前文件ShellExecute open explorer /e,/select,%f查看log"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:log /path:%f/notempfile /closeonenddiff"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:diff /path:%f/notempfile /closeonend取得锁定(check out)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:lock /path:%f/notempfile /closeonend提交(check in)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:commit /path:%f /notempfile /closeonend更新(update)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:%f /notempfile /closeonend更新整个目录(update all)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:*.* /notempfile /closeonend取消锁定(undo check out)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:revert /path:%f /notempfile /closeonend在ultriEdit中编辑"C:\Program Files\UltraEdit-32/uedit32" %f在vim中编辑并定位到当前行"C:\Program Files\Vim\vim63\gvim.exe" --remote-silent +%l %f汇总其他小技巧:让{ 和} 不缩进:Options->Document Options->Auto Indent->Indent Open Brace/Indent Close Bracehao space: SourceInsight 小技巧1、按住"ctrl", 再用鼠标指向某个变量,点击一下,就能进入这个变量的定义。
sourceInsight常用自定义命令和一些小技巧
![sourceInsight常用自定义命令和一些小技巧](https://img.taocdn.com/s3/m/38d1a9fd6394dd88d0d233d4b14e852458fb3949.png)
在Source Insight中添加自定义功能的步骤如下:1.Source Insight中,Options->Custom Commands...->Add...,New Command name 随便写,我的是"Edit with Vim"2.Run中写入: "C:\Program Files\Vim\vim63\gvim.exe" --rem ote-silent +%l %f意思是在当前已经打开的gvim窗口里面打开当前的文件,并且跳转到指定行%l为当前的行号,%f为文件名使用--rem ote-silent 的作用是,如果已经打开了对应文件,就不会打开第二次,而是在已经打开的文件里跳转到对应行3.还是同一个对话框里面,选择Keys->Assign New Key...->按F12,如果你已经将F12设置给其他命令,选择其他的按键就行了下面是一些常用自定义功能:( CUSTOM COMMANDS )打开资源管理器并选中当前文件ShellExecute open explorer /e,/select,%f查看log"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:log /path:%f/notem pfile /closeonenddiff"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:diff /path:%f/notem pfile /closeonend取得锁定(check out)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:lock /path:%f/notem pfile /closeonend提交(check in)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:commit /path:%f /notem pfile /closeonend更新(update)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:%f /notem pfile /closeonend更新整个目录(update all)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:*.* /notem pfile /closeonend取消锁定(undo check out)"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:revert /path:%f /notem pfile /closeonend在ultriEdit中编辑"C:\Program Files\UltraEdit-32/uedit32" %f在vim中编辑并定位到当前行"C:\Program Files\Vim\vim63\gvim.exe" --rem ote-silent +%l %f汇总其他小技巧:让{ 和} 不缩进:Options->Docum ent Options->Auto Indent->Indent Open Brace/Indent Close Bracehao space: SourceInsight 小技巧1、按住"ctrl", 再用鼠标指向某个变量,点击一下,就能进入这个变量的定义。
source insight解析命令行
![source insight解析命令行](https://img.taocdn.com/s3/m/2f39bcfbf61fb7360a4c6508.png)
安装完SI后,会在安装一个如下的文件我的文档\Source Insight\c.tomc.tom的功能与C语言中的#define类似。
打开这个文件,会看到有很多空格分割的字符串,SI在我们阅读代码时,自自动将空格前的字符串替换为空格后的字符串(仅仅是影响阅读,不影响编译喔)。
举两个例子。
#define AP_DECLARE(type) typeAP_DECLARE(int) ap_calc_scoreboard_size(void){....}source insight 把AP_DECLARE当作了函数,当想查ap_calc_scoreboard_size的时候总是很麻烦,不能直接跳转.我的文档\Source Insight\c.tom 加入AP_DECLARE(type) type如下的代码如何让SI 识别出f是一个函数?#define EXPORT_CALL(return,functionname) return functionnameEXPORT_CALL (int, f1())我的文档\Source Insight\c.tom 加入EXPORT_CALL(return,functionname) return functionname同时,在#define中,标准只定义了#和##两种操作。
#用来把参数转换成字符串,##则用来连接前后两个参数,把它们变成一个字符串。
(c.tom的功能与支持##,不支持#好像)这个技巧我在阅读zebra的命令行代码时也用到了。
比如下吗一段代码:(DEFUN是一个宏定义,这个文件中有很多这样的DEFUN。
不修改c.tom 之前看到的是这样的)在我的文档\Source Insight\c.tom的最后添加字符”DEFUN(A,B,C,D,E) A##_cmd( ”,重新打开工程,并同步,之后的效果(filter_set_cisio为界,注意最后要有个括号)看到没,都编绿了。
SOURCE INSIGHT3.5增加三星单片机汇编指令操作说明
![SOURCE INSIGHT3.5增加三星单片机汇编指令操作说明](https://img.taocdn.com/s3/m/f650e8110b4e767f5acfce20.png)
SOURCE INSIGHT3.5增加三星单片机汇编指令操作说明(一)导入汇编指令:Options =>Preferences=>x86 asm language =>import =>S3C.clf=> 没有S3C.CLF的可以自己新建S3C.TXT,复制下面指令到TXT里再导入。
#, Delimiter#~, Delimiter*, Delimiter+, Keyword",", Delimiter., Delimiter:, Delimiter::, Delimiter;, Delimiter>>, DelimiterA, KeywordAB, KeywordAC, KeywordACALL, ControlACC, KeywordADC, ControlADCON, KeywordADD, ControlADDATAH, KeywordADDATAL, KeywordADDC, ControlADS, Controlah, KeywordAJMP, Controlal, KeywordAND, ControlANL, ControlAT, Keywordax, KeywordB, Keywordbh, KeywordBIT, KeywordBITR, Controlbl, Keywordbp, KeywordBTCON, KeywordBTST, Controlbx, KeywordC, Keywordcall, Control CALLS, Control cBegin, Control cCall, Control CCF, Control cEnd, Controlch, Keyword CJNE, Controlcl, Keyword CLKCON, Keyword CLR, Control CODE, Keyword COM, Control const, Keyword CP, ControlCPL, Control cProc, Control CPSE, ControlCP_RL2, Keyword createSeg, Keyword cs, Keyword CSEG, Keywordcx, KeywordCY, KeywordC_T2, Keyword DAA, Control DATA, Keyword DB, Keyword DBIT, Keyword DC, KeywordDEC, Control DECS, Controldh, Keyworddi, ControlDIV, Control DJNZ, Controldl, KeywordDPH, Keyword DPL, Keyword DPTR, Keywordds, KeywordDW, Keyworddx, KeywordE, KeywordEA, Keywordeax, Keywordebp, Keywordebx, Keywordecx, Keywordedi, Keywordeds, Keywordedx, KeywordEI, Controleip, Keywordelse, ControlEMT, Keywordend, Controlendif, Controlendm, Controlendp, Controlenter, KeywordEQ, KeywordEQU, Keywordes, Keywordesi, KeywordET0, KeywordET1, KeywordET2, Keyword(二)宏定义:x86 asm language =>双击=>Custom Parsing=> label\(\W*[A-Za-z0-9_]*\)\(:\)constant^\([A-Za-z0-9_]*\)\w+.equmacro^\([A-Za-z0-9_]*\)\w+.macrovariable^\([A-Za-z0-9_]*\)\w+.ram_dsvariable^\([A-Za-z0-9_]*\)\w+dsconstant^\([A-Za-z0-9_]*\)\w+equvoariable^\([A-Za-z0-9_]*\)\w+ram_dsnamespace#\([A-Za-z0-9_]+\)(三)注释定义:Options=>preferences=>languages=>add=>src新建SRC=>双击SRC=>Comments and Ranges=>add=>line=>comment single line=>range beginswith(;)(四)顔色设置:options=>style Properties=>colors=>freground=>(五)支持汇编格式设置:Options=>document options=>三星单片机的后缀为:*.srcEX0, KeywordEX1, KeywordEXEN2, KeywordEXF2, Keywordextern, Keywordextrn, KeywordF, KeywordF0, Keywordfar, KeywordFLAGS, Keywordfs, KeywordGE, Keywordgs, Keyword GT, Keyword HL, Keyword IDATA, Keyword IDLE, Control IE, KeywordIE0, KeywordIE1, Keywordif, Controlifb, Control ifdef, Control ife, Control ifndef, Control IMR, Keyword INC, Control include, Keyword INCS, Control int, KeywordINT1, Keyword INTB, Keyword INTPND1, Keyword INTPND2, Keyword INTT0, Keyword ip, Keyword IPR, Keyword IRET, ControlIT0, KeywordIT1, Keywordja, Control jae, Controljb, Control jbc, Control jbe, Controljc, Control jcxz, Control je, Control jecxz, Control jg, Control jge, Controljl, Controljle, Control jmp, Control jna, Control jnae, Controljnbe, Control jnc, Control jne, Control jng, Control jnge, Control jnl, Control jnle, Control jno, Control jnp, Control jns, Control jnz, Control jo, Control jp, Control jpe, Control jpo, Control JPR, Control JPS, Control jr, Control js, Control jz, Control LCALL, Control LD, Control LDC, Control LDCD, Control LDCI, Control LE, Keyword leave, Keyword LJMP, Control LMOD, Keyword LPOT, Keyword LT, Keyword macro, Control MI, Keyword MOV, Control MOVC, Control MUL, Control NAME, Keyword NC, Keyword NE, Keyword near, Keyword NOP, Control NOV, Keyword NZ, KeywordORG, Keyword ORL, Control OSCCON, Keyword OV, KeywordP, KeywordP0, KeywordP0CON, Keyword P0CONH, Keyword P0CONL, Keyword P0EDGE, Keyword P0INT, Keyword P0PND, Keyword P0PUR, Keyword P1, KeywordP1CON, Keyword P1EDGE, Keyword P1INT, Keyword P1PUR, Keyword P2, KeywordP2CON, Keyword P2CONH, Keyword P2CONL, Keyword P2PUR, Keyword P3, KeywordP3CON, Keyword P3EDGE, Keyword P3INT, Keyword P3PUR, Keyword P4, KeywordP4CONH, Keyword P4CONL, Keyword P5, KeywordP5CONH, Keyword P5CONL, Keyword P6, KeywordP6CON, Keyword P7, KeywordP8, KeywordP9, Keyword PCON, Keyword PDATA, Keyword PL, Keyword POP, ControlPS, Keyword PSW, KeywordPT0, KeywordPT1, KeywordPT2, Keyword PUBLIC, Keyword PUSH, Control PWMCON, Keyword PWMDATA, Keyword PX0, KeywordPX1, KeywordR0, KeywordR1, Keywordr10, Keywordr11, Keywordr12, Keywordr13, Keywordr14, Keywordr15, KeywordR2, KeywordR3, KeywordR4, KeywordR5, KeywordR6, Keywordr7, Keywordr8, Keywordr9, Keywordram_ds, Keyword ram_org, Keyword RB8, Keyword RCAP2H, Keyword RCAP2L, Keyword RCF, Control RCLK, Keyword RD, Keyword REN, Keyword ret, Control RETI, Control RI, Keyword RL, Control RLC, Control RR, Controlrr0, Keywordrr12, Keywordrr14, Keywordrr2, Keywordrr4, Keywordrr6, Keywordrr8, Keyword RRC, ControlRS0, KeywordRS1, Keyword RSEG, Keyword RXD, Keyword sbc, Control sBegin, Control SBS, Control SBUF, Keyword SCON, Keyword SEGMENT, Keyword sEnd, Control SET, Control SETB, Control si, Keyword SIOCON, Keyword SIODATA, Keyword SIOPS, Keyword SJMP, Control SM0, KeywordSM1, KeywordSM2, Keyword SNZ, Control sp, Keywordss, Keyword STOP, Control STOPCON, Keyword STPCON, Keyword struc, Control sub, Control SUBB, Control SUBC, Control SWAP, Control SYM, Keyword SZ, ControlT, KeywordT0, KeywordT0DATA, Keyword T1, KeywordT2, KeywordT2CON, Keyword T2EX, Keyword TABRDL, Control TACON, Keyword TADATA, Keyword TB8, Keyword TBCON, Keyword TBDATA, Keyword TCLK, Keyword TCON, Keyword TF0, KeywordTF1, KeywordTF2, Keyword TH0, Keyword TH1, Keyword TH2, Keyword TI, KeywordTL0, KeywordTL1, KeywordTL2, Keyword tm, Control TMOD, Keyword TR0, Keyword TR1, Keyword TR2, Keyword TXD, Keyword UGE, Keyword UGT, Keyword ULE, Keyword ULT, Keyword USING, Keyword VECTOR, Control VENT0, Control VENT1, Control VENT2, Control VENT3, Control VENT5, Control WR, Keyword WTCON, Keyword WX, KeywordX, Keyword XCH, Control XDATA, Keyword XOR, Control XRL, Control Z, Keyword ~, Delimiter。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
安装完SI后,会在安装一个如下的文件
我的文档\Source Insight\c.tom
c.tom的功能与C语言中的#define类似。
打开这个文件,会看到有很多空格分割的字符串,SI在我们阅读代码时,自自动将空格前的字符串替换为空格后的字符串(仅仅是影响阅读,不影响编译喔)。
举两个例子。
#define AP_DECLARE(type) type
AP_DECLARE(int) ap_calc_scoreboard_size(void)
{
....
}
source insight 把AP_DECLARE当作了函数,当想查ap_calc_scoreboard_size的时候总是很麻烦,不能直接跳转.
我的文档\Source Insight\c.tom 加入
AP_DECLARE(type) type
如下的代码如何让SI 识别出f是一个函数?
#define EXPORT_CALL(return,functionname) return functionname
EXPORT_CALL (int, f1())
我的文档\Source Insight\c.tom 加入
EXPORT_CALL(return,functionname) return functionname
同时,在#define中,标准只定义了#和##两种操作。
#用来把参数转换成字符串,##则用来连接前后两个参数,把它们变成一个字符串。
(c.tom的功能与支持##,不支持#好像)
这个技巧我在阅读zebra的命令行代码时也用到了。
比如下吗一段代码:(DEFUN是一个宏定义,这个文件中有很多这样的DEFUN。
不修改c.tom 之前看到的是这样的)
在我的文档\Source Insight\c.tom的最后添加字符”DEFUN(A,B,C,D,E) A##_cmd( ”,重新打开工程,并同步,之后的效果(filter_set_cisio为界,注意最后要有个括号)
看到没,都编绿了。
点击其中一个节点能直接跳转了。
按快键F7,在symbol window也能看到这些函数,且能直接跳转对应的名字,比define好看多了。
我上面的代码都是zebra中的代码,在实际工作中,命令行的解析顺序可能与此不同,但可以类推的。
反复提醒:1.修改c.tom文件之后,一定要关闭再打开工程,并同步文件才能看到效果。
不然要等下次你打开工程才能看到效果啊。
SI也会自动同步,但比较慢。
2.c.tom一般都在SI的安装目录下,看你安装在那个盘。
我的是d:\My Documents\Source Insight。