当前位置:网站首页>Detailed explanation of commissioning methods and techniques
Detailed explanation of commissioning methods and techniques
2022-06-30 10:09:00 【Pineapple cat Yena】
Recommend a software , Meditative space , Put down mobile phone , value highly one's time , Fight for the future , For a better life in the future , Blunt duck !!!!
List of articles
Preface
In code bug Hard to avoid , Especially when it works but the result is wrong , It's so painful 罒 ω 罒 . debugging , Is a programmer must have , And practice hard , With skillful skills . This chapter will introduce the methods and techniques of code debugging . We must see the world more , Watch other people's good code , Write more and practice more !
Tips : The following is the main body of this article , The following cases can be used for reference
1. What is debugging
debugging , English name Debug, Immediate debugging , It is the process of finding and reducing errors in programs . The compiler used in this paper is VS, How to find and correct mistakes .
2. Debugging steps
The commissioning steps are divided into : Find the error , Locate the error , Analyze the cause of the error , Solve mistakes , Readjust . here , You have to pay attention , Our thinking should be rigorous , You can't change it , There are steps , Analyze the program predictably Will improve our hands-on and thinking ability .
2.1 Find the error
There are several types of errors in the program .
2.1.1 Compiler error
Also known as Grammar mistakes , We may carelessly write less than a colon , An extra bracket was added , This mistake is the simplest , The program will mark Number of lines where the error is located , We can correct it .
2.2.2 Linked error
From code to executable program , You need to go through the phase of compiling to linking , The general link type error is : Unresolved external symbols , It is divided into The identifier is not defined or is incorrectly written Two cases .

here , If the location of the error is not marked , It can be done by Ctrl+f, Enter the part to be found , You can get the location of the code .
2.1.3 Runtime error
The most annoying mistake , No problem compiling , But it is not the desired result , This is the time , If it's too difficult to find mistakes , Need Step by step debugging To find out what went wrong .
2.2 Debugging environment preparation
2.2.1 debug And release
Below , We can observe , The compilation environment has debug And release Two kinds of .
Next , We introduce the functions of the two environments .
debug , Test version . For programmers to use , Contains various debugging information , Support Programmers and testers Find errors and debug the program step by step .
release , The release , For users , Ensure optimal speed , Convenient for users , no debug info , Debugging is not allowed .
As shown in the figure below , The same procedure ,release Version than debug The version takes up much less memory .

2.2.2 Introduction to shortcut keys required for debugging
2.2.2.1 F5, Start debugging
Generally speaking, it is related to F9 Use a combination of . As shown in the figure below , Press F5, If you just adjust the brightness , need fn Key and f5 Use it together , Will show f5 Key original function .
2.2.2.2 F9, Create cancel breakpoint
Breakpoints are used to , With breakpoints , Click on F5 Will cause the debugging to jump directly to the next breakpoint , The purpose is Skip the code snippet that is sure to work , Adjust only code snippets where errors may occur .
The actual operation is as follows
stay 43 The line has a breakpoint , Press once F5, You can debug code directly from main Jump to the first 43 That's ok .

2.2.2.3 F10, Step by step observation
In turn, click debugging –> window –> monitor –> Select the monitor window –> Enter the variable you want to observe –> enter , During debugging , Observe the changes of relevant variables . This is the key to debugging . We must have a clear mind , Know every step , What happens to variables . Once the change of the variable does not conform to the expectation , We can find mistakes .
Press F10, Observe i The change of 
Press F10 after , Observe j The change of .
2.2.2.4 F11, Inside the function
As shown in the figure below , When encountering a function , Press F10, It doesn't go inside the function 
Press F10 after , Skip to the next line of code , Don't go into functions .
here , If it is necessary to enter the function for internal observation , Just press F11 Inside the function .
Press F11 after , Get into Display Function Internal observation .
in addition , If only Run the program without debugging , You can go through Ctrl+F5 function .
3. understand F1-F12 The original functions of shortcut keys
3.1 F1,Help
F1 It belongs to the help button , When you open the software, you find that it doesn't work , Press F1 Key to call out the instructions window , You can view the instruction manual .
3.2 F2, rename
When selecting a file 、 file 、 Folder , Select any file , Press down F2 You can enable renaming , This function is quite convenient ,
3.3 F3, seek
When looking at the list on the Internet , Thousands of documents are dazzling , Most people will use Ctrl+F key , In fact, just press F3 key , The browser will pop up “ Search window ”, By searching for keywords , It can help us find . When you need to find a file exactly , There is no need to open an interface ,F3 You can call up a search interface with one click
3.4 F4, Address bar form
Many people know Alt+F4 The open serial port can be closed , however F4 stay IE Browser and file management can open the address bar , It is convenient to review the previously visited folders , Webpage .
3.5 F5, Refresh
It is applicable to all browsers, desktops and other programs
3.6 F6, Address bar
Press this key to quickly reach the address bar , Easy and fast input URL.
3.7 F7, Special features
Actually F7 The key in Windows There are no special functions on the system , But in the word processor , Such as Word、Excel when , Press to check for more errors , Check spelling .
3.8 F8, safe mode
When something goes wrong with the computer , Unable to enter Windows System time , It can be pressed continuously when the machine is turned on F8 key , Enter computer security mode . Enter safe mode , It can solve some difficult computer problems , But if you don't understand computers , It is recommended not to enter into .
3.9 F9, Special features
F9 The key in Windws There are no special functions on the system , But the same thing happens in the document processor Word Zhongneng reorganization document 、 Receiving software Outlook You can re launch emails and Windows player Medis Player It has the function of lowering the volume .
3.10 F10, Function list
F10 Key to quickly open the function list , Its coordination Shift Key to open the right mouse button shortcut menu . stay Windows player Media Player It has the function of increasing the volume .
Besides , On computer bios Setting up , After setting up , Press F10 Key to save the current settings .
3.11 F11, Full screen
Display the window or browser in full screen , Can press F11 key .
3.12 F12
stay windows There's no role in . But in word in , Press it to quickly pop up the save as file window ;
summary
Just started debugging , There must be some unfamiliar places , Practice makes perfect , Can't give up , Quantitative change will soon produce qualitative change . For our future , Keep rushing !!!!
边栏推荐
- Slf4j: failed to load class "org.slf4j.impl.staticloggerbinder"
- 开源了!文心大模型ERNIE-Tiny轻量化技术,又准又快,效果全开
- 【JVM】G1垃圾回收器簡述
- Mysql database learning 1
- Small program development journey
- Techtarget: Interpretation of the basic concept of super fusion cloud
- Principle and implementation of small program hand-held bullet screen (uni APP)
- Work notes: SendTo failed errno 22
- IDC released the report on China's software defined storage and hyper convergence market in the fourth quarter of 2020, and smartx hyper convergence software ranked first in the financial industry
- Didn't receive robot state (joint angles) with recent timestamp within 1 seconds
猜你喜欢
![[new book recommendation] mongodb performance tuning](/img/2c/e5a814df4412a246c703ca548a4f68.png)
[new book recommendation] mongodb performance tuning

Plan the IT technology route for the new year? Let's learn about Gartner infrastructure hype cycle

将小程序容器技术应用到物联网IoT生态建设中

Valuenotifier and valuelistenablebuilder in fluent

Shell script multi loop experiment

【JVM】CMS简述
![[C language quick start] let you know C language and get started with zero basics ③](/img/ab/8dee3ee264429fc57ce18fdf8b2ea0.png)
[C language quick start] let you know C language and get started with zero basics ③

磁悬浮3D灯

Forrester senior analyst: five important trends in the development of the hyper convergence market

Shenhe thermomagnetic: Super fusion dual active cluster solution for MES system
随机推荐
How to reduce the delay in live broadcast in the development of live broadcast source code with goods?
Techtarget: Interpretation of the basic concept of super fusion cloud
事件委托的使用与说明》
2022第六季完美童模 托克逊赛区 决赛圆满落幕
Robot system dynamics - inertia parameters
log4j
ModuleNotFoundError: No module named ‘_ swigfaiss‘
OSError: [Errno 28] No space left on device
Appium自动化测试基础 — 12.APPium自动化测试框架介绍
How to build a private cloud and create a hybrid cloud ecosystem?
Upgrade log4j2 to 2.17.1 stepped pit
Memorize the text and remember the words. Read the text and remember the words. Read the article and remember the words; 40 articles with 3500 words; 71 articles broke through the words in the middle
Financial private cloud infrastructure scheme evaluation (Architecture and storage)
【JVM】CMS简述
采坑:Didn‘t receive robot state (joint angles) with recent timestamp within 1 seconds.
Cobbler Automated Deployment
基于强化学习的股票量化交易Automated-Stock-Trading-Ensemble-Strategy
9.缓存优化
Nlopt -- Nonlinear Optimization -- principle introduction and application method
机械臂速成小指南(五):末端执行器