In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about what is the Visual C++ tool. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
The following focuses on the powerful debugging function built into the Visual C++ tool. Debugging occurs when you have successfully compiled and connected to get an executable program, but the results of program execution are incorrect. I hope this article can give you the information you need.
Debug command
Debugging commands are scattered in the Build, Debug, View, and Edit menus. The Build menu contains a Start Debug submenu, in which the commands are a subset of the Debug menu commands, including: start debugging (Go), step trace (Step Into), and run to the cursor (Run To Cursor). When the debugging process is started, the Build menu will be replaced by the Debug menu. The Debug menu contains various commands that control the execution of the program, such as stepping into the function body, coming out of the function body, running to the location of the cursor, and so on.
The View menu contains commands that control the display of various debug-related windows, such as variable window (Variables window), call stack window (Call Stack window), and so on. The Breakpoints command under the Edit menu opens a dialog box where you can insert, delete, start, and stop breakpoints.
Set breakpoint
You can control the program to run directly to a specified location, and then check the status of the program when it runs to that place, such as the value of the variable, the call stack, and so on. You can do this by setting breakpoints. The way to set a breakpoint is to move the cursor to where you want to set the breakpoint, press F9, and a red dot will appear on the left side of the line of code. If you want to cancel the breakpoint, move the cursor to the line of code that sets the breakpoint and press F9.
Start debugging
You can start the debugger by pressing F5 in the Visual C++ tool or from the Build menu, select Start Debug and then Go. The program runs all the way to code that requires user input or has a breakpoint.
View the value of a variable
There are many ways to check the value of a variable, and you can choose the way you like.
1) you can move the mouse to the variable name of the program, and the system will automatically display the value of the variable for you.
2) complex variables (such as objects) can be viewed through QuickWatch, by positioning the cursor to the variable where you want to view the value, press the right mouse button, select the QuickWatch menu, and you can see the variable value.
3) after starting the debugger, two output windows will appear at the bottom of the screen, one is Watch and the other is Variable. The Watch window displays the variable name and value. You can add the variable name you want to observe in the Watch window, or you can select the variable name directly from the source code and drag it to the Watch window. The Variable window displays the values of the variables involved in the current running context of the program.
Control program execution
You can control the program to step through (F10), trace to the inside of a function (F11), run from a function (shift+F11), and run to the cursor location (Ctrl+F10), so that you can easily debug the program. These commands are used to debug the program in detail at some local scope.
You can also control the program to run directly to the breakpoint by setting the breakpoint (F9) and then running it directly (GO or F5). If you set multiple breakpoints, the program will stop at the breakpoints encountered. To continue running from the breakpoint, you can use the various commands mentioned above (F5, F10, F11, Shift+F11, Ctrl+F10).
End debugging
For shortcuts to the Visual C++ tool, press shift+F5 or select the menu Debug | Stop Debugging. When you finish debugging, all debugging windows will automatically close and the Debug menu will automatically revert to the Build menu.
The above is the editor for you to share what is the Visual C++ tool, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.