Program code debugging method and device, equipment and storage medium
By adding stop breakpoint identifiers to the program code and adjusting the debug start point according to the debugging information, the problem of low code debugging efficiency in the existing technology is solved, and an efficient code debugging process is achieved.
Patent Information
- Application Number
- CN202410010056.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, program code debugging is inefficient because the modified code starts from scratch every time it runs, resulting in repeated read and write operations and reducing debugging efficiency.
The stop breakpoint identifier is pre-added to the program code, and the debugging information is output through debugging mode. The developer judges whether it meets expectations based on the debugging information, and marks the stop breakpoint identifier as the starting breakpoint identifier, and continues to debug from the starting breakpoint position to avoid repeated running of unmodified code.
Improves the efficiency of code debugging, avoids repeated runs of unmodified parts of the code, and saves debugging resources.
Smart Images

Figure CN120276962A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a program code debugging method, device, equipment and storage medium. Background Art
[0002] With the development of computer technology, the complexity of software code has been continuously increasing. Developers need to debug the code to test its stability and find problems in the code.
[0003] In the prior art, the code program is debugged and run sequentially, and a debugging result is generated after the run ends. Developers modify the code according to the debugging result, and the modified code runs again from the beginning to generate a new debugging result.
[0004] However, in the prior art, the modified code program needs to run the code from the starting node every time it runs, resulting in repeated read and write operations of the code, which reduces the debugging efficiency. Summary of the Invention
[0005] This application provides a program code debugging method, device, equipment and storage medium to solve the problem of low debugging efficiency existing in the prior art.
[0006] In a first aspect, this application provides a program code debugging method applied to a computer device, including:
[0007] Obtain the program code to be debugged, where the program code contains pre-added stop breakpoint identifiers;
[0008] In response to the operation of the developer to start debugging, start the debugging process of the program code through the code debugging mode;
[0009] During the debugging process, when debugging reaches the position of each stop breakpoint identifier, pause the debugging process and output the corresponding debugging information, where the debugging information is used for the developer to determine whether the debugging meets the expectations;
[0010] In response to the operation of the developer to re-debug, mark the current stop breakpoint identifier as the starting breakpoint identifier, where the re-debug operation is triggered by the developer when the debugging information does not meet the expectations;
[0011] Continue the debugging process of the program code from the position of the marked starting breakpoint identifier to the position of the next stop breakpoint identifier.
[0012] In a possible design, after outputting the corresponding debug information, it further includes: in response to an operation by a developer to modify the program code, obtaining the modified program code; in response to an operation by the developer to re-debug the modified program code, marking the current stop breakpoint identifier as the start breakpoint identifier; and resuming the debugging process for the modified program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier.
[0013] In a possible design, after resuming the debugging process for the program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier, it further includes: outputting the debug information corresponding to the modified program code and highlighting the debug information.
[0014] In a possible design, before obtaining the program code to be debugged, it further includes: in response to an operation by a developer to configure the program code, dividing the program code into multiple configuration processes; and adding stop breakpoint identifiers at the corresponding positions of each configuration process in the program code.
[0015] In a possible design, after resuming the debugging process for the program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier, it further includes: outputting the corresponding debug information; in response to an operation by the developer to remove all stop breakpoint identifiers, removing all stop breakpoint identifiers to obtain the program code without breakpoints, where the removal operation is triggered by the developer when the debug information meets the expectations; and starting the debugging process for the program code without breakpoints in the code debugging mode and outputting the debug information.
[0016] In a second aspect, the present application provides a program code debugging device applied to a computer device, including:
[0017] An acquisition module, configured to acquire the program code to be debugged, where stop breakpoint identifiers are pre-added in the program code;
[0018] A start module, configured to start the debugging process for the program code in the code debugging mode in response to an operation by a developer to start debugging;
[0019] A first output module, configured to pause the debugging process when debugging reaches the position of each stop breakpoint identifier during the debugging process and output the corresponding debug information, where the debug information is used for the developer to determine whether the debugging meets the expectations;
[0020] A first marking module, configured to mark the current stop breakpoint identifier as a start breakpoint identifier in response to an operation of a developer for re-debugging, where the re-debugging operation is triggered by the developer when the debugging information does not meet expectations;
[0021] A first debugging module, configured to continue the debugging process of the program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier.
[0022] In a possible design, the apparatus further includes: a generation module, configured to obtain the modified program code in response to an operation of the developer for modifying the program code; a second marking module, configured to mark the current stop breakpoint identifier as a start breakpoint identifier in response to an operation of the developer for re-debugging the modified program code; and a second debugging module, configured to continue the debugging process of the modified program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier.
[0023] In a possible design, the apparatus further includes: a second output module, configured to output the debugging information corresponding to the modified program code and highlight the debugging information.
[0024] In a third aspect, the present application provides a computer device, including:
[0025] At least one processor and a memory;
[0026] The memory stores computer-executable instructions;
[0027] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the program code debugging method as described in the first aspect and various possible designs of the first aspect above.
[0028] In a fourth aspect, the present application provides a computer storage medium, where computer-executable instructions are stored in the computer storage medium, and when a processor executes the computer-executable instructions, the program code debugging method as described in the first aspect and various possible designs of the first aspect above is implemented.
[0029] The program code debugging method, device, equipment, and storage medium provided by this application enable developers to pre-add stop breakpoint identifiers and output debugging information for each stop breakpoint identifier. Developers can determine whether it meets the expectations based on the output debugging information to re-debug the code. When the computer receives the operation of re-debugging by the developer, it changes the stop breakpoint identifier to a start breakpoint identifier and continues to debug the code from the position of the start breakpoint identifier to the position of the next stop breakpoint identifier. Compared with the prior art, it avoids the situation of occupying code debugging resources caused by repeatedly running the unmodified part of the code and improves the debugging efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0031] Figure 1 Schematic diagram of the system structure of the computer equipment provided by the embodiment of this application;
[0032] Figure 2 Schematic diagram of the flow of the program code debugging method provided by an embodiment of this application;
[0033] Figure 3 Schematic diagram of the output debugging information provided by the embodiment of this application;
[0034] Figure 4 Schematic diagram of the output debugging information after adding the start breakpoint provided by the embodiment of this application;
[0035] Figure 5 Schematic diagram of the structure of the program code debugging device provided by the embodiment of this application;
[0036] Figure 6 Schematic diagram of the hardware structure of the computer equipment provided by the embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0037] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of this application belong to the scope of protection of this application.
[0038] With the development of computer technology, the complexity of software code has been continuously increasing. Developers need to debug the code, test the stability of the code, and find problems in the code. In the prior art, the code program is debugged and run sequentially, and a debugging result is generated after the run ends. The developer modifies the code according to the debugging result, and the modified code runs again from the beginning to generate a new debugging result. However, in the prior art, each time the modified code program runs, it has to run the code from the starting node, resulting in repeated read and write operations of the code, which reduces the debugging efficiency.
[0039] To solve the above technical problems, the embodiments of the present application propose the following technical concept: The inventor considered adding a stop breakpoint identifier to the program code, using the stop breakpoint identifier to control the debugging process and output debugging information. When the developer reviews the debugging information and initiates an operation to re-debug, the inventor thought of marking the stop breakpoint identifier as a starting breakpoint identifier and debugging the code from the position of the starting breakpoint identifier. Compared with the prior art, it avoids debugging the code from the beginning and improves the debugging efficiency. The following will be described in detail with specific embodiments.
[0040] Figure 1 It is a schematic diagram of the system structure of the computer device provided by the embodiments of the present application. As Figure 1 shown, the computer device includes: a receiving device 101, a processor 102, and a display device 103.
[0041] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the article recognition method. In other feasible embodiments of the present application, the above architecture may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange different components, which can be specifically determined according to the actual application scenario and will not be limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0042] In the specific implementation process, the receiving device 101 can be an input / output interface or a communication interface, and can obtain the program code to be debugged.
[0043] The processor 102 can output debugging information and mark the stop breakpoint identifier as a starting breakpoint identifier in response to the developer's operation to re-debug.
[0044] The display device 103 can be used to display the above debugging information, etc.
[0045] The display device can also be a touch display screen, which is used to receive user instructions while displaying the above content to realize operation interaction with the user.
[0046] It should be understood that the above-mentioned processor can be implemented by a processor reading instructions in a memory and executing the instructions, or can be implemented by chip circuits.
[0047] In addition, the network architecture and service scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those of ordinary skill in the art can know that with the evolution of the network architecture and the emergence of new service scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0048] Embodiment 1
[0049] Figure 2 It is a schematic flowchart of a program code debugging method provided by an embodiment of the present application. The execution subject of this embodiment can be a computer device, and no special limitation is made here. As Figure 2 shown, the method includes:
[0050] S201: Obtain the program code to be debugged, where the program code contains pre-added stop breakpoint identifiers.
[0051] In this embodiment, the function of the program code is verified using the debug mode Debug.
[0052] In this embodiment, the developer divides the data processing flow of the code into multiple parts according to the function of the code segment.
[0053] Exemplarily, a complete piece of code is divided into a data acquisition code segment, a conversion field code segment, an algorithm processing field code segment, etc. according to the functions of different code segments.
[0054] In this embodiment, each code segment contains a stop breakpoint identifier.
[0055] In this embodiment, when the program runs to the stop breakpoint identifier, the program no longer runs backward until it receives an instruction from the developer to execute backward.
[0056] S202: In response to the developer's operation of starting debugging, start the debugging process of the program code through the code debugging mode.
[0057] Specifically, the developer issues an instruction to start debugging, and transfers the debugging instruction flow to the code segment of the program code.
[0058] S203: In the debugging process, when debugging reaches the position of each stop breakpoint identifier, pause the debugging process and output the corresponding debugging information, where the debugging information is used for the developer to determine whether the debugging meets the expectations.
[0059] Figure 3Schematic diagram of outputting debug information provided by an embodiment of the present application.
[0060] In this embodiment, when the debug instruction flows to the stop breakpoint identifier, the code segment corresponding to the stop breakpoint identifier runs the debug instruction to generate debug information.
[0061] In this embodiment, the forms of debug information include but are not limited to debug processing tables, debug documents, debug logs, etc.
[0062] Among them, the debug information records the debug results of the current code segment.
[0063] Exemplarily, if the current code segment is a data acquisition code segment, parameters such as the quality, quantity, and speed of data acquisition will be recorded in the debug information.
[0064] S204: In response to the operation of the developer to re-debug, mark the current stop breakpoint identifier as the start breakpoint identifier, where the re-debug operation is triggered by the developer when the debug information does not meet the expectations.
[0065] In this embodiment, if the code segment is marked as the start breakpoint, the program is allowed to skip the previous stop breakpoint identifier and run the program from the start breakpoint identifier.
[0066] S205: Continue the debugging process of the program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier.
[0067] Figure 4 Schematic diagram of outputting debug information after adding the start breakpoint provided by an embodiment of the present application.
[0068] Specifically, start running the debugging process from the start breakpoint identifier to the position of the next stop breakpoint identifier corresponding to the start breakpoint identifier, and output the new debug information corresponding to the modified program code.
[0069] As can be seen from the above embodiments, by the developer pre-adding stop breakpoint identifiers and outputting debug information for each stop breakpoint identifier, the developer determines whether it meets the expectations based on the output debug information to re-debug the code. When the computer receives the operation of the developer to re-debug, it changes the stop breakpoint identifier to the start breakpoint identifier, and continues to debug the code from the position of the start breakpoint identifier to the position of the next stop breakpoint identifier. Compared with the prior art, it avoids the situation of occupying code debugging resources caused by repeatedly running the unmodified part of the code and improves the debugging efficiency.
[0070] Embodiment 2
[0071] In an embodiment of the present application, after step S205, it further includes the process of modifying the program code and re-debugging, which is described in detail as follows:
[0072] S301: In response to the operation of the developer to modify the program code, obtain the modified program code.
[0073] In this embodiment, if the debugging information output by the code segment does not meet the expectation, the developer makes a modification operation for this code segment.
[0074] S302: In response to the operation of the developer to re-debug the modified program code, mark the current stop breakpoint identifier as the start breakpoint identifier.
[0075] In this embodiment, if the developer modifies multiple program codes, replace all the stop breakpoint identifiers corresponding to the modified program codes with start breakpoint identifiers.
[0076] S303: Continue the debugging process for the modified program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier.
[0077] In this embodiment, if there is an unmodified code segment before the position of the start breakpoint identifier, skip the unmodified code segment and continue the debugging process from the position of the start breakpoint identifier.
[0078] In this embodiment, if the developer modifies multiple code segments, take the start breakpoint identifier corresponding to the first code segment as the start position of code execution and the start breakpoint identifier corresponding to the last code segment as the end position of code execution according to the sequence of the code segments, and debug the modified code.
[0079] As can be seen from the above embodiments, by changing the stop breakpoint identifier corresponding to the modified program code to the start breakpoint identifier and executing the debugging process from the position of the start breakpoint identifier, the unmodified program code is skipped, avoiding the repeated execution of the unmodified program code and improving the running efficiency.
[0080] Embodiment Three
[0081] In an embodiment of this application, after step S208, the process of highlighting the debugging information is further included, which is described in detail as follows:
[0082] S304: Output the debugging information corresponding to the modified program code and highlight the debugging information.
[0083] In this embodiment, the method of highlighting the debugging information is to set the background color of the text of the debugging information to a color different from the text font.
[0084] As can be seen from the above embodiments, by highlighting the debugging information output by the modified program code, it is convenient for developers to distinguish the debugging information output by the code at the modified location from the debugging information output by the code at the unmodified location, avoiding confusion of the debugging information by developers.
[0085] Embodiment Four
[0086] In an embodiment of the present application, before step S201, a process of configuring stop breakpoint identifiers is further included, which is described in detail as follows:
[0087] S401: In response to a configuration operation of a developer on the program code, divide the program code into multiple configuration processes.
[0088] In this embodiment, the developer divides the data processing flow of the code into multiple configuration processes according to the function of each code segment in the program code.
[0089] Exemplarily, a complete program code is divided into a data acquisition code segment, a conversion field code segment, an algorithm processing field code segment, etc. according to the functions of different code segments.
[0090] S402: Add stop breakpoint identifiers according to the corresponding positions of each configuration process in the program code.
[0091] In this embodiment, use the debug statement to add stop breakpoint identifiers at the end of the code text of each code segment.
[0092] As can be seen from the above embodiments, the developer divides the program code into multiple configuration processes according to the function of each part of the program code, adds stop breakpoint identifiers for each configuration process, and uses the stop breakpoint identifiers to output debugging information, avoiding directly outputting a debugging information, which causes the developer to be unable to accurately locate the part of the code where an error occurs, and improving the readability of the code.
[0093] Embodiment Five
[0094] In an embodiment of the present application, after step S205, a process of removing all breakpoints and continuing the debugging process is further included, which is described in detail as follows:
[0095] S206: Output the corresponding debugging information.
[0096] In this embodiment, the output debugging information is the debugging information output by the corresponding code segment from the position of the start breakpoint identifier to the position of the next stop breakpoint identifier.
[0097] S207: In response to a removal operation of a developer on all stop breakpoint identifiers, remove all stop breakpoint identifiers to obtain program code without breakpoints, where the removal operation is triggered by the developer when the debugging information meets the expectation.
[0098] In this embodiment, if the output debugging information meets the expectation, the developer removes all the stop breakpoint identifiers in the program code and tests the complete functions of the program code from the beginning.
[0099] S208: Start the debugging process of the program code without breakpoints through the code debugging mode and output the debugging information.
[0100] In this embodiment, the output debugging information is the debugging information of the complete program code.
[0101] Among them, the debugging results of the entire program code are recorded in the debugging information.
[0102] Specifically, if the final output debugging information meets the expectation, the program code is saved as the development configuration.
[0103] As can be seen from the above embodiment, by outputting the debugging information of the modified code, removing the stop breakpoints when the debugging information meets the expectation, running the complete program code again, outputting the debugging information, and saving the program code as the development configuration, it is convenient to call the program code subsequently.
[0104] Embodiment Six
[0105] Figure 5 This is a schematic structural diagram of the program code debugging device provided by the embodiment of the present application. As Figure 5 shown, the program code debugging device 50 includes: an acquisition module 501, a start module 502, a first output module 503, a first marking module 504, and a first debugging module 505.
[0106] The acquisition module 501 is used to acquire the program code to be debugged, where the program code contains pre-added stop breakpoint identifiers.
[0107] The start module 502 is used to respond to the developer's operation of starting debugging and start the debugging process of the program code through the code debugging mode.
[0108] The first output module 503 is used to pause the debugging process when debugging reaches the position of each stop breakpoint identifier during the debugging process and output the corresponding debugging information, where the debugging information is used for the developer to determine whether the debugging meets the expectation.
[0109] The first marking module 504 is used to mark the current stop breakpoint identifier as the starting breakpoint identifier in response to the developer's re-debugging operation, where the re-debugging operation is triggered by the developer when the debugging information does not meet the expectation.
[0110] The first debugging module 505 is used to continue the debugging process of the program code from the position marked by the starting breakpoint identifier to the position marked by the next stopping breakpoint identifier.
[0111] In an embodiment of the present application, the device 50 further includes:
[0112] A generation module 506, configured to obtain the modified program code in response to an operation by a developer to modify the program code.
[0113] A second marking module 507, configured to mark the current stopping breakpoint identifier as the starting breakpoint identifier in response to an operation by a developer to re-debug the modified program code.
[0114] A second debugging module 508, configured to continue the debugging process of the modified program code from the position marked by the starting breakpoint identifier to the position marked by the next stopping breakpoint identifier.
[0115] In an embodiment of the present application, the device 50 further includes:
[0116] A second output module 509, configured to output the debugging information corresponding to the modified program code and highlight the debugging information.
[0117] In an embodiment of the present application, the device 50 further includes:
[0118] A partitioning module 510, configured to partition the program code into multiple configuration processes in response to a configuration operation by a developer for the program code.
[0119] An adding module 511, configured to add stopping breakpoint identifiers at corresponding positions of the program code according to each configuration process.
[0120] In an embodiment of the present application, the device 50 further includes:
[0121] A third output module 512, configured to output the corresponding debugging information.
[0122] A removing module 513, configured to remove all the stopping breakpoint identifiers to obtain the program code without breakpoints in response to an operation by a developer to remove all the stopping breakpoint identifiers, where the removing operation is triggered by the developer when the debugging information meets the expectations.
[0123] A fourth output module 514, configured to start the debugging process of the program code without breakpoints in the code debugging mode and output the debugging information.
[0124] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments, and its implementation principles and technical effects are similar, which will not be elaborated here in this embodiment.
[0125] Embodiment VII
[0126] Figure 6 This is a schematic diagram of the hardware structure of the computer device provided by the embodiments of the present application. As Figure 6 shown, the computer device includes: at least one processor 601 and a memory 602; the memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that at least one processor executes the program code debugging method as described above.
[0127] Optionally, the memory 602 can be either independent or integrated with the processor 601.
[0128] When the memory 602 is independently provided, the computer device further includes a bus 603 for connecting the memory 602 and the processor 601.
[0129] Embodiment VIII
[0130] The embodiments of the present application further provide a computer storage medium, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the program code debugging method as described above is implemented.
[0131] Embodiment IX
[0132] The embodiments of the present application further provide a computer program product, including a computer program. When the computer program is executed by the processor, the program code debugging method as described above is implemented.
[0133] In several embodiments provided by 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 merely illustrative. For example, the above module division is only a logical function division. In actual implementation, there can be other division methods. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be in an electrical, mechanical or other form.
[0134] The modules described above as separate components may or may not be physically separated. The components shown as modules may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to implement the solution of this embodiment.
[0135] In addition, in each embodiment of the present application, the functional modules can be integrated into a processing unit, or each module can exist physically alone, or two or more modules can be integrated into one unit. The unit formed by the above modules can be implemented in the form of hardware, or in the form of a hardware plus software functional unit.
[0136] The integrated module implemented in the form of a software functional module can be stored in a computer-readable storage medium. Stored in a storage medium, the above software functional module includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute some steps of the methods in the various embodiments of the present application.
[0137] It should be understood that the above processor can be a Central Processing Unit (CPU for short), or other general-purpose processors, Digital Signal Processors (DSP for short), Application Specific Integrated Circuits (ASIC for short), 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 combination with the invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0138] The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk, or an optical disc, etc.
[0139] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
[0140] The above storage medium can 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 can be any available medium accessible by a general-purpose or special-purpose computer.
[0141] An exemplary storage medium is coupled to a processor, enabling the processor to read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0142] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the foregoing storage medium includes various media that can store program codes, such as ROM, RAM, magnetic disk or optical disk.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A program code debugging method, characterized in that, Applied to a computer device, including: Obtain the program code to be debugged, where the program code contains pre-added stop breakpoint identifiers; In response to the developer's operation of starting debugging, start the debugging process of the program code through the code debugging mode; During the debugging process, when debugging reaches the position of each stop breakpoint identifier, pause the debugging process and output the corresponding debugging information, where the debugging information is used for the developer to determine whether the debugging meets the expectations; In response to the developer's operation of re-debugging, mark the current stop breakpoint identifier as the starting breakpoint identifier, where the re-debugging operation is triggered by the developer when the debugging information does not meet the expectations; Continue the debugging process of the program code from the position of the marked starting breakpoint identifier to the position of the next stop breakpoint identifier.
2. The method according to claim 1, wherein After outputting the corresponding debugging information, it further includes: In response to the developer's operation of modifying the program code, obtain the modified program code; In response to the developer's operation of re-debugging the modified program code, mark the current stop breakpoint identifier as the starting breakpoint identifier; Continue the debugging process of the modified program code from the position of the marked starting breakpoint identifier to the position of the next stop breakpoint identifier.
3. The method according to claim 2, characterized in that, After continuing the debugging process of the program code from the position of the marked starting breakpoint identifier to the position of the next stop breakpoint identifier, it further includes: Output the debugging information corresponding to the modified program code and highlight the debugging information.
4. The method according to claim 1, characterized in that Before obtaining the program code to be debugged, it further includes: In response to the developer's configuration operation on the program code, divide the program code into multiple configuration processes; Add stop breakpoint identifiers according to the corresponding positions of each configuration process in the program code.
5. The method according to any one of claims 1 to 4, characterized in that, After continuing the debugging process of the program code from the position of the marked starting breakpoint identifier to the position of the next stop breakpoint identifier, it further includes: Output the corresponding debugging information; In response to the developer's operation of removing all stop breakpoint identifiers, remove all stop breakpoint identifiers to obtain the program code without breakpoints, where the removal operation is triggered by the developer when the debugging information meets the expectations; Start the debugging process of the program code without breakpoints through the code debugging mode and output the debugging information.
6. A program code debugging device, characterized in that Applied to a computer device, including: An acquisition module, used to obtain the program code to be debugged, where the program code contains pre-added stop breakpoint identifiers; A start module, used to start the debugging process of the program code through the code debugging mode in response to the developer's operation of starting debugging; A first output module, used to pause the debugging process and output the corresponding debugging information when debugging reaches the position of each stop breakpoint identifier during the debugging process, where the debugging information is used for the developer to determine whether the debugging meets the expectations; A first marking module, configured to mark the current stop breakpoint identifier as a start breakpoint identifier in response to an operation of a developer for re-debugging, where the re-debugging operation is triggered by the developer when the debugging information does not meet expectations; A first debugging module, configured to continue the debugging process of the program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier.
7. The device according to claim 6, characterized in that, The apparatus further includes: A generation module, configured to obtain the modified program code in response to an operation of the developer for modifying the program code; A second marking module, configured to mark the current stop breakpoint identifier as a start breakpoint identifier in response to an operation of the developer for re-debugging the modified program code; A second debugging module, configured to continue the debugging process of the modified program code from the position of the marked start breakpoint identifier to the position of the next stop breakpoint identifier.
8. The device according to claim 7, characterized in that, The apparatus further includes: A second output module, configured to output the debugging information corresponding to the modified program code and highlight the debugging information.
9. A computer device, characterized in that, Comprising: At least one processor and a memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the program code debugging method according to any one of claims 1 to 5.
10. A computer storage medium, characterized in that, Computer-executable instructions are stored in the computer storage medium, and when the processor executes the computer-executable instructions, the program code debugging method according to any one of claims 1 to 5 is implemented.