Progress reproduction method and system for debugging program

By creating a state machine in the debugging program, saving and restoring memory data at different progress, the problem of inability to record errors in a timely manner and maintaining context in the debugging process is solved, and flexible and efficient debugging process recovery is achieved.

CN120216338APending Publication Date: 2025-06-27FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510207103.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

When debugging a program, there are problems such as inability to record code errors in time, inability to maintain program context, and the need to re-step debugging for memory analysis, which makes the debugging process time-consuming and labor-intensive.

Method used

A progress reproduction method of debugging programs is adopted. By creating a state machine, memory data of different progress is obtained when executing the debugging program, and saved to the disk data of the state machine in a node manner. When a data restore request is received, the memory data corresponding to the restore node is obtained from the disk data and restored.

Benefits of technology

It realizes that without affecting the normal operation of the original program, the data during the debugging process is recorded in a timely manner, and the memory data of a certain node is accurately restored when necessary, so as to restore the debugging process in a timely and flexibly manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216338A_ABST
    Figure CN120216338A_ABST
Patent Text Reader

Abstract

The invention discloses a progress reproduction method and system for a debugging program, and the method comprises the steps: creating a state machine, obtaining the memory data of the debugging program in different progresses when the debugging program is executed, storing the memory data in different progresses into the disk data of the state machine in a node mode, and when a data restoration request is received, restoring the data in the disk data of the state machine; and acquiring the memory data corresponding to the restoration node from the disk data according to the data restoration request, and restoring the memory data, so that the memory data of different progresses of the debugging program is stored in a node mode through the state machine, the data in the debugging process can be recorded in time under the condition of not influencing the normal operation of the original program, and the debugging efficiency is improved. And when restoration is needed, the memory data of a certain node is accurately restored, so that the debugging process is timely and flexibly restored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of debugging output, and in particular to a method and system for reproducing the progress of a debugging program. Background Art

[0002] In programming, debugging output is a common method for checking the running status and behavior of a program. Rich debugging functions are provided in the IDE (Integrated Development Environment), such as breakpoints, variable monitoring, call stack viewing, etc., which facilitate the discovery and repair of program BUGs (defects). After the program is determined to be stable, these debugging statements will be removed or disabled in the production environment to avoid leaking sensitive information or affecting performance.

[0003] The difference between the Release Version and the Debug Version programs is that the debug version comes with debugging information, and the performance is affected by the debugging output. During the process of using the debug version program for debugging, the following problems exist: 1. When a code error is found, it may not be possible to record it in time because the debugging itself is the program itself, and the log may not be recorded in time before a crash occurs.

[0004] 2. It is impossible to maintain the program context association, and it is necessary to re-step through the debugging for memory analysis, etc., which is time-consuming and laborious.

[0005] 3. It is necessary to take a snapshot of the data, that is, save certain steps and require context association. For example, after writing a document and saving it, it can be opened and continued, but this is not possible for debugging, and it is necessary to start over from the beginning to reach this step. Summary of the Invention

[0006] The technical problem to be solved by the present invention is: to provide a method and system for reproducing the progress of a debugging program, which can restore the debugging process in a timely and flexible manner.

[0007] In order to solve the above technical problem, a technical solution adopted by the present invention is: A method for reproducing the progress of a debugging program, comprising the steps of: Creating a state machine; When executing the debugging program, obtaining the memory data of the debugging program at different progressions; Saving the memory data at different progressions to the disk data of the state machine in a node manner; Receiving a data restoration request, the data restoration request including a restoration node; Obtain the memory data corresponding to the restore node from the disk data according to the data restoration request, and restore the memory data corresponding to the restore node.

[0008] To solve the above technical problem, another technical solution adopted by the present invention is: A progress reproduction system for debugging programs, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: Create a state machine; When executing the debugging program, obtain the memory data of the debugging program at different progress stages; Save the memory data at different progress stages to the disk data of the state machine in a node manner; Receive a data restoration request, where the data restoration request includes a restore node; Obtain the memory data corresponding to the restore node from the disk data according to the data restoration request, and restore the memory data corresponding to the restore node.

[0009] The beneficial effects of the present invention are as follows: Create a state machine. When executing the debugging program, obtain the memory data of the debugging program at different progress stages, save the memory data at different progress stages to the disk data of the state machine in a node manner. When receiving a data restoration request, obtain the memory data corresponding to the restore node from the disk data and restore it. In this way, the memory data of different progress stages of the debugging program is stored in a node manner through the state machine, which can record the data during the debugging process in a timely manner without affecting the normal operation of the original program, and accurately restore the memory data of a certain node when restoration is required, thereby restoring the debugging process in a timely and flexible manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a step flowchart of a method for reproducing the progress of a debugging program according to an embodiment of the present invention; Figure 2 It is a schematic structural diagram of a system for reproducing the progress of a debugging program according to an embodiment of the present invention; Figure 3 It is a schematic diagram of memory data at different progress stages in the method for reproducing the progress of a debugging program according to an embodiment of the present invention; Figure 4 It is a schematic diagram of a memory view and a time counter in the method for reproducing the progress of a debugging program according to an embodiment of the present invention; Figure 5 It is a schematic diagram of progress restoration in the method for reproducing the progress of a debugging program according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0011] To describe the technical content, achieved objectives and effects of the present invention in detail, the following is described in conjunction with embodiments and with reference to the accompanying drawings.

[0012] Please refer to Figure 1 , a method for reproducing the progress of a debugging program, comprising the steps of: Create a state machine; When executing the debugging program, obtain the memory data of the debugging program at different progress levels; Save the memory data at different progress levels to the disk data of the state machine in the form of nodes; Receive a data restoration request, the data restoration request including a restoration node; According to the data restoration request, obtain the memory data corresponding to the restoration node from the disk data, and restore the memory data corresponding to the restoration node.

[0013] As can be seen from the above description, the beneficial effects of the present invention are as follows: create a state machine, when executing the debugging program, obtain the memory data of the debugging program at different progress levels, save the memory data at different progress levels to the disk data of the state machine in the form of nodes, when receiving a data restoration request, obtain the memory data corresponding to the restoration node from the disk data according to the data restoration request, and restore it, so as to store the memory data of different progress levels of the debugging program in the form of nodes through the state machine, which can record the data during the debugging process in a timely manner without affecting the normal operation of the original program, and when restoration is needed, accurately restore the memory data of a certain node, so as to restore the debugging process in a timely and flexible manner.

[0014] Further, the step of saving the memory data at different progress levels to the disk data of the state machine in the form of nodes includes: Create a memory view; Obtain associated memory data according to the memory data at different progress levels; Store the associated memory data in one-to-one correspondence with the linked list nodes in the memory view; Save the memory view to the disk data of the state machine.

[0015] As can be seen from the above description, since there is an association between progress levels, there is also associated memory data between progress levels. Obtain the associated memory data according to the memory data at different progress levels. The associated memory data is equivalent to the associated changes that occur in the memory. Store the associated memory data in one-to-one correspondence with the linked list nodes in the memory view, which is convenient for progress storage.

[0016] Further, it further includes: Create a time counter; Determine the time corresponding to the associated memory data; Store the time and the associated memory data into the time counter; Save the time counter into the disk data of the state machine.

[0017] As can be seen from the above description, during the program operation, the associated memory data will always change and be in a high-frequency or low-frequency change. In short, it will change with time. Therefore, create a time counter, store the associated memory data corresponding to different times into the time counter, and use the time counter to record the changes occurring in the time region, which is convenient for subsequent viewing of the changes of the context-related data based on the time dimension, so as to gradually restore the data through the time progress bar, thereby flexibly recording and restoring the original program call process.

[0018] Further, the restoration node is a time node; The obtaining of the memory data corresponding to the restoration node from the disk data according to the data restoration request includes: Obtain the associated memory data corresponding to the time node from the time counter according to the data restoration request.

[0019] As can be seen from the above description, when the restoration node is a time node, obtain the associated memory data corresponding to the time node from the time counter according to the data restoration request, so as to accurately obtain the required progress data.

[0020] Further, the restoration node is a parameter condition; The obtaining of the memory data corresponding to the restoration node from the disk data according to the data restoration request includes: Traverse the data in the time counter according to the data restoration request, and query the associated memory data corresponding to the parameter condition.

[0021] As can be seen from the above description, the restoration node can also be a parameter condition, that is, a certain parameter in the associated memory data. Traverse the data in the time counter according to the data restoration request, and query the associated memory data corresponding to the parameter condition. The obtained associated memory data is not unique, realizing the fuzzy query of the progress data and improving the flexibility of the debugging process restoration.

[0022] Please refer to Figure 2 , a progress reproduction system for debugging a program, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: Create a state machine; When executing a debugging program, obtain the memory data of the debugging program at different progress levels; Save the memory data at different progress levels to the disk data of the state machine in the form of nodes; Receive a data restoration request, where the data restoration request includes a restoration node; According to the data restoration request, obtain the memory data corresponding to the restoration node from the disk data, and restore the memory data corresponding to the restoration node.

[0023] From the above description, it can be seen that the beneficial effects of the present invention are as follows: Create a state machine. When executing a debugging program, obtain the memory data of the debugging program at different progress levels, save the memory data at different progress levels to the disk data of the state machine in the form of nodes. When receiving a data restoration request, obtain the memory data corresponding to the restoration node from the disk data according to the data restoration request and restore it. In this way, the memory data of different progress levels of the debugging program is stored in the form of nodes through the state machine, which can record the data during the debugging process in a timely manner without affecting the normal operation of the original program, and accurately restore the memory data of a certain node when restoration is needed, so as to restore the debugging process in a timely and flexible manner.

[0024] Further, the step of saving the memory data at different progress levels to the disk data of the state machine in the form of nodes includes: Create a memory view; Obtain associated memory data based on the memory data at different progress levels; Store the associated memory data in one-to-one correspondence with the linked list nodes in the memory view; Save the memory view to the disk data of the state machine.

[0025] From the above description, since there is an association between progress levels, there is also associated memory data between progress levels. Obtain the associated memory data based on the memory data at different progress levels. The associated memory data is equivalent to the associated changes that occur in the memory. Store the associated memory data in one-to-one correspondence with the linked list nodes in the memory view, which is convenient for progress storage.

[0026] Further, it also includes: Create a time counter; Determine the time corresponding to the associated memory data; Store the time and the associated memory data in the time counter; Save the time counter to the disk data of the state machine.

[0027] As described above, during the program execution, the associated memory data keeps changing and is either in high-frequency change or low-frequency change. In short, it changes over time. Therefore, a time counter is created to store the associated memory data corresponding to different times in the time counter, and the time counter is used to record the changes that occur in the time range, facilitating subsequent viewing of the changes in the context-related data based on the time dimension, so as to gradually restore the data through the time progress bar, thereby flexibly recording and restoring the original program call process.

[0028] Further, the restoration node is a time node; The obtaining of the memory data corresponding to the restoration node from the disk data according to the data restoration request includes: Obtaining the associated memory data corresponding to the time node from the time counter according to the data restoration request.

[0029] As described above, when the restoration node is a time node, the associated memory data corresponding to the time node is obtained from the time counter according to the data restoration request, so as to accurately obtain the required progress data.

[0030] Further, the restoration node is a parameter condition; The obtaining of the memory data corresponding to the restoration node from the disk data according to the data restoration request includes: Traversing the data in the time counter according to the data restoration request to query the associated memory data corresponding to the parameter condition.

[0031] As described above, the restoration node can also be a parameter condition, that is, a certain parameter in the associated memory data. Traversing the data in the time counter according to the data restoration request to query the associated memory data corresponding to the parameter condition. The obtained associated memory data is not unique, realizing the fuzzy query of the progress data and improving the flexibility of the debugging process restoration.

[0032] The above method and system for reproducing the progress of a debugging program according to the present invention can be applied to the scenario of executing a debugging program, which will be described below through specific embodiments: Please refer to Figure 1 、 Figures 3 - 5 , Embodiment 1 of the present invention is: A method for reproducing the progress of a debugging program, including the steps of: S1. Create a state machine.

[0033] S2. When executing the debugging program, obtain the memory data of the debugging program at different progressions.

[0034] For example, the debugging program is the A version program. When executing the A version program, the memory data at progress 1, progress 2... progress n of the A version program is obtained respectively, as Figure 3 shown.

[0035] S3. Save the memory data at different progress to the disk data of the state machine in the form of nodes, specifically including:[[]] S31. Create a memory view.

[0036] The memory view is convenient for progress storage, which is equivalent to planning the data and is used to store the desired data in the memory structure.

[0037] S32. Obtain the associated memory data according to the memory data at different progress.

[0038] For example, obtain the associated memory data according to the memory data at progress 1, progress 2... progress n of the A version program. This is because there is an association between progress and progress, so there is associated memory data between program flows. For example, when the computer inputs 1, the program flow Test01 consists of (Test02, Test03), and the data of Test02 and Test03 both change because of the input 1. This change is called the associated change of the memory, and it is necessary to establish and record the memory association branch. The format of the associated memory data can be as follows:[[]] Test02:0x3,0x5=>Test03:0x9,0x8 01=>Test01; The above associated memory data means that 01 is input as a parameter into Test01, and the associated data at this time is "Test02:0x3,0x5=>Test03:0x9,0x8", that is, the state of each memory when a certain progress is in progress. Data like this is called associated memory data.

[0039] S33. Store the associated memory data in one-to-one correspondence with the linked list nodes to the memory view, as Figure 4 shown.

[0040] S34. Save the memory view to the disk data of the state machine.

[0041] During the program operation, the associated memory data will always change, and it is either in high-frequency change or low-frequency change. In short, it will change with time. Then, it is necessary to create a time counter to record the changes that occur in the time area. In an optional implementation manner, as Figure 4 shown, it further includes:[[]] S35. Create a time counter.

[0042] Among them, the structure of the time counter is: time - memory branch data.

[0043] S36. Determine the time corresponding to the associated memory data.

[0044] S37. Store the time and the associated memory data into the time counter.

[0045] Specifically, store the time and the associated memory data into the time counter in the form of a doubly linked list, so as to facilitate viewing the change of associated data of the upper and lower times, and the data can be gradually restored through the time progress bar without constantly modifying the memory data.

[0046] S38. Save the time counter into the disk data of the state machine.

[0047] S4. Receive a data restoration request, where the data restoration request includes a restoration node.

[0048] S5. Obtain the memory data corresponding to the restoration node from the disk data according to the data restoration request, and restore the memory data corresponding to the restoration node.

[0049] In an alternative embodiment, the restoration node is a time node.

[0050] The obtaining of the memory data corresponding to the restoration node from the disk data according to the data restoration request includes: Obtain the associated memory data corresponding to the time node from the time counter according to the data restoration request.

[0051] For example, if the time node is 1, then obtain the progress from the time counter: Time 1: 01 => Test01->Test02:0x3,0x5 => Test03:0x9,0x8, and then restore the associated memory data therein.

[0052] In an alternative embodiment, the restoration node is a parameter condition.

[0053] The obtaining of the memory data corresponding to the restoration node from the disk data according to the data restoration request includes: Traverse the data in the time counter according to the data restoration request, and query the associated memory data corresponding to the parameter condition.

[0054] For example, if the parameter condition is Test02(x,y) and x = 0x3, then traverse the data in the time counter, query the time node and its associated memory data when 0x3 is passed in Test02. Then the user can view the situation of this part of the associated context data, or the user can select one piece of data from the query results for subsequent data restoration.

[0055] In an alternative embodiment, as Figure 5 shown, the restoration of the memory data corresponding to the restoration node includes: Restoring the memory data corresponding to the restoration node by creating a restoration device.

[0056] The above method of the present invention creates a state machine. When executing a debug program, it obtains the memory data of the debug program at different progressions, saves the memory data at different progressions to the disk data of the state machine in a node manner. When receiving a data restoration request, it obtains the memory data corresponding to the restoration node from the disk data according to the data restoration request and restores it. In this way, by storing the memory data of different progressions of the debug program in a node manner through the state machine, it can record the data during the debugging process in a timely manner without affecting the normal operation of the original program, and accurately restore the memory data of a certain node when restoration is needed. In addition, through the time counter, it can flexibly monitor the call process of the original program, flexibly monitor function calls, isolate the debugging process, and restore the context of any function call, so as to restore the debugging process in a timely and flexible manner.

[0057] Please refer to Figure 2 , Embodiment 2 of the present invention is: A progress reproduction system for a debug program, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements each step in the progress reproduction method of the debug program in Embodiment 1.

[0058] In summary, the present invention provides a method and system for reproducing the progress of a debugging program. A state machine is created. When executing the debugging program, the memory data of the debugging program at different progress levels is obtained, and the memory data at different progress levels is saved to the disk data of the state machine in the form of nodes. When a data restoration request is received, the memory data corresponding to the restoration node is obtained from the disk data according to the data restoration request and restored. In this way, the memory data of different progress levels of the debugging program is stored in the state machine in the form of nodes, which can record the data during the debugging process in a timely manner without affecting the normal operation of the original program, and accurately restore the memory data of a certain node when restoration is required. Additionally, since there is a correlation between progress levels, there are also correlated memory data between progress levels. The correlated memory data is obtained based on the memory data at different progress levels, and the correlated memory data is equivalent to the correlated changes that occur in the memory. The correlated memory data is stored in the memory view in one-to-one correspondence with the linked list nodes for easy progress storage. At the same time, during the operation of the program, the correlated memory data will keep changing and may change frequently or infrequently, that is, it will change over time. Therefore, a time counter is created, and the correlated memory data corresponding to different times is stored in the time counter. The time counter is used to record the changes that occur in the time region, which is convenient for viewing the changes of the context-correlated data based on the time dimension later, so as to gradually restore the data through the time progress bar, thereby flexibly recording and restoring the original program call process.

[0059] The above are only the embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the related technical fields, shall be included in the patent protection scope of the present invention by the same token.

Claims

1. A method for reproducing the progress of a debugging program, characterized in that: Includes steps: Create a state machine; When executing the debugging program, obtaining memory data of the debugging program at different progress levels; The memory data at different progress levels are saved in the disk data of the state machine in a node manner; receiving a data restoration request, wherein the data restoration request includes a restoration node; The memory data corresponding to the restoration node is acquired from the disk data according to the data restoration request, and the memory data corresponding to the restoration node is restored.

2. A method for reproducing the progress of a debugging program according to claim 1, characterized in that: The step of saving the memory data at different progress levels to the disk data of the state machine in a node manner includes: Create a memory view; Obtaining associated memory data according to the memory data at different progress levels; The associative memory data and the linked list nodes are stored in the memory view in a one-to-one correspondence; The memory view is saved to disk data of the state machine.

3. A method for reproducing the progress of a debugging program according to claim 2, characterized in that: Also includes: Create a time counter; Determining the time corresponding to the associative memory data; storing the time and the associative memory data in the time counter; The time counter is saved to disk data of the state machine.

4. A method for reproducing the progress of a debugging program according to claim 3, characterized in that: The restoration node is a time node; The acquiring the memory data corresponding to the restoration node from the disk data according to the data restoration request comprises: According to the data restoration request, the associative memory data corresponding to the time node is obtained from the time counter.

5. A method for reproducing the progress of a debugging program according to claim 3, characterized in that: The restoration node is a parameter condition; The acquiring the memory data corresponding to the restoration node from the disk data according to the data restoration request includes: According to the data restoration request, the data in the time counter is traversed to query the associative memory data corresponding to the parameter condition.

6. A debugging program progress reproduction system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Create a state machine; When executing the debugging program, obtaining memory data of the debugging program at different progress levels; The memory data at different progress levels are saved in the disk data of the state machine in a node manner; receiving a data restoration request, wherein the data restoration request includes a restoration node; The memory data corresponding to the restoration node is acquired from the disk data according to the data restoration request, and the memory data corresponding to the restoration node is restored.

7. A debugging program progress reproduction system according to claim 6, characterized in that: The step of saving the memory data at different progress levels to the disk data of the state machine in a node manner includes: Create a memory view; Obtaining associated memory data according to the memory data at different progress levels; The associative memory data and the linked list nodes are stored in the memory view in a one-to-one correspondence; The memory view is saved to disk data of the state machine.

8. A debugging program progress reproduction system according to claim 7, characterized in that: Also includes: Create a time counter; Determining the time corresponding to the associative memory data; storing the time and the associative memory data in the time counter; The time counter is saved to disk data of the state machine.

9. A debugging program progress reproduction system according to claim 8, characterized in that: The restoration node is a time node; The acquiring the memory data corresponding to the restoration node from the disk data according to the data restoration request includes: According to the data restoration request, the associative memory data corresponding to the time node is obtained from the time counter.

10. A debugging program progress reproduction system according to claim 8, characterized in that: The restoration node is a parameter condition; The acquiring the memory data corresponding to the restoration node from the disk data according to the data restoration request comprises: According to the data restoration request, the data in the time counter is traversed to query the associative memory data corresponding to the parameter condition.