EP0814404B1

Debugging apparatus for debugging a program

Abstract

This record has no abstract on file.

EP0814404B1, drawing sheet 1
Sheet 1 of 32

Term

Term ended

Expired 18 June 2017, 9.3 years ago.

  1. Priority
  2. Filed
  3. Granted
  4. Expired
  5. Today

17 claims: 1 independent, 16 dependent

  1. 1
    A debugging apparatus for verifying a program, which is to be embedded into a target machine (30), by running the program in any of the target machine (30) itself, an emulator machine (20) emulating the target machine (30), and a simulator (1) simulating the target machine (30) in terms of software, wherein    each of the target machine (30), the emulator machine (20), and the simulator (1) includes operation state information which indicates an operation state of the program and inputs and outputs the operation state information in a form unique to each of the target machine (30), the emulator machine (20), and the simulator (1), the debugging apparatus comprising:target environment storing means for storing information of a target environment which is an identification name of any of the target machine (30), the emulator machine (20), and the simulator (1) as an environment target;receiving means for receiving a command input by an operator;instruction detecting means for judging whether a certain instruction is included in the command received by the receiving means;specifying means for, when the instruction detecting means judges that the certain instruction is included in the command, specifying a target environment specified by the identification name stored in the target environment storing means as a source target environment and for specifying, as a destination target environment, one of the target machine (30), the emulator machine (30), and the simulator (1) other than the identification name stored in the target environment storing means;reading means for reading operation state information from the source target environment;converting means for converting the operation state information read by the reading means into operation state information written in a form unique to the destination target environment;setting means for setting the operation state information written in the form unique to the destination target environment in the destination target environment;and operation resuming means for resuming an operation of the program in the destination target environment.
  2. 2
    The debugging apparatus of Claim 1, wherein    the target machine inputs and outputs the operation state information in a first form, the emulator machine inputs and outputs the operation state information in a second form, and the simulator inputs and outputs the operation state information in a third form, wherein    the converting means includes:a first converting unit for converting the operation state information from the first form to the third form when the source target environment is the target machine and the destination target environment is the simulator;and a second converting unit for converting the operation state information from the second form to the third form when the source target environment is the emulator machine and the destination target environment is the simulator, wherein    the setting means includes:    a first setting unit for setting the operation state information in the simulator after the operation state information has been converted into the third form.
  3. 3
    The debugging apparatus of Claim 2, wherein    the converting means includes:a third converting unit for converting the operation state information from the third form to the first form when the source target environment is the simulator and the destination target environment is the target machine;and a fourth converting unit for converting the operation state information from the third form to the second form when the source target environment is the simulator and the destination target environment is the emulator machine, wherein    the setting means includes: a second setting unit for setting the operation state information in the target machine after the operation state information has been converted into the first form;and a third setting unit for setting the operation state information in the emulator machine after the operation state information has been converted into the second form.
  4. 4
    The debugging apparatus of Claim 3, wherein    the converting means includes:a first controlling unit for instructing the first converting unit to convert the operation state information from the first form to the third form when the source target environment is the target machine and the destination target environment is the emulator machine, then instructing the fourth converting unit to convert the operation state information from the third form to the second form;and a second controlling unit for instructing the second converting unit to convert the operation state information from the second form to the third form when the source target environment is the emulator machine and the destination target environment is the target machine, then instructing the third converting unit to convert the operation state information from the third form to the first form.
  5. 5
    The debugging apparatus of Claim 4 further comprising:a serial transfer port for inputting and outputting the operation state information of the first form from and to a processor included in the target machine, wherein the serial transfer port is connected to the processor via a first line;and a device driver for inputting and outputting the operation state information of the second form from and to an incircuit emulator included in the emulator machine, wherein the device driver is connected to the incircuit emulator via a second line.
  6. 6
    The debugging apparatus of Claim 5, wherein    the operation state information is composed of information stored in a register and a memory of the source target environment.
  7. 7
    The debugging apparatus of Claim 6, wherein the target machine, the emulator machine, and the simulator are also called target environments, wherein the information stored in the memory is one of:a breakpoint for instructing the processor to stop operating;trace data which is composed of at least an address of an instruction in the program which has been executed;and interrupt setting information for generating an interrupt signal when a certain condition set by the operator is satisfied.
  8. 8
    The debugging apparatus of Claim 7 further comprising:storage managing means for managing memories and registers of the target machine, the emulator machine, and the simulator by classifying the memories and the registers into memories and registers storing effective values and memories and registers storing ineffective values;and rewriting means for converting ineffective values included in operation state information into default values by referring to the storage managing means when the operation state information is read from the source target environment by the reading means, wherein the converting means converts the operation state information into a form of the destination target environment after the rewriting means has converted the ineffective values into the default values.
  9. 9
    The debugging apparatus of Claim 7 further comprising:breakpoint setting managing means for managing areas of the memories and the registers of the target machine, the emulator machine, and the simulator by classifying the areas into areas for which a breakpoint can be set and areas for which a breakpoint cannot be set;judging means for judging whether a breakpoint is to be set in the destination target environment by referring to the breakpoint setting managing means after the converting means has converted the operation state information into the form of the destination target environment;and notifying means for notifying the operator that the breakpoint is not to be set in the destination target environment when the judging means judges that the breakpoint is not to be set in the destination target environment.
  10. 10
    The debugging apparatus of Claim 7 further comprising:maximum value storing means for storing a value representing the maximum number of accumulated addresses for each of the target machine, the emulator machine, and the simulator;address number recognizing means for recognizing a current number of accumulated addresses in the destination target environment;and notifying means for notifying the operator of a difference between the current number of accumulated addresses and the maximum number of accumulated addresses.
  11. 11
    The debugging apparatus of Claim 7 further comprising:interrupt generation managing means for managing the target environments by classifying the target environments into ones which monitor a satisfaction of an interrupt generation condition and ones which do not monitor the satisfaction of the interrupt generation condition;judging means for judging whether the destination target environment monitors the satisfaction of the interrupt generation condition by referring to the interrupt generation managing means after the converting means has converted the operation state information into the form of the destination target environment;and notifying means for notifying the operator that the destination target environment does not monitor the satisfaction of the interrupt generation condition when the judging means judges that the destination target environment does not monitor the satisfaction of the interrupt generation condition.
  12. 12
    The debugging apparatus of Claim 7 further comprising:first interpreting means for interpreting an instruction of monitoring a generation of an interrupt signal when the instruction detecting means judges that the certain instruction is not included in the command received by the receiving means, the instruction being included in the command received by the receiving means;second interpreting means for interpreting an identification number of an interrupt signal and a corresponding destination target environment, the identification number and the corresponding destination target environment being included in the command received by the receiving means;monitoring means for monitoring the generation of the interrupt signal in the source target environment;and judging means for, when an interrupt signal is generated, judging whether an identification number of the generated interrupt signal matches the identification number interpreted by the second interpreting means, wherein the reading means reads the operation state information from the source target environment when the judging means judges that the identification number of the generated interrupt signal matches the identification number interpreted by the second interpreting means.
  13. 13
    The debugging apparatus of Claim 7 further comprising:first interpreting means for interpreting an instruction of monitoring a rewriting of one of a certain memory and a certain register when the instruction detecting means judges that the certain instruction is not included in the command received by the receiving means, the instruction being included in the command received by the receiving means;second interpreting means for interpreting an instruction of changing a current target environment to another target environment in case one of the certain memory and the certain register is rewritten, the instruction being included in the command received by the receiving means;. and monitoring means for monitoring the rewriting of one of the certain memory and the certain register, wherein the reading means reads the operation state information from the source target environment, wherein the converting means converts the operation state information into the form of the destination target environment which is the other target environment interpreted by the second interpreting means.
  14. 14
    The debugging apparatus of Claim 7 further comprising:first interpreting means for interpreting an instruction of changing target environments when the instruction detecting means judges that the certain instruction is not included in the command received by the receiving means, the instruction being included in the command received by the receiving means;second interpreting means for interpreting a table which shows relation between a plurality of parts of the program and corresponding target environments, the table being included in the command received by the receiving means;third interpreting means for interpreting an instruction of monitoring a change of currently executed part of the program, the instruction being included in the command received by the receiving means;and monitoring means for monitoring the change of currently executed part of the program in the source target environment, wherein    the specifying means includes: a destination specifying unit for specifying a destination target environment when the monitoring means detects the change of currently executed part by referring to the table interpreted by the second interpreting means, wherein the reading means reads the operation state information from the source target environment when the destination specifying unit specifies the destination target environment.
  15. 15
    The debugging apparatus of Claim 7 further comprising:first interpreting means for interpreting an instruction of changing target environments when the instruction detecting means judges that the certain instruction is not included in the command received by the receiving means, the instruction being included in the command received by the receiving means;second interpreting means for interpreting a table which shows relation between a plurality of variable values, a plurality of values which can be stored in one of a memory and a register, and corresponding target environments, the table being included in the command received by the receiving means;third interpreting means for interpreting an instruction of monitoring a change of a certain variable of the program, the instruction being included in the command received by the receiving means;and monitoring means for monitoring the change of the certain variable of the program in the source target environment, wherein    the specifying means includes: a destination specifying unit for specifying a destination target environment when the monitoring means detects the change of the certain variable by referring to the table interpreted by the second interpreting means, wherein the reading means reads the operation state information from the source target environment when the destination specifying unit specifies the destination target environment.
  16. 16
    The debugging apparatus of Claim 7 further comprising:first interpreting means for interpreting a table which shows relation between a plurality of parameters, a plurality of parts of the program, and corresponding target environments when the instruction detecting means judges that the certain instruction is not included in the command received by the receiving means, the table being included in the command received by the receiving means;second interpreting means for interpreting an instruction of monitoring a change of a certain parameter of the program, the instruction being included in the command received by the receiving means;and monitoring means for monitoring the change of the certain parameter of the program in the source target environment, wherein    the specifying means includes: a destination specifying unit for specifying a destination target environment when the monitoring means detects the change of the certain parameter by referring to the table interpreted by the first interpreting means, wherein the reading means reads the operation state information from the source target environment when the destination specifying unit specifies the destination target environment.
  17. 17
    The debugging apparatus of Claim 7 further comprising:first interpreting means for interpreting a table which shows relation between a plurality of target environments and corresponding scheduled execution times when the instruction detecting means judges that the certain instruction is not included in the command received by the receiving means, the table being included in the command received by the receiving means;and time measuring means for measuring a current time, wherein    the specifying means includes: a destination specifying unit for specifying a destination target environment when the current time matches one of the scheduled execution times by referring to the table interpreted by the first interpreting means, wherein the reading means reads the operation state information from the source target environment when the destination specifying unit specifies the destination target environment.
Independent claims17