Embodiments described herein relate generally to a program information generating system, method, and program product.
Systems for generating information indicating the status of execution of a program (software) are used for development, inspection, and the like of the program systems include those that display, on a time axis, order and the results of execution of a program executed in a simulation in which the timing of execution of non-interruption processing and the timing of interruption processing are displayed on the same time axis.
Conventional systems display the position where interruption processing has occurred on a time axis used for displaying results of a simulation. The systems can specify the position of interruption at the level of action information (tracing information) of the program but cannot specify the position at the level of instruction codes constructing the program.
The acquiring unit 11 acquires a program and action information, the program being subject to inspection, the action information indicating the order of execution of a plurality of instruction codes included in the program. The program includes a non-interruption instruction code and an interruption instruction code. The acquiring unit 11 is configured using, for example, the CPU 31, a control program, a logic integrated circuit (IC), and the RAM 33. The term “acquiring” herein means receiving data from outside and generating data inside. The program and the action information may be generated by a system (a device) other than the program information generating system 1 or may be generated inside the program information generating system 1. Methods of generating the program and the action information are not limited, and the program and the action information may be generated using a known or a novel technique as appropriate.
The action interruption position determining unit 12 determines an action interruption position indicating a position where interruption has occurred in the action information based on the interruption instruction code and the action information. The action interruption position determining unit 12 is configured using, for example, the CPU 31, a control program, a logic IC, and the RAM 33.
The program interruption position determining unit 13 determines a program interruption position indicating a position where interruption has occurred in the program based on the non-interruption instruction code and the action interruption position. The program interruption position determining unit 13 is configured using, for example, the CPU 31, a control program, a logic IC, and the RAM 33.
The generating unit 14 generates program interruption position information that specifies a program interruption position. The generating unit 14 is configured using, for example, the CPU 31, a control program, a logic IC, and the RAM 33.
A non-interruption instruction code 55 and an interruption instruction code 56 are included in the instruction codes 50. The interruption instruction code 56 is an instruction code for having the interruption processing executed. The non-interruption instruction code 55 is an instruction code other than the interruption instruction code 56.
The program 52 in this example corresponds to a function funcA of the source code 51. The non-interruption instruction code 55 in this example is configured with a plurality of instruction codes 50 to which three labels 54 of funcA_top, funcA_if, and funcA_else are assigned. The function funcA includes branch processing. Five instruction codes (add, st, ld, st, and jmp) 50 not including branch processing are assigned with the label 54 of funcA_top. Six instruction codes (ld, cmp, jne, mov, ct, and jbr) 50 representing if statements and the inner processing of the function funcA are assigned with the label 54 of funcA_else. Five instruction codes (ld, cmp, jne, mov, and st) 50 representing else statements and the inner processing of the function funcA are assigned with the label 54 of funcA_else.
The function handler the source code 51 is a function for executing interruption processing. The interruption instruction code 56 in this example is configured with a plurality of instruction codes (mov and st) 50 assigned with the label 54 of handler.
It is preferable that the function for executing the interruption processing be preliminarily designated. The function for executing the interruption processing may be manually designated by a user or may be automatically detected and designated by processing of the control program.
The action interruption position determining unit 12 detects a part (a coincident part) coinciding with the interruption instruction code (mov and st) 56 from a plurality of instruction codes 50 included in the action information 53 and determines the coincident part to be the action interruption position 61. The method of detecting the coincident part is not limited, and any method using a known or a novel technique as appropriate is applicable. The coincident part can be detected in the action information 53 using the instruction codes (mov and the function handler and the label (handler) 54 as search keywords. The instruction codes (such as ld, cmp, jne, mov, st, and jbr) 50 in the non-interruption instruction code 55 and the labels (such as funcA_if) 54 may also be used as search keywords. Use of the instruction codes 50 of the non-interruption instruction code 55 and the labels 54 as search keywords allows the user to check the order of the instruction codes 50 arranged ahead of and behind the coincident part, thereby more accurately detecting the coincident part.
In the action information 53 in this example, the interruption instruction codes (mov and st) 50 of handler are interposed between the attached label 57, start, representing an action start of funcA_if and the attached label 57, end, representing an action end of funcA_if. This structure of the action information 53 allows the user to understand that interruption has occurred in the if statement of the function funcA.
The program interruption position determining unit 13 detects an immediately preceding instruction code 62 positioned immediately ahead of the action interruption position 61 and an immediately following instruction code 63 positioned immediately behind the action interruption position 61. The program interruption position determining unit 13 thereafter detects a part (a successive part) where the immediately preceding instruction code 62 and the immediately following instruction code 63 are successively positioned in the non-interruption instruction code 55 and determines the successive part to be the program interruption position 65. The method of detecting the successive part is not limited, and any method using a known or a novel technique as appropriate may be applicable. The successive part (the program interruption position 65) can be detected in the non-interruption instruction code 55 using, for example, the immediately preceding instruction code (mov) 62, the immediately following instruction code 63, and the label (funcA_if) 54 representing a scope including these codes as search keywords. Furthermore, the instruction codes (such as ld, cmp, jne, mov, st, and jbr) 50 positioned ahead of and behind the immediately preceding instruction code 62 and the immediately following instruction code 63 and the label (such as funcA_if) 54 in the action information 53 may be used as search keywords. Use of the instruction codes 50 positioned ahead of and behind the immediately preceding instruction code 62 and the immediately following instruction code 63 and the label 54 as search keywords allows the user to check the order of the instruction codes 50 arranged ahead of and behind the successive part, which enables more accurate detection of the successive part.
The successive part (the program interruption position 65) in this example is positioned at the two instruction codes 50: “mov” and “st” in funcA_if of the non-interruption instruction code 55. This indicates that interruption has occurred after execution of the instruction code 50: “mov” and before execution of the instruction code 50: “st” in the if statement in the function funcA. In this manner, with the program interruption position 65, an interruption occurrence position can be specified at the level of instruction codes 50 of the program 52.
The program interruption position information 71 is not limited to the above-described examples. For example, the program interruption position information 71 may include an ID corresponding to the immediately following instruction code 63 in addition to or instead of the immediately preceding instruction code ID 72.
The program interruption position information 71 generated in the above-described manner can be used for various purposes. For example, the program interruption position information 71 may be directly output to a display or the like of a computer may be provided for another system such as a system visualizing the status of execution of the program 52 and verifying the program 52 (the source code 51) using, for example, a graphical user interface (GUI).
The hardware configurations illustrated in
A control program implementing the functions of the program information generating system 1 can be recorded in a computer-readable memory medium such as a CD-ROM, a flexible disk (FD), a CD-R, a DVD, and the like and provided in an installable or executable file. The control program may be provided by being downloaded from a certain memory device connected to a network to a certain computer or may be provided to a certain information processing device by being preliminarily embedded in a ROM or the like. The control program may be configured with a plurality of modules implementing the functions of the above-described acquiring unit 11, action interruption position determining unit 12, program interruption position determining unit 13, and generating unit 14.
According to the above-described first embodiment, an interruption occurrence position can be specified at the level of instruction codes 50 of the program 52.
Other embodiments will now be described with reference to the drawings. Like numerals indicate like or identical items in the first embodiment, and description thereof may be omitted.
The designating unit 82 designates one or more scopes of a plurality of scopes included in the program 52. The designating unit 62 is configured using, for example, the CPU 31, a control program, a logic IC, and the RAM 33. The action interruption position determining unit 12 determines the action interruption position 61 in the designated scope. The program interruption position determining unit 13 determines the program interruption position 65 in the designated scope. In other words, in the second embodiment, a range for determining an interruption occurrence position in the program 52 can be designated.
A scope designated by the designating unit 82 is a section including one or successive instruction codes 50. The designated scope is typically a section by the function unit assigned with the label 54; however, the embodiments are not limited thereto. The scope may be manually designated by a user or may be automatically designated by the processing of a control program in accordance with a certain condition.
The action interruption position determining unit 12 in this embodiment determines the action interruption position 61 exclusively in the designated section 89. The action information 91 indicates only the order of execution in the designated section 89. The action information 91 in this example is information generated by repeating simulations on the designated section 89. In this embodiment, two action interruption positions 61A and 61B in respective simulations are described.
The program interruption position determining unit 13 in this embodiment determines program interruption positions 65A and 65B in the designated section 89 based on the action interruption positions 61A and 61B and the program as is described in the first embodiment. The program interruption position 65A corresponds to the action interruption position 61A, whereas the program interruption position 65B corresponds to the action interruption position 61B. As is described in the first embodiment, the generating unit 14 generates the program interruption position information 71 based on the program interruption positions 65A and 65B determined in this manner.
According to the second embodiment, an interruption occurrence position can be determined exclusively in a scope requested by the user. This method can prevent generation of unnecessary information and facilitate a check of verification results in each scope.
The display control unit 102 controls a display unit to display a display image depicting the status of execution of the interruption instruction code 56 based on the program interruption position information generated by the generating unit 14. The display unit is a device outputting an image, examples of which include a display and a printer. The display control unit 102 is configured using, for example, the CPU 31, a control program, a logic IC, and the RAM 33.
The scope designation field 117A is a field for having a user select a desired scope from a plurality of scopes (functions) included in the program 52. In this example, a plurality of scopes are displayed in a list, and the can designate a desired scope using a mouse, a touch panel, or the like. For example, a column of a scope selected by the user and a column of a scope in which the interruption processing has occurred may be emphasized by using a display form different from the forms of the other columns.
The result display field 118 displays a graph depicting the status of execution of the interruption processing in a designated scope in the scope designation field 117A.
The call tree 120 depicts scopes in the program 52 as nodes and depicts the call relation between the scopes. The number written on the top right of each node represents the number of interruptions having occurred in the node. The first scope designation field 117C is a field for designating a comparatively wide section (scope) in the program 52. The second scope designation field 117D is a field for designating a more detailed section than the first scope designation field 117C. The result display field 118 displays a graph depicting the status of execution of the interruption processing in a section designated in the second scope designation field 117D. This structure allows the user to designate a scope in two steps from designation of a wider section to designation of a more detailed section using information indicating the call relation between the scopes depicted in the call tree 120. The display control unit 102 may have the display unit display the call tree 120.
Designation of a section in the first step will now be described. Items representing comparatively wide sections in a file, a program of a function, or the like are given on the abscissa of the first scope designation field 117C. The total number of times of interruption processing having occurred during execution of the section of each item is given on the ordinate. In order obtain the total number of times of interruption processing having occurred during execution of a section, it is necessary to obtain the number of times of interruption processing having occurred in all the sections called during execution of the section. The call tree depicts the number of times of interruption processing to be obtained. For example, the number of interruptions having occurred in FuncA is the total number of interruptions having occurred in FuncA and all of its descendant nodes, FuncA_if and FuncA_else as illustrated in a branch portion 122. The total number of interruptions having occurred during execution of FuncA is therefore counted as: 5+30+15=50. The user designates a comparatively wide section from the first scope designation field 117C with reference to such information.
After completing the first step of designating a section in the above-described manner, the process proceeds to the second step of designating a more detailed section. This example describes a case in which FuncA is designated at the first step. The abscissa of the second scope designation field 117D lists all the items representing sections that run during execution of FuncA. The given items can be acquired from the descendant nodes of the FuncA node in the all tree 120. In this example, three items, FuncA, FuncA_if, and FuncA_else are displayed. The total number of times of interruption processing having occurred during execution of the section of each item is given on the ordinate. Unlike the first scope designation field 117C, the ordinate of the second scope designation field 117D does not include the number of interruptions having occurred in another section. Upon designation of a desired section, for example, FuncA_if, from the second scope designation field 117D, a graph depicting the status of execution of interruption processing in FuncA_if is displayed on the result display field 116.
The program interruption position information 86 and the display images 111 to 115 are merely examples, and the embodiments are not limited thereto. The program interruption position information 86 illustrated in
According to the above-described third embodiment, display images 111 to 115 visually depicting the status of execution of the interruption instruction code 56 in a scope requested by the user can be generated by using the results of designation given by the designating unit 82 and the program interruption position information 86 generated by the generating unit 14.
The first interruption instruction code 125 is configured with two instruction codes 50: “mov” and “st” to which the label 54: “handler 1” is assigned. The second interruption instruction code 126 is configured with three instruction codes 50: “mov”, “add”, and “st” to which the label 51: “handler 2” is assigned. The third interruption instruction code 127 is configured with three instruction codes : “mov”, “sub”, and “st” to which the label 54: “handler_3” is assigned.
The first action interruption position 135 corresponds to the first interruption instruction code 125. The second action interruption position 136 corresponds to the second interruption instruction code 126. The third action interruption position 137 corresponds to the third interruption instruction code 127. The action interruption positions 135 to 137 can be determined by performing the same processing as that of the first embodiment on the respective interruption instruction codes 125 to 127.
The first program interruption position information 141 corresponds to the first action interruption position 135. The second program interruption position information 142 corresponds to the second action interruption position 136. The third program interruption position information 143 corresponds to the third action interruption position 137. The program interruption positions 141 to 143 can be generated by performing the same processing as that of the first embodiment on the respective action interruption positions 135 to 137.
The display images 145 and 146 are merely examples, and the embodiments are not limited thereto. For example, the emphasis object 116 illustrated in
According to the above-described fourth embodiment, in the case in which a plurality of interruption instruction codes 125 to 127 exist, the interruption occurrence position for each of the interruption instruction codes 125 to 127 is obtained. Furthermore, easier comparison in the number of interruptions between the interruption instruction codes 125 to 127 facilitates comparison in behavior between the interruption instruction codes 125 to 127 in an action information piece 131.
Three pieces of action information 151 to 153 are acquired by, for example, executing the program 88 three times under respective different conditions. A first action interruption position 148 in the first action information 151, a second action interruption position 149 in the second action information 152, and a third action interruption position 150 in the third action information 153 are different from one another.
The first program interruption position information 158 corresponds to the first action information 151 (the first action interruption position 148). The second program interruption position information 159 corresponds to the second action information 152 (the first action interruption position 149). The third program interruption position information 169 corresponds to the third action information 153 (the third action interruption position 150).
The display images 161 and 162 are merely examples, and the embodiments are not limited thereto. For example, the emphasis object 116 illustrated in
According to the above-described fifth embodiment, in the case in which a plurality of pieces of action information 151 to 153 exist, the interruption position for each of the pieces of action information 151 to 153 is obtained. Furthermore, easier comparison in the number of interruptions between the pieces of action information 151 to 153 facilitates comparison in behavior between the pieces of action information 151 to 153 for an interruption instruction code 125.
In this embodiment, the first action information 171 includes the first action interruption position 175 corresponding to the first interruption instruction code 125 The second action information 172 includes the second action interruption position 176 corresponding to the second interruption instruction code 126. The third action information 173 includes the third action interruption position 177 corresponding to the first interruption instruction code 125 and the fourth action interruption position 178 corresponding to the third interruption instruction code 127.
The first program interruption position information 181 corresponds to the first action interruption position 175. The second program interruption position information 162 corresponds to the second action interruption position 176. The third program interruption position information 183 corresponds to the third action interruption position 177. The fourth program interruption position information 184 corresponds to the fourth action interruption position 176.
The display image 191 is a merely example, and the embodiments are not limited thereto. For example, the emphasis object 116 illustrated in
According to the above-described sixth embodiment, in the case in which a plurality of interruption instruction codes 125 to 127 and a plurality of pieces of action information 171 to 173 exist, the number of interruptions for an interruption occurrence position can be obtained on each of the combinations of the interruption instruction codes and the pieces of action information. Furthermore, various interruption occurrence patterns can be investigated by generating the program interruption position information 181 to 184 based on the interruption instruction codes 125 to 127 and the pieces of action information 171 to 173.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the present invention. The novel embodiments can be implemented in a variety of other forms, and various omissions, substitutions, and changes can be made without departing from the spirit of the present invention. These embodiments and the modifications are included in the scope and spirit of the present invention and included in the scope of the invention described in the accompanying claims and their equivalents.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application is based upon and claims the benefit of priority from PCT Application No. PCT/JP2015/071811, filed on Jul. 31, 2015; the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP2015/071811 | Jul 2015 | US |
Child | 15681523 | US |