当前位置:网站首页>Visual studio debugging tips

Visual studio debugging tips

2022-06-23 06:00:00 linchaolong

VAssistX


VAssistX Download address :http://pan.baidu.com/s/1eQJ9Ud8


Common shortcut key


Find project files :alt+shift+o


Find all references to a class or variable :alt+shift+f


Display a list of methods / To find the way :alt+m



Skip to method implementation / Method statement :alt+g


Switch to .h file /.cpp file :alt+o


Batch change / Method / Class name :alt+shift+r


Breakpoint debugging


Common shortcut key

F10: Process by process

F11: Sentence by sentence


Conditional breakpoint debugging

At run time, if there are many Layout object , But I just want to interrupt _tag by 76888 A method of an object . At this time, you can set the breakpoint condition to achieve .


Right click the breakpoint and select the condition , Add judgment conditions .




Breakpoint setting hits

If a method is called many times , And I just want to interrupt the n Time or >=n perhaps 2n Time operation . This can be achieved by setting the hit times .



Look at the memory

Open the memory window ( Must break a point ):ctrl+alt+m+1

such as , I'll check one here int Values in the type array , Enter the address , The right choice 4 Byte integer ( because int Occupy 4 Bytes ), A signed display indicates a sign , Columns you can select the number of columns to display .



monitor

Select an expression or a variable , Right click to add monitoring , You can get the execution result of the expression or monitor the change of variables .

You can directly click on the name column , Enter the expression directly , Press enter to see the execution result . You can change the value of a variable or execute a function at run time .


Quick monitoring

Shortcut key :shift + f9

In the Quick Monitor window , You can execute expressions at run time .

Recalculate : Re execution

Add monitoring : Add to monitoring window , Because it is temporary monitoring in the quick monitoring window , When the window is closed, it is gone .


call Stack

Shortcut key :ctrl + alt +c

In the call stack window, you can see the call hierarchy of the method .


local variable

Shortcut key :ctrl + alt +l

You can see all the current local variables in the local variables window .


Look at assembly code

Shortcut key :ctrl + alt + d

In the Disassembly window, you can see the assembly code corresponding to the source code .


register

ctrl + alt + g


macro


$(RemoteMachine)
Set to “ debugging ” On the property page “ Remote computer ” The value of the property . For more information , See change for C/C++ Debug the project settings of the configuration .

$(References)
A semicolon separated list of references is added to the project .

$(ConfigurationName)
The name of the current project configuration ( for example “Debug”).

$(PlatformName)
The name of the current project platform ( for example “Win32”).

$(Inherit)
Specify in the command line written by the project generation system , The order in which inherited properties appear . By default , The inherited property appears at the end of the current property .

$(NoInherit)
Make any property that will be inherited not inherited . If you want to avoid calculation at the same level , Please use $(StopEvaluating). Use $(NoInherit) This will result in ignoring any occurrences of... For the same attribute $(Inherit).

$(StopEvaluating)
Immediately stop the calculation of macros in the calculation chain . Appear in the $(StopEvaluating) Any subsequent value will not appear in the calculated value of the macro . If $(StopEvaluating) stay $(Inherit) Before , The inherited value of the current position in the calculation chain will not be connected to the macro value .$(StopEvaluating) yes $(NoInherit) Feature superset .

$(ParentName)
The name of the item that contains this item . The name will be the parent folder name or the project name .

$(RootNameSpace)
Contains the namespace of the application ( If there is ).

$(IntDir)
The directory path specified for the intermediate file relative to the project directory . It translates into “ Intermediate Directory ” The value of the property .

$(OutDir)
The path to the output file directory , Relative to the project directory . This resolves to “ The output directory ” The value of the property .

$(DevEnvDir)
Visual Studio .NET Installation directory ( Definition form : Driver + route ); Including backslashes at the end “\”.

$(InputDir)
Enter the directory of the file ( Definition form : Driver + route ); Including backslashes at the end “\”. If the item is input , Then this macro is equivalent to $(ProjectDir).

$(InputPath)
Enter the absolute pathname of the file ( Definition form : Driver + route + Basic name + File extension ). If the item is input , Then this macro is equivalent to $(ProjectPath).

$(InputName)
Enter the basic name of the file . If the item is input , Then this macro is equivalent to $(ProjectName).

$(InputFileName)
Enter the file name of the file ( Defined as the base name + File extension ). If the item is input , Then this macro is equivalent to $(ProjectFileName).

$(InputExt)
Enter the file extension of the file . It includes... Before the file extension “.”. If the item is input , Then this macro is equivalent to $(ProjectExt).

$(ProjectDir)
Project directory ( Definition form : Driver + route ); Including backslashes at the end “\”.

$(ProjectPath)
The absolute pathname of the project ( Definition form : Driver + route + Basic name + File extension ).

$(ProjectName)
The basic name of the project .

$(ProjectFileName)
The file name of the project ( Defined as the base name + File extension ).

$(ProjectExt)
The file extension of the project . It includes... Before the file extension “.”.

$(SolutionDir)
Directory of solutions ( Definition form : Driver + route ); Including backslashes at the end “\”.

$(SolutionPath)
The absolute pathname of the solution ( Definition form : Driver + route + Basic name + File extension ).

$(SolutionName)
The basic name of the solution .

$(SolutionFileName)
File name of the solution ( Defined as the base name + File extension ).

$(SolutionExt)
File extension of the solution . It includes... Before the file extension “.”.

$(TargetDir)
The directory of the generated main output file ( Definition form : Driver + route ); Including backslashes at the end “\”.

$(TargetPath)
Absolute pathname of the generated main output file ( Definition form : Driver + route + Basic name + File extension ).

$(TargetName)
The base name of the generated main output file .

$(TargetFileName)
The file name of the generated main output file ( Defined as the base name + File extension ).

$(TargetExt)
The file extension of the generated main output file . It includes... Before the file extension “.”.

$(VSInstallDir)
install Visual Studio .NET The catalog of .

$(VCInstallDir)
install Visual C++ .NET The catalog of .

$(FrameworkDir)
install .NET Framework The catalog of .

$(FrameworkVersion)
Visual Studio The use of .NET Framework edition . And $(FrameworkDir) Combination , Namely Visual Studio The use of .NET Framework The full path of the version .

$(FrameworkSDKDir)
install .NET Framework SDK The catalog of ..NET Framework SDK Can be used as Visual Studio .NET Part of the installation , It can also be installed separately .


$(WebDeployPath)
from Web The relative path from the deployment root to where the project output belongs . Return and RelativePath The same value .

$(WebDeployRoot)
Point to <localhost> Absolute path of location . for example ,c:\inetpub\wwwroot.

$(SafeParentName)
The name of the immediate parent of a valid name format . for example , Form is .resx The parent of the file .

$(SafeInputName)
The name of the file as a valid class name , But not including the file extension .

$(SafeRootNamespace)
The project wizard will add the namespace name of the code . This namespace name will only be included in valid C++ Characters allowed in identifier .

$(FxCopDir)
fxcop.cmd Path to file .fxcop.cmd The file is not all Visual C++ Version installed with .


source :http://www.cnblogs.com/lidabo/archive/2012/05/29/2524170.html

原网站

版权声明
本文为[linchaolong]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230421394952.html