Visual Studio 调试技巧[Command Window & Immediate Window ](Tips)
Visual Studio 调试技巧[Command Window & Immediate Window ](Tips)
1. immediate window 定义的一些 alias (//z 2012-3-13 14:04:44 PM IS2120@CSDN)
alias ? Debug.Print
alias ?? Debug.QuickWatch
alias AddProj File.AddNewProject
alias alias Tools.Alias
alias autos Debug.Autos
alias bl Debug.Breakpoints
alias bp Debug.ToggleBreakpoint
alias callstack Debug.CallStack
alias ClearBook Edit.ClearBookmarks
alias close File.Close
alias CloseAll Window.CloseAllDocuments
alias cls Edit.ClearAll
alias cmd View.CommandWindow
alias code View.ViewCode
alias d Debug.ListMemory
alias da Debug.ListMemory /Ansi
alias db Debug.ListMemory /Format:OneByte
alias dc Debug.ListMemory /Format:FourBytes /Ansi
alias dd Debug.ListMemory /Format:FourBytes
alias DelBOL Edit.DeleteToBOL
alias DelEOL Edit.DeleteToEOL
alias DelHSp Edit.DeleteHorizontalWhiteSpace
alias designer View.ViewDesigner
alias df Debug.ListMemory /Format:Float
alias disasm Debug.Disassembly
alias dq Debug.ListMemory /Format:EightBytes
alias du Debug.ListMemory /Unicode
alias eval Debug.EvaluateStatement
alias exit File.Exit
alias format Edit.FormatSelection
alias FullScreen View.FullScreen
alias g Debug.Start
alias GotoBrace Edit.GotoBrace
alias GotoLn Edit.GoTo
alias help Help.F1Help
alias immed Tools.ImmediateMode
alias InsertFile Edit.InsertFileAsText
alias k Debug.ListCallStack
alias kb Debug.ListCallStack
alias Lcase Edit.MakeLowercase
alias LineCut Edit.LineCut
alias LineDel Edit.LineDelete
alias ListMembers Edit.ListMembers
alias locals Debug.Locals
alias log Tools.LogCommandWindowOutput
alias memory memory1
alias memory1 Debug.Memory1
alias memory2 Debug.Memory2
alias memory3 Debug.Memory3
alias memory4 Debug.Memory4
alias n Debug.SetRadix
alias nav navigate
alias navigate View.WebBrowser
alias new File.NewFile
alias NewProj File.NewProject
alias NextBook Edit.NextBookmark
alias nf File.NewFile
alias np File.NewProject
alias of File.OpenFile
alias op File.OpenProject
alias open File.OpenFile
alias OutlineDefs Edit.CollapsetoDefinitions
alias p Debug.StepOver
alias ParamInfo Edit.ParameterInfo
alias pr Debug.StepOut
alias PrevBook Edit.PreviousBookmark
alias print File.Print
alias props View.PropertiesWindow
alias q Debug.StopDebugging
alias r Debug.ListRegisters
alias redo Edit.Redo
alias registers Debug.Registers
alias rtc Debug.RunToCursor
alias save File.SaveSelectedItems
alias SaveAll File.SaveAll
alias SaveAs File.SaveSelectedItemsAs
alias shell Tools.Shell
alias StopFind Edit.FindInFiles /stop
alias StopOutlining Edit.CollapsetoDefinitions
alias SwapAnchor Edit.SwapAnchor
alias t Debug.StepInto
alias tabify Edit.TabifySelectedLines
alias TaskList View.TaskList
alias threads Debug.Threads
alias TileH Window.TileHorizontally
alias TileV Window.TileVertically
alias ToggleBook Edit.ToggleBookmark
alias toolbox View.Toolbox
alias u Debug.ListDisassembly
alias Ucase Edit.MakeUppercase
alias undo Edit.Undo
alias Untabify Edit.UntabifySelectedLines
alias watch Debug.Watch
alias WordWrap Edit.ToggleWordWrap
alias | Debug.ListProcesses
alias ~ Debug.ListThreads
alias ~*k Debug.ListCallStack /AllThreads
alias ~*kb Debug.ListCallStack /AllThreads
//z 2012-3-13 14:04:44 PM IS2120@CSDN
| Task | Solution | Example |
|---|---|---|
|
Evaluate an expression. |
Preface the expression with a question mark (?). |
? a+b |
|
Temporarily enter Command mode while in Immediate mode (to execute a single command). |
Enter the command, prefacing it with a greater than sign (>). |
>alias |
|
Switch to the Command window. |
Enter cmd into the window, prefacing it with a greater than sign (>). |
>cmd |
|
Switch back to the Immediate window. |
Enter immed into the window without the greater than sign (>). |
immed |
3. Command Window
The Command window is used to execute commands or aliases directly in the Visual Studio integrated development environment (IDE). You can execute both menu commands and commands that do not appear on any menu. To display theCommand window, choose Other Windows from theView menu, and select Command Window.
This section explains the commands and aliases available from the Command window.
|
Task |
Solution |
Example |
|---|---|---|
|
Evaluate an expression. |
Preface the expression with a question mark (?). |
? myvar |
|
Switch to an Immediate window. |
Enter immed into the window without the greater than sign (>) |
immed |
|
Switch back to the Command window from an Immediate window. |
Enter cmd into the window. |
>cmd |
The following shortcuts help you navigate while in Command mode.
4. 等号在两个窗口的含义是不一样的
在COMMAND窗口,作为一个比较字符串,而在immediate window 作为一个赋值操作符
The Equals (=) Sign
The window used to enter the EvaluateStatement command determines whether an equals sign (=) is interpreted as a comparison operator or as an assignment operator.
In the Command window, an equals sign (=) is interpreted as a comparison operator. You cannot use assignment operators in theCommand window. So, for example, if the values of variablesvarA and varB are different, then the command
>Debug.EvaluateStatement(varA=varB)
will return a value of False.
In the Immediate window, by contrast, an equals sign (=) is interpreted as an assignment operator. So, for example, the command
>Debug.EvaluateStatement(varA=varB)
will assign to variable varA the value of variable varB.
5. 预定义的一些命令别名
|
Command Name |
Alias |
Complete Name |
|---|---|---|
|
? |
Debug.Print |
|
|
?? |
Debug.Quickwatch |
|
|
Add New Project |
AddProj |
File.AddNewProject |
|
Alias |
Tools.Alias |
|
|
Autos window |
Autos |
Debug.Autos |
|
Breakpoints window |
bl |
Debug.Breakpoints |
|
Toggle Breakpoint |
bp |
Debug.ToggleBreakPoint |
|
Call Stack window |
CallStack |
Debug.CallStack |
|
Clear Bookmarks |
ClearBook |
Edit.ClearBookmarks |
|
Close |
Close |
File.Close |
|
Close All Documents |
CloseAll |
Window.CloseAllDocuments |
|
Clear All |
cls |
Edit.ClearAll |
|
Command mode |
cmd |
View.CommandWindow |
|
code |
View.ViewCode |
|
|
d |
Debug.ListMemory |
|
|
List Memory Command as ANSI |
da |
Debug.ListMemory /Ansi |
|
List Memory Command One Byte format |
db |
Debug.ListMemory /Format:OneByte |
|
List Memory Command as ANSI with Four Byte format |
dc |
Debug.ListMemory /Format:FourBytes /Ansi |
|
List Memory Command Four Byte format |
dd |
Debug.ListMemory /Format:FourBytes |
|
Delete to BOL |
DelBOL |
Edit.DeleteToBOL |
|
Delete to EOL |
DelEOL |
Edit.DeleteToEOL |
|
Delete Horizontal Whitespace |
DelHSp |
Edit.DeleteHorizontalWhitespace |
|
View Designer |
designer |
View.ViewDesigner |
|
List Memory Command Float format |
df |
Debug.ListMemory/Format:Float |
|
Disassembly window |
disasm |
Debug.Disassembly |
|
List Memory Command Eight Byte format |
dq |
Debug.ListMemory /Format:EightBytes |
|
List Memory Command as Unicode |
du |
Debug.ListMemory /Unicode |
|
eval |
Debug.EvaluateStatement |
|
|
Exit |
Exit |
File.Exit |
|
Format Selection |
format |
Edit.FormatSelection |
|
Full Screen |
FullScreen |
View.FullScreen |
|
g |
Debug.Start |
|
|
GotoLn |
Edit.GoTo |
|
|
Go to Brace |
GotoBrace |
Edit.GotoBrace |
|
Help |
Help.F1Help |
|
|
Immediate Mode |
immed |
Tools.ImmediateMode |
|
Insert File as Text |
InsertFile |
Edit.InsertFileAsText |
|
kb |
Debug.ListCallStack |
|
|
Make Lower Case |
Lcase |
Edit.MakeLowercase |
|
Cut Line |
LineCut |
Edit.LineCut |
|
Delete Line |
LineDel |
Edit.LineDelete |
|
List Members |
ListMembers |
Edit.ListMembers |
|
Locals window |
Locals |
Debug.Locals |
|
Log |
Tools.LogCommandWindowOutput |
|
|
Command Window Mark Mode |
mark |
Tools.CommandWindowMarkMode |
|
Memory window |
Memory Memory1 |
Debug.Memory1 |
|
Memory Window 2 |
Memory2 |
Debug.Memory2 |
|
Memory Window 3 |
Memory3 |
Debug.Memory3 |
|
Memory Window 4 |
Memory4 |
Debug.Memory4 |
|
n |
Debug.SetRadix |
|
|
nav navigate |
View.ShowWebBrowser |
|
|
Next Bookmark |
NextBook |
Edit.NextBookmark |
|
nf |
File.NewFile |
|
|
New Project |
np NewProj |
File.NewProject |
|
of Open |
File.OpenFile |
|
|
op |
File.OpenProject |
|
|
Collapse to Definitions/Stop Outlining |
OutlineDefs StopOutlining |
Edit.CollapsetoDefinitions |
|
Step Over |
p |
Debug.StepOver |
|
Parameter Information |
ParamInfo |
Edit.ParameterInfo |
|
Step Out |
pr |
Debug.StepOut |
|
Previous Bookmark |
PrevBook |
Edit.PreviousBookmark |
|
Print File |
|
File.Print |
|
Properties Window |
props |
View.PropertiesWindow |
|
Stop |
q |
Debug.StopDebugging |
|
Redo |
redo |
Edit.Redo |
|
Registers window |
registers |
Debug.Registers |
|
Run to Cursor |
rtc |
Debug.RunToCursor |
|
Save Selected Items |
save |
File.SaveSelectedItems |
|
Save All |
SaveAll |
File.SaveAll |
|
Save As |
SaveAs |
File.SaveSelectedItemsAs |
|
shell |
Tools.Shell |
|
|
Stop Find In Files |
StopFind |
Edit.FindInFiles /stop |
|
Swap Anchor |
SwapAnchor |
Edit.SwapAnchor |
|
Step Into |
t |
Debug.StepInto |
|
Tabify Selection |
tabify |
Edit.TabifySelection |
|
Tasklist window |
TaskList |
View.TaskList |
|
Threads window |
Threads |
Debug.Threads |
|
Tile Horizontally |
TileH |
Window.TileHorizontally |
|
Tile Vertically |
TileV |
Window.TileVertically |
|
Toggle Bookmark |
ToggleBook |
Edit.ToggleBookmark |
|
Toolbox window |
toolbox |
View.Toolbox |
|
u |
Debug.ListDisassembly |
|
|
Make Uppercase |
Ucase |
Edit.MakeUppercase |
|
Undo |
undo |
Edit.Undo |
|
Untabify Selection |
Untabify |
Edit.UntabifySelection |
|
Watch window |
Watch |
Debug.WatchN |
|
Toggle Word Wrap |
WordWrap |
Edit.ToggleWordWrap |
|
List Processes |
| |
Debug.ListProcesses |
|
~ ~*k ~*kb |
Debug.ListThreads Debug.ListTheads /AllThreads |
6. 对别名的一些操作
To create an alias for a Visual Studio command
Open the Command window or place the focus in the Find/Command box.
Type >alias, then the name for the alias, followed by the command you want to create an alias for. For example:
>alias MyAlias File.NewFile MyFile
Press ENTER.
The status bar displays the text "Alias <aliasname> created". The new alias now appears in the auto-completion list for commands.
To delete an alias for a Visual Studio command
Open the Command window or place the focus in the Find/Command box.
Type >alias, then the name of the alias, followed by/delete. For example:
>alias myalias /delete
Press ENTER.
The status bar displays the text "Alias <aliasname> deleted".
To view a list of all current aliases and their definitions
In the Command window, type >alias and press ENTER.
A list of the current Visual Studio command aliases appears, including the definitions for the aliases. You can then print the contents of theCommand window.
Tip To clear the contents of the Command window, type >cls.
To view the definition for a single alias
In the Command window, type >alias followed by the alias name.
7. immediate window 在各个VS版本的支持程度 (//z 2012-3-13 14:04:44 PM IS2120@CSDN)
|
Visual Studio Edition |
Visual Basic |
C# |
C++ |
J# |
|
Express |
No |
No |
No |
No |
|
Standard |
Yes |
Yes |
No |
Yes |
|
Pro/Team |
Yes |
Yes |
No |
Yes |
Visual Studio 调试技巧[Command Window & Immediate Window ](Tips)的更多相关文章
- 新手必备!11个强大的 Visual Studio 调试技巧
简介 调试是软件开发周期中很重要的一部分.它具有挑战性,同时也很让人疑惑和烦恼.总的来说,对于稍大一点的程序,调试是不可避免的.最近几年,调试工具的发展让很多调试任务变的越来越简单和省时. 这篇文章总 ...
- BI之SSIS入门最新版Visual Studio调试技巧
简介 最近公司业务需要用到BI SSIS,SSIS是什么?"SSIS是Microsoft SQL Server Integration Services的简称,是生成高性能数据集成解决方案( ...
- Visual Studio 调试技巧:10 篇热文汇总
本文精选了 DotNet 2017年11月份的10篇热门文章.其中有技术分享.技术资源. 注:以下文章,点击标题即可阅读 <Visual Studio的调试技巧 > 调试技巧是衡量程序员 ...
- Visual Studio调试技巧 -- Attach to Process
本文系作者原创,但可随意转载.另:图中使用的IDE为Visual Studio 2013 RC 英文版. 一般写完代码时,我们通常会启动调试运行一下看看是否正确,启动运行的方式无非是F5-- Star ...
- Visual Studio 调试技巧---指针,元素个数
刚才,我在Visual Studio 中发现了一个以更好的方式调试指针的技巧.您可以在监视窗口中选择“n”,其中“n”是要显示的元素数.我认为下图是不言而喻的.
- Visual Studio 调试技巧之即时窗口的妙用
在 Visual Studio 中有一个窗口叫 Immediate 窗口,中文版本应该叫即时窗口.默认会在你启动调试时在 VS 编辑器中弹出来.你也可以通过 Debug | Windows | Imm ...
- Visual Studio 调试技巧
.net程序开发工具我都用vs(visual studio),开发过程中的跟踪调试最常用的就是断点跟踪调试了,但是现在才发现,用了这么多年vs断点跟踪调试是白用了啊.它居然还可以有这么多用法. 设置断 ...
- Visual Studio 调试技巧 -- 为 Lambda 表达式设置中断
如果我说 .NET 世界上最厉害的开发平台(语言),资深的同仁肯定不会往下看了,因为这将是一个无休止的争论,到头来搞不好还是人身攻击.然而,如果我说 Visual Studio 是世界上最友好最强大的 ...
- Visual Studio调试技巧 -- Attach to Process #Reprinted#
from:http://www.cnblogs.com/lyosaki88/p/3481338.html 一般写完代码时,我们通常会启动调试运行一下看看是否正确,启动运行的方式无非是F5-- Star ...
随机推荐
- Ansible系列(六):各种变量定义方式和变量引用
本文目录:1.1 ansible facts1.2 变量引用json数据的方式 1.2.1 引用json字典数据的方式 1.2.2 引用json数组数据的方式 1.2.3 引用facts数据1.3 设 ...
- 从Leetcode的Combination Sum系列谈起回溯法
在LeetCode上面有一组非常经典的题型--Combination Sum,从1到4.其实就是类似于给定一个数组和一个整数,然后求数组里面哪几个数的组合相加结果为给定的整数.在这个题型系列中,1.2 ...
- JAVA设计模式总结之六大设计原则
从今年的七月份开始学习设计模式到9月底,设计模式全部学完了,在学习期间,总共过了两篇:第一篇看完设计模式后,感觉只是脑子里面有印象但无法言语.于是决定在看一篇,到9月份第二篇设计模式总于看完了,这一篇 ...
- Https系列之四:https的SSL证书在Android端基于okhttp,Retrofit的使用
Https系列会在下面几篇文章中分别作介绍: 一:https的简单介绍及SSL证书的生成二:https的SSL证书在服务器端的部署,基于tomcat,spring boot三:让服务器同时支持http ...
- 基于React Native的移动平台研发实践分享
转载:http://blog.csdn.net/haozhenming/article/details/72772787 本文目录: 一.React Native 已经成为了移动前端技术的趋势 二.基 ...
- 第5章 不要让线程成为脱缰的野马(Keeping your Threads on Leash) ---简介
这一章描述如何初始化一个新线程,如何停止一个执行中的线程,以及如何了解并调整线程优先权. 读过这一章之后,你将有能力回答一个 Win32 多线程程序设计的最基本问题.你一定曾经在 Usenet ...
- HDFS源码分析之NameNode(2)————Format
在Hadoop的HDFS部署好了之后并不能马上使用,而是先要对配置的文件系统进行格式化.在这里要注意两个概念,一个是文件系统,此时的文件系统在物理上还不存在,或许是网络磁盘来描述会更加合适:二就是格式 ...
- 51 nod 1624 取余最长路 思路:前缀和 + STL(set)二分查找
题目: 写这题花了我一上午时间. 下面是本人(zhangjiuding)的思考过程: 首先想到的是三行,每一行一定要走到. 大概是这样一张图 每一行长度最少为1.即第一行(i -1) >= 1, ...
- 约会安排HDU - 4553
寒假来了,又到了小明和女神们约会的季节. 小明虽为屌丝级码农,但非常活跃,女神们常常在小明网上的大段发言后热情回复"呵呵",所以,小明的最爱就是和女神们约会.与此同时,也有很多基 ...
- Android签名机制---签名过程
大神文章:http://blog.csdn.net/jiangwei0910410003/article/details/50402000 一.知识点 1.数据摘要(数据指纹).签名文件,证书文件 2 ...