| OCR Text |
Show director is able to relate an executor's binary state to constructs in the executor's source code. Different levels of understanding can be achieved. 4.6.1 Understanding Data The director needs the name, the address, and the type of a variable to be able to access data structures in the executor. The name and the address are maintained in internal interpreter tables. This information is read by the interpreter when the executor is loaded. The information on the names and addresses of variables can be accessed by the director through directing routines. The information on variable types is not available in the linker information. It can be obtained from the source code of the executor. Variable definitions and their names are not first class language constructs in C. For example, a C program can not print out the definition of a variable or its name. A programmer may manually introduce appropriate print statements, but the language does not provide any mechanisms for that. Therefore, directors to manipulate complex data structures must be written specifically for each executor. A technique used by the director to copy and to modify complex data structures in the executor is explained in Section 4.5.3. An alternative that would provide general directors is to extend C with constructs that would make variable definitions and their names first class constructs. Another alternative is essentially to incorporate a C parser and an interpreter in a director. Both alternatives exceed the scope of this research and were not explored. 4.6.2 Understanding Program A program has two main representations, source code and machine code. Although it is hard to make a detailed correspondence between source code and machine code, a crude correspondence can be done through lines in the source code. 93 |