Software debugging method and device, equipment, storage medium and program product

By introducing debugging operation conditions and operation signal mechanisms into the visual software, the operation status of program modules is woken up and managed, and the problem of poor debugging flexibility in the existing technology is solved, and a more flexible and efficient debugging process is achieved.

CN119669044APending Publication Date: 2025-03-21HANGZHOU HIKROBOT TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411804533.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

Existing visual software lacks debugging flexibility during execution, especially when the Group loop function is enabled, it is impossible to set breakpoints during the loop, resulting in the inability to view and analyze the execution results of each loop in real time.

Method used

Provide a software debugging method, by judging whether the debugging and running conditions are met at the current moment, generating a running signal, awakening the program module in the state to be run, making it run, and after completing the run, determining the subsequent module based on the connection relationship of the program module, and setting its status to the state to be run.

Benefits of technology

It realizes improving debugging flexibility in visual software, supports breakpoint debugging, single-step debugging and exception debugging, and can view and analyze the execution results of each loop in real time during the loop, improving control flexibility during the execution of the target program.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669044A_ABST
    Figure CN119669044A_ABST
Patent Text Reader

Abstract

The invention provides a software debugging method and device, equipment, a storage medium and a program product, and relates to the field of computers. The method comprises the following steps: the electronic equipment can judge whether a debugging operation condition is met at the current moment; if satisfied, the electronic device may generate a run signal. The electronic device may wake up the first program module in response to the run signal. The awakened first program module quits the to-be-operated state and enters the operation state. The electronic equipment can obtain the second program module when the first program module finishes running. The second program module can be a program module following the first program module in the target program. The electronic device can set the state of the second program module as a to-be-run state. According to the method, the debugging flexibility of the program module of the target program is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine vision, and in particular to a software debugging method, device, equipment, storage medium and program product. Background Art

[0002] As an important part of the computer vision field, vision software is widely used in image processing, pattern recognition, and machine vision detection. These software analyze and process images through algorithms to achieve functions such as automated detection, measurement, and classification.

[0003] Existing vision software usually adopts a linear execution mode in terms of control process execution. Once the process starts, all modules will be executed sequentially until the end. Especially when the Group loop function is enabled, the software will execute multiple loops continuously.

[0004] Although this design ensures the continuity of the process, it has obvious deficiencies in debugging and problem diagnosis, resulting in a lack of debugging flexibility in existing vision software. Summary of the invention

[0005] The present application provides a software debugging method, apparatus, device, storage medium and program product to solve the problem of poor debugging flexibility of visual software during execution in the prior art.

[0006] In a first aspect, the present application provides a software debugging method, comprising:

[0007] If the debugging operation conditions are met, a running signal is generated;

[0008] In response to the running signal, waking up a first program module in the target program that is in a waiting state, so that the first program module exits the waiting state and runs;

[0009] When the first program module completes execution, determining a second program module that is a successor to the first program module according to a connection relationship between a plurality of the program modules in the target program;

[0010] The state of the second program module is set to a waiting state.

[0011] In a second aspect, the present application provides a software debugging device, comprising:

[0012] A generating module, used for generating a running signal when the debugging running conditions are met;

[0013] A debugging module is used to respond to the running signal to wake up the first program module in the target program that is in a waiting state, so that the first program module exits the waiting state and runs; when the first program module completes running, determine the second program module that succeeds the first program module according to the connection relationship between multiple program modules in the target program; and set the state of the second program module to the waiting state.

[0014] In a third aspect, the present application provides an electronic device, including: a memory and a processor;

[0015] The memory is used to store computer programs; the processor is used to execute the method in the first aspect and any possible design of the first aspect according to the computer program stored in the memory.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When at least one processor of an electronic device executes the computer program, the electronic device executes the software debugging method in the first aspect and any possible design of the first aspect.

[0017] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When at least one processor of an electronic device executes the computer program, the electronic device executes the method in the first aspect and any possible design of the first aspect.

[0018] The software debugging method, apparatus, device, storage medium and program product provided by the present application determine whether the debugging running conditions are met at the current moment; if met, generate a running signal; can respond to the running signal to wake up the first program module; the first program module after being woken up will exit the waiting state and enter the running state; when the first program module completes the running, obtain the second program module; the second program module can be the successor program module of the first program module in the target program; the means of setting the state of the second program module to the waiting state achieves the effect of improving the debugging flexibility of each program module in the target program. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0020] Figure 1 A schematic diagram of connecting multiple program modules in a target program provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of connecting multiple program modules in a Group of a target program provided in one embodiment of the present application;

[0022] Figure 3 The process of the software debugging method provided in one embodiment of the present application Figure 1 ;

[0023] Figure 4 A flowchart for starting debugging provided in an embodiment of the present application;

[0024] Figure 5 The process of the software debugging method provided in one embodiment of the present application Figure 2 ;

[0025] Figure 6 A flowchart of single-step debugging provided in an embodiment of the present application;

[0026] Figure 7 The process of the software debugging method provided in one embodiment of the present application Figure 3 ;

[0027] Figure 8 A schematic diagram of a breakpoint generation interface provided in an embodiment of the present application;

[0028] Fig. 9 A schematic diagram of a breakpoint setting interface provided in an embodiment of the present application;

[0029] Fig.10 The process of breakpoint debugging provided by an embodiment of the present application Figure 1 ;

[0030] Fig.11 The process of the software debugging method provided in one embodiment of the present application Figure 4 ;

[0031] Fig.12 A flowchart of an abnormal interruption provided by an embodiment of the present application;

[0032] Fig.13 The process of the software debugging method provided in one embodiment of the present application Figure 5 ;

[0033] Fig.14 A flowchart of stopping debugging provided in an embodiment of the present application;

[0034] Fig.15 A schematic diagram of the structure of a software debugging device provided in one embodiment of the present application;

[0035] Fig.16 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application.

[0036] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] Terminology explanation:

[0039] Vision software: The vision software used in this application is specifically VisionMaster. VisionMaster in industrial machine vision is a machine vision software platform independently developed by Hikvision Robotics. It is specially designed to quickly build visual applications and solve visual inspection problems. It provides a series of algorithm tools that can meet the needs of machine vision applications such as visual positioning, dimensional measurement, defect detection, and information recognition. The debugging function of this application is also implemented based on this vision software.

[0040] Process: A container in vision software. This container can contain all modules of the target program. Optionally, the module can be a program module, a Group, etc. This process can control the modules in the target program to run in sequence. The container of the process is one level higher than the Group.

[0041] Loop: An execution strategy of the target program of the vision software within the execution process. In one execution process cycle, the target program can have multiple program modules that are executed multiple times in a loop.

[0042] Group module: A type of module within the vision software. A component module is equivalent to a container. When multiple program modules are assembled together into a black box, the multiple program modules included in the black box form a Group. In the vision software, a Group can be presented to the outside in the form of a module identifier. When you double-click the Group in the display interface, you can enter the Group to view the program modules of the Group. Currently, VisionMaster's Group has both grouping and looping functions. Among them, the looping function is not enabled by default. When you need to use the looping function of the Group, you can enable it manually.

[0043] Breakpoint debugging: When a program module is set with a breakpoint, the process can be interrupted after running sequentially to the program module with the breakpoint set in the debugging state of breakpoint debugging.

[0044] Single-step debugging: When using single-step debugging, each click of the single-step debugging button can realize the sequential execution of a program module in the process.

[0045] In existing visual software, when the control process is executed, once the process execution starts, all modules in the process will be executed without interruption, which is not convenient for debugging. Especially when the Group loop is turned on, when you want to debug and view the execution results of the module in each loop, you cannot set breakpoints. After the Group loop is executed, all graphic results are displayed on the image, but it is difficult to determine which specific loop result corresponds to which graphic position. When you need to know the execution status of each loop, the existing software cannot meet this requirement.

[0046] In the field of industrial automation and intelligent manufacturing, machine vision plays a vital role in improving production efficiency, ensuring product quality and achieving process control. As the core of the machine vision system, vision software is responsible for processing image data, performing algorithm analysis and providing operational feedback.

[0047] Existing vision software has made some progress in controlling process execution and can realize the automatic execution of processes. However, these software have limitations in terms of process control flexibility and debugging convenience. In particular, when process execution begins, existing software does not support interruption in the middle of the process, which is particularly inconvenient during the development and debugging stages. In addition, when using Group loop execution, existing software cannot set breakpoints during the loop, resulting in the inability to view and analyze the execution results of each loop in real time. After the loop ends, all graphic results are superimposed and displayed, making it difficult to identify which specific loop corresponds to which graphic position, which poses a challenge to accurate debugging and problem diagnosis.

[0048] In order to solve the above technical problems, the embodiment of the present application provides a software debugging method that can be applied to visual software. The software debugging method can include three types of debugging: breakpoint debugging, single-step debugging, and exception debugging.

[0049] Optionally, Figure 1 The display interface of the software debugging method of the present application in the visual software is shown. Figure 1 As shown, the top of the interface may include multiple tags. The first three tags may be software fixed tags. The fourth tag and onwards may be process tags. Users may click “+” to create a new process tag. Each process tag may correspond to a process container. For example, Figure 1As shown, it includes 1 process label. The process label may be named "Process 1". The process label may also include a run button and a rerun button.

[0050] Optionally, the path information of the currently running module can be set below the label. Figure 1 As shown in , the currently running module is Line Search 1, and the path information can be "Process 1> Line Search 1". Figure 2 As shown, when the module being run is Ellipse Search 1, the path information may be "Process 1> Combined Module 1> Ellipse Search 1".

[0051] Optionally, Figure 1 The display interface shown may also display debugging buttons. The debugging buttons may include four buttons: "Start debugging", "Single-step debugging", "Breakpoint debugging", and "Exception debugging". Optionally, the identification texts of the four buttons may be set according to user needs. For example, "Start debugging" may be replaced with "Start debugging state", "Single-step debugging" may be replaced with "Single-step execution", "Breakpoint debugging" may be replaced with "Execute to next breakpoint", and "Exception debugging" may be replaced with "NG interrupt". Optionally, when the user clicks the "Start debugging" button, the Start debugging button will become "Stop debugging", and the three buttons "Single-step debugging", "Breakpoint debugging", and "Exception debugging" may be clicked.

[0052] Optionally, Figure 1 The display interface shown may also include a target program. The target program may include multiple program modules connected in sequence. For example, Figure 1The target program shown may include five program modules, namely, image source 1, circle search 1, line search 1, contour matching 1, and line circle measurement 1. Optionally, the target program may also include a Group. The Group may be a combination module 1. Each module may correspond to a rectangular box marked with the module name. The right side of the rectangular box may include an identification area showing the module status. The identification area may display an icon of the execution status of the module. For example, when the module is not executed, the identification area may be empty. When the module is being executed, the representation area may be displayed as a third icon. Optionally, the third icon may be displayed in a color such as yellow. Alternatively, the third icon may also be a grid. When the module completes execution, the representation area may be displayed as a first icon or a second icon. Optionally, when the module is successfully executed, it may be displayed as a second icon. Optionally, the second icon may be displayed in a color such as green. Alternatively, the second icon may also be an upper diagonal line. Optionally, when an exception occurs in the execution of the module, it may be displayed as a first icon. Optionally, the first icon may be displayed in a color such as red. Alternatively, the first diagram may also be a lower diagonal line.

[0053] Optionally, the user can enter the Group by clicking on the Group module. Figure 1 As shown, the combination module 1 can be a Group. Figure 2 As shown, the combined module 1 may include three program modules: circle search 1, blob analysis and ellipse search 1.

[0054] The software debugging method of the following embodiments is executed with the electronic device as the execution subject. Specifically, the execution subject may be a hardware device of the electronic device, or a software application implementing the following embodiments in the electronic device, or a computer-readable storage medium installed with the software application implementing the following embodiments, or a code implementing the software application implementing the following embodiments.

[0055] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0056] Figure 3 The following is a flow chart of a software debugging method provided by an embodiment of the present application. Figure 1 .exist Figure 1 and Figure 2 Based on the embodiment shown, Figure 3 As shown, with the electronic device as the execution subject, the target program includes a plurality of program modules connected in sequence, and the method of this embodiment may include the following steps:

[0057] S101. If the debugging operation conditions are met, generate an operation signal.

[0058] In this embodiment, the electronic device can determine whether the debugging operation condition is met at the current moment. If it is met, the electronic device can generate an operation signal. The operation signal can indicate that the program module in the waiting state is running. Otherwise, if it is not met, the electronic device will continue to wait until the debugging operation condition is met.

[0059] In one example, the debugging operation condition may be that the debugging button is triggered, or that the state triggered by the debugging button is not exited. Optionally, the debugging button may be any one of the three buttons of single-step debugging, breakpoint debugging, and exception debugging. Optionally, when the debugging button is triggered, a running signal may be generated. For example, when the single-step debugging button is triggered, the single-step debugging state may be entered, and a running signal may be generated. When the breakpoint debugging button is triggered, the breakpoint debugging state may be entered, and a running signal may be generated. When the exception debugging button is triggered, the exception debugging state may be entered, and a running signal may be generated. Optionally, when the state triggered by the debugging button is not exited, the electronic device may continue to generate a running signal. For example, the single-step debugging state may exit after completing the execution of the first program module. For another example, the breakpoint debugging state may exit when it is determined that the second program module includes a breakpoint. Before running to the program module where the breakpoint is located, the electronic device is in a running state triggered by the debugging button that is not exited each time the operation of a program module is ended. At this time, the electronic device may directly generate a running signal so that the electronic device may continue to run according to the connection sequence of the program modules until the program module where the breakpoint is located is reached. For another example, the abnormal debugging state can be exited when it is determined that the operation of the first program module is abnormal.

[0060] S102 . In response to a running signal, wake up a first program module in a waiting state in a target program, so that the first program module exits the waiting state and runs.

[0061] In this embodiment, when the electronic device generates a running signal, the electronic device can respond to the running signal and wake up the first program module. After being woken up, the first program module will exit the waiting state and enter the running state. Among them, the first program module is the program module currently in the waiting state. Optionally, the number of the first program modules can be one or more. When the process runs on the main process, the number of the first program modules can be 1. For example, Figure 1 As shown in FIG. 1 , when the process runs in the process of image source 1, circle search 1, and line search 1, the first program can be image source 1, circle search 1, or line search 1. When the process runs to the branch process, the number of the first program modules can be determined according to the number of branches. For example, when two branches are included, the number of the first program modules can be 2. For example, Figure 1 As shown, when the process runs to line circle measurement 1 and contour matching 1, the corresponding two branches may include two first program modules, line circle measurement 1 and contour matching 1.

[0062] In one example, the running signal wakes up the first program module and causes the first program module to exit the waiting state. The process of entering the running state may specifically include:

[0063] Step 11: Count the first number of first program modules in a waiting state.

[0064] In this step, the electronic device may count the number of the first program modules in the waiting state to obtain the first number. Optionally, the first program module in the waiting state may perform a waiting operation (P operation). At this time, the first program module may call a wait function. The electronic device may determine the first number by counting the number of the called wait functions. Optionally, the value of the semaphore of the wait function may be 0. At this time, the first program module may be in a continuing waiting state.

[0065] Step 12: Generate a first number of wake-up signals in response to the operation signal.

[0066] In this step, the electronic device may generate a wake-up signal in response to the operation signal. Optionally, the number of wake-up signals generated by the electronic device may be determined according to the first number. Optionally, each first program module may correspond to a wake-up signal. Optionally, the wake-up signal may be a semaphore.

[0067] Step 13: Use a wake-up signal to wake up the first program module, so that the first program module exits the waiting state.

[0068] In this step, the electronic device can obtain the semaphore through the wait function of the first program module. When the wait function obtains the semaphore, the value of the wait function can become 1. When the value of the wait function can become 1, the first program module is awakened. The awakened first program module will start running. Before starting to run, the wait function can be reduced by 1 to make its value return to 0. After the value of the wait function returns to 0, the first program module will start running.

[0069] Step 14: Run the first program module.

[0070] In this step, the electronic device can run the first program module.

[0071] S103: When the first program module finishes running, determine a second program module that is a successor to the first program module according to the connection relationship between multiple program modules in the target program.

[0072] In this embodiment, the electronic device can obtain the second program module after the first program module completes execution. The second program module can be a subsequent program module of the first program module in the target program. Figure 1 In the target program shown, the program module following image source 1 is circle search 1. The program module following circle search 1 is line search 1. The program modules following line search 1 are contour matching 1 and line circle measurement 1.

[0073] In one example, when the first program module completes running, the electronic device can also display the running result of the first program module by adding an icon in the identification area of ​​the program module. The electronic device can obtain the running result of the first program module, and the running result includes normal running or abnormal running. Optionally, the normal running is running OK, and the abnormal running is running NG. When the running result of the first program module is abnormal running, the electronic device can use the first icon to mark the first program module. When the running result of the first program module is running normally, the electronic device can use the second icon to mark the first program module. Optionally, the first icon and the second icon can be colors. For example, the first icon can be red, and the second icon can be green. Or, the first icon and the second icon can be patterns. For example, the first icon can be a lower diagonal line, and the second icon can be an upper diagonal line. Optionally, the color and pattern are only an example, used to illustrate that the first icon and the second icon are different icons. In actual implementation, the first icon and the second icon can be set by a technician or a user.

[0074] In another example, during the running of the first program, the electronic device can also display the running module by adding an icon in the identification area of ​​the program module. Optionally, when the first program module is running, the first program module is marked with a third icon. Optionally, the third icon can be yellow. Alternatively, the third icon can also be a diamond pattern. Optionally, the color and pattern are only an example to illustrate that the third icon is different from the first icon and the second icon. In actual implementation, the third icon can be set by a technician or a user.

[0075] S104: Set the state of the second program module to a waiting state.

[0076] In this embodiment, after determining the second program module, the electronic device can set the state of the second program module to the waiting state. Optionally, during the setting process, the electronic device can call the wait function of the second program module to make the second program module enter the waiting state. When the second program module enters the waiting state, the value of the wait function can be 0. The second program function will continue to wait to be awakened.

[0077] The software debugging method provided in the present application can determine whether the debugging operation conditions are met at the current moment. If met, the electronic device can generate an operation signal. The electronic device can wake up the first program module in response to the operation signal. The first program module after awakening will exit the waiting state and enter the running state. The electronic device can obtain the second program module when the first program module completes the operation. The second program module can be a subsequent program module of the first program module in the target program. The electronic device can set the state of the second program module to the waiting state. In the present application, by setting the debugging operation conditions, the sequential execution of program modules is realized in multiple debugging processes, and the flexible debugging of each program module in the target program is realized.

[0078] Based on the above embodiments, the debugging buttons can include single-step debugging, breakpoint debugging and exception debugging. Before triggering the three debugging buttons, the user usually needs to click Figure 1 The Start Debug button is shown. When the Start Debug button is clicked, the process can enter the debugging state. When the process enters the debugging state, the single-step debugging, breakpoint debugging and exception debugging buttons can be triggered. And, when the process enters the debugging state, the Start Debug button becomes the Stop Debug button. That is, the Stop Debug button is displayed after the Start Debug button is triggered.

[0079] In one implementation, when the start debugging button is clicked, the steps performed by the electronic device may be as follows: Figure 4 As shown, including:

[0080] S201. Click the Start Debugging button to put the process into debugging state.

[0081] S202, the process scheduling task starts to execute. The scheduling task is used to schedule the target program in the process to start execution. Optionally, a process may include one or more target programs. Optionally, the process scheduling task may generate a process according to each target program. Optionally, a process may be used to execute a program module of the target program. For example, when the first program module completes execution, the process may switch to the second program module.

[0082] S203, running to the starting module in the process. In this embodiment, the process has just started to execute debugging, so the scheduling task can be scheduled to the starting module of the target program of the process. The starting module is the first program module of the target program. For example, Figure 1 In the target program shown, the starting module is image source 1.

[0083] S204, the number of debug signal waiting is increased. Optionally, the number of debug signal waiting can be the number of program modules entering the waiting state, that is, the first number. In the initial state, the number of debug signal waiting can be 0. When running to the starting module of the process, the electronic device can quickly implement the statistics of the number of wait function calls by increasing the number of debug signal waiting.

[0084] S205, the state of the starting module is set to the waiting state. Optionally, when the starting module is set to the waiting state, the wait function of the starting module will be called.

[0085] S206, waiting for a continue operation signal. The continue operation signal is a semaphore. In this step, the continue operation signal is generated only when the debug button is triggered.

[0086] Figure 5 The following is a flow chart of a software debugging method provided by an embodiment of the present application. Figure 2 .exist Figures 1 to 4 Based on the embodiment shown, when the debug button is a single-step debug button, as Figure 5 As shown, with the electronic device as the execution subject, the method of this embodiment may include the following steps:

[0087] S301: If the single-step debugging button is triggered, a run signal is generated.

[0088] In this embodiment, the electronic device can obtain the trigger signal of the single-step debugging button when the user triggers the single-step debugging button. The electronic device can modify the debugging state to the single-step debugging state in response to the trigger signal of the single-step debugging button. The electronic device can generate a running signal in response to the single-step debugging state. Optionally, the single-step debugging button is used to instruct the target program to run a program module. Alternatively, when the target program includes multiple branches, the single-step debugging button can also be used to indicate that multiple branches of the target program all run a program module. That is, the single-step debugging button can be used to control the process to run the first program model currently processing the waiting state. Optionally, the running signal triggered by the single-step debugging button can include a semaphore. The wait function of the first program model in the waiting state can obtain the semaphore.

[0089] S302 . In response to a running signal, wake up a first program module in a waiting state in a target program, so that the first program module exits the waiting state and runs.

[0090] S303: When the first program module completes execution, determine a second program module that is a successor to the first program module according to a connection relationship between multiple program modules in the target program.

[0091] S304: Set the state of the second program module to a waiting state.

[0092] Among them, the implementation of steps S302 to S304 is Figure 2 The implementation of steps S102 to S104 in the embodiment is similar and will not be described in detail in this embodiment.

[0093] S305, exiting the single-step debugging state entered when the single-step debugging button is triggered.

[0094] In this embodiment, during the single-step debugging process, each time the single-step debugging button is triggered, the electronic device can be controlled to enter the single-step debugging state. The single-step debugging state is only used to execute the first program module that is currently in the waiting state. After the operation of the first program module is completed, the electronic device can exit the single-step debugging state after completing the setting of controlling the second program module to enter the waiting state.

[0095] For example, the target program can be Figure 1 When the first program module is circle search 1, the electronic device can use line search 1 as the second program module after completing circle search 1. The electronic device can exit the single-step debugging state corresponding to the single-step debugging after setting the state of line search 1 to the waiting state.

[0096] When the electronic device obtains the trigger information of the single-step debugging button again, the electronic device can use the line circle measurement 1 and the contour matching 1 as the second program module after completing the operation of the straight line search 1. The electronic device can exit the single-step debugging state corresponding to the single-step debugging after setting the state of the line circle measurement 1 and the contour matching 1 to the waiting state.

[0097] When the electronic device obtains the trigger information of the single-step debugging again, the electronic device can complete the line circle measurement 1 and the contour matching 1. If a program module is included after the line circle measurement 1, the program module will be used as the second program module. Figure 1 In the example, the program module is not included after the line circle measurement 1. Therefore, the branch line ends running. And the combination module 1 after the contour matching 1 will be used as the second program module. The combination module 1 is a grouping module, which is obtained by combining multiple program modules.

[0098] The electronic device can exit the single-step debugging state corresponding to the single-step debugging after setting the state of the second program module to the waiting state. Optionally, when the combined module 1 is determined to be the second program module, the page will automatically jump to the following Figure 2 The interface shown. In this combined module 1, the first program module Circle Search 1 is redefined as the second program module.

[0099] In the subsequent single-step debugging, the electronic device will run sequentially according to the single-step debugging instructions. Figure 2 Optionally, in the subsequent single-step debugging process, the number of cycles of the multiple program modules in the combined module 1 will be determined according to the setting information of the combined module 1.

[0100] Therefore, during the single-step debugging process, the actual execution is Figure 2 The circle shown is found in 1. Figure 2 The three program modules shown are the specific components of the combined module 1. During single-step debugging, each time the single-step debugging button is clicked, a program module in the combined module 1 will be run.

[0101] For example, when the combined module 1 has no loop, the combined module 1 will complete execution when the execution of the three program modules is completed. Optionally, when the combined module 1 completes execution, the page can return to Figure 1 The process shown is 1. The process will continue to execute other modules after the combined module 1.

[0102] The software debugging method provided by the present application is that the electronic device can obtain the trigger of the single-step debugging button when the user triggers the single-step debugging button. The electronic device can generate a running signal in response to the trigger information of the single-step debugging button. The electronic device can respond to the running signal to wake up the first program module in the target program that is in the waiting state, so that the first program module exits the waiting state and runs. When the first program module completes the operation, the electronic device can determine the second program module that succeeds the first program module according to the connection relationship of multiple program modules in the target program. The electronic device can set the state of the second program module to the waiting state. The electronic device can exit the single-step debugging state after completing the setting of the processing state of the second program module. In the present application, by using single-step debugging, the sequential execution of the program modules in the target program is realized module by module, which improves the control flexibility during the model execution process.

[0103] In one implementation, when the single-step debugging button is clicked, the steps performed by the electronic device may be as follows: Figure 6 As shown, including:

[0104] S401. Click the single-step debugging button.

[0105] S402, obtaining the number of debugging waiting signals, wherein the number of debugging waiting signals is the first number of the first program modules entering the waiting-to-run state.

[0106] S403, generating a wake-up signal according to the quantity. The wake-up signal may be named as a debugging waiting signal. Each wake-up signal may wake up a first program module in a waiting state.

[0107] S404: The first program module in the waiting state is awakened.

[0108] S405: The first program module runs.

[0109] S406: If the first program module runs normally, the module status is set to "Run OK", otherwise, the module status is set to "Run NG". The module status setting can be achieved by displaying a corresponding icon in the identification area.

[0110] S407: Determine a second program module that is a successor to the first program module according to a connection relationship between multiple program modules in the target program.

[0111] S408: The number of debug signal waiting modules increases. The electronic device may subtract the number of first program modules from the number of debug signal waiting modules and add the number of second program modules to obtain a new number of debug signal waiting modules, that is, a new first number.

[0112] S409: Set the status of the second program module to be ready for execution.

[0113] S410, waiting for a continue operation signal. The continue operation signal is a semaphore. In this step, the continue operation signal will be generated when the single-step debugging button is triggered again.

[0114] Figure 7 The following is a flow chart of a software debugging method provided by an embodiment of the present application. Figure 3 .exist Figures 1 to 6 Based on the embodiment shown, when the debug button is a breakpoint debug button, as shown in Figure 7 As shown, with the electronic device as the execution subject, the method of this embodiment may include the following steps:

[0115] S501: If a breakpoint debugging button is triggered, or the breakpoint debugging state triggered by the breakpoint debugging button has not been exited, a run signal is generated, wherein the breakpoint debugging state is entered when the breakpoint debugging button is triggered.

[0116] The steps shown in this embodiment are the execution process of a program module in the breakpoint debugging process. In this process, the electronic device can determine whether the first program module currently in the waiting state can be run according to the above two situations. Among them, one situation is that when the electronic device determines that the breakpoint debugging button is triggered, the electronic device can generate a run signal. Optionally, when the breakpoint debugging button is triggered, the electronic device can enter the breakpoint debugging state in response to the triggering information of the breakpoint debugging button. Another situation is that when the electronic device determines that the breakpoint debugging state has not been exited, the electronic device can generate a run signal. Since the breakpoint debugging state will exit when there is a breakpoint in the second program module, when the breakpoint debugging state is not exited, it means that the first program module does not include a breakpoint. That is, the electronic device can determine that the current breakpoint debugging has not yet run to the breakpoint. Optionally, the run signal is used to indicate that the first program module in the waiting state is running.

[0117] In one example, during the breakpoint debugging process, the electronic device may determine whether to enter the breakpoint debugging state and whether to exit the breakpoint debugging state in specific steps, including:

[0118] Step 31: When the breakpoint debugging button is triggered, it is determined whether there is a program module with a breakpoint set in the multiple program modules subsequent to the first program module according to the connection relationship between the multiple program modules in the target program.

[0119] In this step, the target program in the process container is obtained, and the sequential traversal starts from the next program module of the first program module. If the electronic device will end the traversal when the program module is set with a breakpoint, the electronic device can return the traversal result with the breakpoint. If the electronic device does not traverse the program module with a breakpoint when completing the traversal, the electronic device can return the traversal result without the breakpoint.

[0120] The first program module is a program module in a waiting state when the breakpoint debugging button is triggered. When the first program module has a breakpoint, the breakpoint debugging program will not be able to run. Therefore, the electronic device will not determine the breakpoint in the first program module when searching for the breakpoint.

[0121] It should be noted that when the first program module has a breakpoint and the first program module is in a loop, if the electronic device traverses to the first program module when traversing according to the target program, the breakpoint in the first program module will be acquired.

[0122] Step 32: If it is determined that the traversal result is that a breakpoint exists, then the breakpoint debugging state is entered. Otherwise, if it is determined that the traversal result is that no breakpoint exists, then the breakpoint debugging state is not entered.

[0123] Optionally, the process only associates a program module that is closest to the first module and has a breakpoint in the program modules.

[0124] S502 . In response to a running signal, wake up a first program module in a waiting state in a target program, so that the first program module exits the waiting state and runs.

[0125] S503: When the first program module finishes running, determine a second program module that is a successor to the first program module according to the connection relationship between multiple program modules in the target program.

[0126] S504: Set the state of the second program module to a waiting state.

[0127] Among them, the implementation of steps S502 to S504 is the same as Figure 2 The implementation of steps S102 to S104 in the embodiment is similar and will not be described in detail in this embodiment.

[0128] S505: If the second program module includes a breakpoint, exit the breakpoint debugging state.

[0129] In this embodiment, the electronic device can determine whether the second program module includes a breakpoint after completing the setting of the waiting state of the second program module. If the breakpoint is included, it means that the breakpoint debugging has been run to the breakpoint, and the breakpoint debugging is finished. Therefore, the electronic device can exit the breakpoint debugging state when it is determined that the second program module includes a breakpoint.

[0130] Optionally, the electronic device may return to step S501 when the second program module does not include a breakpoint. After returning to step S501, the second program module will become the first program module. The electronic device will no longer generate a run signal when it is determined that the breakpoint debugging state has been exited. Optionally, if the second program module does not include a breakpoint, the electronic device will not exit the breakpoint debugging state. After returning to step S501, the electronic device may generate a run signal and continue to sequentially execute program modules without exiting the breakpoint debugging state.

[0131] The software debugging method provided by the present application is that the electronic device can generate a running signal when the breakpoint debugging button is triggered. Alternatively, the electronic device can generate a running signal when it is determined that there is no exit from the breakpoint debugging state generated when the breakpoint debugging button is triggered. The electronic device can respond to the running signal to wake up the first program module in the target program that is in the waiting state, so that the first program module exits the waiting state and runs. When the first program module completes the operation, the electronic device can determine the second program module that is the successor of the first program module according to the connection relationship of multiple program modules in the target program. The electronic device can set the state of the second program module to the waiting state. After completing the setting of the waiting state of the second program module, the electronic device can determine whether the second program module includes a breakpoint. If a breakpoint is included, the electronic device can exit the breakpoint debugging state. In the present application, by using breakpoint debugging, a debugging method in which the target program stops running at a breakpoint is implemented, which improves the control flexibility during the execution of the target program.

[0132] Based on the above embodiments, before the breakpoint debugging button is triggered, the electronic device needs to set a breakpoint on at least one program module of the target program. The breakpoint setting process can be as follows: Figure 8 As shown, the user can right-click on the program module where the breakpoint needs to be set to trigger a menu. The menu includes at least an option to add a breakpoint. When the user clicks the option to add a breakpoint, the electronic device can set a breakpoint on the program module in response to the user's operation. Optionally, the menu may also include an option to delete a breakpoint. The breakpoint delete option can delete the breakpoint set on the program module. Optionally, the menu may also include an option to delete all breakpoints. The option to delete all breakpoints can delete all breakpoints on the target program.

[0133] Optionally, when done as Figure 8 After the breakpoint is set on the program module shown in FIG. 1 , the electronic device can pause the execution of the program when it reaches the breakpoint and display the current processing result. The processing result can be as follows: Fig. 9 The interface may include a display window frame. The display window may display setting parameters of the combined module, as well as output images and output results.

[0134] In one implementation, when the breakpoint debugging button is clicked, the execution steps of the electronic device can be as follows: Fig.10 As shown, including:

[0135] S601. Click the breakpoint debugging button.

[0136] S602, entering the breakpoint debugging state. Optionally, a breakpoint debugging state flag may be set in the electronic device. When the breakpoint debugging state flag is true, it indicates that the electronic device has entered the breakpoint debugging state.

[0137] S603, obtaining the number of debugging waiting signals, wherein the number of debugging waiting signals is the first number of the first program modules entering the waiting-to-run state.

[0138] S604: Generate a wake-up signal according to the quantity. The wake-up signal may be named as a debugging waiting signal. Each wake-up signal may wake up a first program module in a waiting state.

[0139] S605: The first program module in the waiting state is awakened.

[0140] S606: The first program module runs.

[0141] S607: If the first program module runs normally, the module status is set to "run OK", otherwise, the module status is set to "run NG".

[0142] S608: Determine a second program module that is a successor to the first program module according to a connection relationship between multiple program modules in the target program.

[0143] S609: Determine whether the second program module has a breakpoint. If yes, execute S610. If no, use the second program module as the new first program module and return to S606.

[0144] S610, exit the breakpoint debugging state. Optionally, when the breakpoint debugging state mark is false, it indicates that the electronic device exits the breakpoint debugging state. Therefore, the electronic device can exit the breakpoint debugging state by modifying the breakpoint debugging mark to false.

[0145] S611: The number of debug signal waiting modules increases. The electronic device may subtract the number of first program modules from the number of debug signal waiting modules and add the number of second program modules to obtain a new number of debug signal waiting modules, that is, a new first number.

[0146] S612: Set the status of the second program module to be ready for execution.

[0147] S613, waiting for a continue operation signal. The continue operation signal is a semaphore. In this step, the continue operation signal will be generated when the breakpoint debugging button is triggered again.

[0148] Fig.11 The following is a flow chart of a software debugging method provided by an embodiment of the present application. Figure 4 .exist Figures 1 to 10 Based on the embodiment shown, when the debug button is an abnormal debug button, such as Fig.11As shown, with the electronic device as the execution subject, the method of this embodiment may include the following steps:

[0149] S701. If an abnormal debugging button is triggered, or the abnormal debugging state triggered by the abnormal debugging button has not been exited, a running signal is generated; wherein the abnormal debugging state is entered when the abnormal debugging button is triggered.

[0150] The steps shown in this embodiment are the execution process of a program module in the abnormal debugging process. In this process, the electronic device can determine that the first program module currently in the waiting state can be run according to the above two situations. Among them, one situation is that when the abnormal debugging button is triggered, the electronic device can generate a running signal. In another situation, when the abnormal debugging state entered when the abnormal debugging button is triggered has not been exited, the electronic device can determine that the current abnormal debugging has not encountered an abnormality during the operation process, and generate a running signal. The running signal is used to indicate that the first program module currently in the waiting state is running.

[0151] S702 . In response to a running signal, wake up a first program module in a waiting state in a target program, so that the first program module exits the waiting state and runs.

[0152] S703: When the first program module completes execution, determine a second program module that is a successor to the first program module according to a connection relationship between multiple program modules in the target program.

[0153] S704: Set the state of the second program module to a waiting state.

[0154] Among them, the implementation of steps S702 to S704 is the same as Figure 2 The implementation of steps S102 to S104 in the embodiment is similar and will not be described in detail in this embodiment.

[0155] S705: If the operation result of the first program module is abnormal, exit the abnormal debugging state.

[0156] In this embodiment, the electronic device can determine whether the running result of the first program module is abnormal after completing the setting of the waiting state of the second program module. If it is abnormal, it means that an abnormal program module has appeared in the running process of this abnormal debugging, and this abnormal debugging ends. Therefore, the electronic device can exit the abnormal debugging state when determining that the running result of the first program module is abnormal.

[0157] Optionally, the electronic device may return to step S701 when the operation result of the first program module is normal. After returning to step S701, the second program module will become the first program module. The electronic device will generate an operation signal and continue to run the target program based on the situation that the first program module runs normally.

[0158] The software debugging method provided by the present application is that when the abnormal debugging button is triggered, the electronic device can generate a running signal. Alternatively, the electronic device can generate a running signal when the abnormal interrupt signal triggered by the abnormal debugging button has not exited. The electronic device can respond to the running signal to wake up the first program module in the target program that is in a waiting state, so that the first program module exits the waiting state and runs. When the first program module completes the operation, the electronic device can determine the second program module that succeeds the first program module according to the connection relationship of multiple program modules in the target program. The electronic device can set the state of the second program module to the waiting state. After completing the setting of the waiting state of the second program module, the electronic device can determine whether the running result of the first program module is an abnormal operation. If it is an abnormal operation, then the abnormal debugging result. In the present application, by using abnormal debugging, a debugging method in which the target program stops running at an abnormal location is implemented, which improves the control flexibility during the execution of the target program.

[0159] In one implementation, when the abnormal debugging button is clicked, the execution steps of the electronic device can be as follows: Fig.12 As shown, including:

[0160] S801, click the NG debugging button. Optionally, the NG debugging button can be an exception debugging button. Optionally, the NG can be used to refer to an exception during program execution.

[0161] S802, entering an abnormal debugging state. Optionally, an abnormal debugging state flag may be set in the electronic device. When the abnormal debugging state flag is true, it indicates that the electronic device enters an abnormal debugging state. When the abnormal debugging state flag is false, it indicates that the electronic device exits the abnormal debugging state.

[0162] S803, obtaining the number of debugging waiting signals, wherein the number of debugging waiting signals is the first number of the first program modules entering the waiting-to-run state.

[0163] S804, generating a wake-up signal according to the quantity. The wake-up signal may be named as a debugging waiting signal. Each wake-up signal may wake up a first program module in a waiting state.

[0164] S805: The first program module in the waiting state is awakened.

[0165] S806: First program module runs

[0166] S807: Determine whether the operation result of the first program module is abnormal. If yes, go to S808. If no, go to S813.

[0167] S808: Set the state of the first program module to NG for operation, which means that the operation is abnormal.

[0168] S809, exit the abnormal debugging state. Optionally, when the abnormal debugging state is marked as false, it indicates that the electronic device exits the abnormal debugging state. When the electronic device determines that the first program module is NG, it can modify the mark of the abnormal debugging state to false to exit the abnormal debugging state. Optionally, the exit of the abnormal debugging state can precede the operation of setting the second program module to the waiting state.

[0169] S810: The number of debug signal waiting modules increases. The electronic device may subtract the number of first program modules from the number of debug signal waiting modules and add the number of second program modules to obtain a new number of debug signal waiting modules, that is, a new first number.

[0170] S811. Set the status of a second program module that is a successor to the first program module to be ready for execution.

[0171] S812, wait for a continue operation signal. The continue operation signal is a semaphore. In this step, the continue operation signal will be generated when the breakpoint debugging button is triggered again.

[0172] S813: Set the status of the first program module to "run OK", which means the module is running normally.

[0173] S814: Determine a second program module that is a successor to the first program module according to a connection relationship between multiple program modules in the target program.

[0174] Fig.13 The following is a flow chart of a software debugging method provided by an embodiment of the present application. Figure 5 .exist Figures 1 to 12 Based on the embodiment shown in FIG. 1 , when the debugging button is a stop debugging button, as shown in FIG. Fig.13 As shown, with the electronic device as the execution subject, the method of this embodiment may include the following steps:

[0175] S901: If there is a first program module in a waiting state, generate a running signal.

[0176] In this embodiment, when the stop debugging button is triggered, the electronic device can obtain the trigger information of the stop debugging button. The electronic device can exit the debugging state according to the trigger information. After the electronic device exits the debugging state, the single-step debugging, breakpoint debugging, and exception debugging buttons will not be triggered. When the electronic device determines that there is a first program module in the waiting state, it will generate a running signal so that the first program module can continue to run.

[0177] Optionally, the Stop Debugging button will appear after the Start Debugging button is triggered.

[0178] In one example, after the stop debugging button is triggered, the electronic device also needs to perform the following operations:

[0179] Step 41: If the program is in single-step debugging state, exit the single-step debugging state.

[0180] Step 42: If the system is in a breakpoint debugging state, exit the breakpoint debugging state.

[0181] In this step, the electronic device may set the mark of the breakpoint debugging state to false, so that the electronic device exits the breakpoint debugging state.

[0182] Step 43: If the system is in an abnormal debugging state, exit the abnormal debugging state.

[0183] In this step, the electronic device can set the mark of the abnormal debugging state to false, so that the electronic device exits the abnormal debugging state. After exiting the abnormal debugging state, when the target program runs with NG, it will no longer be interrupted.

[0184] Step 43: Exit the debugging state.

[0185] In this step, when the electronic device exits the debugging state, the single-step debugging, breakpoint debugging, and exception debugging buttons will not be triggered. In addition, the stop debugging button will be changed back to the start debugging button.

[0186] S902 . In response to a running signal, wake up a first program module in a waiting state in the target program, so that the first program module exits the waiting state and runs.

[0187] S903: When the first program module finishes running, determine a second program module that is a successor to the first program module according to the connection relationship between multiple program modules in the target program.

[0188] S904: Set the state of the second program module to a waiting state.

[0189] Among them, the implementation of steps S902 to S904 is the same as Figure 2The implementation of steps S102 to S104 in the embodiment is similar, and will not be described in detail in this embodiment. Optionally, after the state setting of the second program module is completed, the electronic device may return to step S901.

[0190] The software debugging method provided by the present application can enable the electronic device to exit the debugging state when the stop debugging button is triggered. If there is a first program module in a waiting state, a run signal is generated. The electronic device can respond to the run signal to wake up the first program module in the target program that is in a waiting state, so that the first program module exits the waiting state and runs. When the first program module completes running, the electronic device can determine the second program module that succeeds the first program module based on the connection relationship of multiple program modules in the target program. The electronic device can set the state of the second program module to the waiting state. In the present application, by using stop debugging, the setting of ending the debugging process at any time is realized.

[0191] In one implementation, when the stop debugging button is clicked, the execution steps of the electronic device can be as follows: Fig.14 As shown, including:

[0192] S911, click the stop debugging button. Optionally, the stop debugging button may be changed to the stop debugging button after the start debugging button is triggered.

[0193] S912, exit debugging state, exit breakpoint debugging state, exit exception debugging state.

[0194] S913, generating a wake-up signal according to the number of program modules in the waiting state. The wake-up signal can be named as a debugging waiting signal. Each wake-up signal can wake up a first program module in the waiting state.

[0195] S914, the first program module in the waiting state is awakened and runs S917, the first program module runs.

[0196] S915: Determine whether the second program module exists according to the connection relationship. If yes, execute S916. If no, terminate the operation of the target program.

[0197] S916, setting the running state of the second program module to the waiting state, and returning to S915.

[0198] Fig.15 A schematic diagram of the structure of a software debugging device provided by an embodiment of the present application is shown. Fig.15 As shown, the software debugging device 10 of this embodiment is used to implement the operation corresponding to the electronic device in any of the above method embodiments, wherein the target program includes a plurality of program modules connected in sequence, and the software debugging device 10 of this embodiment includes:

[0199] The generating module 11 is used to generate an operation signal when the debugging operation conditions are met;

[0200] The debugging module 12 is used to respond to the running signal to wake up the first program module in the target program that is in the waiting state, so that the first program module exits the waiting state and runs; when the first program module completes the operation, the second program module that succeeds the first program module is determined according to the connection relationship between multiple program modules in the target program; and the state of the second program module is set to the waiting state.

[0201] Optionally, the debugging module 12 is used to:

[0202] Counting a first number of first program modules in a waiting-to-run state;

[0203] In response to the run signal, generating a first number of wake-up signals;

[0204] Using a wake-up signal, waking up the first program module so that the first program module exits the waiting state;

[0205] Run the first program module.

[0206] Optionally, debug operating conditions, including:

[0207] The debug button is triggered, or the debug button triggering state is not exited.

[0208] Optionally, when the debugging button is a single-step debugging button, the generating module 11 is used to:

[0209] If the single-step debugging button is triggered, a run signal is generated.

[0210] Optionally, after setting the state of the second program module to a waiting state, the debugging module 12 is used to:

[0211] The single-step debugging state entered when the exit single-step debugging button is triggered.

[0212] Optionally, when the debugging button is a breakpoint debugging button, the generating module 11 is used to:

[0213] If the breakpoint debugging button is triggered, or the breakpoint debugging state triggered by the breakpoint debugging button is not exited, a run signal is generated;

[0214] Among them, the breakpoint debugging state is entered when the breakpoint debugging button is triggered.

[0215] Optionally, after setting the state of the second program module to a waiting state, the debugging module 12 is used to:

[0216] If the second program module includes a breakpoint, exit the breakpoint debugging state.

[0217] Optionally, before the breakpoint debugging button is triggered, the debugging module 12 is used to:

[0218] A breakpoint is set on at least one program module of the target program.

[0219] Optionally, when the debugging button is an abnormal debugging button, the generating module 11 is used to:

[0220] If the abnormal debugging button is triggered, or the abnormal debugging state triggered by the abnormal debugging button is not exited, a running signal is generated;

[0221] Among them, the abnormal debugging state is entered when the abnormal debugging button is triggered.

[0222] Optionally, after setting the state of the second program module to a waiting state, the debugging module 12 is used to:

[0223] If the operation result of the first program module is abnormal, the abnormal interrupt state is exited.

[0224] Optionally, when the stop debugging button is triggered, the generating module 11 is used to:

[0225] If there is a first program module in a state to be executed, an execution signal is generated.

[0226] Optionally, the debugging module 12:

[0227] If it is in single-step debugging state, exit the single-step debugging state;

[0228] If in breakpoint debugging state, exit the breakpoint debugging state;

[0229] If it is in abnormal debugging state, exit the abnormal debugging state;

[0230] Exit debugging state.

[0231] Optionally, a Stop Debugging button is displayed after the Start Debugging button is triggered.

[0232] Optionally, the debugging module 12 is used to:

[0233] If the Start Debugging button is triggered, the system will enter the debugging state.

[0234] Optionally, the debugging module 12 is used to:

[0235] Obtaining an operation result of the first program module, where the operation result includes normal operation or abnormal operation;

[0236] When the running result of the first program module is abnormal, the first program module is marked with a first icon; when the running result of the first program module is normal, the first program module is marked with a second icon.

[0237] Optionally, the debugging module 12 is used to:

[0238] When the first program module is executed, the first program module is labeled with a third illustration.

[0239] The software debugging device 10 provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principle and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.

[0240] Fig.16 FIG. 1 shows a hardware structure diagram of an electronic device provided in an embodiment of the present application. Fig.16 As shown, the electronic device 20 is used to implement the operations corresponding to the electronic device in any of the above method embodiments. The electronic device 20 of this embodiment may include: a memory 21, a processor 22 and a display 24.

[0241] The memory 21 is used to store computer programs. The memory 21 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a disk, or an optical disk.

[0242] The processor 22 is used to execute the computer program stored in the memory to implement the software debugging method in the above embodiment. For details, please refer to the relevant description in the above method embodiment. The processor 22 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0243] Optionally, the memory 21 may be independent or integrated with the processor 22 .

[0244] When the memory 21 is a device independent of the processor 22, the electronic device 20 may further include a bus 23. The bus 23 is used to connect the memory 21 and the processor 22. The bus 23 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0245] The display 24 may be connected to the processor 21 via the bus 23. The processor 22 may display the target software and the debugging button via the display 24, and the processor 22 may also obtain trigger information generated when the user operates the display 24.

[0246] The electronic device provided in this embodiment can be used to execute the above-mentioned software debugging method, and its implementation method and technical effect are similar, which will not be described in detail in this embodiment.

[0247] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the methods provided in the various embodiments described above.

[0248] Among them, the computer-readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, a computer-readable storage medium is coupled to a processor so that the processor can read information from the computer-readable storage medium and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can be located in an application-specific integrated circuit (ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the computer-readable storage medium can also exist in a communication device as discrete components.

[0249] Specifically, the computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium may be any available medium that can be accessed by a general or special-purpose computer.

[0250] The present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of a device can read the computer program from the computer-readable storage medium, and at least one processor executes the computer program so that the device implements the methods provided in the various embodiments described above.

[0251] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0252] Among them, each module can be physically separated, for example, installed in different locations of a device, or installed on different devices, or distributed on multiple network units, or distributed on multiple processors. Each module can also be integrated together, for example, installed in the same device, or integrated in a set of codes. Each module can exist in the form of hardware, or can also exist in the form of software, or can also be implemented in the form of software plus hardware. The present application can select some or all of the modules according to actual needs to achieve the purpose of the present embodiment.

[0253] When each module is implemented as an integrated module in the form of a software function module, it can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of each embodiment of the present application.

[0254] It should be understood that, although the various steps in the flowcharts in the above-described embodiments are sequentially displayed according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily to be carried out sequentially, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0255] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the above embodiments can still be modified, or some or all of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A software debugging method, characterized in that: Applied to debugging a target program, the target program includes a plurality of program modules connected in sequence, the method comprising: If the debugging operation conditions are met, a running signal is generated; In response to the running signal, waking up a first program module in the target program that is in a waiting state, so that the first program module exits the waiting state and runs; When the first program module completes execution, determining a second program module that is a successor to the first program module according to a connection relationship between a plurality of the program modules in the target program; The state of the second program module is set to a waiting state.

2. The method according to claim 1, characterized in that The step of waking up a first program module in the target program that is in a waiting state in response to the running signal, so that the first program module exits the waiting state and runs, specifically includes: Counting a first number of first program modules in a waiting-to-run state; In response to the run signal, generating the first number of wake-up signals; Using the wake-up signal, waking up the first program module, so that the first program module exits the waiting state; Run the first program module.

3. The method according to claim 1, characterized in that The debugging operation conditions include: The debug button is triggered, or the debug button triggering state is not exited.

4. The method according to any one of claims 1 to 3, characterized in that When the debug button is a single-step debug button, if the debug run conditions are met, a run signal is generated, including: If the single-step debugging button is triggered, the run signal is generated.

5. The method according to claim 4, characterized in that After setting the state of the second program module to a waiting state, the method further includes: Exit the single-step debugging state entered when the single-step debugging button is triggered.

6. The method according to any one of claims 1 to 3, characterized in that When the debug button is a breakpoint debug button, if the debug run conditions are met, a run signal is generated, including: If the breakpoint debugging button is triggered, or the breakpoint debugging state triggered by the breakpoint debugging button is not exited, the running signal is generated; The breakpoint debugging state is entered when the breakpoint debugging button is triggered.

7. The method according to claim 6, characterized in that After setting the state of the second program module to a waiting state, the method further includes: If the second program module includes a breakpoint, exit the breakpoint debugging state.

8. The method according to claim 6, characterized in that Before the breakpoint debugging button is triggered, the method further includes: A breakpoint is set on at least one program module of the target program.

9. The method according to any one of claims 1 to 3, characterized in that: When the debug button is an abnormal debug button, if the debug run conditions are met, a run signal is generated, including: If the abnormal debugging button is triggered, or the abnormal debugging state triggered by the abnormal debugging button is not exited, the running signal is generated; The abnormal debugging state is entered when the abnormal debugging button is triggered.

10. The method according to claim 9, characterized in that After setting the state of the second program module to a waiting state, the method further includes: If the operation result of the first program module is abnormal, then exit the abnormal interrupt state.

11. The method according to any one of claims 1 to 3, characterized in that: When the stop debugging button is triggered, the method includes: If there is a first program module in a state to be executed, an execution signal is generated.

12. The method according to claim 11, characterized in that The method further comprises: If it is in single-step debugging state, exit the single-step debugging state; If in breakpoint debugging state, exit the breakpoint debugging state; If it is in abnormal debugging state, exit the abnormal debugging state; Exit debugging state.

13. The method according to claim 11, characterized in that The stop debugging button is displayed after the start debugging button is triggered.

14. The method according to any one of claims 1 to 3, characterized in that The method further comprises: If the Start Debugging button is triggered, the system will enter the debugging state.

15. The method according to any one of claims 1 to 3, characterized in that: When the first program module completes execution, the method further includes: Obtaining an operation result of the first program module, wherein the operation result includes normal operation or abnormal operation; When the running result of the first program module is abnormal, the first program module is marked with a first icon; when the running result of the first program module is normal, the first program module is marked with a second icon.

16. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When the first program module is running, the first program module is labeled with a third diagram.

17. A software debugging device, characterized in that: The device comprises: A generating module, used for generating a running signal if the debugging running conditions are met; A debugging module is used to respond to the running signal to wake up the first program module in the target program that is in a waiting state, so that the first program module exits the waiting state and runs; when the first program module completes running, determine the second program module that succeeds the first program module according to the connection relationship between multiple program modules in the target program; and set the state of the second program module to the waiting state.

18. An electronic device, characterized in that: The electronic device comprises: a memory and a processor; The memory is used to store a computer program; the processor is used to implement the method according to any one of claims 1 to 16 according to the computer program stored in the memory.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 16.

20. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 16 is implemented.

Citation Information

Patent Citations

  • Method and device for debugging applet, electronic equipment and storage medium

    CN112214416A

  • Debugging method and device of visual inspection scheme, equipment and storage medium

    CN117951032A

  • Method and device for performing single-step operation on virtual machine by using Hypervisor, medium and product

    CN118939565A

  • System, method and article of manufacture for a debugger capable of operating across multiple threads and lock domains

    US20020199173A1

  • User-Specific Software Debugging

    US20120317552A1