Method for performing a debugging operation of a control program of an automation system
By generating and comparing source code version identifiers, the problem of mismatch between source code and machine code in automation systems is solved, enabling more efficient debugging operations and safer control program development.
Patent Information
- Application Number
- CN202380077766.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-11-10
- Filing Date
- 2023-11-09
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2043-11-09
AI Technical Summary
In automated systems, existing technologies cannot effectively debug the problem of incompatibility between the source code version and the machine code version of the control program, which leads to a complex development process and makes it difficult for different developers to collaborate.
By generating and comparing the identifiers of the first source code version and the second source code version, a version identifier is established to determine the association between the two, and based on this, the machine code-source code relationship is determined, enabling debugging operations on the control program.
It simplifies debugging operations, improves development efficiency, ensures that different developers can effectively debug control programs on different versions of source code, and improves the control quality and security of automation systems.
Smart Images

Figure CN120239854B_ABST
Abstract
Description
[0001] The present invention relates to a method for performing a debugging operation of a control program of an automation system.
[0002] This patent application claims priority to German patent application DE 10 2022 129 772.1, the disclosure of which is incorporated herein by reference.
[0003] Programmable logic controllers (PLC) are mainly used for the control and regulation of machines and devices, in particular in the field of automation. In this case, the control or regulation behavior is represented by a control program which is suitably set and executable on a corresponding PLC. Such a control program is usually developed by a developer individually for a corresponding machine or device type.
[0004] In order to test the behavior of the control program, the developer usually installs and executes an incomplete but runnable control program on the PLC at an early stage. During the execution, the handling of the machine or device can be observed and the control program can be improved by changing the knowledge gained by the program.
[0005] In order to gain knowledge (for example for error analysis), the developer can observe and control the control program when executing it on the control system using a tool (debugger). For this purpose, the developer usually has access to the source code of the control program being executed, which is usually stored on his development system.
[0006] In order to check the operability of the control program, the developer can implement a segmented execution of the control program by setting so-called stop points, in which the control program stops at the position of the stop point. In this state, the developer can check the variables and continue the execution step by step, i.e. line by line, so that the intermediate results of the control program are controlled. In this case, the current position of the execution interruption is always marked in the display of the source code. These basic functions are provided by usual development tools.
[0007] However, problems can arise if the source code on the development system is different from the source code that translates the control program currently running.
[0008] It is therefore an object of the present invention to provide an improved method for performing a debugging operation of a control program of an automation system.
[0009] This object is achieved by a method for performing a debugging operation of a control program of an automation system according to claim 1. Preferred embodiments are given in the dependent claims.
[0010] According to one aspect of the present invention, a method for performing a debugging operation of a control program of an automation system is provided, comprising:
[0011] In a receiving step, a first machine code-source code relationship and a first source code identification are received by a development system for performing a debugging operation, wherein the first machine code-source code relationship defines an association between lines of a first source code version of a control program and corresponding code elements of a machine code of the control program generated by translating the first source code version, and wherein the first source code identification comprises information about the first source code version which enables to identify individual lines of the first source code version;
[0012] In a source code comparison step, the first source code identification is compared with a second source code identification of a second source code version executed on the development system, wherein the second source code version results from at least one source code change from the first source code version, and wherein the second source code identification comprises information about the second source code version which enables to identify individual lines of the second source code version;
[0013] In an identification generation step, a version identification is generated based on the comparison of the first source code identification and the second source code identification, wherein the version identification defines an association between lines of the first source code version and lines of the second source code version corresponding to the lines of the first source code version;
[0014] In a relationship determination step, a second machine code-source code relationship is determined based on the first machine code-source code relationship and the version identification, wherein the second machine code-source code relationship defines an association between lines of the second source code version and corresponding code elements of the machine code; and
[0015] In a debugging step, a debugging operation of the machine code stored on the control unit is performed based on the second source code version using the second machine code-source code relationship.
[0016] Thus, a technical advantage can be achieved, namely an improved method for performing a debugging operation of a control program of an automation system can be provided. With the improved method, in particular, a debugging operation of a control program can be performed which is performed on a version of a source code of the control program which does not correspond to a version of a translated and executable machine code of the control program.
[0017] In particular, the method according to the present application can cover a case where a machine code of a control program is generated by a translation operation of a first version of a source code. By making changes to the first source code version, a second source code version is generated below. Thus, the second source code version does not match the generated machine code version.
[0018] Conventional debugging procedures cannot perform a debugging procedure of a respective program based on a source code which is different from a corresponding machine code.
[0019] According to the application, in addition to the first machine code-source relationship which is generated and which defines the association between the lines of the first source code version of the control program and the corresponding code elements of the machine code generated by the translation, a first source code identification is provided to solve this problem. Here, the first source code identification provides information about the first source code version which enables the individual lines of the first source code version to be identified.
[0020] Furthermore, a second source code identification is provided which is based on a second source code version which is different from the first source code version, which, similar to the first source code identification, provides information about the second source code which enables the individual lines of the second source code to be identified.
[0021] The two source code identifications of the first source code version and of the second source code version are then compared with one another and a version identification is generated.
[0022] The version identification defines a mapping between the lines of the first source code version and the lines of the second source code version.
[0023] The version identification thus identifies the lines of the first source code version and of the second source code version which match. Furthermore, the lines of the first source code version and of the second source code version are identified which have no correspondence in the respective other source code version.
[0024] On the basis of the first machine code-source relationship and of the version identification, a second machine code-source relationship is then determined. Here, the second machine code-source relationship defines an association between the lines of the second source code version and corresponds to the code elements of the machine code.
[0025] The explicit relationship between the lines of the second source code version and the elements of the machine code is thus known by means of the second machine code-source relationship. The second machine code-source relationship thus uniquely identifies the lines of the second source code version which have a correspondence in the machine code and the lines of the second source code version which have no correspondence in the machine code. On the basis of the second machine code-source relationship, it is thus possible to carry out the respective debugging operations of the control program using the second source code version.
[0026] The debugging processes of the control program which are carried out on the source code version of the control program which does not correspond to the respective machine code of the control program can thus be carried out by means of the method according to the application.
[0027] This is advantageous, for example, for debugging operations during the programming operation of the control program. The source code thus does not need to be retranslated into the appropriate machine code each time a modification to the source code is carried out in order to carry out the debugging operations.
[0028] In contrast, the debugging operation can be performed on already existing machine code, even if the related source code has been modified in the current version. This makes the programming operation easier.
[0029] Furthermore, the method according to the application makes it possible to perform debugging operations in which the programming operation is performed, for example, by different developers who implement the development of the control program in different development environments or development systems. If the developers work on different source code versions, because the retranslation of the source code into the appropriate machine code is not performed each time the source code is modified, a single developer from a different development system can still perform meaningful debugging operations on the already generated control program based on different source code versions.
[0030] In particular, by performing the debugging operation, an improved control program can be provided. Thus, an improved, more efficient and safer control of the automation system can be achieved.
[0031] In the sense of the present application, the development system 300 is a development environment for developing the source code. Such a development system can be provided, for example, by an IDE (intelligent development engine).
[0032] A development system used, for example, in automation technology provides the developers of automation software with various functions for programming such software. For text-based programming languages in DIN 61131, this includes, for example, autocompletion of frequently used programming expressions and the like. For graphical programming languages from DIN 61131, the development system provides a graphical representation of the programming.
[0033] Thus, the developers of the software product can use the development system to develop control programs for machines or automation systems and other technical devices.
[0034] For this purpose, the developers can use different programming languages. In the field of automation, programming languages in DIN 61131 are predominantly used. These can also include graphical programming languages.
[0035] The developers can also use the development system to observe and understand the behavior of the programmed control program during execution, for example, to analyze error behavior or to optimize behavior. This is achieved in the debugging process.
[0036] The development system can also be used by the skilled person to debug the device, for example, the automation system. This can include transferring the control program to the appropriate controller, for example, a PLC programmable logic controller, and setting device parameters or observing the device behavior, respectively, as described above, in order to be able to rule out or detect installation errors.
[0037] Operators of technical equipment, such as automation systems, can also use the development system to control the equipment, to manually operate, to bridge behavior or to set simple parameters.
[0038] Generally, the control program is written in one or more of the languages of the IEC 61131-3 standard.
[0039] The standard comprises five languages: "structured text", "instruction list", "sequential function chart", "function block diagram" and "function block language". "Structured text" and "instruction list" are text languages. "Sequential function chart" and "function block diagram" are graphical languages. "Sequential function chart" comprises both text and graphical aspects.
[0040] The input of the source code during programming can be supported by automatic completion mechanisms within the development system used. For example, the automatic completion can complete, correct the input of a keyword and / or insert another associated keyword.
[0041] The input can also be simplified by displaying information. For example, the expected parameters of a function call can be displayed.
[0042] If the program code is detected to be defective (during input), the corresponding location in the source code can be marked and optionally an explanation can be displayed, which can facilitate the immediate correction of the error.
[0043] According to one embodiment, the first source code identification comprises a first source code version and the second source code identification comprises a second source code version.
[0044] Thus, a technical advantage can be achieved, namely that an exact association between the first and the second source code version can be realized by the first and the second source code identification. For this purpose, the first and the second source code identification comprise the first and the second source code version, respectively.
[0045] By the comparison between the first and the second source code identification described above and the generation of the version identification, it is thus possible to exactly determine which lines of the second source code version correspond to which lines of the first source code version or which lines of the second source code version have no correspondence in the first source code version, based on the first and the second source code version.
[0046] By using the first and the second source code version as source code identification, an exact version identification can be provided. Thereby, an exact second machine code-source code relationship can be established again, since the exact association of the lines of the second source code version to the lines of the first source code version makes it possible to associate the lines of the second source code version exactly to the corresponding elements of the machine code.
[0047] According to one embodiment, the first source code identification comprises a first encrypted source code version based on an encryption of the first source code version, wherein the method further comprises:
[0048] The second source code version is encrypted and a second encrypted source code version is generated in the step of encrypting, wherein the second source code identification comprises the second encrypted source code version; and wherein comparing the first and second source code identification comprises comparing the first and second encrypted source code version.
[0049] Thus, the technical advantage of the encryption of the first and second source code version can be realized which allows to increase the data security. To this end, the first and second source code version provide a first and second encrypted source code version, respectively.
[0050] In this case, the first source code identification accordingly comprises the first encrypted source code version which is based on the encryption of the first source code version. By using the encrypted version of the first source code version instead of the actual first source code version for the first source code identification, the first source code identification can be stored on the control unit of the automation system in addition to the machine code which is based on the machine code-source code relationship.
[0051] By storing only the encrypted source code version in the form of the first encrypted source code version of the first source code identification on the control unit of the automation system, it can be prevented that a user of the automation system has access to the source code of the control program.
[0052] Thus, during the operation of the automation system by the user, the first source code identification can remain stored on the control unit in the form of the first encrypted source code version. Thus, when further developing the control program by a programming operation, the developer can resort to the first source code identification stored on the control unit and thereby obtain information about the lines of the first source code version. Due to the encryption of the first source code version, the risk that the source code of the control program can be read in by a user of the automation system does not exist within the first source code identification.
[0053] The above described method for determining the second machine code-source code relationship and the association between the lines of the second source code version and the corresponding elements of the machine code stored on the control unit can be performed analogously by the encryption of the first and second source code version.
[0054] To this end, first a second encrypted source code version is generated by encrypting the second source code version. Furthermore, a second source code identification is generated which comprises the second encrypted source code version and provides information about the lines of the second source code version.
[0055] Analogously, the first source code identification which can be stored on the control unit of the automation system comprises the first encrypted source code version already mentioned.
[0056] By comparing the first and the second source code identification, wherein the first encrypted source code version is compared with the second encrypted source code version, similar to the above described embodiment, an association between the lines of the first encrypted source code version and the lines of the second encrypted source code version can be achieved.
[0057] Based thereon, a version identification can be generated, which in this case defines an association between the encrypted lines of the first encrypted source code version and the encrypted lines of the second encrypted source code version.
[0058] Based thereon, a second machine code-source code relationship can be determined, wherein an association between the lines of the second source code version and the respective elements of the machine code is defined.
[0059] Here, it is assumed that the encrypted lines of the first encrypted source code version are related to the lines of the first source code version and that the encrypted lines of the second encrypted source code version are related to the unencrypted lines of the second source code version.
[0060] According to one embodiment, the encryption of the first and the second source code version is performed line by line.
[0061] Thus, a technical advantage can be achieved, namely an exact association of the unencrypted lines of the first source code version and the encrypted lines of the first encrypted source code version and an exact association of the unencrypted lines of the second source code version and the encrypted lines of the second encrypted source code version.
[0062] By encrypting the first and the second source code version line by line, the order of the lines of the respective source code version can be maintained. Thus, by comparing the encrypted lines of the first and the second source code version with each other as described above and thereby determining the respective relationship between the first source code version and the second source code version, an explicit line by line association of the second source code version to the respective elements of the machine code can be achieved by the two encrypted source code versions.
[0063] Due to the encryption of the first source code version, this allows an increased data security, since the first source code identification stored on the control unit of the automation system cannot be read by uninvolved or unauthorized persons and conclusions about the original source code can thereby be drawn.
[0064] However, the line by line encryption can achieve an exact association between the two different source code versions, so that based thereon an exact association between the individual lines of the second source code version and the individual elements of the machine code stored on the control unit of the automation system can be achieved.
[0065] This allows an easy debugging of the control program based on the modified source code version during operation of the automation system. This in turn makes a smooth and safe control of the automation system possible.
[0066] According to an embodiment, the encryption of the first and second source code versions is constituted as binary encryption.
[0067] Thus, a technical advantage can be achieved in that the first and second source code versions are encrypted as simply as possible.
[0068] Examples of binary encryption are RSA (Rivest-Shamir-Adleman) encryption or AES (Advanced Encrypted Standard) encryption. Both of these encryptions use a key to transform data into a form which only allows an inference of the original data if the key is known. Symmetric encryption uses the same key for encryption and decryption. Asymmetric encryption, on the other hand, uses separate and different keys for encryption and decryption.
[0069] Both methods take a sequence of bytes as input and return (encrypt / decrypt) a sequence of bytes, where a byte contains an integer in the interval [0..255].
[0070] Each text is interpreted as a sequence of bytes and can thus be encrypted immediately. However, the result is a sequence of bytes which usually does not correspond to any valid text line.
[0071] According to an embodiment, the comparing of the first and second encrypted source code versions in the identification generation step comprises comparing the encrypted lines of the first and second encrypted source code versions line by line.
[0072] In this way, a technical advantage can be achieved in that by comparing the encrypted lines of the first and second encrypted source code versions line by line, a line-by-line association of the encrypted lines of the first and second encrypted source code versions is made possible, such that a precise association between the first and second source code versions within the version identification is possible. The precise association of the individual lines of the first and second source code versions to each other makes an association of the lines of the second source code version to elements of the machine code possible. Due to the precise association, a problem-free debugging operation can be carried out.
[0073] According to an embodiment, a match of the encryption of a line of the first encrypted source code version with the encryption of a line of the second encrypted source code version is interpreted as a perfect match of the respective lines of the first and second source code versions.
[0074] In this way, a technical advantage can be achieved in that a line of the first source code version can be precisely associated with a line of the second source code version via the two encrypted source code versions. In this case, it is assumed that the same encryption is generated if the content of the two lines is identical, and a different encryption can be expected if the content of the lines is different.
[0075] Thus, when comparing the encrypted lines of the first encrypted source code version with the encrypted lines of the second encrypted source code version, it can be assumed that the respective unencrypted lines of the two source code versions also match, if the two encrypted lines match.
[0076] Similarly, when the encrypted lines deviate, it can be assumed that the respective unencrypted content of the lines of the two source code versions also deviate from each other. This allows an exact association of the two source code versions and, in connection therewith, an exact line-by-line association of the second source code version with the machine code.
[0077] According to one embodiment, the binary encryption is constituted as a hash value of the respective line.
[0078] Thus, a technical advantage of as simple as possible encryption of the source code versions can be achieved.
[0079] The hash value can be determined, for example, by applying a function line by line to the first source code version to calculate the hash value of the individual lines of the source code version line by line. Such a function can be given, for example, by a secure hash function such as SHA-256.
[0080] According to one embodiment, the first machine code-source code relationship and the first source code identification are stored on a control unit of the automation system, and wherein the receiving step comprises copying the first machine code-source code relationship and the first source code identification from the control unit to the development system.
[0081] Thus, a technical advantage can be achieved that the machine code-source code relationship or the first source code identification stored on the control unit of the automation system can be used for debugging operations to be performed on the development system.
[0082] According to one embodiment, the method further comprises:
[0083] In the information providing step, based on the comparison between the first and the second encrypted source code version, matching information about deviations and / or matches of the first source code version and the second source code version is provided.
[0084] Thus, a technical advantage can be achieved that by providing consistency information to the developer in the development system, the developer can be provided with precise information about the consistency or deviation of the second source code version he is working on from the first source code version corresponding to the current machine code.
[0085] In the development process based on the second source code version, the developer usually does not see the first source code version. Thus, by the provided consistency information, the developer can directly find the differences or the consistency of the two source code versions and adjust the debugging operation accordingly. For example, considering the matching information, the developer can avoid placing a stop point in a line that is modified in the second source code version relative to the first source code version in the debugging operation. This simplifies the debugging operation and speeds up the development process.
[0086] According to one embodiment, the matching information marks lines in the second source code version that have been deleted or added in the second source code version relative to the first source code version.
[0087] Thus, a technical advantage can be achieved, namely by marking the lines within the second source code version that are added or deleted relative to the first source code version, the changes in the second source code version can be directly shown to the developer, so that these changes can be taken into account in the development process.
[0088] According to one embodiment, the matching information is displayed to a user in a development system for performing a debugging operation.
[0089] This can achieve a technical advantage, namely the development process can be simplified or accelerated, because the developer can directly see the changes. Furthermore, by allowing more precise debugging operations and more efficient development processes, the quality of the control program can be improved.
[0090] According to one embodiment, the identification generation step comprises:
[0091] In the file association step, the first files comprising the lines of the first source code version and / or the lines of the first encrypted source code version are associated to the second files comprising the lines of the second source code version and / or the lines of the second encrypted source code version, wherein each first file is associated at most with one second file and each second file is associated at most with one first file; and
[0092] In the file comparison step, the lines of the first source code version and / or the first encrypted source code version of the first files are compared with the lines of the second source code version and / or the second encrypted source code version of the corresponding associated second files.
[0093] In this way, a technical advantage can be achieved, namely by the association of the files, the first and second source code versions are stored and by the respective comparison of the files comprising the first and second source code versions, respectively, the precise association of the individual lines of the first and second source code versions to each other and in connection therewith the precise version identification between the two first and second source code versions becomes possible. This allows precise debugging operations and improves the development process, which in turn can lead to an improvement of the automated system and possibly a safer control program.
[0094] According to an embodiment, in the file associating step, the first and second files are associated based on file paths of the respective first and second files or by similarity of lines and / or encrypted lines of the first and second files, wherein the similarity is achieved by performing a method for determining a Longest Common Subsequence (LCS) on lines of the first and second source code versions and / or the first and second encrypted source code versions stored in the first and second files.
[0095] Thus, a technical advantage of precise association of various files or precise comparison of files can be achieved.
[0096] According to an embodiment, the contents of the associated first and second files are compared by performing a method for determining a Longest Common Subsequence on the contents of the first and second files.
[0097] Thus, a technical advantage can be achieved, namely that by performing a method for determining a Longest Common Subsequence, a precise association of encrypted lines of the first encrypted source code version and encrypted lines of the second encrypted source code version is possible. Thus, no decryption and encryption of lines is required to create an association between different source code versions.
[0098] According to an embodiment, performing the debugging operation comprises:
[0099] When a stop point command for setting a stop point within the second source code version for execution in the development system is received from a user:
[0100] In a mapping step, a line of the second source code version at which the stop point is to be set is mapped to an address of the machine code based on the second machine code-source code relationship;
[0101] In a program holding step, the execution of the machine code is stopped by the control unit at the address of the machine code identified for the stop point; and
[0102] In a further mapping step, the address of the machine code at which the execution of the machine code is stopped is mapped to the respective line of the second source code version based on the second machine code-source code relationship; and
[0103] In a displaying step, the line of the second source code version at which the execution of the machine code has been stopped is displayed in the development environment.
[0104] Thus, a technical advantage can be achieved which allows a precise debugging operation. When setting a stop point within the second source code version, by the above-mentioned association between lines of the second source code version and respective elements of the machine code, a precise execution of the machine code and a stopping of the execution of the program at a position provided for this purpose can be achieved.
[0105] According to another aspect, there is provided an automation system having a control unit and a development system, wherein the automation system is arranged to perform a method for performing a debugging operation of a control program of the automation system according to one of the preceding embodiments.
[0106] The application is explained in more detail with reference to the drawings. In the drawings:
[0107] Figure 1 A schematic diagram of an automation system is shown;
[0108] Figure 2 A flowchart of a method for performing a debugging operation according to an embodiment is shown;
[0109] Figure 3 Another flowchart of a method for performing a debugging operation according to another embodiment is shown;
[0110] Figure 4 Another flowchart of a method for performing a debugging operation according to another embodiment is shown; and
[0111] Figure 5 Another flowchart of a method for performing a debugging operation according to another embodiment is shown.
[0112] Figure 1 A schematic diagram of an automation system 200 is shown.
[0113] The shown automation system 200 comprises a control unit 201 for executing a control program and for controlling an automation process, and a plurality of sensor / actuator units 202 connected to the control unit 201 for performing the automation process.
[0114] In the shown embodiment, the automation system 200 further comprises two development systems 203, 205 for developing a control program for the automation system 200.
[0115] Figure 1 A time sequence of a development operation of a control program for the automation system 200 is shown. In this time sequence, various operations for developing a control program described in detail below are performed by the shown two development systems 203, 205 at different times. In this case, the operations performed by the development system 203 are performed at a later point in time than the operations performed by the other development system 205.
[0116] The shown two development systems 203, 205 can actually represent different development systems, for example operated by different developers at different times. This represents the case where different developers are simultaneously involved in the development of a common control program and make changes to the source code of the commonly handled control program at different times.
[0117] Optionally, the two development systems 203 and 205 shown can represent the same development system at different times. This indicates a situation where, during development, developers generate different versions of source code using the corresponding development systems. In this case, Figure 1 Another development system 205 describes development system 203 at an earlier point in time.
[0118] The following references the diagram. Figure 1 The various steps of the method for debugging operations of the control program for executing the automation system 200 according to the present invention are described.
[0119] First, on the development system 205 shown, the developers generate a first version 207 of the source code 207 for the control program to be programmed during the development operation. In the translation operation 208, the corresponding machine code 209 for programming the control program is generated based on the first source code version 207.
[0120] Furthermore, a first machine code-source code relationship 211 is generated during translation operation 208. Here, the first machine code-source code relationship 211 describes the association between lines of the first source code version 207 and corresponding elements of the machine code 209.
[0121] In the first line identification operation 212, a first source code identifier 213 is also generated. Here, the first source code identifier 213 includes information about the first source code version 207, wherein the information of the first source code identifier 213 enables the identification of each line of the first source code version 207.
[0122] For example, the first source code identifier 213 may include, for example, the complete first source code version 207 or a portion of the first source code version 207.
[0123] The generation of the first source code identifier 213 can be achieved through a function or algorithm with appropriate settings. In this case, the function or algorithm is set to read the lines of the first source code version 207 and output the corresponding identification information for each line.
[0124] Alternatively or additionally, encryption of the first source code version 207 can be performed through the first encryption operation 226, and the first encrypted source code version 221 can be created.
[0125] Here, encryption can be performed line by line by encrypting each line of the first source code version 207 and generating the corresponding encrypted lines of the first encrypted source code version 221.
[0126] Line-by-line encryption can be achieved using a specially configured encryption function or algorithm. In this case, the function or algorithm is set to encrypt each line of the first source code version individually and generate the corresponding encrypted line.
[0127] In this case, the line-by-line division of the first source code version 207 is maintained by line-by-line encryption within the first encrypted source code version 221. Here, the line number of the first encrypted source code version 221 corresponds to the line number of the first source code version 207. Here, the i-th line of the first encrypted source code version 221 corresponds to the encryption of the i-th line of the first source code version 207. In this case, the first source code identifier 213 may include the first encrypted source code 221.
[0128] In installation operation 214, according to the present invention, machine code 209 generated by translation operation 208, first machine code-source code relationship 211 also generated by translation operation 208, and first source code identifier 213 generated by first line identification operation 212 or by first encryption operation 226 are installed on control unit 201 of automation system 200.
[0129] The installation of machine code 209, first machine code-source code relationship 211 and first source code identifier 213 on control unit 201 is achieved by the corresponding installation function or the corresponding installation algorithm.
[0130] The control unit 201 of the automation system 200 can be set, for example, by the customers and users of the automation system 200. By encrypting the first source code version 207 and the correspondingly generated first encrypted source code version 221, the source code information in the first source code identifier 213 installed on the user's control unit 201 cannot be read by unauthorized persons.
[0131] Figure 1 The following example illustrates a scenario where the first source code version 207 is modified to the second source code version 215 through a source code change operation 216 performed by a developer through programming and modifications to the first source code version 207. For example, this can be accomplished by adding or deleting individual lines from the first source code version 207.
[0132] In the diagram shown, development system 203 performs source code modification operation 216 or subsequent operations on the modified second source code version 215. As previously mentioned, the two development systems 203 and 205 can be two truly different development systems, for example, performed by different developers during simultaneous development operations within the same control program.
[0133] Alternatively, development systems 203 and 205 may represent the same actual development systems that are executed only at different times.
[0134] In order to perform debugging operation 224 based on second source code version 215, which is modified relative to first source code version 207, first machine code-source code relationship 211 and first source code identifier 213 are copied from control unit 201 to development system 203 in copy operation 218.
[0135] Copying can be performed using the corresponding copy function or the corresponding copy algorithm.
[0136] In addition, in the second line identification operation 220, a second source code identifier 217 is generated based on the second source code version 215.
[0137] Similar to the first source code identifier 213, the second source code identifier 217 may include the complete second source code version 215 or a portion of the second source code version 215.
[0138] The generation of the second source code identifier 217 can be achieved through a function or algorithm configured accordingly. In this case, the function or algorithm is configured to read the second source code version 215, identify individual lines, and generate the corresponding line information.
[0139] Alternatively or additionally, a second encryption source code version 223 may be created in a second encryption operation 228 based on a second source code version 215.
[0140] Encryption can be achieved through a corresponding encryption function or a corresponding encryption algorithm.
[0141] In this case, the second source code identifier 217 may include the second encrypted source code version 223. Encryption may be performed line by line, such that the line divisions of the second source code version 215 are preserved in the second encrypted source code version 223, and the second encrypted source code version 223 has encrypted lines that can be associated with the unencrypted lines of the second source code version 215 respectively.
[0142] The first source code identifier 213 and the second source code identifier 217 are preferably generated in the same way. The corresponding relationships within the source code identifiers 213 and 217 are implemented in the same way here, so that there is comparability between the two source code identifiers 213 and 217.
[0143] The encryption in the first and second encryption operations 226, 228 can be, for example, binary encryption. For instance, binary encryption can be given by calculating the corresponding hash values of each line in the first and second source code versions 207, 215. The encrypted lines of the first and second encryption source code versions 221, 223 can be represented by hash values calculated line by line in each case.
[0144] In identifier generation operation 222, version identifier 219 is generated based on second source code identifier 217 and first source code identifier 213. In this case, version identifier 219 describes the association between lines of the first source code version 207 and lines of the second source code version 215.
[0145] Version identifier 219 describes which lines of the second source code version 215 correspond to lines of the first source code version 207, or identifies lines of the second source code version 215 that do not correspond to the first source code version 207 due to modifications and / or additions or supplements in source code modification operation 216.
[0146] In addition, version identifier 219 can identify lines in first source code version 207 that do not correspond to second source code version 215 due to deletions and / or changes during source code change operation 216.
[0147] In this case, version identifier 219 is generated by comparing the first and second source code identifiers 213 and 217 with each other. If the first and second source code identifiers 213 and 217 include the first and second encrypted source code versions 221 and 223 generated by encryption operations 226 and 228, then comparing the first and second source code identifiers 213 and 217 includes comparing the encrypted lines of the first and second encrypted source code versions 221 and 223.
[0148] The generation of version identifier 219 can be achieved through a function or algorithm with corresponding settings. In this case, the function or algorithm is configured to read the first and second source text versions 207 and 215, and identify lines of the first source text version 207 contained in the second source text version 215. Furthermore, the function or algorithm can be configured to identify lines of the second source text version that do not appear in the first source text version 207 and / or identify lines of the first source text version 207 that do not appear in the second source text version 215.
[0149] Alternatively or additionally, the function or algorithm may be configured to be applied to the first and second encrypted source text versions 221, 223, and to identify encrypted lines of the first encrypted source text version 221 that have not been changed or have not appeared in the second encrypted source text version 223, or to identify encrypted lines of the second encrypted source text version 223 that do not correspond to the first encrypted source text version 221.
[0150] There is no need to decrypt the encrypted lines of the first and second encrypted source code versions 221 and 223.
[0151] Conversely, assuming that in the case of encrypting the lines of the first and second source code versions 207 and 215 line by line, the same encryption is achieved for lines with the same content, while the encrypted lines with different content also have different encryption values.
[0152] Here, the encryption of the first and second source code versions 207 and 215 is performed using the same encryption key in the two encryption operations 226 and 228.
[0153] Therefore, when encrypting individual rows by calculating hash values, it is assumed that rows with the same content will be calculated with the same hash value, while rows with different content will result in different hash values.
[0154] The comparison of the encrypted lines of the first and second encrypted source code versions 221 and 223 of the first and second source code identifiers 213 and 217 can be achieved, for example, by performing a method for determining the Longest Common Subsequence (LCS) as part of a diff tool. For this purpose, methods known in the art for determining the longest common subsequence can be used, and can be performed on the corresponding encrypted lines of the first and second encrypted source code versions 221 and 223 to thereby determine the aforementioned association between the encrypted lines of the first and second encrypted source code versions 221 and 223.
[0155] Based on the first machine code-source code relationship 211 and the generated version identifier 219, a second machine code-source code relationship 227 is determined in the relationship generation operation 230. The dashed line indicates that generating a corresponding file including the second machine code-source code relationship 227 is optional in order to determine the second machine code-source code relationship 227.
[0156] The second machine code-source code relationship 227 can be executed by a correspondingly configured function or algorithm. In this case, the function or algorithm can be configured to read the first machine code-source code relationship 211 and the version identifier 219, and determine from the first machine code-source code relationship 211 which lines of the first source code version 207 correspond to which code elements of machine code 209. The function or algorithm is also configured to read the version identifier 219 and determine which lines of the first source code version 207 correspond to which lines of the second source code version 215. The function or algorithm is also configured to determine, based on the information from the first machine code-source code relationship 211 and the version identifier 219, which lines of the second source code version 215 correspond to which code elements of machine code 209, and establish the corresponding relationships. These relationships can be stored as the second machine code-source code relationship 227 in a corresponding file.
[0157] Optionally, the association described in the second machine code-source code relationship 227 between the lines of the second source code version 215 and the corresponding elements of the machine code 209 can be used only for the corresponding execution of the debugging operation 224 of the corresponding lines of the second source code version 215, without needing to be stored in the corresponding file.
[0158] To determine the association between lines in the second source code version 215 and corresponding elements in machine code 209, the association between lines in the second source code version 215 and lines in the first source code version 207 is first determined based on version identifier 219.
[0159] As previously stated, these associations can be indirectly achieved via the corresponding encrypted lines of the second encrypted source code versions 221 and 223, since the association between the encrypted lines of the first and second encrypted source code versions 221 and 223 is first determined, and the association between the corresponding unencrypted lines of the first and second source code versions 207 and 215 is determined based on this.
[0160] Based on the association between the lines of the first and second source code versions 207 and 215 of the determined version identifier 219, and taking into account the first machine code-source code relationship 211 that defines which lines of the first source code version 207 correspond to which elements of the machine code 209, the corresponding association between the lines of the second source code version 215 and the corresponding elements of the machine code 209 can be determined in the form of the second machine code-source code relationship 227.
[0161] Based on version identifier 219 and considering the second machine code-source code relationship 227, debugging operations 224 of the control program can then be performed based on the second source code version 215 and machine code 209 stored on the control unit 201.
[0162] By considering the second machine code-source code relationship 227, although there is a deviation between the second source code version 215 and the first source code version 207 based on the second source code version 215, the execution of machine code 209 can be implemented and executed separately in the debugging operation 224.
[0163] Therefore, as is usually done in debugging operations, a stop point can be set within the second source code version 215, and taking into account the second machine code-source code relationship 227, the control program based on machine code 209 can stop at the desired location.
[0164] To better identify the changes in the second source code version 215 relative to the first source code version 207, matching information 225 can be provided in the matching provision operation 232. Here, the matching information 225 provides the matches or changes between the second source code version 215 and the first source code version 207.
[0165] Matching information 225 can be visually displayed to developers in development system 203, for example, by marking matching or modified lines in second source code version 215.
[0166] The generation and provision of matching information 225 can be performed by a function or algorithm configured accordingly. In this case, the function or algorithm is configured to read version identifier 219, determine the matching and / or deviation of lines of the first source text version 207 and the second source text version 215 based on it, and provide this information in matching information 225.
[0167] Figure 2 A flowchart of a method 100 for performing debugging operation 224 according to an embodiment is shown.
[0168] To perform debugging operation 224, in receiving step 101, development system 203 first receives the first machine code-source code relationship 211 and the first source code identifier 213. For this purpose, a copy operation 218 can be performed, in which the first machine code-source code relationship 211 and the first source code identifier 213 are copied to development system 203. This copying can be achieved by appropriately configuring functions for copying data. For example... Figure 1 The first machine code-source code relationship 211 and the first source code identifier 213 can be pre-stored on the control unit 201 of the automation system 200.
[0169] Similarly, as already combined Figure 1 The description, First Machine Code-Source Code Relationship 211, describes the association between lines of the first version of the source code 207 of the control program of the automation system 200 and elements of the associated machine code 209.
[0170] Conversely, the first source code identifier 213 includes information about the first source code version 207, which allows identification of the individual lines of the first source code version 207.
[0171] According to one implementation, the first source code identifier 213 may include a first source code version 207 or a portion thereof.
[0172] In source code comparison step 103, the copied first source code identifier 213 is compared with the second source code identifier 217 of the second source code version 215 executed on the development system 203. Here, the second source code identifier 217 is based on the second source code version 215, and the second source code version 215 may include all or part of the second source code version 215.
[0173] As described above, the second source code version 215 is based on the first source code version 207 and is generated from the first source code version 207 by source code changes in the form of adding or deleting individual lines of source code.
[0174] The comparison of the first and second source code identifiers 213 and 217 can be performed line by line, wherein the comparison determines which lines of the second source code version 215 match lines of the first source code version 207, or which lines do not correspond to the first source code version 207.
[0175] In identifier generation step 105, version identifier 219 is generated based on a comparison between the first and second source code identifiers 213 and 217. Here, version identifier 219 describes the association between lines of the first source code version 207 and lines of the second source code version 215.
[0176] Therefore, version identifier 219 defines which lines in the second source code version 215 match lines in the first source code version 207, and which lines in the second source code version 215 do not match lines in the first source code version 207. For the matching lines in the second source code version 215, it further defines which lines in the first source code version 207 also match.
[0177] In relationship determination step 107, a second machine code-source code relationship 227 is determined based on the first machine code-source code relationship 211 and the version identifier 219. Here, the second machine code-source code relationship 227 defines the association between lines of the second source code version 215 and elements of machine code 209.
[0178] Subsequently, in debugging step 109, taking into account the second machine code-source code relationship 227 based on the second source code version 215, the machine code 209 stored on the control unit 201 of the automation system 200 is used to perform the debugging operation 224 of the control program.
[0179] Figure 3 Another flowchart of a method 100 for performing debugging operation 224 according to another embodiment is shown.
[0180] Figure 3 The implementation of method 100 shown is based on Figure 2 The embodiments described herein include all method steps. Further detailed descriptions are omitted if these are identical in the illustrated embodiments.
[0181] and Figure 2 The implementation methods are different, in Figure 3 In the implementation method, encryption of the second source code version 215 is first performed in encryption step 111, and the second encrypted source code version 223 is generated.
[0182] Similarly, the corresponding encryption of the first source code version 207 is performed previously, and a corresponding first encrypted source code version 221 is generated. The first encrypted source code version 221 is accordingly incorporated into the first source code identifier 213 and stored on the control unit 201 of the automation system 200.
[0183] The encryption of the first and second source code versions 207 and 215 can be performed line by line by converting the individual lines of the first and second source code versions 207 and 215 into the corresponding encrypted lines of the first and second encrypted source code versions 221 and 223. Line by line encryption preserves the line structure of the first and second source code versions 207 and 215.
[0184] According to one implementation, encryption can be constructed, for example, as binary encryption. For this purpose, for example, for line-by-line encryption of single lines in first and second source code versions 207, 215, a hash value can be calculated.
[0185] In encryption operations 226 and 228 of the first and second source code versions 207 and 215, the same key is used accordingly, making it possible to compare encryption of individual lines in different source code versions.
[0186] Similar to the first source code identifier 213, in the illustrated embodiment, the second source code identifier 217 is generated based on the second encrypted source code version 223.
[0187] In source code comparison step 103, the encrypted lines of the first and second encrypted source code versions 221 and 223 of the first and second source code identifiers 213 and 217 are compared with each other accordingly. Therefore, it is not necessary to decrypt the encrypted lines of the first and second encrypted source code versions 221 and 223.
[0188] Instead, comparisons can be made on the encrypted lines of the encrypted source code versions 221 and 223.
[0189] This assumes that rows with identical content generate the same encryption, while rows with different content result in different encrypted rows. The comparison of encrypted rows from the first and second encryption source code versions 221 and 223 can be achieved, for example, by performing methods known in the art for determining the longest common subsequence on encrypted rows of each encryption source code version.
[0190] By executing a method for determining the longest common subsequence, a precise association can be achieved between the encrypted lines of the second encryption source code version 223 and the encrypted lines of the first encryption source code version 221. In this case, it can be explicitly associated with which encrypted line of the first encryption source code version 221 corresponds to an encrypted line of the second encryption source code version 223.
[0191] Based on the comparison of the first and second encrypted source code versions 221 and 223, version identifier 219 is generated in identifier generation step 105. As described above, this describes the association between the lines of the first source code version 207 and the second line of the second source code version 215. In this case, the fact that the line structure is preserved during the line-by-line encryption of the first and second source code versions 207 and 215 is utilized.
[0192] This means that the first encrypted line in the encrypted source code version corresponds to the encryption of the first unencrypted line in the corresponding unencrypted source code version. In this case, the line numbers of the corresponding encrypted and unencrypted lines are the same.
[0193] Therefore, the association between the encrypted lines of the first and second encrypted source code versions 221 and 223 can be used to infer the corresponding association between the unencrypted lines of the first and second source code versions 207 and 215.
[0194] Therefore, the version identifier 219 generated based on the first and second encrypted source code versions 221 and 223 corresponds to the version identifier 219 calculated on the first and second source code versions 207 and 215 in the above embodiment.
[0195] Furthermore, in the illustrated embodiment, matching information 225 is provided in information providing step 113. Matching information 225 defines lines in second source code version 215 that match lines in first source code version 207 and lines that do not match any lines in first source code version 207. Additionally, lines in first source code version 207 that were deleted in second source code version 215 can be displayed or marked. Markings may include the actual deleted lines and / or the line numbers of the deleted lines and / or the number of deleted lines. Matching information 225 can be displayed to developers through the markings in second source code version 215.
[0196] Figure 4 Another flowchart of a method 100 for performing debugging operation 224 according to another embodiment is shown.
[0197] Figure 4 The implementation shown is based on Figure 3 The implementation methods, and include all the method steps described therein.
[0198] and Figure 3 The implementation methods differ in that, Figure 4 In the embodiment shown, in the identifier generation step 105, the first file, which includes the contents of the first source code version 207 and the first encrypted source code version 221, is first associated with the second file, which includes the contents of the second source code version 215 and the second encrypted source code version 223, in the file association step 115.
[0199] In this scenario, each first file can be associated with at most one second file, and each second file can be associated with at most one first file.
[0200] According to one implementation, the association between the first and second files can be achieved based on the file paths of the corresponding first and second files.
[0201] Alternatively or additionally, the association between the first and second documents can be achieved by considering the corresponding contents of the first and second documents. For this purpose, for example, the method described above for determining the longest common subsequence can be used.
[0202] In file comparison step 117, the interrelated first and second files are compared with each other. For this purpose, the previously mentioned method can again be used to determine the longest common subsequence of the corresponding contents of the interrelated first and second files.
[0203] Therefore, by using the method for determining the longest common subsequence, first and second files that are related to each other can be compared, and first and second files that contain the same or similar content can be identified.
[0204] The generation of the aforementioned version identifier 219 can be achieved through file association and file comparison, wherein the file content specifically includes the unencrypted lines of the first and second source code versions 207 and 215, as described above, and the encrypted lines of the first and second encrypted source code versions 221 and 223.
[0205] Figure 5 Another flowchart of a method 100 for performing debugging operation 224 according to another embodiment is shown.
[0206] Figure 5 The implementation shown is based on Figure 4 The implementation methods, and include all the method steps described therein.
[0207] In the illustrated embodiment, in order to perform debugging operation 224 in debugging step 109, firstly in mapping step 119, when a stop point command for setting a stop point in the second source code version 215 for execution or display in development system 203 is received from the user of development system 203, based on the second machine code-source code relationship 227, the line in the second source code version 215 to which the stop point is to be set is mapped to the address or element of machine code 209.
[0208] Therefore, according to the second machine code-source code relationship 227, the relevant elements of machine code 209 are associated with the corresponding lines of the second source code version 215.
[0209] In program hold step 121, control unit 201 implements a stop point in the execution of machine code 209 at an address or element of machine code 209 identified as a stop point. Based on the set stop point, once the execution of machine code 209 reaches the stop point, the execution of the control or control program is stopped at the location identified by the stop point, just as in normal debugging operation 224.
[0210] In another mapping step 123, based on the second machine code-source code relationship 227, the corresponding address or element of the machine code 209 that stops execution or controls the program is mapped to the corresponding line in the second source code version 215. This can also be done for locations in machine code 209 where no stop point is set but which have been transferred to the second source code version 215 via the second machine code-source code relationship 227.
[0211] In a regular debugging operation 224, the user or developer in the development system 203 is shown the corresponding line within the executed source code of the second source code version 215, at which the execution of the control program or associated machine code 209 has stopped. This is achieved through the second machine code-source code relationship 227 generated as described above, where each element of the machine code 209 is associated with a line in the second source code version 215.
[0212] In step 125, the development system 203 displays to the relevant developers the line of the second source code version 215 that stopped the execution of machine code 209.
[0213] As described with respect to the above embodiments, the method 100 for debugging operation 224 of the control program for executing the automation system 200 according to the present invention can be used to debug the control program based on a source code version that does not correspond to the source code version, based on which the corresponding machine code 209 of the control program has been generated by a translation process and executed on the control unit 201.
[0214] As a result, debugging operation 224 can be performed without having to re-translate the source code into the corresponding machine code 209 and update the machine code 209 on the control unit 201 every time the source code is changed during the development of the control program, including restarting the execution of the control program on the control unit 201.
[0215] The method 100 according to the present invention, based on the above embodiments, can be executed by a corresponding execution module. In this case, the execution module can be executed, for example, by the development system 203 during programming operations to perform translation or debugging operations. For this purpose, the execution module can be integrated into the development system, for example.
[0216] List of reference numerals
[0217] 100 methods
[0218] 101 Receiving Steps
[0219] 103 Source Code Comparison Steps
[0220] 105 Identifier Generation Steps
[0221] 107 Steps to Determine Relationships
[0222] 109 Debugging Steps
[0223] 111 Encryption Steps
[0224] 113 Information Provision Steps
[0225] 115 File Association Steps
[0226] 117 File Comparison Steps
[0227] 119 Mapping Steps
[0228] 121 Procedure Holding Steps
[0229] 123 Another mapping step
[0230] 125 Show steps
[0231] 200 Automated Systems
[0232] 201 Control Unit
[0233] 202 Sensor / Actuator Unit
[0234] 203 Development System
[0235] 205 Another development system
[0236] 207 First Source Code Version
[0237] 208 Translation Operation
[0238] Machine code 209
[0239] 211 First Machine Code - Source Code Relationship
[0240] 212 First line recognition operation
[0241] 213 First source code identifier
[0242] 214 Installation Operation
[0243] 215 Second Source Code Version
[0244] 216 Source Code Modification Operations
[0245] 217 Second source code identifier
[0246] 218 Copy operation
[0247] Version 219 identifier
[0248] 220 Second row recognition operation
[0249] 221 First Encrypted Source Code Version
[0250] 222 Identifier Generation Operation
[0251] 223 Second Encrypted Source Code Version
[0252] 224 Debugging Operation
[0253] 225 Matching Information
[0254] 226 First Encryption Operation
[0255] 227 Second Machine Code - Source Code Relationship
[0256] 228 Second encryption operation
[0257] 230 Relation Generation Operation
[0258] 232 Matching provides operations
Claims
1. A method (100) for debugging operations of a control program for an automated system (200), comprising: In the receiving step (101), the development system (203) for performing the debugging operation (224) receives a first machine code-source code relationship (211) and a first source code identifier (213), wherein the first machine code-source code relationship (211) defines the association between lines of the first source code version (207) of the control program and corresponding code elements of the machine code (209) of the control program generated by translating the first source code version (207), and wherein the first source code identifier (213) includes information about the first source code version (207) that enables the identification of the individual lines of the first source code version (207); In the source code comparison step (103), the first source code identifier (213) is compared with the second source code identifier (217) of the second source code version (215) executed on the development system (203), wherein the second source code version (215) is generated by at least one source code change from the first source code version (207), wherein the second source code identifier (217) includes information about the second source code version (215) that enables the identification of individual lines of the second source code version (215), and wherein the first source code identifier (213) includes the first source code version (207), and the second source code identifier (217) includes the second source code version (215), wherein the first source code identifier (213) hereincludes the complete first source code version (207) or a portion thereof, and wherein the second source code identifier (217) hereincludes the complete second source code version (215) or a portion thereof; In the identifier generation step (105), a version identifier (219) is generated based on the comparison of the first source code identifier (213) and the second source code identifier (217), wherein the version identifier (219) defines the association between the lines of the first source code version (207) and the lines of the second source code version (215) corresponding to the lines of the first source code version (207). In the relationship determination step (107), a second machine code-source code relationship (227) is determined based on the first machine code-source code relationship (211) and the version identifier (219), wherein the second machine code-source code relationship (227) defines the association between lines of the second source code version (215) and corresponding code elements of the machine code (209); and In the debugging step (109), the debugging operation (224) of the machine code (209) stored on the control unit (201) is performed based on the second source code version (215) using the second machine code-source code relationship (227).
2. The method (100) according to claim 1, wherein, The first source code identifier (213) includes an encrypted first encrypted source code version (221) based on the first source code version (207), and wherein the method (100) further includes: The second source code version (215) is encrypted, and a second encrypted source code version (223) is generated in the encryption step (111), wherein the second source code identifier (217) includes the second encrypted source code version (223); and wherein comparing the first and second source code identifiers (213, 217) includes comparing the first and second encrypted source code versions (221, 223).
3. The method (100) according to claim 2, wherein, The encryption in the first and second source code versions (207, 215) is performed line by line.
4. The method (100) according to claim 2 or 3, wherein, The encryption in the first and second source code versions (207, 215) is constructed as binary encryption.
5. The method (100) according to any one of claims 2 to 4, wherein, The comparison of the first and second encrypted source code versions (221, 223) in the identifier generation step (105) includes comparing the encrypted lines of the first and second encrypted source code versions (221, 223) line by line.
6. The method (100) according to claim 5, wherein, The matching of a line of encryption in the first encrypted source code version (221) with the line of encryption in the second encrypted source code version (223) is interpreted as a complete match of the corresponding lines in the first and second source code versions (207, 215).
7. The method (100) according to any one of claims 4 to 6, wherein, Binary encryption is constructed as a hash value for the corresponding row.
8. The method (100) according to any one of the preceding claims, wherein, The first machine code-source code relationship (211) and the first source code identifier (213) are stored on the control unit of the automation system (200), and wherein the receiving step (101) includes copying the first machine code-source code relationship (211) and the first source code identifier (213) from the control unit (201) to the development system (203).
9. The method (100) according to any one of the preceding claims further includes: In the information provision step (113), matching information (225) is provided regarding the deviation and / or match between the first source code version (207) and the second source code version (215) based on the comparison between the first and second encrypted source code versions (221, 223).
10. The method (100) according to claim 9, wherein, The matching information (225) marks lines in the second source code version (215) that have been deleted or added in the second source code version (215) relative to the first source code version (207).
11. The method (100) according to claim 9 or 10, wherein, The matching information (225) is displayed to the user in the development system (203) to perform the debugging operation (224).
12. The method (100) according to any one of the preceding claims, wherein, The identifier generation step (105) includes: In the file association step (115), a first file including lines of the first source code version (207) and / or lines of the first encrypted source code version (221) is associated with a second file including lines of the second source code version (215) and / or lines of the second encrypted source code version (223), wherein each first file is associated with at most a second file, and each second file is associated with at most a first file; and In the file comparison step (117), the lines of the first source code version (207) and / or the first encrypted source code version (221) of the first file are compared with the lines of the second source code version (215) and / or the second encrypted source code version (223) of the corresponding associated second file.
13. The method (100) according to claim 12, wherein, In the file association step (115), the first and second files are associated based on the file paths of the corresponding first and second files or by the similarity of the lines and / or encrypted lines of the first and second files, and wherein the similarity is achieved by performing a method for determining the longest common subsequence (LCS) on the lines of the first and second source code versions (207, 215) and / or the first and second encrypted source code versions (221, 223) stored in the first and second files.
14. The method (100) according to claim 12 or 13, wherein, The contents of the associated first and second files are compared by performing a method for determining the longest common subsequence on the contents of the first and second files.
15. The method (100) according to any one of the preceding claims, wherein, Performing the debugging operation (224) includes: When a user receives a stoppoint command for setting a stoppoint within the second source code version (215) executed in the development system (203): In the mapping step (119), based on the second machine code-source code relationship (227), the line in the second source code version (215) to which the stop point is to be set is mapped to the address of the machine code (209); In the program hold step (121), the control unit (201) stops the execution of the machine code (209) at the address of the machine code (209) identified for the stop point; and In the further mapping step (123), based on the second machine code-source code relationship (227), the address of the machine code (209) whose execution stopped is mapped to the corresponding line of the second source code version (215); and In the display step (125), a line of the second source code version (215) is displayed in the development environment, in which the execution of the machine code (209) has stopped.
Citation Information
Patent Citations
Method and device for identifying semantic difference between source code versions
CN105446723A
Code update based on detection of change in runtime code during debugging
US20190205239A1