search
HomeCommon ProblemHow to debug codeblocks?

How to debug codeblocks?

Apr 16, 2020 pm 02:01 PM

How to debug codeblocks? The following article will introduce it to you. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

How to debug codeblocks?

#CodeBlocks is an open source, full-featured cross-platform C/C integrated development environment (IDE).

Download address: http://www.codeblocks.org/downloads/26

Among them, you can use the installation package installation program in Windows environment, or use the installation-free zip.

Function of CodeBlocks Debugger

Generally speaking, the debugger is an indispensable tool in the IDE.

The debugger plays a very convenient role in tracking the code execution process and locating bugs.

Although it is said that you should not rely too much on the debugger, in general, especially when the program logic is complex, using a debugger can greatly improve the efficiency of program optimization and maintenance.

How to debug CodeBlocks?

The CodeBlocks debugger requires a complete project to start, and the debugger cannot be used on separate files. When using the debugger, it is best to create the project in an English path, and the path cannot contain Chinese characters.

1. Create a project

1) Create a project when or after CodeBlocks is started

How to debug codeblocks? How to debug codeblocks?

2), select the console program

How to debug codeblocks?

3), fill in the project name and path

How to debug codeblocks?

4), select Compiler, the default is

How to debug codeblocks?

5). After the project is created, as follows, you can write the program in the automatically created main.cpp, or create a new file

How to debug codeblocks?

2. Start the debugger

1) Generally, the debugger button can be found on the toolbar

How to debug codeblocks?

If not, you can call it from the view menu item

How to debug codeblocks?

2), set breakpoints

Required when using the debugger Let the program interrupt at the required location. Set the breakpoint as follows before starting the debugger. Click the mouse on the left side of the editor to set the breakpoint.

How to debug codeblocks?

3), start debugging

The debugger needs to be started in Debug mode, click the button debug:

How to debug codeblocks?

After starting, when the program execution reaches the breakpoint, it will interrupt

How to debug codeblocks?

If you encounter an input statement during execution, you need to complete the input before you can continue execution

1How to debug codeblocks? 1How to debug codeblocks?

In the toolbar Open the debugging window in, mainly open Watches

1How to debug codeblocks?

##Watches displays the value of the current variable, you can expand the array,

1How to debug codeblocks?

In addition to the automatically displayed values, you can also manually add variables that need to be observed, such as a certain value in the array,

1How to debug codeblocks?

Click Next line to execute the next statement, on the right Step into is to execute internal statements, and the red button Stop debugger on the far right is to end debugging; when executing a function call, you can use next line to directly execute the function, or step into to jump to the execution statement inside the function. If you want to stop debugging, click stop debugger,

How to debug codeblocks?

End

The above is the basic method of using the debugger. The purpose of debugging is mainly to track variable values ​​and observe whether the program behaves as expected. During execution, if a variable value is encountered that does not match expectations, the problem occurs in the previous statement.

Before debugging, you need to consider the potentially problematic code segment and set a breakpoint after this code segment.

(In practical applications, you can try to use the VS debugger)

For more related knowledge, please pay attention to PHP Chinese website! !

The above is the detailed content of How to debug codeblocks?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.