当前位置:网站首页>Introduction to visual studio shortcut keys and advanced gameplay

Introduction to visual studio shortcut keys and advanced gameplay

2022-06-24 16:55:00 Ruthless swordsman

Since the use of IDE, I think we should pay more attention to its debugging and positioning functions . Other shortcuts need to be explored by yourself . The bad thing about Microsoft is vscode and studio The shortcut to is different .

debugging

• debugging ( start-up ):F5;• debugging ( Restart ): Use key combination “Ctrl+Shift+F5”;• debugging ( Start execution without debugging ): Use key combination “Ctrl+F5”;• debugging ( Sentence by sentence , Stepping into ):F11;• debugging ( Process by process , Step over ):F10;• To set breakpoints :F9.• Exit the current process : Shift+F11• compile : F7

If you encounter a library function , Want to see the implementation of library functions , What do I do ? for instance memset function , A very common function . (1) F9 stay memset Set breakpoint (2) Debug Run the program (3) Reach a breakpoint , see memset The disassembly of

memset(&appBaseMem, 0, sizeof(appBaseMem));
00600645  push        0Ch  
00600647  push        0  
00600649  lea         eax,[appBaseMem]  
0060064C  push        eax  
0060064D  call        _memset (024571FCh)  
00600652  add         esp,0Ch

(4) F11 Stepping _memset

024571FC  jmp         dword ptr [__imp__memset (1855A5B4h)]

(5) continue F11

583750E0  mov         ecx,dword ptr [esp+0Ch]  
583750E4  movzx       eax,byte ptr [esp+8]  
583750E9  mov         edx,edi  
583750EB  mov         edi,dword ptr [esp+4]  
583750EF  test        ecx,ecx  
583750F1  je          58375233  
583750F7  imul        eax,eax,1010101h  
583750FD  cmp         ecx,20h  
58375100  jle         583751E5  
58375106  cmp         ecx,80h  
5837510C  jl          5837519D  
58375112  bt          dword ptr ds:[5838731Ch],1  
5837511A  jae         58375125  
5837511C  rep stos    byte ptr es:[edi]  
5837511E  mov         eax,dword ptr [esp+4]  
58375122  mov         edi,edx  
58375124  ret

Can gradually Debugging assembly code , Check the value of the register . You can also view the value of memory , Function Call Stack etc. , Super powerful .

From (4)-> The first (5) What happened , The follow-up meeting will be devoted to explaining , This involves windows Lower library function positioning .

location

1. Jump to definition :F12;2. Find all references : Use key combination “Shift+F12”

Search function

CTRL+F Global search [1]

Insert a line above or below the line where the cursor is

• Composite key “Ctrl+Enter”: Insert a blank row above the current row ;• Composite key “Ctrl+Shift+Enter”: Insert an empty row below the current row .

At the end

Visual Studio It's very powerful , than Android Studio It's a lot more powerful , It covers almost every aspect of programming , Even debugging windows The kernel is also possible ( In essence, it is integration windbg), Can replace windbg. however Visual Studio It's too big , If not necessary , It may not be possible to use such a big tool , After all, you don't have to use an ox knife to kill a chicken , But to kill an ox, you have to use an ox knife .

official account

More , Welcome to my WeChat official account. : Ruthless swordsman .

References

[1] Global search : https://jingyan.baidu.com/article/2c8c281d9e987e0008252a92.html

原网站

版权声明
本文为[Ruthless swordsman]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/04/20210403111047643n.html