Debugging Tips 丨 Tubor C 2.0

Source: Internet
Author: User

let the program execute where you want to pause and observe the results of the stage

Method One: Make the program execute to the line where the cursor is paused

Step 1: Move the cursor over the line that needs to be paused

Step 2: Execute the "Go to Cursor" option in the Run drop-down menu of the menu (or press the shortcut key "F4")

Effect:

When the program executes to that row, it pauses on the line

Extended:

has been paused in a previous position, if you move the cursor back to a location, and then press "F4", the program will continue from the current position of the pause point to the new cursor position, pause again

Method Two: Set breakpoints

Step 1: Move the cursor over the line that you want to set as a breakpoint

Step 2: Set breakpoints on the "Toggle Breakpoint" option in the "Break/watch" drop-down menu (or press CTRL + F8) in the menu.

Effect: The line of the breakpoint being set will be shown as a red light bar

Extension: On the same line, the first time you press Ctrl + F8 is set, the second time you press Yes to cancel the setting

    

Step 3: Press the shortcut key "Ctrl + F9", the program begins execution, and the line to set the breakpoint is paused

Set the result variable to be observed

Method: Causes the program execution to pause at the specified location, at which point you can view the value of the current variable you want to view

Step 1: Select the "Add Watch" option in the "Break/watch" menu (or press the shortcut key "Ctrl + F7")

Effect: a small window pops up on the screen, providing the input variable name to see the current value of the variable

  

 Step 2: For example, move the cursor to line fifth, then press "F4" and the program executes to line fifth to pause

    Effect:

The View window displays the current value of the view variable i

Description

A green light bar indicates where the current program was executed (where it was paused)

Extended:

Set multiple viewing variables: Use "Ctrl + F8" multiple times

Change the name of the view variable:

Step 1: Press "F6"

Effect: Switch the Action window to the viewing window

Step 2: Press the "Enter" key

Effect: You can change the name of the view variable at this time

To delete a view variable:

                Step 1: Press "F6"

Effect: Switch the Action window to the viewing window

Step 2: Move the cursor up or down to select a view variable to be deleted

Step 3: Delete The view variable you want to delete by pressing the "delete" key

Single Step Execution

Method: Execute the "Step over" action in the Menu "Run" (shortcut "F8")

Case 1: If you encounter a custom function call, you have to step into the function

Step 1:

Execute the "Trace into" action in the Menu "Run" (shortcut "F7")

Case 2: For a statement that is not a function call, perform a "Step over" Operation and a "Trace into" Operation with the same effect

Be careful: do not use "F7" for calls that encounter system functions

End Debugging

Method: Execute the "program reset" action in the Menu "Run" (shortcut "Ctrl + F2")

Debugging Tips 丨 Tubor C 2.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.