Source code analyzing system and source code analyzing method
AssigneeKabushiki Kaisha Toshiba
InventorsYuji Ishikawa, Yutaka Ota, Yu Nakanishi
Life of this patent
Estimating the term…
Abstract
Every time an assignment statement is executed during performing a simulation according to a second variable memory system, it is determined whether a value interpreted to have the same meaning is assigned to the assignment statement in the simulation according to a first variable memory system and in the simulation according to the second variable memory system. When the value interpreted to have the same meaning is not assigned, the value assigned according to the second variable memory system is overwritten by an expected value, and a report indicating that the assignment statement is a part dependent on a variable memory system is output.
Claims20
A source code analyzing system comprising:
- a first execution environment that includes at least one processor and a memory;
- a second execution environment that includes at least one processor a memory;
- a first building unit that builds a source code to generate a first object code that executes in the first execution environment according to a first endian variable memory system;
- a first executing unit that executes an execution-trace outputting process in which the first object code is executed to sequentially acquire values assigned to an assignment statement on an execution path of the first object code, and association between the acquired value and the assignment statement is sequentially output as an execution trace;
- a second building unit that uses the source code to generate a second object code that executes in the second execution environment according to a second endian variable memory system, which is different from the first endian variable memory system;
- and
- a second executing unit that executes a dependent-part specifying process in which the second object code is executed to
- acquire a value assigned to an assignment statement on an execution path of the second object code during execution of the second object code,
- determine, every time a value is assigned, whether the acquired value assigned to the assignment statement during execution of the second object code matches an expected value, wherein the expected value is a value obtained based on the execution trace and assigned to the assignment statement on the execution path of the second object code,
- overwrite, when both of the values are different from each other, the value assigned during execution of the second object code by the expected value, and
- output a report of position information of the assignment statement in the source code, indicating that the assignment statement in which the assigned value during execution of the second object is overwritten by the expected value is a part dependent on an endian variable memory system.
A source code analyzing method comprising:
- generating a first object code that executes in a first execution environment according to a first endian variable memory system by building a source code;
- executing an execution-trace outputting process in which the first object code is executed to sequentially acquire values assigned to an assignment statement on an execution path of the first object code, and association between the acquired value and the assignment statement is sequentially output as an execution trace;
- generating a second object code that executes in a second execution environment according to a second endian variable memory system, which is different from the first endian variable memory system, by the source code;
- and
- executing a dependent-part specifying process in which the second object code is executed to acquire a value assigned to an assignment statement on an execution path of the second object code during execution of the second object code, every time a value is assigned, determining whether the acquired value assigned to the assignment statement during execution of the second object code matches an expected value, which is a value obtained based on the execution trace and assigned to the assignment statement on the execution path of the second object code, and when both values are different from each other, overwriting the value assigned during execution of the second object code by the expected value and outputting a report of position information of the assignment statement in the source code, indicating that the assignment statement in which the assigned value during execution of the second object code is overwritten by the expected value is a part dependent on an endian variable memory system.
Dependencies are inferred from the claim text.