How many steps does it take to debug a C program?

Updated on delicacies 2024-03-23
5 answers
  1. Anonymous users2024-02-07

    Breakpoint--step-by-step--Observe c, I don't know much about c, it doesn't seem to generate any files.

  2. Anonymous users2024-02-06

    1. Debugging C programs in Keil.

    1. Open our program and click Start StopDebug on the right side of the menu barbutton to enter the debugging mode, as shown in the following figure.

    2. The left side is the register window, and the upper right side is the assembly window, we can see the values of each register and the assembly corresponding to the C language, as shown in the figure below.

    3. Click the single-step execution button or click F11 and F10 to enter the single-step execution mode, which is convenient for us to see the program flow and execution steps, as shown in the following figure.

    4. Click the serial port button in the menu bar, let's debug the output of the serial port, there are many corresponding debugging tools to choose from, as shown in the figure below.

    5. Single-step execution, we see the changes of each window, when going straight to the output, we can see that the serial port window has the corresponding character output, as shown in the following figure.

    6. Click the start stop button again to stop debugging, as shown below.

    2. Use VS2012 to debug the C language.

    1. Click on a vertical empty space on the left side of the programming environment, and click on the corresponding statement you want to debug.

    2. Click on the debugging interface in the toolbar at the top of the window, and click on sentence by sentence or process, it doesn't matter.

    3. Start debugging, in the debugging process, each debugging statement should be pressed once F5 key, press on the keyboard, you can see that in the current statement, there is an arrow in the red dot on the left.

    4. In each debugging statement, when the variable value changes, the small interface below will be displayed to see if it is correct.

    5. Repeat this step until you know where you find the wrong place.

    6. After the error is found, stop the debugging and modify the corresponding **, that is, complete the debugging.

  3. Anonymous users2024-02-05

    Steps to write and debug C language programs in VisualStudio 2013: 1. Open [File] - New - Project to open the "New Project" window. 2. Select [Visual C++] Win32 Console Application in [Template], [Name], [Location], and [Solution Name] can be filled in according to your needs.

    5. [Source File] - Right-click [Add] - New Item] Here [Name] Give your file a name, and select [C++ File (.].cpp)] — add], and then you can program. 6. After the program is written, press [F5] to debug, and [Ctrl+F5] to run.

  4. Anonymous users2024-02-04

    Briefly describe the general steps of computer debugging of C program?

  5. Anonymous users2024-02-03

    1. Procedural modulation method: The first thing to pay attention to in the modulation is the process, you must clarify the ideas that lead to the final result, that is, the process of committing the crime, and follow up step by step in the process of committing the crime to get the result of the crime. In the analysis of the crime process, each suspicious point must be marked (that is, the log information mentioned in **).

    After this analysis process, a black box test is performed, inputs are added, and the results are verified. Ultimately, you will be able to verify your judgment based on the markers of each change step to find the cause. The above scheme is a procedural modulation method.

    The advantages of this method are self-evident, the whole process can be analyzed directly through a test, but this method is very time-consuming, and it is okay to sort out your own logic, while it is difficult to clarify the logic of others. 2. Unit test tuning method: The basic purpose of unit testing is to ensure the normal operation of a function, class or a functional module, including the testing and verification of its abnormal conditions.

    As a programmer's favorite verification method is "piling" (the meaning of piling is to provide false default data), this method is very convenient to modulate, but there is a disadvantage that it cannot be used again, because after we verify that it is normal, many developers will comment or delete it, so if we complete the development in the development environment, but we want to verify in the test environment, we must rewrite a piling logic. It's even more troublesome. Since there are so many inconveniences, you can try the following practices. Add a unit test class, this class needs to control its permissions, only through the background login or the command line can be executed, the role of this class is to detect the key logic of the system, and make the corresponding test nuclear travel output results.

    Be confident that all interface classes can be tested through unit test classes. A lot of times programmers are questioning, is this something we should do? In fact, we really need to do it, after all, many tests are now done black box tests.

    This modulation method is suitable for the development process and can ensure that our live network will run normally after the release of **. We hope that you will also be involved in the development phase when planning the development time. 3. Are the first two complex processes of the fast positioning method too idealistic?

    Mine only has 100 lines, and the system is not complicated. If that's the case, then do a quick positioning analysis. In many cases, it will encounter 1. The input is normal and the output is abnormal; 2. The input is normal, the logic is abnormal, and the output is abnormal; 3. The input is abnormal, the logic is normal, and the output is normal; 4. The input is abnormal, the logic is abnormal, and the output is none.

Related questions
10 answers2024-03-23

1: Confirm that in the Configuration Properties, enable debugging"for"true "2: Confirm yours" ""debug=true " 3: >>>More

4 answers2024-03-23

Cite month[12][10]; Wrong. Without the element month[12][10], up to month[11][9], and the pointer p is useless. There's also the deletion of all your +10-level corresponding *. >>>More

4 answers2024-03-23

You use a P1 port to control the dynamic scanning of 8 digital tubes, and the dynamic scanning display of digital tubes needs to be blanked. >>>More

12 answers2024-03-23

I'm also fine with this when debugging, but the compiled one will report poison. I don't know if there is a problem with your version, I recommend going to the Jingyi forum**. You can try to add him to the 360 whitelist, put the exe file in the easy language directory, and the entire directory of easy language, and c: >>>More

3 answers2024-03-23

The steps for debugging the C language are as follows: >>>More