WO2010092641A1 - Program debugging device and emulator system - Google Patents

Program debugging device and emulator system Download PDF

Info

Publication number
WO2010092641A1
WO2010092641A1 PCT/JP2009/005543 JP2009005543W WO2010092641A1 WO 2010092641 A1 WO2010092641 A1 WO 2010092641A1 JP 2009005543 W JP2009005543 W JP 2009005543W WO 2010092641 A1 WO2010092641 A1 WO 2010092641A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
trace
recording
latest
longest
Prior art date
Application number
PCT/JP2009/005543
Other languages
French (fr)
Japanese (ja)
Inventor
三宅博之
高松正昭
瀬戸口博志
Original Assignee
パナソニック株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by パナソニック株式会社 filed Critical パナソニック株式会社
Publication of WO2010092641A1 publication Critical patent/WO2010092641A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Definitions

  • the present invention relates to a program debug apparatus having a trace function and an event function, and more particularly to a program debug apparatus effective for debugging a product program using multiple interrupts and the like.
  • emulators and on-board debuggers which are program debugging devices, are widely used in development environments for embedded programs.
  • high-quality software is desired at the same time as the software becomes larger and more complex with higher functionality.
  • CPU Central Processing Unit
  • CPU design In a CPU design that requires such settings, the design work becomes more complicated as software becomes larger and more complex, and problems such as memory access exclusivity and interrupt processing time are more likely to occur. Therefore, CPU design often falls into a situation where the design contents must be analyzed using a program debugging device.
  • the program debugging apparatus has a trace function and an event function, and the design contents are traced by the CPU using these functions, and as a result, the trace log (record of processing executed by the program) obtained by the CPU is analyzed. .
  • FIG. 20 is a block diagram showing a configuration of a conventional program debugging apparatus.
  • the program debugging apparatus includes a CPU 1, an event controller 2, a trace controller 3, and a trace memory 11.
  • the event controller 2 monitors the state of processing performed by the CPU 1 during execution of the program, determines whether the monitored state is equivalent to the state set as an event, and determines the determination result as the event establishment state.
  • the trace controller 3 Based on the trace log acquired from the CPU 1 and the event establishment state acquired from the trace controller 3, the trace controller 3 is equivalent to the state established in advance as the start event and the end event and the event establishment state. It is determined whether or not. Further, the trace controller 3 creates the trace recording execution information 3a based on the determination result. When there is an instruction to record the trace log, the trace controller 3 records the held trace log in the trace memory 11 and then analyzes the log.
  • the program debug device sets a start event and an end event at a place where it can be assumed that a problem occurs in software as described above, and then in a period from the start event to the end event (hereinafter abbreviated as a trace log period). Acquire the trace log and analyze the acquired trace log. By repeating the above processing, a place where a problem finally occurs is specified.
  • a method for specifying the longest trace log period is proposed in Patent Document 1.
  • a method for recording a trace log is proposed in Patent Document 2.
  • the trace logs in each period can be accumulated and recorded, but the trace log in the specified longest trace log period cannot be selectively recorded after the longest trace log period is specified. .
  • the longest trace log period In the longest trace log period, ⁇ Multiple interrupts occur, ⁇ An unexpected interrupt occurs. ⁇ The amount of processing increases abnormally. ⁇ Multiple tasks have write access to variables, As a result, it is assumed that the problem of exclusivity occurs and the task processing time becomes abnormally long. Therefore, the longest trace log period is estimated based on such an assumption. Therefore, if the interrupt is not entered, the processing time is shortened and the above-mentioned inconvenience often does not occur. Then, the trace log period that should be the longest trace log period is specified as the longest trace log period. It becomes impossible.
  • the event controller 2 also outputs the event establishment state to the time measuring device 7.
  • the time measuring device 7 determines whether or not the state set in advance as the start event and the end event is equivalent to the event establishment state.
  • the time measuring device 7 measures the time of the event establishment state determined to be equivalent to the state set in advance in the determination.
  • the time measurement is to measure the time length of the trace log period in which the processing state of the start / end event is equivalent to one arbitrary event in the event establishment state.
  • the time length measured in this way is simply referred to as the time length.
  • the time measuring device 7 After performing the above time measurement, the time measuring device 7 records the measured time length. When recording, the time measuring device 7 compares the time length of the trace log period measured this time with the time length of the trace log period already stored, and the time length of the trace log period measured this time is the recorded trace log period. Only when the time length is longer than the time length, the time length is updated. When the time length is shorter, the time length is not updated. By performing such a record update operation, the time measuring device 7 maintains the longest time length while constantly updating it.
  • the time measuring device 7 While the trace controller 3 accumulates the trace log, the time measuring device 7 performs time length measurement and update processing of the longest time length.
  • the conventional program debugging apparatus repeats such an operation.
  • the time measuring device 7 operates independently of the trace controller 3.
  • the CPU 1 When analyzing problems on systems that are used for a long time or software with low reproducibility, the CPU 1 is executed for a long time and the trace log is accumulated. However, in that case, the accumulated trace log becomes enormous, and the analysis of the trace log itself becomes difficult, and the processing takes a lot of time. Furthermore, since the capacity of the trace memory 11 is limited, if the trace log becomes enormous, the area for recording the trace log is rolled over and the trace log is overwritten, so that the trace log cannot be analyzed. There is also.
  • the data unit of the trace log is 20 bytes and the average number of trace log data in the period (trace log period) from the start to the end of the trace is 5,000
  • the data size of the trace log in the trace log period is 100,000 bytes. If the setting cycle of the trace log period is 10 times per second and the capacity of the trace memory 11 is 1,000,000 bytes, the amount of trace log that can be recorded is only about 1 second, which is insufficient. I must say.
  • the main object of the present invention is to narrow down the trace log effectively in the recording of the trace log, thereby quickly and easily identifying a problem with low reproducibility and difficult to analyze.
  • the present invention has the following configuration.
  • a program debugging apparatus comprises: A CPU for executing the program; After holding an event defining an arbitrary state at the time of execution of the program by the CPU, the process progress at the time of actual program execution by the CPU is compared with the event, and in the process progress based on the comparison result An event controller that determines whether or not a partial progress that defines the start and end of the event is established; and A trace memory for recording the partial progress; A trace controller for temporarily recording the partial progress determined to be established by the event controller in the trace memory; Whether the period from the start of the partial progress to the end at the temporary point at the time of actual program execution is the longest among the groups of the partial progress groups established before that including the temporary point A trace log recording confirmation controller for selecting whether to record the partial progress temporarily recorded in the trace memory at the temporary point based on the determination of Is provided.
  • the event controller is -Holds an event that defines an arbitrary state when the program is executed by the CPU. -Compare the process progress (trace log) and event during the actual program execution by the CPU, -It is determined whether or not the partial progress in which the start and end are defined by the event in the processing progress is established based on the comparison result, Perform the operation.
  • the trace controller Temporarily record the partial progress determined to be established by the event controller in the trace memory. Perform the operation.
  • Trace log record confirmation controller ⁇ Whether the period from the start of the partial progress at the temporary point at the time of actual program execution to the end is the longest among the groups of partial progress groups established before that including the temporary point to decide, -Select whether to record the partial progress temporarily recorded in the trace memory at a temporary point based on the judgment result, Perform the operation.
  • the period from the start of the partial progress at the temporary point at the time of actual program execution to the end is the longest among the groups of the partial progress groups established before that including the temporary point” Is actually “longer than last time” and does not mean just one.
  • the partial progress left in the trace memory is the partial progress related to events that are relatively long in duration and likely to contain more serious software problems. Therefore, by analyzing the partial progress that has been narrowed down and stored in the trace memory in this way, it is possible to quickly and easily identify the location of the final problem. In addition, narrowing down the partial progress of recording is also effective in avoiding an excessive increase in the capacity of the trace memory.
  • the trace log record confirmation controller comprises a trace memory address manager;
  • the trace memory address manager sets a recording address (latest) that defines a memory position in the trace memory that stores the partial progress established at the temporary point, and the part established at a time before the temporary point.
  • Set the recording address (previous) that defines the memory location in the trace memory that stores the progress.
  • the trace memory address manager determines that the period is the longest in the group of periods
  • the trace memory address manager updates the recording address (latest) while determining that the period is not the longest in the group of periods. Then, the recording address (previous) is set to the recording address (latest). There is a mode.
  • the recording address (latest) is updated. Then, the next partial progress is recorded, the updated recording address (latest), and not the recording address (previous) which is the address at which temporary recording was performed one time before. For this reason, overwriting is not performed on the address where temporary recording was performed once before, and as a result, the partial progress recording at the address where temporary recording was performed once was confirmed as the main recording. It becomes. On the other hand, if it is determined that the period is not the longest in the period group, the recording address (previous) is set as the recording address (latest).
  • the next partial progress is recorded as a recording address (previous) where the temporary recording was performed once before, as a result of the recording address where the temporary recording was performed once before. Overwritten for (previous).
  • the partial progress record at the address where the temporary recording was performed once is discarded, and a trace log relating to the current temporary recording is recorded instead.
  • the trace memory address manager determines that the period is the longest in the group of periods, the trace memory address manager copies the updated recording address (latest) to the recording address (previous), and the period is the period. If it is determined that it is not the longest in the group, the recording address (previous) is copied to the recording address (latest). There is a mode.
  • Control to shift from temporary recording to actual recording or discarding is realized by copying the updated recording address (latest) to the recording address (previous) or copying the recording address (previous) to the recording address (latest). Therefore, the control from the temporary recording to the main recording or discarding can be easily realized with a simple configuration. If the updated recording address (latest) is copied to the recording address (previous), the recording address (previous) becomes the recording destination address of the partial passage temporarily recorded immediately before this. The fact that such an address is stored at the recording address (previous) corresponds to the temporary recording being promoted to the main recording.
  • the recording address (previous) is copied to the recording address (latest)
  • the recording address updated after temporary recording (latest) will be restored, and overwriting of the next trace log to that address will be allowed. become. As a result, the previous temporary record is discarded.
  • the update timing controller determines the setting timing of the recording address (latest) by the trace memory address manager and the recording address (based on the determination whether the period is the longest in the group of periods. Control the timing of the previous) There is a mode.
  • the update timing controller judges whether or not the period required for temporary recording of partial progress is the longest up to the present, and gives the judgment result to the trace memory address manager.
  • the update timing controller is exclusively used for timing management. It can be configured to manage
  • the program debug device of (2) described above includes The trace log record confirmation controller further holds the record address (previous) as a trace start address. There is a mode.
  • the partial progress recording When the partial progress recording is completed, a plurality of partial progresses having the longest period are recorded in the trace memory.
  • the partial progress having the longest period (the longest partial progress in the longest) is read out from the recorded partial progress group. It will be. It can be estimated that the partial course having the longest period in the partial course group is likely to be a result of the program part including the most serious software problem. In this way, by analyzing after narrowing down the partial progress, it is possible to further quickly and easily identify the problem occurrence location.
  • the program debugging device of (5) described above includes When the trace log recording confirmation controller determines that the period is the longest in the group of the periods, it sets the recording address (previous) as the trace start address and then updates the updated recording address (latest ) Is copied to the recording address (previous), and if the period is determined not to be the longest in the group of periods, the recording address (previous) is copied to the recording address (latest). There is a mode.
  • a time measuring device In the program debugging device of (4) described above, A time measuring device, The time measuring device generates longest time update information indicating a determination result of whether or not the period is the longest in the group of the periods; The update timing controller controls the setting timing of the recording address (latest) and the setting timing of the recording address (previous) by the trace memory address manager based on the longest time update information. . If comprised in this way, it will become possible to comprise in the state which isolate
  • the program debugging device (4) described above includes There is a mode in which the update timing controller determines whether or not the period is the longest in the group of periods based on time information attached to the partial progress.
  • the trace memory address manager updates the recording address (latest), thereby determining the temporary recording of the partial progress in the trace memory as the main recording.
  • the temporary recording of the trace log is discarded by setting the recording address (previous) as the recording address (latest).
  • the update timing controller controls the timing of the trace memory address manager based on the determination result of whether or not the period is the longest in the group of the periods.
  • the longest determination of the period in the update timing controller is performed using time information attached to the partial progress.
  • the present invention can be realized even in a program debug device that does not include the time measuring device in the configuration of (7) described above.
  • the update timing controller determines whether the period is the longest in the group of periods based on the partial progress and the event. There is a mode.
  • the update timing controller compares the event information set as the partial progress provisional recording start event with the processing progress, and compares the time information when the event matches the processing progress with the event information set as the partial progress provisional recording end event. Then, the time length of the period is calculated from the time information when they match. Further, the update timing controller generates event trace information indicating the calculated time length, and controls the timing of the trace memory address manager based on the event trace information. According to this aspect, the present invention can be realized even in a program debugging apparatus that does not include a time measuring device.
  • the program debug device of (4) described above includes An update timing mask controller;
  • the update timing mask controller controls the validity / invalidity of the control operation of the setting timing of the recording address (latest) by the update timing controller. There is a mode.
  • Partial progress that is not predicted to cause a problem may be excluded from provisional recording.
  • the partial period immediately after the program execution tends to be the longest.
  • the partial progress determined to be the longest period immediately after the execution of the program there are many cases where there is no problem in the program component that caused the partial progress. Therefore, although it is determined that the period is the longest, the partial progress that is considered to be unlikely to have a defect in the program component that caused the partial progress may be discarded.
  • the recording address (latest) that the update timing controller performs for the partial process The update control is set to invalid by the update timing mask controller. By doing so, it is possible to discard the temporary recording of partial progress that is known in advance that the program component that caused the partial progress is unlikely to be defective.
  • the recording address (latest) that the update timing controller performs for the partial progress Set the update control to valid.
  • the temporary recording in the trace memory is limited to the main recording, limited to the partial processing that is known in advance that the possibility that the program component that caused the partial processing is defective is not low. It becomes possible to confirm. As a result, the collection of partial progress related to the problem occurrence location is made efficient.
  • An external trigger output device The update timing controller outputs address update information indicating update / non-update of the recording address (latest), The external trigger output unit generates and outputs an external trigger composed of an arbitrary waveform signal based on the address update information. There is a mode.
  • the external trigger output unit When analyzing problems that occur in the program, you can solve the problem by not only analyzing the collected partial progress, but also acquiring waveforms such as the location of the problem or the output status at the time of the problem, and analyzing that waveform together. Can be effectively advanced.
  • the recording address (latest) is updated when the longest period is updated.
  • the external trigger output unit outputs an arbitrary waveform signal used for problem solving as an external trigger. For example, a waveform such as an output state of an actuator or the like in the user target system is acquired by an oscilloscope or the like and output as an external trigger.
  • the program debugging device (4) described above includes A break controller, The update timing controller outputs address update information indicating update / non-update of the recording address (latest), The break controller stops the operation of the CPU based on the address update information; There is a mode.
  • Update / non-update of the recording address (latest) that is, if the CPU is stopped when the longest value of the period is updated, the state and processing of the variable at the time of occurrence of the problem immediately using the partial progress acquired at that time It is possible to debug the state of the problem, and it is possible to speed up problem solving.
  • the emulator system of the present invention A host IF circuit that exchanges debugging information with the host computer;
  • Equipment, Is provided.
  • the emulator system of the present invention can efficiently debug a problem on a program or a peripheral device.
  • the partial progress in which the event establishment state is valid is temporarily recorded in the trace memory, and then only the partial progress in which the period is the longest is recorded, so that it is effective in recording the partial progress.
  • the partial progress in which the event establishment state is valid is temporarily recorded in the trace memory, and then only the partial progress in which the period is the longest is recorded, so that it is effective in recording the partial progress.
  • FIG. 1 is a block diagram showing a configuration of a program debugging apparatus according to Embodiment 1 of the present invention.
  • FIG. 2 is a flowchart showing the trace log temporary recording operation in the program debugging apparatus according to the first embodiment of the present invention.
  • FIG. 3 is a flowchart of the address operation of the trace memory in the program debugging apparatus according to the first embodiment of the present invention.
  • FIG. 4A is an explanatory diagram of a first transition of the length of the trace log period according to the first embodiment of the present invention.
  • FIG. 4B is an explanatory diagram showing a second transition of the length of the trace log period according to the first embodiment of the present invention.
  • FIG. 1 is a block diagram showing a configuration of a program debugging apparatus according to Embodiment 1 of the present invention.
  • FIG. 2 is a flowchart showing the trace log temporary recording operation in the program debugging apparatus according to the first embodiment of the present invention.
  • FIG. 3 is a flowchart of
  • FIG. 5 is a block diagram showing the configuration of the program debugging apparatus according to the second embodiment of the present invention.
  • FIG. 6 is a flowchart of the operation of the recording destination address in the program debugging apparatus according to the second embodiment of the present invention.
  • FIG. 7 is a block diagram showing the configuration of the program debug apparatus according to the third embodiment of the present invention.
  • FIG. 8 is a block diagram showing the configuration of the program debugging apparatus according to the fourth embodiment of the present invention.
  • FIG. 9 is a diagram showing an example of a trace log accompanying time information according to Embodiment 4 of the present invention.
  • FIG. 10 is a flowchart for determining the trace log period according to the fourth embodiment of the present invention.
  • FIG. 10 is a flowchart for determining the trace log period according to the fourth embodiment of the present invention.
  • FIG. 11 is a block diagram showing a configuration of a program debugging apparatus according to Embodiment 5 of the present invention.
  • FIG. 12 is a flowchart for determining the trace log period according to the fifth embodiment of the present invention.
  • FIG. 13 is a block diagram showing the configuration of the program debugging apparatus according to the sixth embodiment of the present invention.
  • FIG. 14 is a flowchart of trace memory address operations according to the sixth embodiment of the present invention.
  • FIG. 15 is a block diagram showing a configuration of a program debugging apparatus according to the seventh embodiment of the present invention.
  • FIG. 16 is a flowchart of the trace memory address operation in the seventh embodiment of the present invention.
  • FIG. 17 is a block diagram showing a configuration of a program debugging apparatus according to the eighth embodiment of the present invention.
  • FIG. 18 is a flowchart of the address operation of the trace memory according to the eighth embodiment of the present invention.
  • FIG. 19 is a block diagram showing the configuration of an emulator system and its peripherals according to the present invention.
  • FIG. 20 is a block diagram showing a configuration of a program debugging apparatus using a conventional trace function and event function.
  • FIG. 21 is a block diagram showing a configuration of a program debugging apparatus to which a time measuring function of the prior art is added.
  • FIG. 1 is a block diagram showing a configuration of a program debugging apparatus according to Embodiment 1 of the present invention.
  • the program debugging apparatus includes a CPU 1, an event controller 2, a trace controller 3, a trace log record confirmation controller 4, and a trace memory 11.
  • the present embodiment is characterized in that it has the configuration of the conventional example shown in FIG. 20 and further includes a trace log recording confirmation controller 4.
  • the CPU 1 is configured by hardware or software and executes a program (specifically, a program code).
  • the event controller 2 manages two or more events.
  • An event defines an arbitrary state during program execution. More specifically, the event defines the start and end of an arbitrary partial progress included in the processing progress when the CPU 1 executes the program.
  • An address when the CPU 1 executes a program, an address when reading or writing various data, and the like are defined by events.
  • the event controller 2 registers and manages a plurality of events. After that, the event controller 2 compares the process progress when the CPU 1 actually executes the program with the managed event, and each part of the process progress specifies an arbitrary event (start / end of a predetermined partial progress).
  • the event establishment state is information indicating validity / invalidity.
  • valid indicates that one state included in the process progress is equivalent to one arbitrary event, and “invalid” indicates that it is not equivalent.
  • Trace memory 11 records a trace log.
  • the trace log is a record of all or part of the processing progress of execution of the program by the CPU 1, and indicates the partial progress in the present invention.
  • Typical examples of the trace log include an address at which the CPU 1 executes a program, an address at which various data are read or written, and the like. The contents of the trace log vary depending on the program debug device.
  • the trace controller 3 When the event establishment state output from the event controller 2 indicates that the event controller 2 is valid, the trace controller 3 starts a process of temporarily recording the trace log, which is an operation record of the CPU 1, in the trace memory 11, and subsequently another event is established. When the status indicates valid, the temporary recording process is terminated.
  • the trace log record confirmation controller 4 The trace log temporarily recorded in the trace memory 11 (hereinafter referred to as “trace log (latest)”) is confirmed as a trace log (hereinafter referred to as “trace log (record)”) that is continuously recorded without being discarded. To ⁇ Determine that the above trace log (latest) is to be discarded without being a trace log (record). Switching control is performed.
  • the trace log recording confirmation controller 4 records a trace log period T indicating the time required for temporary recording of the trace log.
  • the trace log period T is a state equivalent to any other event managed by the event controller 2 after a state equivalent to any one event managed by the event controller 2 occurs. Refers to the period of time that occurs. In other words, the trace log period T is a period from the start of partial progress to the end.
  • the trace log period T calculated by the trace log recording confirmation controller 4 in accordance with the calculation of the trace log (latest) by the trace controller 3 is referred to as a trace log period (latest) T2.
  • the trace log recording confirmation controller 4 temporarily records the longest trace log period (latest) T2 at that time, and then records it.
  • the longest recorded trace log period (latest) T2 is referred to as a trace log period (record) T1.
  • the trace log recording confirmation controller 4 sets a trace log period (latest) T2 corresponding to the trace log (latest). After the calculation, the trace log period (latest) T2 is compared with the already recorded trace log period (record) T1. In this comparison result, the trace log record confirmation controller 4 determines whether the trace log period (latest) T2 is longer than the trace log period (record) T1 (in other words, whether the trace log period (latest) T2 is the longest). Whether or not: T2> T1) is determined. Based on the determination result, the trace log record confirmation controller 4 determines whether or not to confirm the trace log (latest) in the trace memory 11 as the trace log (record).
  • the trace log record confirmation controller 4 includes a trace memory address manager 5 and an update timing controller 6.
  • the trace memory address manager 5 manages the recording address (latest) A and the recording address (previous) B, and the trace memory address manager 5 is composed of a register, for example.
  • the recording address (latest) A is address information for specifying a recording area on the trace memory 11. This address information is set to temporarily record the trace log (latest). Each time the temporary recording of the trace log (latest) is completed on the trace memory 11, the recording address (latest) A is updated by a process such as increment for the next temporary recording.
  • the recording address (previous) B indicates a memory position on the trace memory 11 in which the trace log in which the main recording is confirmed is stored.
  • the recording address (previous) B is equal to the recording address (latest) A before the update (that is, the old) of the trace log in which the main recording is confirmed after the temporary recording. In actual processing, every time the recording address (latest) A is updated, the recording address (latest) A before updating is recorded as the recording address (previous) B.
  • the trace memory address manager 5 When the trace log period (latest) T2 calculated by the trace controller 3 is the longest at the present time (when T2 is longer than T1: T2> T1), the trace memory address manager 5 next traces in the trace memory 11.
  • the recording address (latest) A indicating the memory location where the log is temporarily recorded is updated.
  • the address update is performed by, for example, increment processing.
  • the trace memory address manager 5 updates the record address (latest) as A.
  • the current value is continuously set without performing.
  • the trace memory address manager 5 adjusts the recording address (previous) B. That is, when the trace log period (latest) T2 is the longest at the present time (T2> T1), the trace memory address manager 5 updates the record address (latest) A and then updates the updated record address (latest). ) A is copied to the recording address (previous) B. By simultaneously updating the recording address (latest) A and copying the recording address (previous) B with the updated recording address (latest) A, the temporary recording of the trace log that has just been temporarily completed is Finalize as final record.
  • the trace memory address manager 5 copies the recording address (latest) A to the recording address (previous) B.
  • the trace log measured next time is overwritten at the memory location of the trace memory 11 where the trace log that has just been temporarily recorded is recorded, and as a result, the temporary recording is completed. The destruction of the temporary record of the last trace log is confirmed.
  • the update timing controller 6 determines whether or not the trace log period (latest) T2 is the longest at the present time (T2> T1), and controls the timing at which the determination result is given to the trace memory address manager 5. . This is used when the copy timing of the recording addresses A and B is controlled. There are various methods for managing time in the update timing controller 6, and details will be described in other embodiments.
  • FIG. 2 is a flowchart showing the operation of temporarily recording the trace log of the program debugging apparatus according to the first embodiment.
  • the CPU 1 executes a program (specifically, a program code) (step S01).
  • the trace controller 3 acquires a trace log that is a record of the processing contents when the CPU 1 executes the program (step S02).
  • the trace controller 3 acquires the event establishment state from the event controller 2 (step S03).
  • the event establishment state becomes valid, and becomes invalid when becoming non-equivalent. .
  • the trace controller 3 determines whether or not to temporarily record the trace log based on the acquired event establishment state (step S04). If the event establishment state indicates valid, it is determined that temporary recording of the trace log is to be executed, and an execution instruction is generated. On the other hand, in the case of indicating invalidity, it is determined that the temporary recording of the trace log is not executed, and a non-execution instruction is generated.
  • the trace controller 3 determines the instruction content related to the temporary recording of the trace log created in step AS04 (step S05).
  • the trace controller 3 traces the trace log to the memory location of the trace memory 11 defined by the recording address (latest) A recorded in the trace memory address manager 5. Is temporarily recorded, and the recording address (latest) A recorded in the trace memory address manager 5 is updated with address information indicating another memory position where the trace log is temporarily recorded next (step S06). Update is performed by increment or the like.
  • the trace controller 3 does not temporarily record a trace log (step S07). The update process of the recording address (latest) A is performed in order to write the next trace log to another memory location on the trace memory 11 after writing the trace log to the trace memory 11.
  • FIG. 3 is a flowchart showing an operation for manipulating the address of the trace memory 11 of the program debugging apparatus of the first embodiment.
  • the trace memory address manager 5 determines whether or not the trace log period (latest) T2 is the longest at the present time. Subsequent processing branches based on this determination (steps S10 and S20).
  • the update timing controller 6 outputs the updated recording address (latest) A to the trace memory address manager 5 ( Step S30). This process is recorded by the updated recording address (latest) A (indicating the memory position on the trace memory 11 where the trace log of the current measurement in which the trace log period (latest) T2 is determined to be the longest) is recorded. This is performed so that the address (previous) B is copied. By this copy recording, the recording address (latest) A determined to be recorded is registered as the recording address (previous) B.
  • step S20 determines whether the trace log period (latest) T2 is not the longest at the present time. If it is determined in step S20 that the trace log period (latest) T2 is not the longest at the present time, the update timing controller 6 causes the recording address (latest) A to be copied by the recording address (previous) B. Then, the recording address (previous) B is output to the trace memory address manager 5 (step S40). This copying allows the trace log to be overwritten, and the temporary recording of the trace log that has just been completed is discarded.
  • the trace log (latest) is recorded at the memory position of the trace memory 11 specified by the recording address (latest) A.
  • the recording address (latest) A is updated and the updated recording address (latest) A is recorded. It is copied to the address (previous) B and the main record of the trace log is finalized.
  • the recording address (latest) A is copied with the recording address (previous) B, contrary to the above. Will return.
  • the trace log (latest) shifts to a state where it is discarded.
  • the actual recording of the trace log is performed only when the trace log period (latest) T2 is the longest at the present time.
  • the number of trace logs (records) is not limited to one.
  • the longest value of the trace log period (latest) T2 becomes longer and updated as the measurement time elapses, as is apparent from the measurement form. Accordingly, every time the longest value of the trace log period (latest) T2 is updated in the measurement result, the longest value of the trace log period (latest) T2 is detected.
  • the trace log (latest) at that time is regarded as a trace log (record).
  • a plurality of trace logs (records) are recorded in the trace memory 11. Therefore, the trace log period (recording) T1 becomes longer as the recording time is later. This is shown in FIG.
  • FIG. 4A shows the transition of the trace log period (latest) T2
  • FIG. 4B shows the transition of the trace log period (record) T1 held in the trace memory 11.
  • the trace log marked with ⁇ is selected and remains in the trace memory 11, and the trace log marked with ⁇ is discarded.
  • the address [0100] is updated and set as the recording address (latest) A, and further, the recording is recorded with the update setting of the recording address (latest) A It is assumed that the address [0100] is also copied to the address (previous) B. In this state, it is assumed that the trace log L1 is currently recorded at the memory location of the trace memory 11 designated by the recording address (latest) A [0100]. In this state, the recording address (latest) A is updated (incremented) from address [0100] to address [0200].
  • the updated recording address (latest) A1 [0200] is set as the recording address (latest) A.
  • the updated recording address (latest) A1 is set as the recording address (latest) A
  • the updated recording address (latest) A1 is also copied to the recording address (previous) B.
  • the main record is recorded as the trace log having the longest trace log period (latest) T2 at the present time. Is confirmed.
  • the recorded trace log L2 is merely a trace log (latest) and not a definitive trace log (record). However, since the trace log (latest) is recorded, the recording address (latest) A is incremented and updated from address [0200] to address [0300].
  • the trace log is always recorded in the trace memory 11 once. However, it is not a main recording but a temporary recording.
  • the determination as to whether or not the trace log (latest) temporarily recorded in this way is the trace log (record) is to determine whether or not the next measured trace log period (latest) T2 is the longest. It is entrusted. Further, the process of changing the trace log (latest) to the trace log (record) and the process of discarding the trace log (latest) are performed through the adjustment process of the recording address (latest) A.
  • the recording address (latest) A having the longest or equivalent trace log period (latest) T2 at the current time is set as the updated recording address (latest) A (address incremented with temporary recording), and The updated recording address (latest) A is copied to the recording address (previous) B in order to determine the temporary recording as the main recording.
  • the trace log period (latest) T2 is not the longest at the present time
  • the updated recording address (previous) B is copied to the recording address (latest) A. This is the technical point of the present embodiment.
  • the trace log having the longest trace log period T at the present time is selectively recorded in the trace memory from among a plurality of temporarily recorded trace log groups, and the other trace log groups are discarded. Even in a state where the capacity of the trace memory 11 is limited, it is possible to selectively record a trace log that is likely to cause a problem in software. As a result, it is an extremely effective measure for quickly and easily finding and solving problems. In addition, since the trace log records are narrowed down, it is possible to avoid an excessive increase in the capacity of the trace memory 11.
  • the program debug apparatus uses 1 trace log having the longest trace log period T (the longest in the longest trace log group) among a plurality of trace logs recorded in the trace memory 11. And a configuration for recording a trace start address for this purpose.
  • FIG. 5 is a block diagram showing the configuration of the program debugging apparatus according to the second embodiment.
  • the trace memory address manager 5 further holds a trace start address C.
  • the trace start address C is held in order to back up and hold the recording address (previous) B among the addresses defining the memory position of the trace memory 11.
  • the timing at which the recording address (previous) B is backed up to the trace start address C is the timing at which the trace log period T is the longest at the present time.
  • the update timing controller 6 further has a function of controlling the timing for copying the recording address (previous) B to the trace start address C.
  • Other configurations are the same as those in the first embodiment, and thus description thereof is omitted.
  • FIG. 6 is a flowchart showing the operation of manipulating the address of the trace memory 11 of the program debugging apparatus according to the second embodiment, which corresponds to the flowchart of FIG. 3 according to the first embodiment with step S21 added.
  • the flowchart of FIG. 2 in the first embodiment is followed in the present embodiment.
  • step S21 the update timing controller 6 outputs the recording address (previous) B to the trace memory address manager 5 so as to copy it to the trace start address C.
  • the recording address (latest) A is copied to the recording address (previous) B
  • the recording address (previous) B changes, but the previous recording address (previous) B is copied to the trace start address C. Back up. Thereby, the trace start address C when the trace log is temporarily recorded is held.
  • the trace log L1 is recorded at the recording address (latest) A [0100], and the recording address (latest) A is updated to the address [0200] according to this trace log recording, and the recording address (previous) B is Suppose that the address [0100] is repeated.
  • the recording address (latest) A [0200] is copied to the recording address (previous) B.
  • the recording address (previous) B [0100] before copying is copied to the trace start address C.
  • the address (address [0100] in this example) copied to the trace start address C indicates the storage address of the trace log L1 in which the trace log period T is the longest at the present time.
  • the updated recording address (latest) A [0200] is copied to the recording address (previous) B.
  • the recording address (previous) B is the address [0200].
  • the trace log L2 is recorded at the recording address (latest) A [0200], and the recording address (latest) A is updated to the address [0300] accordingly.
  • the recording address (previous) B [0200] is copied to the trace start address C.
  • the trace start address C is the address [0200]. It becomes. This indicates that the address specifying the memory location where the trace log L2 having the longest trace log period T is stored is the address [0200] at the current time.
  • the updated recording address (latest) A [0300] is copied to the recording address (previous) B. As a result, the recording address (previous) B becomes address 0300.
  • the recording destination address of one trace log finally confirmed and recorded among the entire trace log group decided from temporary recording to actual recording is the trace start address C. Will be held.
  • the recording destination address of the longest trace log period T in the entire trace log group recorded in the trace memory 11 the longest in the longest trace log group. It can. As a result, it is possible to quickly find and solve the problem part.
  • the address of the main recording at that time is recorded in the trace start address C1.
  • the address at the trace start address C1 of the first main record is copied to the trace start address C2, and the current main record address is copied to the trace start address C1. Copy to.
  • the address at the trace start address C2 of the first main record is copied to the trace start address C3, and the trace of the second main record is performed.
  • the address at the start address C1 is copied to the trace start address C2, and the current main recording address is copied to the trace start address C1.
  • the recording addresses of the n trace logs can be specified sequentially from the longest to the next long as the trace log having a long trace log period T. Therefore, even when the problem cannot be analyzed with only one trace log of the longest one, it is possible to quickly find and solve the problem part by analyzing the nth trace log. It is also possible to have a configuration in which a plurality of trace memories 11 are provided and addresses are assigned to the respective trace memories 11.
  • the program debugging apparatus is provided with a time measuring device for generating time information to be handled by the update timing controller 6 outside.
  • FIG. 7 is a block diagram showing the configuration of the program debugging apparatus according to the third embodiment.
  • the same reference numerals as those in FIG. 1 of the first embodiment indicate the same components.
  • a time measuring device 7 is added.
  • the time measuring device 7 is supplied with the event establishment state output from the event controller 2.
  • the time measuring device 7 measures each trace log period (latest) T2, and then, among the measured trace log period (latest) T2, the trace log period (latest) T2 that is the longest at the present time is determined as the trace log period. (Recording) Extracted as T1.
  • the time measuring device 7 determines whether or not the longest trace log period has been updated from the extraction result of the trace log period (record) T1, and further updates the determination result as the longest trace log period update information. Output to the timing controller 6.
  • the update timing controller 6 that receives the longest trace log period update information, based on the received longest trace log period update information, records address (latest) A and record address (previous) B held by the trace memory address manager 5. Control the timing of the mutual copying process. That is, the update timing controller 6 determines whether or not the trace log period (record) T1 is the longest at the current time based on the longest time update information in step S20 of the flowchart of FIG.
  • Other configurations and operations are the same as those in the first embodiment, and thus description thereof is omitted.
  • the update timing controller 6 can also be realized by a configuration including a time measurement function.
  • the update timing controller 6 can also be realized by a configuration including the event controller 2.
  • the update timing controller 6 can also be realized by a configuration including a time measurement function and the event controller 2.
  • the program debugging apparatus equipped with the tracing function of the prior art of FIG. 21 corresponds to the addition of the time measurement function, and the conventional program debugging apparatus in terms of resource reuse and the like Easy application deployment
  • the program debugging apparatus is configured to perform update timing control based on time information attached to the trace log.
  • FIG. 8 is a block diagram showing a configuration of the program debugging apparatus according to the fourth embodiment.
  • the update timing controller 6 is supplied with a trace log including time information from the CPU 1 and an event establishment state from the event controller 2.
  • the update timing controller 6 determines whether or not the trace log period (record) T1 that is the longest at the present time has been updated based on the supplied event establishment state and the time information of the trace log.
  • Some trace information is supplied to the trace memory address manager 5.
  • the trace memory address manager 5 controls the execution timing of the copying process performed between the recording address (latest) A and the recording address (previous) B based on the supplied trace information. Since other configurations are the same as those in the first embodiment, description thereof is omitted.
  • FIG. 9 is an example of a trace log accompanied with time information, and individual time information is attached to each trace log.
  • the time information attached to each trace log includes start time information and end time information, respectively.
  • FIG. 10 is a flow chart for determining whether or not the trace log period (record) T1 is the longest at the present time using the time information of the trace log.
  • the update timing controller 6 notified from the event controller 2 that the temporary recording of the trace log has been started acquires the trace log recording disclosure time information (step S51).
  • the update timing controller 6 notified from the event controller 2 that the temporary recording of the trace log has been completed acquires the recording end time information of the trace log (step S52).
  • the update timing controller 6 calculates a trace log period (latest) T2 from the recording start time information and the recording end time information (step S53).
  • the update timing controller 6 compares the trace log period (latest) T2 calculated this time with the previously calculated trace log period (record) T1, and the trace log period (latest) T2 is the longest at the present time. Whether or not (step S54).
  • the update timing controller 6 determines that the trace log period T is the longest at the present time, the update timing controller 6 stores the trace log period (latest) T2 at that time as the trace log period (record) T1.
  • the trace log period (latest) T2 calculated and stored as described above is the trace information (step S55). As described above, in the present embodiment, in step S20 of the flowchart of FIG. 3, it is specifically determined whether or not the trace log period (latest) T2 is the longest at the present time, in the process of step S54 of FIG. Is realized.
  • the update timing controller 6 calculates the trace log period (latest) T2 by detecting the trace log recording start time in the trace memory 11 and further detecting the trace log recording end time. Then, it is determined whether or not the trace log period (latest) T2 calculated in this way is the longest at the present time.
  • the present invention can be realized even in a program debugging apparatus that does not include the time measuring device 7.
  • the program debugging apparatus is configured to perform update timing control based on a trace log and an event.
  • FIG. 11 is a block diagram showing the configuration of the program debugging apparatus according to the fifth embodiment.
  • the update timing controller 6 is supplied with the trace log from the CPU 1 and the event managed by the event controller 2 from the event controller 2.
  • the update timing controller 6 generates event trace information based on the trace log and the event.
  • the event trace information is information indicating whether or not the longest value of the trace log period (latest) T2 has been updated.
  • the update timing controller 6 supplies event trace information to the trace memory address manager 5.
  • the trace memory address manager 5 controls the execution timing of the copying process performed between the recording address (latest) A and the recording address (previous) B based on the supplied event trace information.
  • FIG. 12 is a flowchart for determining whether or not the trace log period T is the longest at the present time using the trace log and the event. First, compare the supplied trace log with any one event registered in advance as the start event in the trace log period, and record the trace log when the trace log at that time matches the start event. It is determined that the trace log period to be started has started, and time information indicating the event disclosure time is acquired (step S61).
  • the supplied trace log is compared with any other event registered in advance as an end event in the trace log period, and if the trace log at that time matches the end event, the trace log period Time information indicating the event end time is acquired (step S62).
  • a trace log period (latest) T2 is calculated based on the event start time information acquired in step S61 and the event end time information acquired in step S62 (step S63).
  • Step S64 the calculated trace log period (latest) T2 and the recorded trace log period (previous) T1 are compared to determine whether the trace log period (latest) T2 is the longest at the present time.
  • the trace log period (latest) T2 determined to be the longest is stored as the trace log period (record) T1 (step S65).
  • steps S10 and S20 determines whether the trace log period (latest) T2 is the longest at the present time
  • the flowchart of FIG. 12 steps S61 to S65. It can be carried out. Even when the time information is not attached to the trace log, it is possible to determine whether or not the trace log period (latest) T2 is the longest at the present time. That is, the update timing controller 6 calculates the trace log period (latest) T2 by detecting the trace log recording start time in the trace memory 11 and further detecting the trace log recording end time. Then, it is determined whether or not the trace log period (latest) T2 calculated in this way is the longest at the present time.
  • the present invention can be realized even in a program debugging apparatus that does not include the time measuring device 7.
  • the program debugging apparatus includes an update timing mask controller that validates / invalidates the function of the update timing controller 6.
  • FIG. 13 is a block diagram showing the configuration of the program debugging apparatus according to the sixth embodiment.
  • the same reference numerals as those in FIG. 1 of the first embodiment indicate the same components.
  • an update timing mask controller 8 for setting validity / invalidity for the update control of the recording address (latest) A performed by the update timing controller 6 is added.
  • the update timing mask controller 8 determines that the update of the recording address (latest) A is valid, the function of the update timing controller 6 is validated. Conversely, when the update timing controller 6 determines invalid, the function of the update timing controller 6 is invalid. It becomes. Such valid / invalid setting in the update control of the recording address (latest) A is performed by a user operation. Since other configurations are the same as those in the first embodiment, description thereof is omitted.
  • FIG. 14 is a flowchart showing the operation of manipulating the address of the trace memory 11 in the program debugging apparatus of the sixth embodiment. Step S20 in the flowchart of FIG. 3 in the case of the first embodiment is replaced with step S22. The flowchart of FIG. 2 in the case of the first embodiment follows the present embodiment.
  • the trace memory address manager 5 determines whether the trace log period (latest) T2 is the longest at the present time and the update control of the recording address (latest) A is effective. Determine whether or not. Subsequent processing branches based on this determination (steps S10 and S22).
  • step S20 when it is determined that the trace log period (latest) T2 is the longest at the present time and the update control of the recording address (latest) A is valid, the update timing controller 6 determines that the updated recording address ( The latest A is output to the trace memory address manager 5 (step S30). In this process, the updated recording address (latest) A (indicating the memory position on the trace memory 11 in which the trace log of the current measurement in which the trace log period (latest) T2 is determined to be the longest) is recorded is recorded. It is executed so as to be copied to the address (previous) B. As a result of this copying, the recording address (latest) A that is determined to be recorded is registered as the recording address (previous) B.
  • step S20 determines whether the trace log period (latest) T2 is not the longest at the present time or the update control of the recording address (latest) A is invalid.
  • the update timing controller 6 determines the recording address (previous).
  • the recording address (previous) B is output to the trace memory address manager 5 so that B is copied to the recording address (latest) A (step S40). By this copying, the address is returned and overwriting of the trace log is permitted, so that the temporary recording of the trace log that has just been completed is discarded.
  • the longest value of the trace log period (latest) T2 is easily updated even if no problem occurs in the program. Therefore, the trace log for which the trace log period (latest) T2 is determined to be the longest value at this time is discarded.
  • the trace log for which the trace log period (latest) T2 is determined to be the longest value at this time is discarded.
  • the update control of the recording address (latest) A Necessary trace logs can be selectively acquired. This makes it possible to quickly find and solve problem areas.
  • the program debug apparatus provides an external trigger output that outputs a waveform indicating a state in which the trace log period (latest) T2 is the longest in order to quickly find and solve a problem part in software. Equipped with a bowl.
  • FIG. 15 is a block diagram showing the configuration of the program debugging apparatus according to the seventh embodiment.
  • the present embodiment further includes an external trigger output unit 9, and the update timing controller 6 further has a function of outputting the update / non-update of the recording address (latest) A to the external trigger output unit 9 as address update information.
  • the external trigger output unit 9 outputs address update information to the outside with an arbitrary waveform. Since other configurations are the same as those in the first embodiment, description thereof is omitted.
  • FIG. 16 is a flowchart showing the operation of manipulating the address of the trace memory 11 in the program debugging apparatus of the seventh embodiment. Step S30 in the flowchart of FIG. 3 in the first embodiment is replaced with step S31 of FIG. 16, and step S32 is further added. The flowchart of FIG. 2 in the case of the first embodiment follows the present embodiment.
  • the trace memory address manager 5 determines whether or not the trace log period (latest) T2 is the longest at the present time. Subsequent processing branches based on this determination (steps S10 and S20).
  • the update timing controller 6 outputs the updated recording address (latest) A to the trace memory address manager 5 ( Step S31). This process is recorded by the updated recording address (latest) A (indicating the memory position on the trace memory 11 where the trace log of the current measurement in which the trace log period (latest) T2 is determined to be the longest) is recorded. This is performed so that the address (previous) B is copied. By this copy recording, the recording address (latest) A determined to be recorded is registered as the recording address (previous) B.
  • the external trigger output unit 9 outputs a predetermined waveform corresponding to the address update information (step S32). The operation of the external trigger output device 9 is the point of this embodiment.
  • step S20 determines whether the trace log period (latest) T2 is not the longest at the present time. If it is determined in step S20 that the trace log period (latest) T2 is not the longest at the present time, the update timing controller 6 causes the recording address (latest) A to be copied by the recording address (previous) B. Then, the recording address (previous) B is output to the trace memory address manager 5 (step S40). By this copying, the address is returned and overwriting of the trace log is permitted, so that the temporary recording of the trace log that has just been completed is discarded.
  • the external trigger output device 9 acquires any output waveform (for example, acquired by an oscilloscope) indicating update / non-update of the longest value. Waveform indicating the output state of the actuator, etc.).
  • the change in the output waveform that occurs when a problem occurs and the trace log are faced and analyzed, so that the problem part can be quickly discovered and solved.
  • the program debugging apparatus has a break control for stopping the CPU 1 when the longest value of the trace log period (latest) T2 is updated in order to quickly find and solve a problem part in software. Equipped with a bowl.
  • FIG. 17 is a block diagram showing the configuration of the program debugging apparatus according to the eighth embodiment.
  • the present embodiment is characterized in that it further includes a break controller 10.
  • the update timing controller 6 further includes a function capable of outputting address update information indicating update / non-update of the recording address (latest) A.
  • the break controller 10 is configured to stop the CPU 1 based on the address update information and the state of the CPU 1. Since other configurations are the same as those in the first embodiment, description thereof is omitted.
  • FIG. 18 is a flowchart showing an operation for manipulating the address of the trace memory 11 in the program debugging apparatus of the eighth embodiment.
  • Step S30 in the flowchart of FIG. 3 in the first embodiment is replaced with step S33 of FIG. 18, and step S34 is further added.
  • the flowchart of FIG. 2 in the case of the first embodiment follows the present embodiment.
  • the trace memory address manager 5 determines whether or not the trace log period (latest) T2 is the longest at the present time. Subsequent processing branches based on this determination (steps S10 and S20).
  • the update timing controller 6 outputs the updated recording address (latest) A to the trace memory address manager 5 ( Step S30). This process is recorded by the updated recording address (latest) A (indicating the memory position on the trace memory 11 where the trace log of the current measurement in which the trace log period (latest) T2 is determined to be the longest) is recorded. This is performed so that the address (previous) B is copied. By this copy recording, the recording address (latest) A determined to be recorded is registered as the recording address (previous) B.
  • the break controller 10 stops the CPU 1 (step S34). The operation of the break controller 10 is the point of this embodiment.
  • the update timing controller 6 outputs to the trace memory address manager 5 so as to copy the updated previous recording address B to the current recording address A (step S40). By this copying, the address is returned to allow overwriting, and the temporary recording of the trace log that has just been completed is discarded.
  • step S20 determines whether the trace log period (latest) T2 is not the longest at the present time. If it is determined in step S20 that the trace log period (latest) T2 is not the longest at the present time, the update timing controller 6 causes the recording address (latest) A to be copied by the recording address (previous) B. Then, the recording address (previous) B is output to the trace memory address manager 5 (step S40). By this copying, the address is returned and the overwriting of the trace log is allowed, so that the temporary recording of the trace log that has just been completed is discarded.
  • the CPU 1 when the longest value of the trace log period (latest) T2 is updated, the CPU 1 is stopped.
  • the program can be debugged using the trace log when the longest value of the period (latest) T2 is updated, and the problem location can be obtained by debugging the variable status and the processing status when the problem occurs. Can be quickly discovered and resolved.
  • FIG. 19 is a block diagram showing the configuration of the emulator system 20 and its periphery according to the present invention.
  • the emulator system 20 includes a host IF circuit 21, an emulation function 22, an emulation ROM / RAM 23, a microcomputer peripheral circuit 24, and the program debug device X according to any one of the first to eighth embodiments described above.
  • the emulator system 20 is connected to a personal computer host and a user target system 40.
  • the host IF circuit 21 can receive a debug command from the personal computer / host 30 and transmit the debugging state and result to the personal computer / host 30. What is sent includes a trace log.
  • the program debug device X operates in response to a debug command from the personal computer host 30.
  • the program debug device X includes a CPU 1.
  • the CPU 1 performs emulation using the resources of the emulation function 22, the emulation ROM / RAM 23, and the microcomputer peripheral circuit 24.
  • the program debugging apparatus X performs debugging by controlling the user target system 40 by the microcomputer peripheral circuit 24 during the emulation operation.
  • the trace log (latest) at the time when the longest value of the trace log period (latest) T2 is updated is acquired as the trace log (record). Then, the obtained trace log (record) is analyzed by the personal computer / host 30 to quickly find and solve the problem part.
  • the program debugging apparatus of the present invention can effectively narrow down the trace logs related to events that are likely to contain software problems, and record them in the trace memory. This is useful to quickly and easily identify difficult problems.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

On the basis of a result of comparison between a processing progress at the time of actual program execution and an event defining an arbitrary condition during program execution by a CPU, an event controller determines whether or not a partial progress has been established in the processing progress.  A trace controller provisionally records the partial progress that is determined as having been established, in a trace memory.  On the basis of the determination as to whether or not the period of the partial progress at a certain time point during the actual execution of the program is the longest the among periods of the prior partial progress group, a trace log record settlement controller selects whether or not the provisionally recorded partial progress should be recorded as a definite record.

Description

プログラムデバッグ装置およびエミュレータシステムProgram debugging device and emulator system
 本発明はトレース機能とイベント機能を備えたプログラムデバッグ装置にかかわり、特には多重割り込み等を多用した製品のプログラムのデバッグに有効なプログラムデバッグ装置に関する。 The present invention relates to a program debug apparatus having a trace function and an event function, and more particularly to a program debug apparatus effective for debugging a product program using multiple interrupts and the like.
 本出願は、2009年2月13日に出願された、明細書,図面、特許請求の範囲を含む日本特許出願2009-030689号の全てを、ここに参照として本明細書に組み入れている。 This application is hereby incorporated herein by reference in its entirety, including Japanese Patent Application No. 2009-030689 filed on February 13, 2009, including the specification, drawings, and claims.
 近年、組み込みプログラムの開発環境等において、プログラムデバッグ装置であるエミュレータやオンボードデバッガが広く利用されている。組み込みプログラムにおいては、高機能化に伴うソフトウェアの肥大化や複雑化が進むと同時に、高い品質のソフトウェアが望まれている。特にカーナビゲーションや携帯電話のソフトウェアにおいては、高い機能を実現するために多重割り込み等が多用されてCPU(Central Processing Unit)の機能が最大限に利用されている。そのため、CPU設計において、割り込み処理時間やメモリアクセスの排他性に適切な設定が必要となる。 In recent years, emulators and on-board debuggers, which are program debugging devices, are widely used in development environments for embedded programs. In the embedded program, high-quality software is desired at the same time as the software becomes larger and more complex with higher functionality. In particular, in car navigation and mobile phone software, multiple interrupts are frequently used to realize high functions, and the functions of CPU (Central Processing Unit) are utilized to the maximum extent. Therefore, in the CPU design, it is necessary to appropriately set the interrupt processing time and the memory access exclusivity.
 このような設定が必要となるCPU設計では、ソフトウェアの肥大化や複雑化が進むに連れてその設計作業も複雑化し、メモリアクセスの排他性や割り込み処理時間に問題が発生し易くなっている。そのため、CPU設計では、プログラムデバッグ装置を用いて設計内容を解析しなければならない状況に陥ることがよくある。プログラムデバッグ装置はトレース機能とイベント機能とを有しており、これら機能を用いて設計内容をCPUでトレースさせ、その結果としてCPUで得られるトレースログ(プログラムを実行した処理の記録)を解析する。 In a CPU design that requires such settings, the design work becomes more complicated as software becomes larger and more complex, and problems such as memory access exclusivity and interrupt processing time are more likely to occur. Therefore, CPU design often falls into a situation where the design contents must be analyzed using a program debugging device. The program debugging apparatus has a trace function and an event function, and the design contents are traced by the CPU using these functions, and as a result, the trace log (record of processing executed by the program) obtained by the CPU is analyzed. .
 図20は従来技術のプログラムデバッグ装置の構成を示すブロック図である。このプログラムデバッグ装置は、CPU1、イベント制御器2、トレース制御器3、およびトレースメモリ11を備える。 FIG. 20 is a block diagram showing a configuration of a conventional program debugging apparatus. The program debugging apparatus includes a CPU 1, an event controller 2, a trace controller 3, and a trace memory 11.
 CPU1は、プログラムを実行する。イベント制御器2は、CPU1がプログラムの実行中に行う処理の状態を監視し、監視している状態がイベントとして設定した状態と等価であるか否かを判別し、その判別結果をイベント成立状態としてトレース制御器3に出力する。トレース制御器3は、CPU1から取得するトレースログとトレース制御器3から取得するイベント成立状態とに基づいて、開始イベントや終了イベントとして予め設定しておいた状態とイベント成立状態とが等価であるか否かを判別する。さらにトレース制御器3は、その判別結果に基づいてトレース記録実行情報3aを作成する。なおトレース制御器3は、トレースログ記録の指示があると、保持しているトレースログをトレースメモリ11に記録したうえでそのログを解析する。 CPU1 executes the program. The event controller 2 monitors the state of processing performed by the CPU 1 during execution of the program, determines whether the monitored state is equivalent to the state set as an event, and determines the determination result as the event establishment state. To the trace controller 3. Based on the trace log acquired from the CPU 1 and the event establishment state acquired from the trace controller 3, the trace controller 3 is equivalent to the state established in advance as the start event and the end event and the event establishment state. It is determined whether or not. Further, the trace controller 3 creates the trace recording execution information 3a based on the determination result. When there is an instruction to record the trace log, the trace controller 3 records the held trace log in the trace memory 11 and then analyzes the log.
 プログラムデバッグ装置は、上述したようにソフトウェア上で問題が生じると推測できる箇所に開始イベントと終了イベントを設定したうえでその開始イベントから終了イベントに至る期間(以下、トレースログ期間と略する)におけるトレースログを取得し、取得したトレースログを解析する。以上の処理を繰り返すことで、最終的に問題が発生する箇所を特定する。 The program debug device sets a start event and an end event at a place where it can be assumed that a problem occurs in software as described above, and then in a period from the start event to the end event (hereinafter abbreviated as a trace log period). Acquire the trace log and analyze the acquired trace log. By repeating the above processing, a place where a problem finally occurs is specified.
 一般に、トレースログ期間はその処理時間が長いほど、そこで発生する問題がソフトウェアに及ぼす影響が大きくなる。したがって、処理時間が最長になるトレースログ期間(以下、最長トレースログ期間と称する)では、そこで発生する問題の影響が最大になる。このことから、最長トレースログ期間を特定したうえでその最長トレースログ期間を解析することが問題解決に要する時間の短縮に有効であると考えられる。なお、最長トレースログ期間を特定する方法は、特許文献1において提案されている。また、トレースログの記録方法については、特許文献2で提案されている。 In general, the longer the processing time is in the trace log period, the greater the effect of the problem that occurs on the software. Therefore, in the trace log period in which the processing time is the longest (hereinafter referred to as the longest trace log period), the influence of the problem occurring there is the maximum. From this, it is considered effective to reduce the time required to solve the problem by specifying the longest trace log period and analyzing the longest trace log period. A method for specifying the longest trace log period is proposed in Patent Document 1. A method for recording a trace log is proposed in Patent Document 2.
特開平3-92940号公報Japanese Patent Laid-Open No. 3-92940 特開平5-241878号公報Japanese Patent Laid-Open No. 5-241878
 特許文献2によれば、各期間におけるトレースログを累積して記録することができるが、最長トレースログ期間を特定したうえで特定した最長トレースログ期間におけるトレースログを選択的に記録することはできない。 According to Patent Document 2, the trace logs in each period can be accumulated and recorded, but the trace log in the specified longest trace log period cannot be selectively recorded after the longest trace log period is specified. .
 最長トレースログ期間では、
・割り込みが多重に発生する、
・想定外の割り込みが発生する、
・処理量が異常に多くなる、
・複数のタスクが変数をライトアクセスする、
等の状態が発生して排他性の問題が発生し、そのためにタスクの処理時間が異常に長くなる場合等を想定しており、このような想定に基づいて最長トレースログ期間を推定している。したがって、割り込みが入らない状態であれば処理時間が短くなって上述した不都合が生じないことが多く、そうすると、本来なら最長トレースログ期間となるはずのトレースログ期間を、最長トレースログ期間として特定することが不可能になる。
In the longest trace log period,
・ Multiple interrupts occur,
・ An unexpected interrupt occurs.
・ The amount of processing increases abnormally.
・ Multiple tasks have write access to variables,
As a result, it is assumed that the problem of exclusivity occurs and the task processing time becomes abnormally long. Therefore, the longest trace log period is estimated based on such an assumption. Therefore, if the interrupt is not entered, the processing time is shortened and the above-mentioned inconvenience often does not occur. Then, the trace log period that should be the longest trace log period is specified as the longest trace log period. It becomes impossible.
 このことを、図20の時間測定機能を追加した図21に示すプログラムデバッグ装置で説明する。イベント制御器2は、時間測定器7にもイベント成立状態を出力する。時間測定器7は、開始イベントや終了イベントとして予め設定しておいた状態とイベント成立状態とが等価であるか否かを判別する。時間測定器7は、その判別において予め設定しておいた状態と等価であると判断したイベント成立状態の時間測定を行う。ここで時間測定とは、イベント成立状態において、その開始/終了イベントの処理状態が任意の一イベントと等価である、と見なされたトレースログ期間の時間長を測定することである。以下、このようにして測定した時間長を単に時間長という。 This will be described with reference to the program debugging apparatus shown in FIG. 21 to which the time measurement function shown in FIG. 20 is added. The event controller 2 also outputs the event establishment state to the time measuring device 7. The time measuring device 7 determines whether or not the state set in advance as the start event and the end event is equivalent to the event establishment state. The time measuring device 7 measures the time of the event establishment state determined to be equivalent to the state set in advance in the determination. Here, the time measurement is to measure the time length of the trace log period in which the processing state of the start / end event is equivalent to one arbitrary event in the event establishment state. Hereinafter, the time length measured in this way is simply referred to as the time length.
 以上の時間測定を行ったうえで時間測定器7は、測定した時間長の記録を行う。記録に際して時間測定器7は、今回測定したトレースログ期間の時間長と、既に記憶しているトレースログ期間の時間長とを比較し、今回測定したトレースログ期間の時間長が既記録トレースログ期間の時間長よりが長い場合にのみ、時間長の更新を行い、短い場合には、時間長の更新を行わない。このような記録更新操作を行うことで時間測定器7は、最長の時間長を常時更新しつつ維持する。 After performing the above time measurement, the time measuring device 7 records the measured time length. When recording, the time measuring device 7 compares the time length of the trace log period measured this time with the time length of the trace log period already stored, and the time length of the trace log period measured this time is the recorded trace log period. Only when the time length is longer than the time length, the time length is updated. When the time length is shorter, the time length is not updated. By performing such a record update operation, the time measuring device 7 maintains the longest time length while constantly updating it.
 トレース制御器3がトレースログを蓄積する一方、時間測定器7が時間長の測定と最長時間長の更新処理とを行う。このような動作を従来のプログラムデバッグ装置は繰り返す。なお、時間測定器7は、トレース制御器3とは独立して動作する。 While the trace controller 3 accumulates the trace log, the time measuring device 7 performs time length measurement and update processing of the longest time length. The conventional program debugging apparatus repeats such an operation. The time measuring device 7 operates independently of the trace controller 3.
 長時間使用するようなシステムや再現性の低いソフトウェア上の問題を解析する場合、CPU1が長時間実行されてトレースログが蓄積される。しかしながら、そうすると蓄積されたトレースログが膨大なものとなってトレースログの解析自体が難しくなりその処理に多くの時間を要する。さらには、トレースメモリ11の容量に限りがあるために、トレースログが膨大なものとなるとトレースログを記録する領域がロールオーバーされてトレースログを上書きしてしまい、そのためにトレースログを解析できないこともある。 When analyzing problems on systems that are used for a long time or software with low reproducibility, the CPU 1 is executed for a long time and the trace log is accumulated. However, in that case, the accumulated trace log becomes enormous, and the analysis of the trace log itself becomes difficult, and the processing takes a lot of time. Furthermore, since the capacity of the trace memory 11 is limited, if the trace log becomes enormous, the area for recording the trace log is rolled over and the trace log is overwritten, so that the trace log cannot be analyzed. There is also.
 このような理由により、割り込みの多重発生や想定外の割り込み発生等によって想定以上に解析に時間がかかる状態においてはトレースログを解析してその時間長を特定することは現実的には不可能である。 For these reasons, it is practically impossible to analyze the trace log and identify the length of time when analysis takes longer than expected due to multiple interrupts or unexpected interrupts. is there.
 トレースログのデータ単位が20バイトであり、トレースを開始してから終了するまで期間(トレースログ期間)におけるトレースログの平均データ数が5,000個である、という状態を一例にすると、一つのトレースログ期間におけるトレースログのデータサイズは100,000バイトとなる。トレースログ期間の設定サイクルが1秒に10回でありかつトレースメモリ11の容量が1,000,000バイトである場合、記録できるトレースログのデバッグ量はたかだか約1秒間でしかなく、不十分と言わざるを得ない。 For example, when the data unit of the trace log is 20 bytes and the average number of trace log data in the period (trace log period) from the start to the end of the trace is 5,000, The data size of the trace log in the trace log period is 100,000 bytes. If the setting cycle of the trace log period is 10 times per second and the capacity of the trace memory 11 is 1,000,000 bytes, the amount of trace log that can be recorded is only about 1 second, which is insufficient. I must say.
 本発明は、トレースログの記録においてトレースログの効果的な絞り込みを行い、もって、再現性が低く解析が難しい問題の特定を迅速・容易化することを主たる目的としている。 The main object of the present invention is to narrow down the trace log effectively in the recording of the trace log, thereby quickly and easily identifying a problem with low reproducibility and difficult to analyze.
 上述した従来の課題が生じる原因は、トレース対象とするトレースログ期間を最長トレースログ期間に絞り込めていないことにある、と見なしたうえで本発明は以下の構成を備える。 Considering that the cause of the above-described conventional problem is that the trace log period to be traced is not narrowed down to the longest trace log period, the present invention has the following configuration.
 (1)本発明によるプログラムデバッグ装置は、
 プログラムを実行するCPUと、
 前記CPUによる前記プログラムの実行時における任意状態を定義するイベントを保持したうえで、前記CPUによる実際のプログラム実行時における処理経過と前記イベントとを比較し、その比較結果に基づいて前記処理経過において前記イベントによってその開始と終了とが定義される部分経過が成立しているか否かを判断するイベント制御器と、
 前記部分経過を記録するためのトレースメモリと、
 前記イベント制御器によって成立していると判断された前記部分経過を、前記トレースメモリに仮記録するトレース制御器と、
 実際のプログラム実行時における一時点において前記部分経過が開始してから終了するまでの期間が、前記一時点を含むそれ以前に成立した部分経過群における前記期間の群の中で最長であるか否かの判断に基づいて、前記一時点において前記トレースメモリに仮記録させた前記部分経過を本記録するか否かを選択するトレースログ記録確定制御器と、
 を備える。
(1) A program debugging apparatus according to the present invention comprises:
A CPU for executing the program;
After holding an event defining an arbitrary state at the time of execution of the program by the CPU, the process progress at the time of actual program execution by the CPU is compared with the event, and in the process progress based on the comparison result An event controller that determines whether or not a partial progress that defines the start and end of the event is established; and
A trace memory for recording the partial progress;
A trace controller for temporarily recording the partial progress determined to be established by the event controller in the trace memory;
Whether the period from the start of the partial progress to the end at the temporary point at the time of actual program execution is the longest among the groups of the partial progress groups established before that including the temporary point A trace log recording confirmation controller for selecting whether to record the partial progress temporarily recorded in the trace memory at the temporary point based on the determination of
Is provided.
 この構成において、イベント制御器は、
・CPUによるプログラムの実行時における任意状態を定義するイベントを保持する、
・CPUによる実際のプログラム実行時における処理経過(トレースログ)とイベントとを比較する、
・比較結果に基づいて処理経過においてイベントによってその開始と終了とが定義される部分経過が成立しているか否かを判断する、
という動作を行う。
In this configuration, the event controller is
-Holds an event that defines an arbitrary state when the program is executed by the CPU.
-Compare the process progress (trace log) and event during the actual program execution by the CPU,
-It is determined whether or not the partial progress in which the start and end are defined by the event in the processing progress is established based on the comparison result,
Perform the operation.
 トレース制御器は、
・イベント制御器によって成立していると判断された部分経過を、トレースメモリに仮記録する、
 という動作を行う。
The trace controller
-Temporarily record the partial progress determined to be established by the event controller in the trace memory.
Perform the operation.
 トレースログ記録確定制御器は、
・実際のプログラム実行時における一時点において部分経過が開始してから終了するまでの期間が、一時点を含むそれ以前に成立した部分経過群における期間の群の中で最長であるか否かの判断する、
・判断結果に基づいて、一時点においてトレースメモリに仮記録させた部分経過を本記録するか否かを選択する、
 という動作を行う。
Trace log record confirmation controller
・ Whether the period from the start of the partial progress at the temporary point at the time of actual program execution to the end is the longest among the groups of partial progress groups established before that including the temporary point to decide,
-Select whether to record the partial progress temporarily recorded in the trace memory at a temporary point based on the judgment result,
Perform the operation.
 このようにして不要な部分経過を破棄することにより、トレースメモリに残される部分経過の数を絞り込むことが可能となる。なお、「実際のプログラム実行時における一時点において部分経過が開始してから終了するまでの期間が、一時点を含むそれ以前に成立した部分経過群における期間の群の中で最長である」というのは、実態としては「前回よりも長い」ということであり、ただ1つということを意味するものではない。トレースメモリに残される部分経過は、期間が比較的長いものであり、より重大なソフトウェア上の問題を含んでいる可能性が高いイベントに関係する部分経過である。したがって、このようにして絞り込まれてトレースメモリに格納された部分経過を解析すれば、最終的な問題発生箇所の特定を迅速・容易に進めることが可能となる。また、記録する部分経過の絞り込みは、トレースメモリの容量の過大な増加を回避するうえでも有効である。 By discarding unnecessary partial processes in this way, the number of partial processes remaining in the trace memory can be reduced. In addition, "the period from the start of the partial progress at the temporary point at the time of actual program execution to the end is the longest among the groups of the partial progress groups established before that including the temporary point" Is actually “longer than last time” and does not mean just one. The partial progress left in the trace memory is the partial progress related to events that are relatively long in duration and likely to contain more serious software problems. Therefore, by analyzing the partial progress that has been narrowed down and stored in the trace memory in this way, it is possible to quickly and easily identify the location of the final problem. In addition, narrowing down the partial progress of recording is also effective in avoiding an excessive increase in the capacity of the trace memory.
 (2)上述した(1)のプログラムデバッグ装置には、
 前記トレースログ記録確定制御器はトレースメモリアドレス管理器を備え、
 前記トレースメモリアドレス管理器は、前記一時点において成立した前記部分経過を格納する前記トレースメモリにおけるメモリ位置を規定する記録アドレス(最新)の設定と、前記一時点より前の時点において成立した前記部分経過を格納する前記トレースメモリにおけるメモリ位置を規定する記録アドレス(前回)の設定とを行い、
 前記トレースメモリアドレス管理器は、前記期間が前記期間の群の中で最長であると判断すると、前記記録アドレス(最新)を更新する一方、前記期間が前記期間の群の中で最長でないと判断すると、前記記録アドレス(前回)を前記記録アドレス(最新)に設定する、
 という態様がある。
(2) In the program debugging apparatus of (1) described above,
The trace log record confirmation controller comprises a trace memory address manager;
The trace memory address manager sets a recording address (latest) that defines a memory position in the trace memory that stores the partial progress established at the temporary point, and the part established at a time before the temporary point. Set the recording address (previous) that defines the memory location in the trace memory that stores the progress,
When the trace memory address manager determines that the period is the longest in the group of periods, the trace memory address manager updates the recording address (latest) while determining that the period is not the longest in the group of periods. Then, the recording address (previous) is set to the recording address (latest).
There is a mode.
 部分経過における上記期間(換言すればその仮記録に要した時間長)が期間群の中で最長であれば、記録アドレス(最新)を更新する。すると、次の部分経過が記録されることになるのは、更新後の記録アドレス(最新)となり、1回前に仮記録が行われたアドレスである記録アドレス(前回)ではなくなる。そのため、1回前に仮記録が行われたアドレスに対する上書きは行われることはなくなって、結果として、1回前に仮記録が行われたアドレスにおける部分経過の記録は本記録として確定されたものとなる。一方、期間が期間群の中で最長でないと判断されると、記録アドレス(前回)が記録アドレス(最新)に設定される。すると、次の部分経過が記録されることになるのは、1回前に仮記録が行われたアドレスである記録アドレス(前回)となる結果、1回前に仮記録が行われた記録アドレス(前回)に対して上書きされる。これにより、1回前に仮記録が行われたアドレスにおける部分経過の記録は破棄されて、代わりに今回の仮記録にかかわるトレースログが記録されることになる。 If the above period (in other words, the length of time required for the temporary recording) in the partial progress is the longest in the period group, the recording address (latest) is updated. Then, the next partial progress is recorded, the updated recording address (latest), and not the recording address (previous) which is the address at which temporary recording was performed one time before. For this reason, overwriting is not performed on the address where temporary recording was performed once before, and as a result, the partial progress recording at the address where temporary recording was performed once was confirmed as the main recording. It becomes. On the other hand, if it is determined that the period is not the longest in the period group, the recording address (previous) is set as the recording address (latest). Then, the next partial progress is recorded as a recording address (previous) where the temporary recording was performed once before, as a result of the recording address where the temporary recording was performed once before. Overwritten for (previous). As a result, the partial progress record at the address where the temporary recording was performed once is discarded, and a trace log relating to the current temporary recording is recorded instead.
 (3)上述した(2)のプログラムデバッグ装置には、
 前記トレースメモリアドレス管理器は、前記期間が前記期間の群の中で最長であると判断すると、更新後の前記記録アドレス(最新)を前記記録アドレス(前回)に複写し、前記期間が前記期間の群の中で最長でないと判断すると、前記記録アドレス(前回)を前記記録アドレス(最新)に複写する、
 という態様がある。
(3) In the program debugging apparatus of (2) described above,
When the trace memory address manager determines that the period is the longest in the group of periods, the trace memory address manager copies the updated recording address (latest) to the recording address (previous), and the period is the period. If it is determined that it is not the longest in the group, the recording address (previous) is copied to the recording address (latest).
There is a mode.
 仮記録から本記録または破棄へ移行する制御を、更新後の記録アドレス(最新)を記録アドレス(前回)に複写する、または記録アドレス(前回)を記録アドレス(最新)に複写することによって実現されるので、仮記録から本記録または破棄への制御を簡易な構成で容易に実現することが可能になる。更新後の記録アドレス(最新)を記録アドレス(前回)に複写すれば、記録アドレス(前回)は、この直前に仮記録された部分経過の記録先アドレスとなる。このようなアドレスが記録アドレス(前回)に保存されているということは、仮記録が本記録に昇格することに相当する。一方、記録アドレス(前回)を記録アドレス(最新)に複写すれば、仮記録後に更新した記録アドレス(最新)を元に戻すことになり、そのアドレスへの次のトレースログの上書きを許容することになる。その結果、先の仮記録は破棄されることになる。 Control to shift from temporary recording to actual recording or discarding is realized by copying the updated recording address (latest) to the recording address (previous) or copying the recording address (previous) to the recording address (latest). Therefore, the control from the temporary recording to the main recording or discarding can be easily realized with a simple configuration. If the updated recording address (latest) is copied to the recording address (previous), the recording address (previous) becomes the recording destination address of the partial passage temporarily recorded immediately before this. The fact that such an address is stored at the recording address (previous) corresponds to the temporary recording being promoted to the main recording. On the other hand, if the recording address (previous) is copied to the recording address (latest), the recording address updated after temporary recording (latest) will be restored, and overwriting of the next trace log to that address will be allowed. become. As a result, the previous temporary record is discarded.
 (4)上述した(2)のプログラムデバッグ装置には、
 更新タイミング制御器をさらに備え、
 前記更新タイミング制御器は、前記期間が前記期間の群の中で最長であるか否かの判断に基づいて、前記トレースメモリアドレス管理器による前記記録アドレス(最新)の設定タイミングと前記記録アドレス(前回)の設定タイミングとを制御する、
 という態様がある。
(4) In the program debugging device of (2) described above,
An update timing controller;
The update timing controller determines the setting timing of the recording address (latest) by the trace memory address manager and the recording address (based on the determination whether the period is the longest in the group of periods. Control the timing of the previous)
There is a mode.
 更新タイミング制御器は、部分経過の仮記録に要した期間が現在までにおいて最長か否かを判断し、判断結果をトレースメモリアドレス管理器に与えるものであり、更新タイミング制御器をもっぱらタイミングの管理を司るものとして構成することが可能となる。 The update timing controller judges whether or not the period required for temporary recording of partial progress is the longest up to the present, and gives the judgment result to the trace memory address manager. The update timing controller is exclusively used for timing management. It can be configured to manage
 (5)上述した(2)のプログラムデバッグ装置には、
 前記トレースログ記録確定制御器は、前記記録アドレス(前回)をさらにトレース開始アドレスとして保持する、
 という態様がある。
(5) The program debug device of (2) described above includes
The trace log record confirmation controller further holds the record address (previous) as a trace start address.
There is a mode.
 これは、記録アドレス(最新)、記録アドレス(前回)に加えてさらにトレース開始アドレスを用いるものである。その都度の記録アドレス(最新)をトレース開始アドレスとして保持するので、トレース開始アドレスには常に本記録にかかわる記録アドレス(最新)が設定されていることになる。本記録にかかわる期間は、記録されている期間群のうちで最長となる。 This uses the trace start address in addition to the record address (latest) and record address (previous). Since each recording address (latest) is held as a trace start address, a record address (latest) related to the actual recording is always set as the trace start address. The period related to this recording is the longest among the recorded period groups.
 部分経過の記録が完了すると、トレースメモリには期間が最長となった部分経過が複数記録されていることになる。解析に際してトレースメモリから部分経過を読み出すに当たり、トレース開始アドレスにアクセスして読み出せば、記録されている部分経過群のうちで期間が最も長い部分経過(最長中の最長の部分経過)が読み出されることになる。部分経過群のうちで期間が最も長い部分経過は、最も重大なソフトウェア上の問題を含んだプログラム部分によって実施された結果である可能性が高いと推定できる。このようにして部分経過を絞り込んだうえで解析を行うことによって、問題発生箇所の特定をさらに迅速・容易に進めることが可能となる。 When the partial progress recording is completed, a plurality of partial progresses having the longest period are recorded in the trace memory. When reading the partial progress from the trace memory at the time of analysis, if the trace start address is accessed and read, the partial progress having the longest period (the longest partial progress in the longest) is read out from the recorded partial progress group. It will be. It can be estimated that the partial course having the longest period in the partial course group is likely to be a result of the program part including the most serious software problem. In this way, by analyzing after narrowing down the partial progress, it is possible to further quickly and easily identify the problem occurrence location.
 (6)上述した(5)のプログラムデバッグ装置には、
 前記トレースログ記録確定制御器は、前記期間が前記期間の群の中で最長であると判断すると、前記記録アドレス(前回)を前記トレース開始アドレスに設定したうえで、更新後の記録アドレス(最新)を前記記録アドレス(前回)に複写する一方、前記期間が前記期間の群の中で最長でないと判断すると、前記記録アドレス(前回)を記録アドレス(最新)に複写する、
 という態様がある。
(6) The program debugging device of (5) described above includes
When the trace log recording confirmation controller determines that the period is the longest in the group of the periods, it sets the recording address (previous) as the trace start address and then updates the updated recording address (latest ) Is copied to the recording address (previous), and if the period is determined not to be the longest in the group of periods, the recording address (previous) is copied to the recording address (latest).
There is a mode.
 これは、上記の(5)のプログラムデバッグ装置を実現するに当たり、アドレスの調整を複写により実施するものである。 This is to adjust the address by copying to realize the program debugging device of (5) above.
 (7)上述した(4)のプログラムデバッグ装置には、
 時間測定器をさらに備え、
 前記時間測定器は、前記期間が前記期間の群の中で最長であるか否かの判断結果を示す最長時間更新情報を生成し、
 前記更新タイミング制御器は、前記最長時間更新情報に基づいて前記トレースメモリアドレス管理器による前記記録アドレス(最新)の設定タイミングと前記記録アドレス(前回)の設定タイミングとを制御する、という態様がある。このように構成すれば、時間測定器を更新タイミング制御器から分離した状態で構成することが可能となる。本構成の場合、時間測定器を追加することで、トレース機能をもつ従来プログラムデバッグ装置に本発明を応用展開することが容易になる。
(7) In the program debugging device of (4) described above,
A time measuring device,
The time measuring device generates longest time update information indicating a determination result of whether or not the period is the longest in the group of the periods;
The update timing controller controls the setting timing of the recording address (latest) and the setting timing of the recording address (previous) by the trace memory address manager based on the longest time update information. . If comprised in this way, it will become possible to comprise in the state which isolate | separated the time measuring device from the update timing controller. In the case of this configuration, by adding a time measuring device, it becomes easy to apply and deploy the present invention to a conventional program debugging apparatus having a trace function.
 (8)上述した(4)のプログラムデバッグ装置には、
 前記更新タイミング制御器は、前記部分経過に付帯される時刻情報に基づいて、前記期間が前記期間の群の中で最長であるか否かを判断する、という態様がある。
(8) The program debugging device (4) described above includes
There is a mode in which the update timing controller determines whether or not the period is the longest in the group of periods based on time information attached to the partial progress.
 トレースメモリアドレス管理器は、期間が前記期間の群の中で最長のときは、記録アドレス(最新)を更新することにより、トレースメモリにおける部分経過の仮記録を本記録として確定する。一方、期間が前記期間の群の中で最長でないときは、記録アドレス(最新)として記録アドレス(前回)を設定することにより、トレースログの仮記録を破棄する。そして、更新タイミング制御器は、期間が前記期間の群の中で最長であるか否かの判断結果に基づいて、トレースメモリアドレス管理器をタイミング制御する。本態様では、更新タイミング制御器における期間の最長判断を、部分経過に付帯される時刻情報を利用して行っている。部分経過の仮記録を開始したときの時刻情報と終了したときの時刻情報とから期間の時間長を算出し、算出した期間の時間長に基づいてトレース情報を生成して、さらに生成したトレース情報に基づいてトレースメモリアドレス管理器をタイミング制御する。本構成によれば、上述した(7)の構成における時間測定器を含まないプログラムデバッグ装置においても、本発明を実現することが可能になる。 When the period is the longest in the group of the periods, the trace memory address manager updates the recording address (latest), thereby determining the temporary recording of the partial progress in the trace memory as the main recording. On the other hand, when the period is not the longest in the group of periods, the temporary recording of the trace log is discarded by setting the recording address (previous) as the recording address (latest). Then, the update timing controller controls the timing of the trace memory address manager based on the determination result of whether or not the period is the longest in the group of the periods. In this aspect, the longest determination of the period in the update timing controller is performed using time information attached to the partial progress. Calculate the time length of the period from the time information when the partial progress temporary recording starts and the time information when it ends, generate trace information based on the calculated time length of the period, and further generate the trace information Based on the timing of the trace memory address manager. According to this configuration, the present invention can be realized even in a program debug device that does not include the time measuring device in the configuration of (7) described above.
 (9)上述した(4)のプログラムデバッグ装置には、
 前記更新タイミング制御器は、前記部分経過と前記イベントとに基づいて、前記期間が前記期間の群の中で最長であるか否かを判断する、
 という態様がある。
(9) In the program debugging device of (4) described above,
The update timing controller determines whether the period is the longest in the group of periods based on the partial progress and the event.
There is a mode.
 更新タイミング制御器による期間の最長判断において、部分経過とイベントとの2つの要素を利用するのが本態様である。更新タイミング制御器は、部分経過の仮記録開始イベントとして設定したイベントと処理経過とを比較して一致したときの時刻情報と、部分経過の仮記録終了イベントとして設定したイベントと処理経過とを比較して一致したときの時刻情報とから期間の時間長を算出する。さらに更新タイミング制御器は、算出した時間長を示すイベントトレース情報を生成し、そのイベントトレース情報に基づいて、トレースメモリアドレス管理器をタイミング制御する。本態様によれば、時間測定器を含まないプログラムデバッグ装置においても、本発明を実現することが可能になる。 In this mode, two elements of partial progress and event are used in the longest judgment of the period by the update timing controller. The update timing controller compares the event information set as the partial progress provisional recording start event with the processing progress, and compares the time information when the event matches the processing progress with the event information set as the partial progress provisional recording end event. Then, the time length of the period is calculated from the time information when they match. Further, the update timing controller generates event trace information indicating the calculated time length, and controls the timing of the trace memory address manager based on the event trace information. According to this aspect, the present invention can be realized even in a program debugging apparatus that does not include a time measuring device.
 (10)上述した(4)のプログラムデバッグ装置には、
 更新タイミングマスク制御器をさらに備え、
 前記更新タイミングマスク制御器は、前記更新タイミング制御器による前記記録アドレス(最新)の設定タイミングの制御動作の有効/無効を制御する、
 という態様がある。
(10) The program debug device of (4) described above includes
An update timing mask controller;
The update timing mask controller controls the validity / invalidity of the control operation of the setting timing of the recording address (latest) by the update timing controller.
There is a mode.
 ソフトウェアで問題を生じる部分経過を事前にある程度予測できる場合には、部分経過の仮記録を、問題が生じると予測されるものに絞り込むのが合理的である。問題が生じると予測されない部分経過については、仮記録の対象外とすればよい。例えば、プログラム実行直後における部分経過では、その期間が最長となりやすい。しかしながら、プログラム実行直後において期間最長と判定される部分経過においては、その部分経過を生じさせたプログラム成分に不具合がない場合が多い。したがって、期間最長と判定されるものの、その部分経過を生じさせたプログラム成分に不具合がある可能性が低いと見なされる部分経過は破棄すればよい。このようにその部分経過を生じさせたプログラム成分に不具合がある可能性が低いことが事前に分かっている部分経過については、その部分経過に対して更新タイミング制御器が実施する記録アドレス(最新)の更新制御を、更新タイミングマスク制御器によって無効に設定しておく。そうすることにより、その部分経過を生じさせたプログラム成分に不具合がある可能性が低いことが事前に分かっている部分経過の仮記録を破棄させることが可能となる。一方、その部分経過を生じさせたプログラム成分に不具合がある可能性が低くないことが事前に分かっている部分経過については、その部分経過に対して更新タイミング制御器が実施する記録アドレス(最新)の更新制御を有効に設定しておく。以上の制御を実施することで、その部分経過を生じさせたプログラム成分に不具合がある可能性が低くないことが事前に分かっている部分経過に限定して、トレースメモリにおける仮記録を本記録に確定することが可能となる。結果として、問題発生箇所に関わる部分経過の収集が効率化される。 If it is possible to predict in advance a partial process that causes a problem in software to some extent, it is reasonable to narrow the temporary record of the partial process to one that is predicted to cause a problem. Partial progress that is not predicted to cause a problem may be excluded from provisional recording. For example, the partial period immediately after the program execution tends to be the longest. However, in the partial progress determined to be the longest period immediately after the execution of the program, there are many cases where there is no problem in the program component that caused the partial progress. Therefore, although it is determined that the period is the longest, the partial progress that is considered to be unlikely to have a defect in the program component that caused the partial progress may be discarded. In this way, with respect to a partial process that is known in advance to be unlikely to be defective in the program component that caused the partial process, the recording address (latest) that the update timing controller performs for the partial process The update control is set to invalid by the update timing mask controller. By doing so, it is possible to discard the temporary recording of partial progress that is known in advance that the program component that caused the partial progress is unlikely to be defective. On the other hand, for partial progress that is known in advance that there is no low possibility that the program component that caused the partial progress is defective, the recording address (latest) that the update timing controller performs for the partial progress Set the update control to valid. By implementing the above control, the temporary recording in the trace memory is limited to the main recording, limited to the partial processing that is known in advance that the possibility that the program component that caused the partial processing is defective is not low. It becomes possible to confirm. As a result, the collection of partial progress related to the problem occurrence location is made efficient.
 (11)上述した(4)のプログラムデバッグ装置には、
 外部トリガ出力器をさらに備え、
 前記更新タイミング制御器は、記録アドレス(最新)の更新/非更新を示すアドレス更新情報を出力し、
 前記外部トリガ出力器は、前記アドレス更新情報に基づいて任意の波形信号からなる外部トリガを生成して出力する、
 という態様がある。
(11) In the program debugging device of (4) described above,
An external trigger output device
The update timing controller outputs address update information indicating update / non-update of the recording address (latest),
The external trigger output unit generates and outputs an external trigger composed of an arbitrary waveform signal based on the address update information.
There is a mode.
 プログラム上に発生した問題の解析に当たっては、収集した部分経過の解析だけでなく、問題発生箇所または問題発生時の出力状態等の波形を取得して、その波形も併せて解析すれば、問題解決を効果的に進めることが可能になる。記録アドレス(最新)を更新するのは、最長期間が更新されたときであり、このとき、外部トリガ出力器が、問題解決に供する任意の波形信号を外部トリガとして出力する。例えば、ユーザターゲットシステムにおけるアクチュエータ等の出力状態等の波形をオシロスコープ等によって取得して外部トリガとして出力する。 When analyzing problems that occur in the program, you can solve the problem by not only analyzing the collected partial progress, but also acquiring waveforms such as the location of the problem or the output status at the time of the problem, and analyzing that waveform together. Can be effectively advanced. The recording address (latest) is updated when the longest period is updated. At this time, the external trigger output unit outputs an arbitrary waveform signal used for problem solving as an external trigger. For example, a waveform such as an output state of an actuator or the like in the user target system is acquired by an oscilloscope or the like and output as an external trigger.
 (12)上述した(4)のプログラムデバッグ装置には、
 ブレーク制御器をさらに備え、
 前記更新タイミング制御器は、記録アドレス(最新)の更新/非更新を示すアドレス更新情報を出力し、
 前記ブレーク制御器は、前記アドレス更新情報に基づいて前記CPUの動作を停止させる、
 という態様がある。
(12) The program debugging device (4) described above includes
A break controller,
The update timing controller outputs address update information indicating update / non-update of the recording address (latest),
The break controller stops the operation of the CPU based on the address update information;
There is a mode.
 記録アドレス(最新)の更新/非更新、すなわち、期間の最長値が更新されたときにCPUを停止させれば、そのとき取得した部分経過を用いて、直ちに問題発生時の変数の状態や処理の状態をデバッグすることが可能となり、問題解決の迅速化を図ることが可能となる。 Update / non-update of the recording address (latest), that is, if the CPU is stopped when the longest value of the period is updated, the state and processing of the variable at the time of occurrence of the problem immediately using the partial progress acquired at that time It is possible to debug the state of the problem, and it is possible to speed up problem solving.
 (13)本発明のエミュレータシステムは、
 ホストコンピュータとの間でデバッグに関する情報を授受するホストIF回路と、
 前記ホストIF回路を介した前記ホストコンピュータの指示に基づいてユーザターゲットシステムを制御してデバッグを行い、そのデバッグ結果を、前記ホストIF回路を介して前記ホストコンピュータに送信する請求項1のプログラムデバッグ装置と、
 を備える。本発明のエミュレータシステムは、プログラムや周辺装置上の問題のデバッグを効率良く進めることが可能となる。
(13) The emulator system of the present invention
A host IF circuit that exchanges debugging information with the host computer;
The program debug according to claim 1, wherein debugging is performed by controlling a user target system based on an instruction of the host computer via the host IF circuit, and transmitting the debug result to the host computer via the host IF circuit. Equipment,
Is provided. The emulator system of the present invention can efficiently debug a problem on a program or a peripheral device.
 本発明によれば、イベント成立状態が有効となる部分経過を、一旦トレースメモリに仮記録したうえで、期間が最長となる部分経過に限定して本記録するので、部分経過の記録において効果的な絞り込みが行われ、再現性が低く解析が難しいソフトウェア上の問題の特定を迅速・容易化することができる。 According to the present invention, the partial progress in which the event establishment state is valid is temporarily recorded in the trace memory, and then only the partial progress in which the period is the longest is recorded, so that it is effective in recording the partial progress. As a result, it is possible to quickly and easily identify software problems that are difficult to analyze with low reproducibility.
図1は本発明の実施の形態1におけるプログラムデバッグ装置の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of a program debugging apparatus according to Embodiment 1 of the present invention. 図2は本発明の実施の形態1のプログラムデバッグ装置におけるトレースログ仮記録の動作を示すフローチャートである。FIG. 2 is a flowchart showing the trace log temporary recording operation in the program debugging apparatus according to the first embodiment of the present invention. 図3は本発明の実施の形態1のプログラムデバッグ装置におけるトレースメモリのアドレス操作のフローチャートである。FIG. 3 is a flowchart of the address operation of the trace memory in the program debugging apparatus according to the first embodiment of the present invention. 図4Aは本発明の実施の形態1におけるトレースログ期間の長さの第1の変遷の様子の説明図である。FIG. 4A is an explanatory diagram of a first transition of the length of the trace log period according to the first embodiment of the present invention. 図4Bは本発明の実施の形態1におけるトレースログ期間の長さの第2の変遷の様子の説明図である。FIG. 4B is an explanatory diagram showing a second transition of the length of the trace log period according to the first embodiment of the present invention. 図5は本発明の実施の形態2におけるプログラムデバッグ装置の構成を示すブロック図である。FIG. 5 is a block diagram showing the configuration of the program debugging apparatus according to the second embodiment of the present invention. 図6は本発明の実施の形態2のプログラムデバッグ装置における記録先アドレスの操作のフローチャートである。FIG. 6 is a flowchart of the operation of the recording destination address in the program debugging apparatus according to the second embodiment of the present invention. 図7は本発明の実施の形態3におけるプログラムデバッグ装置の構成を示すブロック図である。FIG. 7 is a block diagram showing the configuration of the program debug apparatus according to the third embodiment of the present invention. 図8は本発明の実施の形態4におけるプログラムデバッグ装置の構成を示すブロック図である。FIG. 8 is a block diagram showing the configuration of the program debugging apparatus according to the fourth embodiment of the present invention. 図9は本発明の実施の形態4における時刻情報を付帯するトレースログの一例を示す図である。FIG. 9 is a diagram showing an example of a trace log accompanying time information according to Embodiment 4 of the present invention. 図10は本発明の実施の形態4におけるトレースログ期間の判別のフローチャートである。FIG. 10 is a flowchart for determining the trace log period according to the fourth embodiment of the present invention. 図11は本発明の実施の形態5におけるプログラムデバッグ装置の構成を示すブロック図である。FIG. 11 is a block diagram showing a configuration of a program debugging apparatus according to Embodiment 5 of the present invention. 図12は本発明の実施の形態5におけるトレースログ期間の判別のフローチャートである、FIG. 12 is a flowchart for determining the trace log period according to the fifth embodiment of the present invention. 図13は本発明の実施の形態6におけるプログラムデバッグ装置の構成を示すブロック図である。FIG. 13 is a block diagram showing the configuration of the program debugging apparatus according to the sixth embodiment of the present invention. 図14は本発明の実施の形態6におけるトレースメモリのアドレス操作のフローチャートである。FIG. 14 is a flowchart of trace memory address operations according to the sixth embodiment of the present invention. 図15は本発明の実施の形態7におけるプログラムデバッグ装置の構成を示すブロック図である。FIG. 15 is a block diagram showing a configuration of a program debugging apparatus according to the seventh embodiment of the present invention. 図16は本発明の実施の形態7におけるトレースメモリのアドレス操作のフローチャートである。FIG. 16 is a flowchart of the trace memory address operation in the seventh embodiment of the present invention. 図17は本発明の実施の形態8におけるプログラムデバッグ装置の構成を示すブロック図である。FIG. 17 is a block diagram showing a configuration of a program debugging apparatus according to the eighth embodiment of the present invention. 図18は本発明の実施の形態8におけるトレースメモリのアドレス操作のフローチャートである。FIG. 18 is a flowchart of the address operation of the trace memory according to the eighth embodiment of the present invention. 図19は本発明にかかわるエミュレータシステムとその周辺の構成を示すブロック図である。FIG. 19 is a block diagram showing the configuration of an emulator system and its peripherals according to the present invention. 図20は従来技術のトレース機能とイベント機能を用いたプログラムデバッグ装置の構成を示すブロック図である。FIG. 20 is a block diagram showing a configuration of a program debugging apparatus using a conventional trace function and event function. 図21は従来技術の時間測定機能を追加したプログラムデバッグ装置の構成を示すブロック図である。FIG. 21 is a block diagram showing a configuration of a program debugging apparatus to which a time measuring function of the prior art is added.
 (実施の形態1)
 図1は本発明の実施の形態1におけるプログラムデバッグ装置の構成を示すブロック図である。このプログラムデバッグ装置は、CPU1と、イベント制御器2と、トレース制御器3と、トレースログ記録確定制御器4と、トレースメモリ11とを備える。本実施の形態は、図20に示す従来例の構成を備えるうえに、トレースログ記録確定制御器4をさらに備えることに特徴を有する。
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of a program debugging apparatus according to Embodiment 1 of the present invention. The program debugging apparatus includes a CPU 1, an event controller 2, a trace controller 3, a trace log record confirmation controller 4, and a trace memory 11. The present embodiment is characterized in that it has the configuration of the conventional example shown in FIG. 20 and further includes a trace log recording confirmation controller 4.
 CPU1は、ハードウェアあるいはソフトウェアで構成され、プログラム(具体的にはプログラムコード)を実行するものである。イベント制御器2はイベントを2つ以上管理する。イベントとは、プログラム実行時における任意状態を定義するものである。さらに詳細にいえば、イベントとは、CPU1によるプログラムの実行時における処理経過に含まれる任意の部分経過の開始と終了とをそれぞれ定義する。CPU1がプログラムを実行する際のアドレスや各種データをリードまたはライトする際のアドレス等は、イベントにより定義される。イベント制御器2は、複数のイベントを登録して管理している。そのうえでイベント制御器2は、CPU1がプログラムを実際に実行する際における処理経過と、管理しているイベントとを比較し、処理経過の各部が任意のイベント(所定の部分経過の開始/終了を特定するイベント)と等価であるか否かの判別を、管理しているイベント毎に実施し、その判別結果をイベント成立状態として出力する。イベント成立状態は、有効/無効を示す情報となる。ここで、有効とは、処理経過に含まれる一つの状態が任意の一イベントと等価であることを示し、無効とは非等価であることを示す。 The CPU 1 is configured by hardware or software and executes a program (specifically, a program code). The event controller 2 manages two or more events. An event defines an arbitrary state during program execution. More specifically, the event defines the start and end of an arbitrary partial progress included in the processing progress when the CPU 1 executes the program. An address when the CPU 1 executes a program, an address when reading or writing various data, and the like are defined by events. The event controller 2 registers and manages a plurality of events. After that, the event controller 2 compares the process progress when the CPU 1 actually executes the program with the managed event, and each part of the process progress specifies an arbitrary event (start / end of a predetermined partial progress). Is determined for each managed event, and the result of the determination is output as an event establishment state. The event establishment state is information indicating validity / invalidity. Here, “valid” indicates that one state included in the process progress is equivalent to one arbitrary event, and “invalid” indicates that it is not equivalent.
 トレースメモリ11はトレースログを記録する。トレースログはCPU1がプログラムを実行した処理経過の全てもしくはその一部の記録のことであって、本発明における部分経過を示している。トレースログとしては、CPU1がプログラムを実行したアドレスや各種データのリードまたはライトを実行したアドレス等が代表例として挙げられる。トレースログの内容は、プログラムデバッグ装置によって異なる。 Trace memory 11 records a trace log. The trace log is a record of all or part of the processing progress of execution of the program by the CPU 1, and indicates the partial progress in the present invention. Typical examples of the trace log include an address at which the CPU 1 executes a program, an address at which various data are read or written, and the like. The contents of the trace log vary depending on the program debug device.
 トレース制御器3は、イベント制御器2が出力するイベント成立状態が有効を示すと、CPU1の動作記録であるトレースログをトレースメモリ11に仮記録する処理を開始し、引き続いてもう一つのイベント成立状態が有効を示すと、その仮記録処理を終了する。 When the event establishment state output from the event controller 2 indicates that the event controller 2 is valid, the trace controller 3 starts a process of temporarily recording the trace log, which is an operation record of the CPU 1, in the trace memory 11, and subsequently another event is established. When the status indicates valid, the temporary recording process is terminated.
 トレースログ記録確定制御器4は、
・トレースメモリ11において一時的に記録したトレースログ(以下、トレースログ(最新)と称する)を、破棄することなく継続的に記録に留めるトレースログ(以下、トレースログ(記録)と称する)として確定する、
・上記トレースログ(最新)をトレースログ(記録)とせずに破棄するものとして確定する、
との切換制御を行う。
The trace log record confirmation controller 4
The trace log temporarily recorded in the trace memory 11 (hereinafter referred to as “trace log (latest)”) is confirmed as a trace log (hereinafter referred to as “trace log (record)”) that is continuously recorded without being discarded. To
・ Determine that the above trace log (latest) is to be discarded without being a trace log (record).
Switching control is performed.
 トレースログ記録確定制御器4による切り替え制御は次のようにして実施される。トレースログ記録確定制御器4は、トレースログの仮記録に要する時間を示すトレースログ期間Tを記録する。トレースログ期間Tは、具体的には、イベント制御器2が管理する任意の1つのイベントと等価な状態が発生してから、イベント制御器2が管理する任意のもう1つのイベントと等価な状態が発生するに至る期間をいう。換言すれば、トレースログ期間Tは、部分経過が開始されてから終了に至る期間となる。以下、トレース制御器3によるトレースログ(最新)の算出に伴ってトレースログ記録確定制御器4が算出するトレースログ期間Tを、トレースログ期間(最新)T2と称する。トレースログ記録確定制御器4は、その時点における最長のトレースログ期間(最新)T2を仮記録したうえで本記録する。以下、本記録された最長のトレースログ期間(最新)T2を、トレースログ期間(記録)T1と称する。 Switching control by the trace log record confirmation controller 4 is performed as follows. The trace log recording confirmation controller 4 records a trace log period T indicating the time required for temporary recording of the trace log. Specifically, the trace log period T is a state equivalent to any other event managed by the event controller 2 after a state equivalent to any one event managed by the event controller 2 occurs. Refers to the period of time that occurs. In other words, the trace log period T is a period from the start of partial progress to the end. Hereinafter, the trace log period T calculated by the trace log recording confirmation controller 4 in accordance with the calculation of the trace log (latest) by the trace controller 3 is referred to as a trace log period (latest) T2. The trace log recording confirmation controller 4 temporarily records the longest trace log period (latest) T2 at that time, and then records it. Hereinafter, the longest recorded trace log period (latest) T2 is referred to as a trace log period (record) T1.
 トレース制御器3が新たにトレースログ(最新)を算出してトレースメモリ11に仮記録すると、トレースログ記録確定制御器4は、そのトレースログ(最新)に応じたトレースログ期間(最新)T2を算出したうえで、当該トレースログ期間(最新)T2と、既に記録しているトレースログ期間(記録)T1とを比較する。この比較結果において、トレースログ記録確定制御器4は、トレースログ期間(最新)T2がトレースログ期間(記録)T1より長いか否か(換言すればトレースログ期間(最新)T2が最長であるか否か:T2>T1)を判断する。トレースログ記録確定制御器4は、この判断結果に基づいて、トレースメモリ11におけるトレースログ(最新)をトレースログ(記録)として確定するか否かを判断する。 When the trace controller 3 newly calculates a trace log (latest) and temporarily records it in the trace memory 11, the trace log recording confirmation controller 4 sets a trace log period (latest) T2 corresponding to the trace log (latest). After the calculation, the trace log period (latest) T2 is compared with the already recorded trace log period (record) T1. In this comparison result, the trace log record confirmation controller 4 determines whether the trace log period (latest) T2 is longer than the trace log period (record) T1 (in other words, whether the trace log period (latest) T2 is the longest). Whether or not: T2> T1) is determined. Based on the determination result, the trace log record confirmation controller 4 determines whether or not to confirm the trace log (latest) in the trace memory 11 as the trace log (record).
 トレースログ記録確定制御器4は、トレースメモリアドレス管理器5と更新タイミング制御器6とを備える。トレースメモリアドレス管理器5は、記録アドレス(最新)Aと記録アドレス(前回)Bとを管理するものであって、トレースメモリアドレス管理器5は例えばレジスタから構成される。記録アドレス(最新)Aは、トレースメモリ11上の記録領域を特定するアドレス情報である。このアドレス情報は、トレースログ(最新)を仮記録するために設定される。記録アドレス(最新)Aは、トレースメモリ11上でトレースログ(最新)の仮記録が完了する毎に、次回の仮記録のためにインクリメント等の処理により更新される。記録アドレス(前回)Bは、本記録が確定したトレースログが格納されているトレースメモリ11上のメモリ位置を示す。記録アドレス(前回)Bは、仮記録を経て本記録が確定したトレースログの更新前(すなわち旧)の記録アドレス(最新)Aと同等になる。実際の処理においては、記録アドレス(最新)Aが更新される毎に、更新前の記録アドレス(最新)Aが記録アドレス(前回)Bとして記録される。 The trace log record confirmation controller 4 includes a trace memory address manager 5 and an update timing controller 6. The trace memory address manager 5 manages the recording address (latest) A and the recording address (previous) B, and the trace memory address manager 5 is composed of a register, for example. The recording address (latest) A is address information for specifying a recording area on the trace memory 11. This address information is set to temporarily record the trace log (latest). Each time the temporary recording of the trace log (latest) is completed on the trace memory 11, the recording address (latest) A is updated by a process such as increment for the next temporary recording. The recording address (previous) B indicates a memory position on the trace memory 11 in which the trace log in which the main recording is confirmed is stored. The recording address (previous) B is equal to the recording address (latest) A before the update (that is, the old) of the trace log in which the main recording is confirmed after the temporary recording. In actual processing, every time the recording address (latest) A is updated, the recording address (latest) A before updating is recorded as the recording address (previous) B.
 トレース制御器3によって算定されたトレースログ期間(最新)T2が現時点において最長である場合(T2がT1より長い場合:T2>T1)、トレースメモリアドレス管理器5は、トレースメモリ11において次にトレースログを仮記録するメモリ位置を示す記録アドレス(最新)Aを更新する。アドレスの更新は、例えば、インクリメント処理により実施される。 When the trace log period (latest) T2 calculated by the trace controller 3 is the longest at the present time (when T2 is longer than T1: T2> T1), the trace memory address manager 5 next traces in the trace memory 11. The recording address (latest) A indicating the memory location where the log is temporarily recorded is updated. The address update is performed by, for example, increment processing.
 一方、トレースログ期間(最新)T2が現時点において最長でない場合(T2がT1と同等もしくはそれよりも短い場合:T2≦T1)、トレースメモリアドレス管理器5は、記録アドレス(最新)Aとして、更新を行うことなく現状値を継続設定する。 On the other hand, when the trace log period (latest) T2 is not the longest at the present time (when T2 is equal to or shorter than T1: T2 ≦ T1), the trace memory address manager 5 updates the record address (latest) as A. The current value is continuously set without performing.
 上述した記録アドレス(最新)Aの調整を行ったうえで、トレースメモリアドレス管理器5は、記録アドレス(前回)Bの調整を行う。すなわち、トレースログ期間(最新)T2が現時点において最長である場合(T2>T1)、トレースメモリアドレス管理器5は、記録アドレス(最新)Aを更新したうえで、さらに、更新した記録アドレス(最新)Aを、記録アドレス(前回)Bに複写する。記録アドレス(最新)Aの更新と更新した記録アドレス(最新)Aによる記録アドレス(前回)Bの複写とを同時に実施することにより、いままさに仮記録が完了したばかりのトレースログの仮記録が、本記録として確定する。 After adjusting the recording address (latest) A described above, the trace memory address manager 5 adjusts the recording address (previous) B. That is, when the trace log period (latest) T2 is the longest at the present time (T2> T1), the trace memory address manager 5 updates the record address (latest) A and then updates the updated record address (latest). ) A is copied to the recording address (previous) B. By simultaneously updating the recording address (latest) A and copying the recording address (previous) B with the updated recording address (latest) A, the temporary recording of the trace log that has just been temporarily completed is Finalize as final record.
 一方、トレースログ期間(最新)T2が現時点において最長でない場合(T2≦T1)、トレースメモリアドレス管理器5は、記録アドレス(最新)Aを、記録アドレス(前回)Bに複写する。これにより、いままさに仮記録が完了したばかりのトレースログが記録されているトレースメモリ11のメモリ位置に、次回測定されるトレースログが上書きされることが許容され、その結果、仮記録が完了したばかりのトレースログの仮記録の破棄が確定する。 On the other hand, when the trace log period (latest) T2 is not the longest at the present time (T2 ≦ T1), the trace memory address manager 5 copies the recording address (latest) A to the recording address (previous) B. As a result, it is allowed that the trace log measured next time is overwritten at the memory location of the trace memory 11 where the trace log that has just been temporarily recorded is recorded, and as a result, the temporary recording is completed. The destruction of the temporary record of the last trace log is confirmed.
 更新タイミング制御器6は、トレースログ期間(最新)T2が現時点において最長であるか否か(T2>T1)を判断したうえで、その判断結果をトレースメモリアドレス管理器5に与えるタイミングを制御する。これが、記録アドレスA,Bの複写タイミングを制御する際に利用される。なお、更新タイミング制御器6における時間の管理については種々の方式があり、詳細は他の実施の形態において説明する。 The update timing controller 6 determines whether or not the trace log period (latest) T2 is the longest at the present time (T2> T1), and controls the timing at which the determination result is given to the trace memory address manager 5. . This is used when the copy timing of the recording addresses A and B is controlled. There are various methods for managing time in the update timing controller 6, and details will be described in other embodiments.
 図2は実施の形態1のプログラムデバッグ装置のトレースログを仮記録する動作を示すフローチャートである。最初に、CPU1がプログラム(具体的にはプログラムコード)を実行する(ステップS01)。次に、トレース制御器3は、CPU1がプログラムを実行した際における処理内容の記録であるトレースログを取得する(ステップS02)。次に、トレース制御器3は、イベント制御器2からイベント成立状態を取得する(ステップS03)。ここでCPU1によるプログラム実行処理においてその処理の一部分を構成する状態が、イベント制御器2で予め登録管理しているイベントと等価になると、イベント成立状態は有効になり、非等価になると無効になる。 FIG. 2 is a flowchart showing the operation of temporarily recording the trace log of the program debugging apparatus according to the first embodiment. First, the CPU 1 executes a program (specifically, a program code) (step S01). Next, the trace controller 3 acquires a trace log that is a record of the processing contents when the CPU 1 executes the program (step S02). Next, the trace controller 3 acquires the event establishment state from the event controller 2 (step S03). Here, when a state constituting a part of the processing in the program execution processing by the CPU 1 becomes equivalent to an event registered and managed in advance by the event controller 2, the event establishment state becomes valid, and becomes invalid when becoming non-equivalent. .
 次に、トレース制御器3は、トレースログを仮記録するか否かを、取得したイベント成立状態に基づいて判断する(ステップS04)。イベント成立状態が有効を示す場合、トレースログの仮記録を実行すると判断されて実行指示が作成される。一方、無効を示す場合、トレースログの仮記録を実行しないと判断されて非実行の指示が作成される。 Next, the trace controller 3 determines whether or not to temporarily record the trace log based on the acquired event establishment state (step S04). If the event establishment state indicates valid, it is determined that temporary recording of the trace log is to be executed, and an execution instruction is generated. On the other hand, in the case of indicating invalidity, it is determined that the temporary recording of the trace log is not executed, and a non-execution instruction is generated.
 次に、トレース制御器3は、ステップAS04で作成したトレースログの仮記録に関する指示内容を判断する(ステップS05)。仮記録実行指示が作成されていると判断する場合、トレース制御器3は、トレースメモリアドレス管理器5に記録されている記録アドレス(最新)Aで規定されるトレースメモリ11のメモリ位置にトレースログを仮記録したうえで、トレースメモリアドレス管理器5に記録されている記録アドレス(最新)Aを、次にトレースログを仮記録する他のメモリ位置を示すアドレス情報で更新する(ステップS06)。更新はインクリメント等によって実施される。一方、非実行の指示が作成されていると判断する場合、トレース制御器3は、トレースログを仮記録しない(ステップS07)。なお、記録アドレス(最新)Aの更新処理は、トレースログをトレースメモリ11に書き込んだ後に、次のトレースログを、トレースメモリ11上の別のメモリ位置に書き込むために行われる。 Next, the trace controller 3 determines the instruction content related to the temporary recording of the trace log created in step AS04 (step S05). When determining that the temporary recording execution instruction has been created, the trace controller 3 traces the trace log to the memory location of the trace memory 11 defined by the recording address (latest) A recorded in the trace memory address manager 5. Is temporarily recorded, and the recording address (latest) A recorded in the trace memory address manager 5 is updated with address information indicating another memory position where the trace log is temporarily recorded next (step S06). Update is performed by increment or the like. On the other hand, when determining that a non-execution instruction has been created, the trace controller 3 does not temporarily record a trace log (step S07). The update process of the recording address (latest) A is performed in order to write the next trace log to another memory location on the trace memory 11 after writing the trace log to the trace memory 11.
 図3は実施の形態1のプログラムデバッグ装置のトレースメモリ11のアドレスを操作する動作を示すフローチャートである。最初に、任意の1つのイベントが成立することで(すなわち、トレースされた1つの処理状態が登録イベントと等価であると判断されることで)、トレースログの仮記録が開始される。そのうえでさらにもう一つの任意のイベントが成立することで(すなわち、トレースされたもう1つの処理状態がもう一つの登録イベントと等価であると判断されることで)、トレースログの仮記録が終了される。 FIG. 3 is a flowchart showing an operation for manipulating the address of the trace memory 11 of the program debugging apparatus of the first embodiment. First, when one arbitrary event is established (that is, when it is determined that one traced processing state is equivalent to a registered event), temporary recording of the trace log is started. In addition, when another arbitrary event is established (ie, it is determined that another traced processing state is equivalent to another registered event), the temporary recording of the trace log is terminated. The
 このようにして実行されるトレースログの仮記録において、トレースメモリアドレス管理器5は、トレースログ期間(最新)T2が現時点において最長であるか否かを判別する。以降の処理は、この判別に基づいて分岐される(ステップS10,S20)。 In the temporary recording of the trace log executed in this way, the trace memory address manager 5 determines whether or not the trace log period (latest) T2 is the longest at the present time. Subsequent processing branches based on this determination (steps S10 and S20).
 ステップS20において、トレースログ期間(最新)T2が現時点において最長であると判別されると、更新タイミング制御器6は、更新後の記録アドレス(最新)Aをトレースメモリアドレス管理器5に出力する(ステップS30)。この処理は、更新後の記録アドレス(最新)A(トレースログ期間(最新)T2が最長であると判別された今回測定のトレースログが記録されたトレースメモリ11上のメモリ位置を示す)によって記録アドレス(前回)Bが複写されるように実施される。この複写記録により、記録されることが確定した記録アドレス(最新)Aが記録アドレス(前回)Bとして登録されることになる。 If it is determined in step S20 that the trace log period (latest) T2 is the longest at the present time, the update timing controller 6 outputs the updated recording address (latest) A to the trace memory address manager 5 ( Step S30). This process is recorded by the updated recording address (latest) A (indicating the memory position on the trace memory 11 where the trace log of the current measurement in which the trace log period (latest) T2 is determined to be the longest) is recorded. This is performed so that the address (previous) B is copied. By this copy recording, the recording address (latest) A determined to be recorded is registered as the recording address (previous) B.
 一方、ステップS20において、トレースログ期間(最新)T2は現時点において最長ではないと判別されると、更新タイミング制御器6は、記録アドレス(前回)Bによって記録アドレス(最新)Aが複写されるように、記録アドレス(前回)Bをトレースメモリアドレス管理器5に出力する(ステップS40)。この複写により、トレースログの上書きが許容され、これによりいままさに仮記録が完了したばかりのトレースログの仮記録が破棄される。 On the other hand, if it is determined in step S20 that the trace log period (latest) T2 is not the longest at the present time, the update timing controller 6 causes the recording address (latest) A to be copied by the recording address (previous) B. Then, the recording address (previous) B is output to the trace memory address manager 5 (step S40). This copying allows the trace log to be overwritten, and the temporary recording of the trace log that has just been completed is discarded.
 すなわち、図2に示すように、任意のトレースログ期間Tでは、記録アドレス(最新)Aで特定されるトレースメモリ11のメモリ位置にトレースログ(最新)が記録されている。そのうえで、図3に示すように、そのトレースログ期間(最新)T2が現時点において最長であるときのみ、記録アドレス(最新)Aが更新されたうえで、更新後の記録アドレス(最新)Aが記録アドレス(前回)Bに複写されて、トレースログの本記録が確定する。 That is, as shown in FIG. 2, in an arbitrary trace log period T, the trace log (latest) is recorded at the memory position of the trace memory 11 specified by the recording address (latest) A. In addition, as shown in FIG. 3, only when the trace log period (latest) T2 is the longest at the present time, the recording address (latest) A is updated and the updated recording address (latest) A is recorded. It is copied to the address (previous) B and the main record of the trace log is finalized.
 一方、トレースログ期間Tが現時点において最長ではないと判断される場合には、上記とは逆に、記録アドレス(最新)Aが記録アドレス(前回)Bで複写されることで、そのアドレスが元に戻ることになる。その結果、トレースログ(最新)は破棄される状態に移行する。 On the other hand, if it is determined that the trace log period T is not the longest at the present time, the recording address (latest) A is copied with the recording address (previous) B, contrary to the above. Will return. As a result, the trace log (latest) shifts to a state where it is discarded.
 以上の処理においては、トレースログの本記録を行うのは、トレースログ期間(最新)T2が現時点において最長である場合に限定される。しかしながら、トレースログ(記録)の数は1つだけに限られない。トレースログ期間(最新)T2の最長値は、その測定形態から明らかなように測定時間が経過するに連れて長くなって更新される。したがって、測定結果において、トレースログ期間(最新)T2の最長値が更新される毎に、トレースログ期間(最新)T2の最長値が検出される。そのうえで、当該最長値と判断される毎に、その際のトレースログ(最新)がトレースログ(記録)と見なされる。その結果、トレースメモリ11には複数のトレースログ(記録)が記録される。したがって、記録時刻が後になるほどトレースログ期間(記録)T1は長いものとなる。この様子を図4に示す。 In the above processing, the actual recording of the trace log is performed only when the trace log period (latest) T2 is the longest at the present time. However, the number of trace logs (records) is not limited to one. The longest value of the trace log period (latest) T2 becomes longer and updated as the measurement time elapses, as is apparent from the measurement form. Accordingly, every time the longest value of the trace log period (latest) T2 is updated in the measurement result, the longest value of the trace log period (latest) T2 is detected. In addition, each time the maximum value is determined, the trace log (latest) at that time is regarded as a trace log (record). As a result, a plurality of trace logs (records) are recorded in the trace memory 11. Therefore, the trace log period (recording) T1 becomes longer as the recording time is later. This is shown in FIG.
 図4Aはトレースログ期間(最新)T2の変遷を示し、図4Bはトレースメモリ11に保持されるトレースログ期間(記録)T1の変遷を示す。○印のトレースログが選択されてトレースメモリ11に残り、×印のトレースログは破棄されている。 4A shows the transition of the trace log period (latest) T2, and FIG. 4B shows the transition of the trace log period (record) T1 held in the trace memory 11. The trace log marked with ○ is selected and remains in the trace memory 11, and the trace log marked with × is discarded.
 いま、動作の一例として、前回時点におけるトレースログL0の記録に伴い、記録アドレス(最新)Aとして、アドレス〔0100〕が更新設定され、さらに記録アドレス(最新)Aの更新設定に伴って、記録アドレス(前回)Bにも、アドレス〔0100〕が複写設定されているとする。この状態で記録アドレス(最新)A〔0100〕で指定されるトレースメモリ11のメモリ位置に現時点においてトレースログL1が記録されたとする。この状態になると、記録アドレス(最新)Aは、アドレス〔0100〕からアドレス〔0200〕に更新(インクリメント)される。 Now, as an example of the operation, with the recording of the trace log L0 at the previous time, the address [0100] is updated and set as the recording address (latest) A, and further, the recording is recorded with the update setting of the recording address (latest) A It is assumed that the address [0100] is also copied to the address (previous) B. In this state, it is assumed that the trace log L1 is currently recorded at the memory location of the trace memory 11 designated by the recording address (latest) A [0100]. In this state, the recording address (latest) A is updated (incremented) from address [0100] to address [0200].
 以上の処理が進行することにより、次に測定されるトレースログL2を仮記録すべき記録アドレス(最新)の候補は、
・更新後の記録アドレス(最新)A1〔0200〕と、
・更新前の記録アドレス(最新)A2〔0100〕(=記録アドレス(前回)B)と、
の二つになる。更新後の記録アドレス(最新)A1〔0200〕と更新前の記録アドレス(最新)A2〔0100〕とのうちのいずれを次の記録アドレス(最新)Aに設定するかは、トレースログ期間(最新)T2における最長判断に基づいて決定される。すなわち、トレースログ期間(最新)T2が現時点において最長であると判断される場合(T2>T1)には、更新後の記録アドレス(最新)A1〔0200〕が記録アドレス(最新)Aとして設定され、最長ではないと判断される場合(T2≦T1)には、更新前の記録アドレス(最新)A2(=記録アドレス(前回)B〔0100〕)が記録アドレス(最新)Aとして設定される。
As the above process proceeds, the candidate of the recording address (latest) at which the trace log L2 to be measured next is to be temporarily recorded is
-Updated recording address (latest) A1 [0200],
Recording address before update (latest) A2 [0100] (= recording address (previous) B),
It becomes two. Which of the recording address after update (latest) A1 [0200] and the recording address before update (latest) A2 [0100] is set as the next recording address (latest) A depends on the trace log period (latest) ) Determined based on the longest judgment in T2. That is, when it is determined that the trace log period (latest) T2 is the longest at the present time (T2> T1), the updated recording address (latest) A1 [0200] is set as the recording address (latest) A. When it is determined that the recording address is not the longest (T2 ≦ T1), the recording address (latest) A2 (= recording address (previous) B [0100]) before the update is set as the recording address (latest) A.
 更新後の記録アドレス(最新)A1が記録アドレス(最新)Aとして設定されると、更新後の記録アドレス(最新)A1は記録アドレス(前回)Bにも複写設定される。その結果、更新前の記録アドレス(最新)A2(=記録アドレス(前回)B〔0100〕)で規定されるトレースメモリ11のメモリ位置に記録されたトレースログ(最新)の本記録が確定し上書きが許容されなくなる。これにより、記録アドレス(前回)Bで規定されるトレースメモリ11のメモリ位置に記録されたトレースログ(最新)では、トレースログ期間(最新)T2が現時点において最長となったトレースログとしてその本記録が確定される。一方、更新前の記録アドレス(最新)A2が記録アドレス(最新)Aとして設定されると、更新前の記録アドレス(最新)A2で規定されるトレースメモリ11のメモリ位置において上書きが許容されることになる。その結果、更新前の記録アドレス(最新)A2(=記録アドレス(前回)B〔0100〕)で規定されるトレースメモリ11のメモリ位置に記録されたトレースログ(最新)は破棄される。 When the updated recording address (latest) A1 is set as the recording address (latest) A, the updated recording address (latest) A1 is also copied to the recording address (previous) B. As a result, the actual record of the trace log (latest) recorded at the memory location of the trace memory 11 defined by the recording address (latest) A2 before updating (= recording address (previous) B [0100]) is confirmed and overwritten. Is no longer allowed. Thereby, in the trace log (latest) recorded in the memory location of the trace memory 11 defined by the recording address (previous) B, the main record is recorded as the trace log having the longest trace log period (latest) T2 at the present time. Is confirmed. On the other hand, when the recording address (latest) A2 before update is set as the recording address (latest) A, overwriting is permitted at the memory location of the trace memory 11 defined by the recording address (latest) A2 before update. become. As a result, the trace log (latest) recorded at the memory location of the trace memory 11 defined by the recording address (latest) A2 before update (= recording address (previous) B [0100]) is discarded.
 以下、上述した処理をさらに詳細に説明する。 Hereinafter, the processing described above will be described in more detail.
 (a-1の処理)
 上述したトレースログL1についてトレースログ期間(最新)T2が現時点における最長もしくはそれと同等であると判断されて、更新後の記録アドレス(最新)A1であるアドレス〔0200〕が記録アドレス(最新)Aとして設定された場合、次のトレースログL2は新たに設定された記録アドレス(最新)Aであるアドレス〔0200〕によって規定されるトレースメモリ11のメモリ位置に記録される。これにより、トレースメモリ11にはトレースログL1とトレースログL2とが記録されていることになる。ただし、トレースログL2については、そのトレースログ期間(最新)T2が現時点における最長であるか否かの判断はされていない。そのため、記録されたトレースログL2はあくまでもトレースログ(最新)であって確定的なトレースログ(記録)ではない。しかしながら、トレースログ(最新)が記録されたので、記録アドレス(最新)Aはインクリメントされてアドレス〔0200〕からアドレス〔0300〕に更新される。
(Processing of a-1)
It is determined that the trace log period (latest) T2 of the trace log L1 described above is the longest or equivalent to the present time, and the updated recording address (latest) A1 [0200] is set as the recording address (latest) A. When set, the next trace log L2 is recorded at the memory location of the trace memory 11 defined by the address [0200] which is the newly set recording address (latest) A. As a result, the trace log L1 and the trace log L2 are recorded in the trace memory 11. However, regarding the trace log L2, it is not determined whether or not the trace log period (latest) T2 is the longest at the present time. Therefore, the recorded trace log L2 is merely a trace log (latest) and not a definitive trace log (record). However, since the trace log (latest) is recorded, the recording address (latest) A is incremented and updated from address [0200] to address [0300].
 (b-1の処理)
 一方、上述したトレースログL1についてトレースログ期間(最新)T2が現時点における最長ではないと判断されて、記録アドレス(前回)B〔0100〕が記録アドレス(最新)Aとして設定された場合、次のトレースログL2は記録アドレス(最新)Aであるアドレス〔0100〕で規定されるトレースメモリ11のメモリ位置に記録される。これで、アドレス〔0100〕で規定されるトレースメモリ11のメモリ位置では、それまで記録されていたトレースログL1が、トレースログL2によって上書き記録されることになる。すなわち、前回、トレースログ(最新)として記録されていたトレースログL1は結果的に破棄されたことになる。トレースログ(最新)が記録されたので、記録アドレス(最新)Aは、インクリメントされてアドレス〔0100〕からアドレス〔0200〕に変更される。
(Process b-1)
On the other hand, when it is determined that the trace log period (latest) T2 is not the longest at the present time for the trace log L1 described above and the recording address (previous) B [0100] is set as the recording address (latest) A, the following The trace log L2 is recorded in the memory location of the trace memory 11 defined by the address [0100] which is the recording address (latest) A. Thus, at the memory location of the trace memory 11 defined by the address [0100], the trace log L1 recorded so far is overwritten and recorded by the trace log L2. That is, the trace log L1 previously recorded as the trace log (latest) is eventually discarded. Since the trace log (latest) is recorded, the recording address (latest) A is incremented and changed from address [0100] to address [0200].
 (a-2の処理)
 a-1の処理に続いて、トレースログL2においてそのトレースログ期間(最新)T2が現時点において最長であれば、アドレス〔0200〕をインクリメント更新したアドレス〔0300〕が記録アドレス(最新)Aとして確定される。このような状態になると、記録アドレス(最新)Aとして確定されたアドレス〔0300〕よりインクリメント手前に位置するアドレス〔0200〕は、記録アドレス(最新)Aにはなりえない。そのため、記録アドレス(最新)Aであるアドレス〔0200〕によって規定されるトレースメモリ11のメモリ位置に記録されているトレースログL2の本記録は確定したことになる。これにより、トレースログ期間(最新)T2が現時点において最長となるトレースログは、トレースログL1とトレースログL2との2つとなる。
(Process a-2)
Following the processing of a-1, if the trace log period (latest) T2 is the longest at the present time in the trace log L2, the address [0200] obtained by incrementing the address [0200] is determined as the recording address (latest) A Is done. In such a state, the address [0200] positioned before the increment [0300] determined as the recording address (latest) A cannot be the recording address (latest) A. Therefore, the main record of the trace log L2 recorded at the memory location of the trace memory 11 defined by the address [0200] which is the recording address (latest) A is confirmed. As a result, the trace logs having the longest trace log period (latest) T2 at the present time are the trace log L1 and the trace log L2.
 (b-2の処理)
 b-1の処理に続いて、トレースログL2においてそのトレースログ期間(最新)T2が現時点において最長であれば、記録アドレス(最新)Aとしてインクリメント更新されたアドレス〔0200〕が記録アドレス(最新)Aとして確定される。このような状態になると、記録アドレス(最新)Aとして確定されたアドレス〔0200〕よりインクリメント手前に位置するアドレス〔0100〕は、記録アドレス(最新)Aにはなりえない。そのため、記録アドレス(最新)Aであるアドレス〔0100〕によって規定されるトレースメモリ11のメモリ位置に記録されているトレースログL2の本記録は確定したことになる。また、レースログ期間(最新)T2が現時点において最長またはそれと同等となるトレースログは、トレースログL2となる。
(Process b-2)
Following the process of b-1, if the trace log period (latest) T2 is the longest at the present time in the trace log L2, the address [0200] incremented and updated as the recording address (latest) A is the recording address (latest). Confirmed as A. In such a state, the address [0100] positioned before the increment [0200] determined as the recording address (latest) A cannot be the recording address (latest) A. Therefore, the main record of the trace log L2 recorded at the memory location of the trace memory 11 defined by the address [0100] which is the recording address (latest) A is confirmed. Further, the trace log whose race log period (latest) T2 is the longest or equivalent to the current time is the trace log L2.
 以上のように、トレースログを仮記録する指示が活性化されると、そのトレースログは一旦は必ずトレースメモリ11に記録される。ただし本記録ではなく、仮記録である。このようにして仮記録されるトレースログ(最新)をトレースログ(記録)とするか否かの判断は、次に測定されるトレースログ期間(最新)T2が最長であるか否かの判断に委ねられる。さらに、トレースログ(最新)をトレースログ(記録)に変更する処理やトレースログ(最新)を破棄する処理は、記録アドレス(最新)Aの調整処理を通じて実施される。すなわち、トレースログ期間(最新)T2が現時点において最長またはそれと同等となる記録アドレス(最新)Aを、更新後の記録アドレス(最新)A(仮記録に伴ってインクリメントされたアドレス)とするとともに、仮記録を本記録として確定するために更新後の記録アドレス(最新)Aが記録アドレス(前回)Bに複写される。トレースログ期間(最新)T2が現時点において最長でないときは、更新後の記録アドレス(前回)Bを記録アドレス(最新)Aに複写される。これが本実施の形態の技術ポイントである。 As described above, when the instruction to temporarily record the trace log is activated, the trace log is always recorded in the trace memory 11 once. However, it is not a main recording but a temporary recording. The determination as to whether or not the trace log (latest) temporarily recorded in this way is the trace log (record) is to determine whether or not the next measured trace log period (latest) T2 is the longest. It is entrusted. Further, the process of changing the trace log (latest) to the trace log (record) and the process of discarding the trace log (latest) are performed through the adjustment process of the recording address (latest) A. That is, the recording address (latest) A having the longest or equivalent trace log period (latest) T2 at the current time is set as the updated recording address (latest) A (address incremented with temporary recording), and The updated recording address (latest) A is copied to the recording address (previous) B in order to determine the temporary recording as the main recording. When the trace log period (latest) T2 is not the longest at the present time, the updated recording address (previous) B is copied to the recording address (latest) A. This is the technical point of the present embodiment.
 本形態のプログラムデバッグ装置を用いることで、任意の1つのイベントが成立して、さらに任意の1つのイベントが成立するまでの時間長を示すトレースログ期間(最新)T2が最長となる毎に、トレースログを記録することができる。その結果、不要なトレースログを破棄することができる。 By using the program debug device of the present embodiment, every time an arbitrary event is established and the trace log period (latest) T2 indicating the length of time until any one event is established is the longest, Trace log can be recorded. As a result, unnecessary trace logs can be discarded.
 本実施の形態では、複数仮記録されるトレースログ群のうちからトレースログ期間Tが現時点において最長となるトレースログを選択的にトレースメモリに記録し、それ以外のトレースログ群を破棄したので、トレースメモリ11の容量に制限がある状態でも、ソフトウェア上で問題が生じる可能性の高いトレースログを選択的に記録することができる。その結果、問題の発見および解決を迅速・容易化する上できわめて有効な対策となる。また、トレースログの記録を絞り込むので、トレースメモリ11の容量の過大な増加を回避することが可能となる。 In the present embodiment, the trace log having the longest trace log period T at the present time is selectively recorded in the trace memory from among a plurality of temporarily recorded trace log groups, and the other trace log groups are discarded. Even in a state where the capacity of the trace memory 11 is limited, it is possible to selectively record a trace log that is likely to cause a problem in software. As a result, it is an extremely effective measure for quickly and easily finding and solving problems. In addition, since the trace log records are narrowed down, it is possible to avoid an excessive increase in the capacity of the trace memory 11.
 (実施の形態2)
 本発明の実施の形態2にかかわるプログラムデバッグ装置は、トレースメモリ11に記録された複数のトレースログのうちからトレースログ期間Tが最も長い(最長トレースログ群中で最長となる)トレースログを1つ指定できるように構成されたもので、そのためにトレース開始アドレスを記録する構成をさらに備える。
(Embodiment 2)
The program debug apparatus according to the second embodiment of the present invention uses 1 trace log having the longest trace log period T (the longest in the longest trace log group) among a plurality of trace logs recorded in the trace memory 11. And a configuration for recording a trace start address for this purpose.
 図5は実施の形態2におけるプログラムデバッグ装置の構成を示すブロック図である。図5において、実施の形態1の図1におけるのと同じ符号は同一構成要素を指している。本実施の形態に特有の構成は次の通りである。トレースメモリアドレス管理器5は、トレース開始アドレスCをさらに保持する。トレース開始アドレスCは、トレースメモリ11のメモリ位置を規定するアドレスの中で記録アドレス(前回)Bをバックアップ保持しておくために保持される。 FIG. 5 is a block diagram showing the configuration of the program debugging apparatus according to the second embodiment. In FIG. 5, the same reference numerals as those in FIG. 1 of the first embodiment indicate the same components. The configuration specific to the present embodiment is as follows. The trace memory address manager 5 further holds a trace start address C. The trace start address C is held in order to back up and hold the recording address (previous) B among the addresses defining the memory position of the trace memory 11.
 記録アドレス(前回)Bをトレース開始アドレスCにバックアップ保持するタイミングは、トレースログ期間Tが現時点において最長となるタイミングである。更新タイミング制御器6は、記録アドレス(前回)Bをトレース開始アドレスCに複写するタイミングを制御する機能をさらに備える。その他の構成については、実施の形態1と同様であるので説明を省略する。 The timing at which the recording address (previous) B is backed up to the trace start address C is the timing at which the trace log period T is the longest at the present time. The update timing controller 6 further has a function of controlling the timing for copying the recording address (previous) B to the trace start address C. Other configurations are the same as those in the first embodiment, and thus description thereof is omitted.
 図6は実施の形態2のプログラムデバッグ装置のトレースメモリ11のアドレスを操作する動作を示すフローチャートであり、これは実施の形態1における図3のフローチャートにステップS21を追加したものに相当し、実施の形態1における図2のフローチャートは本実施の形態において踏襲される。 FIG. 6 is a flowchart showing the operation of manipulating the address of the trace memory 11 of the program debugging apparatus according to the second embodiment, which corresponds to the flowchart of FIG. 3 according to the first embodiment with step S21 added. The flowchart of FIG. 2 in the first embodiment is followed in the present embodiment.
 ステップS21において、更新タイミング制御器6は記録アドレス(前回)Bをトレース開始アドレスCに複写するようトレースメモリアドレス管理器5に出力する。記録アドレス(最新)Aが記録アドレス(前回)Bに複写されることによって、記録アドレス(前回)Bは変化してしまうが、変化前の記録アドレス(前回)Bをトレース開始アドレスCに複写してバックアップしておく。これにより、トレースログを仮記録したときのトレース開始アドレスCが保持される。 In step S21, the update timing controller 6 outputs the recording address (previous) B to the trace memory address manager 5 so as to copy it to the trace start address C. When the recording address (latest) A is copied to the recording address (previous) B, the recording address (previous) B changes, but the previous recording address (previous) B is copied to the trace start address C. Back up. Thereby, the trace start address C when the trace log is temporarily recorded is held.
 いま、トレースログL1が記録アドレス(最新)A〔0100〕に記録されており、このトレースログ記録に応じて記録アドレス(最新)Aがアドレス〔0200〕に更新され、記録アドレス(前回)Bは、繰り替わって、アドレス〔0100〕になったとする。この状態において、トレースログL1のトレースログ期間Tが現時点において最長であれば、記録アドレス(最新)A〔0200〕が記録アドレス(前回)Bに複写される。その際、複写の前処理として、複写設定前の記録アドレス(前回)B〔0100〕がトレース開始アドレスCに複写される。トレース開始アドレスCに複写されるアドレス(この例ではアドレス〔0100〕)は、トレースログ期間Tが現時点において最長となるトレースログL1の格納アドレスを示している。複写設定前の記録アドレス(前回)B〔0100〕がトレース開始アドレスCに複写された後、更新後の記録アドレス(最新)A〔0200〕が、記録アドレス(前回)Bに複写される結果、記録アドレス(前回)Bはアドレス〔0200〕となる。 Now, the trace log L1 is recorded at the recording address (latest) A [0100], and the recording address (latest) A is updated to the address [0200] according to this trace log recording, and the recording address (previous) B is Suppose that the address [0100] is repeated. In this state, if the trace log period T of the trace log L1 is the longest at the present time, the recording address (latest) A [0200] is copied to the recording address (previous) B. At this time, as a pre-processing for copying, the recording address (previous) B [0100] before copying is copied to the trace start address C. The address (address [0100] in this example) copied to the trace start address C indicates the storage address of the trace log L1 in which the trace log period T is the longest at the present time. After the recording address (previous) B [0100] before copying is copied to the trace start address C, the updated recording address (latest) A [0200] is copied to the recording address (previous) B. The recording address (previous) B is the address [0200].
 次にトレースログL2が記録アドレス(最新)A〔0200〕に記録され、これに伴い記録アドレス(最新)Aがアドレス〔0300〕に更新される。このトレースログL2のトレースログ期間(最新)T2が現時点において最長であれば、記録アドレス(前回)B〔0200〕はトレース開始アドレスCに複写され、その結果、トレース開始アドレスCはアドレス〔0200〕となる。これは、トレースログ期間Tが現時点において最長となるトレースログL2が格納されているメモリ位置を特定するアドレスは、現時点においてアドレス〔0200〕であることを示している。次いで、更新後の記録アドレス(最新)A〔0300〕を記録アドレス(前回)Bに複写する。これにより、記録アドレス(前回)Bはアドレス0300となる。 Next, the trace log L2 is recorded at the recording address (latest) A [0200], and the recording address (latest) A is updated to the address [0300] accordingly. If the trace log period (latest) T2 of the trace log L2 is the longest at the present time, the recording address (previous) B [0200] is copied to the trace start address C. As a result, the trace start address C is the address [0200]. It becomes. This indicates that the address specifying the memory location where the trace log L2 having the longest trace log period T is stored is the address [0200] at the current time. Next, the updated recording address (latest) A [0300] is copied to the recording address (previous) B. As a result, the recording address (previous) B becomes address 0300.
 以上で明らかなように、本実施の形態によれば、仮記録から本記録に確定されたトレースログ群全体のうち最終に確定記録された1つのトレースログの記録先アドレスがトレース開始アドレスCに保持されていることになる。これにより、トレースメモリ11に記録されているトレースログ群全体のうちでトレースログ期間Tが現在までにおいて最長のもの(最長トレースログ群の中の最長のもの)の記録先アドレスを特定することができる。その結果として、問題箇所をいち早く発見して解決することが実現できる。 As is apparent from the above, according to the present embodiment, the recording destination address of one trace log finally confirmed and recorded among the entire trace log group decided from temporary recording to actual recording is the trace start address C. Will be held. As a result, it is possible to specify the recording destination address of the longest trace log period T in the entire trace log group recorded in the trace memory 11 (the longest in the longest trace log group). it can. As a result, it is possible to quickly find and solve the problem part.
 なお、トレース開始アドレスCを、C1,C2,…Cnとn個保持する構成も考えられる。トレースログ期間Tが現在までにおいて最長となる第1回目において、そのときの本記録のアドレスをトレース開始アドレスC1に記録する。トレースログ期間Tが現在までにおいて最長となる第2回目において、第1回目の本記録のトレース開始アドレスC1にあるアドレスをトレース開始アドレスC2に複写し、現在の本記録のアドレスをトレース開始アドレスC1に複写する。同様に、トレースログ期間Tが現在までにおいて最長となる第3回目において、第1回目の本記録のトレース開始アドレスC2にあるアドレスをトレース開始アドレスC3に複写し、第2回目の本記録のトレース開始アドレスC1にあるアドレスをトレース開始アドレスC2に複写し、現在の本記録のアドレスをトレース開始アドレスC1に複写する。 A configuration in which n trace start addresses C, C1, C2,. At the first time when the trace log period T is the longest so far, the address of the main recording at that time is recorded in the trace start address C1. At the second time when the trace log period T is the longest so far, the address at the trace start address C1 of the first main record is copied to the trace start address C2, and the current main record address is copied to the trace start address C1. Copy to. Similarly, at the third time when the trace log period T is the longest so far, the address at the trace start address C2 of the first main record is copied to the trace start address C3, and the trace of the second main record is performed. The address at the start address C1 is copied to the trace start address C2, and the current main recording address is copied to the trace start address C1.
 このような処理を繰り返すと、トレースログ期間Tが長いトレースログとして、最長のものから次に長いものへと順次にn個分のトレースログについてそれぞれの記録アドレスを特定することができる。したがって、最長もののみ1つだけのトレースログでは問題を解析できない場合でも、n番目までのトレースログを解析することにより、問題箇所の早急な発見と解決を実現することができる。なお、トレースメモリ11を複数個備え、各トレースメモリ11にアドレスを振り分けた構成とすることも可能である。 When such processing is repeated, the recording addresses of the n trace logs can be specified sequentially from the longest to the next long as the trace log having a long trace log period T. Therefore, even when the problem cannot be analyzed with only one trace log of the longest one, it is possible to quickly find and solve the problem part by analyzing the nth trace log. It is also possible to have a configuration in which a plurality of trace memories 11 are provided and addresses are assigned to the respective trace memories 11.
 (実施の形態3)
 本発明の実施の形態3にかかわるプログラムデバッグ装置は、更新タイミング制御器6において取り扱うべき時間情報について、それを生成する時間測定器を外部に設けたものである。
(Embodiment 3)
The program debugging apparatus according to the third embodiment of the present invention is provided with a time measuring device for generating time information to be handled by the update timing controller 6 outside.
 図7は実施の形態3のプログラムデバッグ装置の構成を示すブロック図である。図7において、実施の形態1の図1におけるのと同じ符号は同一構成要素を指している。本実施の形態においては、時間測定器7が追加されている。時間測定器7には、イベント制御器2が出力するイベント成立状態が供給される。時間測定器7は、各トレースログ期間(最新)T2を測定したうえで、測定したトレースログ期間(最新)T2群の中で、現時点において最長となるトレースログ期間(最新)T2をトレースログ期間(記録)T1として抽出する。さらに時間測定器7は、トレースログ期間(記録)T1の抽出結果から、現時点において最長となるトレースログ期間を更新したか否かを判別し、さらにその判別結果を最長トレースログ期間更新情報として更新タイミング制御器6に出力する。最長トレースログ期間更新情報を受け取る更新タイミング制御器6は、受け取った最長トレースログ期間更新情報に基づいて、トレースメモリアドレス管理器5が保持する記録アドレス(最新)Aと記録アドレス(前回)Bとの間の相互複写処理のタイミングを制御する。すなわち、更新タイミング制御器6は、図3のフローチャートのステップS20において、トレースログ期間(記録)T1が現時点において最長かどうかを最長時間更新情報に基づいて判定している。その他の構成および動作については、実施の形態1と同様であるので説明を省略する。本実施の形態のプログラムデバッグ装置の基本的動作は、実施の形態1の場合の図2,図3のフローチャートを踏襲するものである。なお、更新タイミング制御器6は、時間測定機能を含んだ構成でも実現できる。また、更新タイミング制御器6は、イベント制御器2を含んだ構成でも実現できる。また、更新タイミング制御器6は、時間測定機能とイベント制御器2を含んだ構成でも実現できる。 FIG. 7 is a block diagram showing the configuration of the program debugging apparatus according to the third embodiment. In FIG. 7, the same reference numerals as those in FIG. 1 of the first embodiment indicate the same components. In the present embodiment, a time measuring device 7 is added. The time measuring device 7 is supplied with the event establishment state output from the event controller 2. The time measuring device 7 measures each trace log period (latest) T2, and then, among the measured trace log period (latest) T2, the trace log period (latest) T2 that is the longest at the present time is determined as the trace log period. (Recording) Extracted as T1. Further, the time measuring device 7 determines whether or not the longest trace log period has been updated from the extraction result of the trace log period (record) T1, and further updates the determination result as the longest trace log period update information. Output to the timing controller 6. The update timing controller 6 that receives the longest trace log period update information, based on the received longest trace log period update information, records address (latest) A and record address (previous) B held by the trace memory address manager 5. Control the timing of the mutual copying process. That is, the update timing controller 6 determines whether or not the trace log period (record) T1 is the longest at the current time based on the longest time update information in step S20 of the flowchart of FIG. Other configurations and operations are the same as those in the first embodiment, and thus description thereof is omitted. The basic operation of the program debugging apparatus according to the present embodiment follows the flowcharts of FIGS. 2 and 3 in the case of the first embodiment. The update timing controller 6 can also be realized by a configuration including a time measurement function. The update timing controller 6 can also be realized by a configuration including the event controller 2. The update timing controller 6 can also be realized by a configuration including a time measurement function and the event controller 2.
 本実施の形態によれば、図21の従来技術のトレース機能を搭載したプログラムデバッグ装置において、時間測定機能を追加したものに相当し、資源の再利用等の側面において、従来技術のプログラムデバッグ装置への応用展開を容易なものにする。 According to the present embodiment, the program debugging apparatus equipped with the tracing function of the prior art of FIG. 21 corresponds to the addition of the time measurement function, and the conventional program debugging apparatus in terms of resource reuse and the like Easy application deployment
 (実施の形態4)
 本発明の実施の形態4にかかわるプログラムデバッグ装置は、更新タイミング制御をトレースログに付帯された時刻情報に基づいて行うように構成されたものである。
(Embodiment 4)
The program debugging apparatus according to the fourth embodiment of the present invention is configured to perform update timing control based on time information attached to the trace log.
 図8は実施の形態4のプログラムデバッグ装置の構成を示すブロック図である。図8において、実施の形態1における図1と同じ符号は同一構成要素を指している。本実施の形態においては、更新タイミング制御器6には、時刻情報を含むトレースログがCPU1から、イベント成立状態がイベント制御器2からそれぞれ供給される。更新タイミング制御器6は、供給されるイベント成立状態とトレースログの時刻情報とに基づいて、現時点において最長となるトレースログ期間(記録)T1が更新されたか否かを判別し、その判別結果であるトレース情報をトレースメモリアドレス管理器5に供給する。トレースメモリアドレス管理器5は、供給されるトレース情報に基づいて、記録アドレス(最新)Aと記録アドレス(前回)Bとの間で相互に実施する複写処理の実施タイミングを制御する。その他の構成については、実施の形態1の場合と同様であるので、説明を省略する。 FIG. 8 is a block diagram showing a configuration of the program debugging apparatus according to the fourth embodiment. In FIG. 8, the same reference numerals as those in FIG. 1 in the first embodiment indicate the same components. In the present embodiment, the update timing controller 6 is supplied with a trace log including time information from the CPU 1 and an event establishment state from the event controller 2. The update timing controller 6 determines whether or not the trace log period (record) T1 that is the longest at the present time has been updated based on the supplied event establishment state and the time information of the trace log. Some trace information is supplied to the trace memory address manager 5. The trace memory address manager 5 controls the execution timing of the copying process performed between the recording address (latest) A and the recording address (previous) B based on the supplied trace information. Since other configurations are the same as those in the first embodiment, description thereof is omitted.
 図9は時刻情報を付帯するトレースログの一例であり、個々のトレースログには、それぞれに個別の時刻情報が付帯されている。個々のトレースログに付帯された時刻情報は、それぞれ開始時刻情報と終了時刻情報とを含む。本実施の形態のプログラムデバッグ装置の基本的動作は、実施の形態1の場合の図2,図3のフローチャートを踏襲するものである。ただし、図3のステップS10の動作が図10のフローチャートに変更される。 FIG. 9 is an example of a trace log accompanied with time information, and individual time information is attached to each trace log. The time information attached to each trace log includes start time information and end time information, respectively. The basic operation of the program debugging apparatus according to the present embodiment follows the flowcharts of FIGS. 2 and 3 in the case of the first embodiment. However, the operation in step S10 in FIG. 3 is changed to the flowchart in FIG.
 図10はトレースログ期間(記録)T1が現時点において最長かどうかをトレースログの時刻情報を用いて判別するフローチャートである。 FIG. 10 is a flow chart for determining whether or not the trace log period (record) T1 is the longest at the present time using the time information of the trace log.
 まず、トレースログの仮記録を開始したことを、イベント制御器2から報知された更新タイミング制御器6は、トレースログの記録開示時刻情報を取得する(ステップS51)。次に、トレースログの仮記録を終了したことをイベント制御器2から報知された更新タイミング制御器6は、トレースログの記録終了時刻情報を取得する(ステップS52)。次に、更新タイミング制御器6は、記録開始時刻情報と記録終了時刻情報とからトレースログ期間(最新)T2を算出する(ステップS53)。次に、更新タイミング制御器6は、今回算出したトレースログ期間(最新)T2と前回算出したトレースログ期間(記録)T1とを比較して、トレースログ期間(最新)T2が現時点において最長であるか否かを判別する(ステップS54)。次に、更新タイミング制御器6は、トレースログ期間Tが現時点において最長であると判断すると、その時点におけるトレースログ期間(最新)T2をトレースログ期間(記録)T1として保存する。 First, the update timing controller 6 notified from the event controller 2 that the temporary recording of the trace log has been started acquires the trace log recording disclosure time information (step S51). Next, the update timing controller 6 notified from the event controller 2 that the temporary recording of the trace log has been completed acquires the recording end time information of the trace log (step S52). Next, the update timing controller 6 calculates a trace log period (latest) T2 from the recording start time information and the recording end time information (step S53). Next, the update timing controller 6 compares the trace log period (latest) T2 calculated this time with the previously calculated trace log period (record) T1, and the trace log period (latest) T2 is the longest at the present time. Whether or not (step S54). Next, when the update timing controller 6 determines that the trace log period T is the longest at the present time, the update timing controller 6 stores the trace log period (latest) T2 at that time as the trace log period (record) T1.
 以上のようにして算出して保存されたトレースログ期間(最新)T2がトレース情報である(ステップS55)。このように、本実施の形態では、図3のフローチャートのステップS20において、トレースログ期間(最新)T2が現時点において最長であるか否かの判別を、具体的に、図10のステップS54の処理で実現している。 The trace log period (latest) T2 calculated and stored as described above is the trace information (step S55). As described above, in the present embodiment, in step S20 of the flowchart of FIG. 3, it is specifically determined whether or not the trace log period (latest) T2 is the longest at the present time, in the process of step S54 of FIG. Is realized.
 なお、トレースログに時刻情報が付帯されていない状態であっても、トレースログ期間(最新)T2が現時点において最長であるか否かの判別を行うことができる。すなわち、更新タイミング制御器6は、トレースメモリ11にトレースログの記録開始時点を検出したうえで、さらにトレースログの記録終了時点の検出を行うことで、トレースログ期間(最新)T2を算出する。そしてこのようにして算出したトレースログ期間(最新)T2が現時点において最長であるか否かを判別する。 Note that even when the time information is not attached to the trace log, it is possible to determine whether or not the trace log period (latest) T2 is the longest at the present time. That is, the update timing controller 6 calculates the trace log period (latest) T2 by detecting the trace log recording start time in the trace memory 11 and further detecting the trace log recording end time. Then, it is determined whether or not the trace log period (latest) T2 calculated in this way is the longest at the present time.
 本実施の形態によれば、時間測定器7を含まないプログラムデバッグ装置においても、本発明を実現することができる。 According to the present embodiment, the present invention can be realized even in a program debugging apparatus that does not include the time measuring device 7.
 (実施の形態5)
 本発明の実施の形態5にかかわるプログラムデバッグ装置は、トレースログとイベントとに基づいて更新タイミング制御を行うように構成されたものである。
(Embodiment 5)
The program debugging apparatus according to the fifth embodiment of the present invention is configured to perform update timing control based on a trace log and an event.
 図11は実施の形態5におけるプログラムデバッグ装置の構成を示すブロック図である。図11において、実施の形態1における図1と同じ符号は同一構成要素を指している。本実施の形態においては、更新タイミング制御器6には、CPU1からトレースログが供給されるとともに、イベント制御器2から当該器2で管理されているイベントが供給される。更新タイミング制御器6は、トレースログとイベントとに基づいてイベントトレース情報を生成する。イベントトレース情報は、トレースログ期間(最新)T2の最長値が更新されたか否か示す情報である。更新タイミング制御器6は、イベントトレース情報をトレースメモリアドレス管理器5に供給する。トレースメモリアドレス管理器5は、供給されるイベントトレース情報に基づいて、記録アドレス(最新)Aと記録アドレス(前回)Bとの間で相互に実施する複写処理の実施タイミングを制御する。 FIG. 11 is a block diagram showing the configuration of the program debugging apparatus according to the fifth embodiment. In FIG. 11, the same reference numerals as those in FIG. 1 in the first embodiment indicate the same components. In the present embodiment, the update timing controller 6 is supplied with the trace log from the CPU 1 and the event managed by the event controller 2 from the event controller 2. The update timing controller 6 generates event trace information based on the trace log and the event. The event trace information is information indicating whether or not the longest value of the trace log period (latest) T2 has been updated. The update timing controller 6 supplies event trace information to the trace memory address manager 5. The trace memory address manager 5 controls the execution timing of the copying process performed between the recording address (latest) A and the recording address (previous) B based on the supplied event trace information.
 その他の構成については、実施の形態1と同様であるので、説明を省略する。本実施の形態のプログラムデバッグ装置の基本的動作は、実施の形態1における図2,図3のフローチャートを踏襲するものである。ただし、図3のステップS10の動作は図12のフローチャートに変更されている。 Other configurations are the same as those in the first embodiment, and thus description thereof is omitted. The basic operation of the program debugging apparatus of the present embodiment follows the flowcharts of FIGS. 2 and 3 in the first embodiment. However, the operation in step S10 in FIG. 3 is changed to the flowchart in FIG.
 図12はトレースログ期間Tが現時点において最長であるか否かをトレースログとイベントとを用いて判別するフローチャートである。最初に、供給されたトレースログと、予めトレースログ期間における開始イベントとして登録しておいた任意の一つのイベントとを比較し、その時点におけるトレースログが当該開始イベントに一致すると、トレースログを記録するトレースログ期間が開始したと判断してそのイベント開示時刻を示す時刻情報を取得する(ステップS61)。 FIG. 12 is a flowchart for determining whether or not the trace log period T is the longest at the present time using the trace log and the event. First, compare the supplied trace log with any one event registered in advance as the start event in the trace log period, and record the trace log when the trace log at that time matches the start event. It is determined that the trace log period to be started has started, and time information indicating the event disclosure time is acquired (step S61).
 次に、供給されたトレースログと、予めトレースログ期間における終了イベントとして登録しておいた任意のもう一つのイベントとを比較し、その時点におけるトレースログが当該終了イベントに一致すると、トレースログ期間が終了したと判断してそのイベント終了時刻を示す時刻情報を取得する(ステップS62)。 Next, the supplied trace log is compared with any other event registered in advance as an end event in the trace log period, and if the trace log at that time matches the end event, the trace log period Time information indicating the event end time is acquired (step S62).
 次に、ステップS61で取得したイベント開始時刻情報とステップS62で取得したイベント終了時刻情報とに基づいて、トレースログ期間(最新)T2を計算する(ステップS63)。 Next, a trace log period (latest) T2 is calculated based on the event start time information acquired in step S61 and the event end time information acquired in step S62 (step S63).
 次に、計算したトレースログ期間(最新)T2と記録しているトレースログ期間(前回)T1とを比較して、トレースログ期間(最新)T2が現時点において最長であるか否かを判別する(ステップS64)。 Next, the calculated trace log period (latest) T2 and the recorded trace log period (previous) T1 are compared to determine whether the trace log period (latest) T2 is the longest at the present time ( Step S64).
 次に、最長と判断したトレースログ期間(最新)T2をトレースログ期間(記録)T1として保存する(ステップS65)。 Next, the trace log period (latest) T2 determined to be the longest is stored as the trace log period (record) T1 (step S65).
 以上説明したように、図3のフローチャートにおけるステップS10,S20の処理(トレースログ期間(最新)T2が現時点において最長であるか否かの判断)は、図12のフローチャート(ステップS61~S65)によって行うことができる。なお、トレースログに時刻情報が付帯されていない状態であっても、トレースログ期間(最新)T2が現時点において最長であるか否かの判別を行うことができる。すなわち、更新タイミング制御器6は、トレースメモリ11にトレースログの記録開始時点を検出したうえで、さらにトレースログの記録終了時点の検出を行うことで、トレースログ期間(最新)T2を算出する。そしてこのようにして算出したトレースログ期間(最新)T2が現時点において最長であるか否かを判別する。 As described above, the processing of steps S10 and S20 (determination of whether the trace log period (latest) T2 is the longest at the present time) in the flowchart of FIG. 3 is performed by the flowchart of FIG. 12 (steps S61 to S65). It can be carried out. Even when the time information is not attached to the trace log, it is possible to determine whether or not the trace log period (latest) T2 is the longest at the present time. That is, the update timing controller 6 calculates the trace log period (latest) T2 by detecting the trace log recording start time in the trace memory 11 and further detecting the trace log recording end time. Then, it is determined whether or not the trace log period (latest) T2 calculated in this way is the longest at the present time.
 本実施の形態によれば、時間測定器7を含まないプログラムデバッグ装置においても、本発明を実現することができる。 According to the present embodiment, the present invention can be realized even in a program debugging apparatus that does not include the time measuring device 7.
 (実施の形態6)
 本発明の実施の形態6にかかわるプログラムデバッグ装置は、更新タイミング制御器6の機能の有効化/無効化を行う更新タイミングマスク制御器を備える。
(Embodiment 6)
The program debugging apparatus according to the sixth embodiment of the present invention includes an update timing mask controller that validates / invalidates the function of the update timing controller 6.
 図13は実施の形態6におけるプログラムデバッグ装置の構成を示すブロック図である。図13において、実施の形態1の図1におけるのと同じ符号は同一構成要素を指している。本実施の形態においては、更新タイミング制御器6が行う記録アドレス(最新)Aの更新制御について有効/無効を設定する更新タイミングマスク制御器8が追加されている。 FIG. 13 is a block diagram showing the configuration of the program debugging apparatus according to the sixth embodiment. In FIG. 13, the same reference numerals as those in FIG. 1 of the first embodiment indicate the same components. In the present embodiment, an update timing mask controller 8 for setting validity / invalidity for the update control of the recording address (latest) A performed by the update timing controller 6 is added.
 更新タイミングマスク制御器8が記録アドレス(最新)Aの更新を有効と判定すると、更新タイミング制御器6の機能は有効化され、逆に、無効と判定すると、更新タイミング制御器6の機能は無効化される。このような記録アドレス(最新)Aの更新制御における有効/無効の設定はユーザの操作によって実施される。その他の構成については、実施の形態1と同様であるので、説明を省略する。 When the update timing mask controller 8 determines that the update of the recording address (latest) A is valid, the function of the update timing controller 6 is validated. Conversely, when the update timing controller 6 determines invalid, the function of the update timing controller 6 is invalid. It becomes. Such valid / invalid setting in the update control of the recording address (latest) A is performed by a user operation. Since other configurations are the same as those in the first embodiment, description thereof is omitted.
 図14は実施の形態6のプログラムデバッグ装置においてトレースメモリ11のアドレスを操作する動作を示すフローチャートである。実施の形態1の場合の図3のフローチャートのステップS20がステップS22に置き換わっている。実施の形態1の場合の図2のフローチャートは本実施の形態に踏襲される。 FIG. 14 is a flowchart showing the operation of manipulating the address of the trace memory 11 in the program debugging apparatus of the sixth embodiment. Step S20 in the flowchart of FIG. 3 in the case of the first embodiment is replaced with step S22. The flowchart of FIG. 2 in the case of the first embodiment follows the present embodiment.
 最初に、任意の1つのイベントが成立することで(すなわち、トレースされた1つの任意状態が登録イベントと等価であると判断されることで)、トレースログの仮記録が開始される。そのうえでさらにもう一つの任意のイベントが成立することで(すなわち、トレースされたもう1つの任意状態がもう一つの登録イベントと等価であると判断されることで)、トレースログの仮記録が終了される。 First, when one arbitrary event is established (that is, when it is determined that one traced arbitrary state is equivalent to the registered event), temporary recording of the trace log is started. Furthermore, when another arbitrary event is established (that is, when it is determined that another traced optional state is equivalent to another registered event), the temporary recording of the trace log is terminated. The
 このようにして実行されるトレースログの仮記録において、トレースメモリアドレス管理器5は、トレースログ期間(最新)T2が現時点において最長でありかつ記録アドレス(最新)Aの更新制御が有効であるか否かを判別する。以降の処理は、この判別に基づいて分岐される(ステップS10,S22)。 In the temporary recording of the trace log executed in this way, the trace memory address manager 5 determines whether the trace log period (latest) T2 is the longest at the present time and the update control of the recording address (latest) A is effective. Determine whether or not. Subsequent processing branches based on this determination (steps S10 and S22).
 ステップS20において、トレースログ期間(最新)T2が現時点において最長でありかつ記録アドレス(最新)Aの更新制御が有効であると判別されると、更新タイミング制御器6は、更新後の記録アドレス(最新)Aをトレースメモリアドレス管理器5に出力する(ステップS30)。この処理は、更新後の記録アドレス(最新)A(トレースログ期間(最新)T2が最長であると判別された今回測定のトレースログが記録されたトレースメモリ11上のメモリ位置を示す)が記録アドレス(前回)Bに複写されるように実施される。この複写により、本記録されることが確定した記録アドレス(最新)Aが記録アドレス(前回)Bとして登録されることになる。 In step S20, when it is determined that the trace log period (latest) T2 is the longest at the present time and the update control of the recording address (latest) A is valid, the update timing controller 6 determines that the updated recording address ( The latest A is output to the trace memory address manager 5 (step S30). In this process, the updated recording address (latest) A (indicating the memory position on the trace memory 11 in which the trace log of the current measurement in which the trace log period (latest) T2 is determined to be the longest) is recorded is recorded. It is executed so as to be copied to the address (previous) B. As a result of this copying, the recording address (latest) A that is determined to be recorded is registered as the recording address (previous) B.
 一方、ステップS20において、トレースログ期間(最新)T2は現時点において最長ではない、または記録アドレス(最新)Aの更新制御が無効と判別されると、更新タイミング制御器6は、記録アドレス(前回)Bが記録アドレス(最新)Aに複写されるように、記録アドレス(前回)Bをトレースメモリアドレス管理器5に出力する(ステップS40)。この複写により、アドレスを戻してトレースログの上書きが許容され、これによりいままさに仮記録が完了したばかりのトレースログの仮記録が破棄されることになる。 On the other hand, if it is determined in step S20 that the trace log period (latest) T2 is not the longest at the present time or the update control of the recording address (latest) A is invalid, the update timing controller 6 determines the recording address (previous). The recording address (previous) B is output to the trace memory address manager 5 so that B is copied to the recording address (latest) A (step S40). By this copying, the address is returned and overwriting of the trace log is permitted, so that the temporary recording of the trace log that has just been completed is discarded.
 このように、記録アドレス(最新)Aの更新制御を有効にしたときの操作は、図3のフローチャートと同様のものとなる。一方、記録アドレス(最新)Aの更新制御を無効にしたときは、必ず記録アドレス(前回)Bが記録アドレス(最新)Aに複写されることで、トレースログの上書きが許容される。これによりいままさに仮記録が完了したばかりのトレースログの仮記録が破棄される。 Thus, the operation when the update control of the recording address (latest) A is validated is the same as the flowchart of FIG. On the other hand, when the update control of the recording address (latest) A is invalidated, the recording log (previous) B is always copied to the recording address (latest) A, thereby allowing the trace log to be overwritten. As a result, the temporary recording of the trace log that has just been completed is discarded.
 プログラム実行直後は、プログラム上で問題が生じなくともトレースログ期間(最新)T2の最長値が更新されやすい。そこで、この時期においてトレースログ期間(最新)T2が最長値と判定されたトレースログが破棄される。本実施の形態によれば、ソフトウェア上の問題を再現するパターンがある程度特定できている場合に、再現するパターンが発現する前に、記録アドレス(最新)Aの更新制御を有効にすることで、必要なトレースログを選択的に取得することができる。これによって問題箇所の早急な発見と解決を実現することができる。 * Immediately after the program is executed, the longest value of the trace log period (latest) T2 is easily updated even if no problem occurs in the program. Therefore, the trace log for which the trace log period (latest) T2 is determined to be the longest value at this time is discarded. According to the present embodiment, when the pattern that reproduces the problem on the software can be specified to some extent, before the pattern to be reproduced appears, by enabling the update control of the recording address (latest) A, Necessary trace logs can be selectively acquired. This makes it possible to quickly find and solve problem areas.
 (実施の形態7)
 本発明の実施の形態7にかかわるプログラムデバッグ装置は、ソフトウェア上の問題箇所の早急な発見と解決を図るべく、トレースログ期間(最新)T2が最長となる状態を示す波形を出力する外部トリガ出力器を備える。
(Embodiment 7)
The program debug apparatus according to the seventh embodiment of the present invention provides an external trigger output that outputs a waveform indicating a state in which the trace log period (latest) T2 is the longest in order to quickly find and solve a problem part in software. Equipped with a bowl.
 図15は実施の形態7におけるプログラムデバッグ装置の構成を示すブロック図である。図15において、実施の形態1の図1におけるのと同じ符号は同一構成要素を指している。本実施の形態は、外部トリガ出力器9をさらに備え、更新タイミング制御器6は、記録アドレス(最新)Aの更新/非更新をアドレス更新情報として外部トリガ出力器9に出力する機能をさらに備えることに特徴がある。外部トリガ出力器9は、アドレス更新情報を任意の波形で外部へ出力する。その他の構成については、実施の形態1と同様であるので、説明を省略する。 FIG. 15 is a block diagram showing the configuration of the program debugging apparatus according to the seventh embodiment. In FIG. 15, the same reference numerals as those in FIG. 1 of the first embodiment indicate the same components. The present embodiment further includes an external trigger output unit 9, and the update timing controller 6 further has a function of outputting the update / non-update of the recording address (latest) A to the external trigger output unit 9 as address update information. There is a special feature. The external trigger output unit 9 outputs address update information to the outside with an arbitrary waveform. Since other configurations are the same as those in the first embodiment, description thereof is omitted.
 図16は実施の形態7のプログラムデバッグ装置においてトレースメモリ11のアドレスを操作する動作を示すフローチャートである。実施の形態1の場合の図3のフローチャートのステップS30が図16のステップS31に置き換わっており、さらにステップS32が追加されている。実施の形態1の場合の図2のフローチャートは本実施の形態に踏襲される。 FIG. 16 is a flowchart showing the operation of manipulating the address of the trace memory 11 in the program debugging apparatus of the seventh embodiment. Step S30 in the flowchart of FIG. 3 in the first embodiment is replaced with step S31 of FIG. 16, and step S32 is further added. The flowchart of FIG. 2 in the case of the first embodiment follows the present embodiment.
 最初に、任意の1つのイベントが成立することで(すなわち、トレースされた1つの任意状態が登録イベントと等価であると判断されることで)、トレースログの仮記録が開始される。そのうえでさらにもう一つの任意のイベントが成立することで(すなわち、トレースされたもう1つの任意状態がもう一つの登録イベントと等価であると判断されることで)、トレースログの仮記録が終了される。 First, when one arbitrary event is established (that is, when it is determined that one traced arbitrary state is equivalent to the registered event), temporary recording of the trace log is started. Furthermore, when another arbitrary event is established (that is, when it is determined that another traced optional state is equivalent to another registered event), the temporary recording of the trace log is terminated. The
 このようにして実行されるトレースログの仮記録において、トレースメモリアドレス管理器5は、トレースログ期間(最新)T2が現時点において最長であるか否かを判別する。以降の処理は、この判別に基づいて分岐される(ステップS10,S20)。 In the temporary recording of the trace log executed in this way, the trace memory address manager 5 determines whether or not the trace log period (latest) T2 is the longest at the present time. Subsequent processing branches based on this determination (steps S10 and S20).
 ステップS20において、トレースログ期間(最新)T2が現時点において最長であると判別されると、更新タイミング制御器6は、更新後の記録アドレス(最新)Aをトレースメモリアドレス管理器5に出力する(ステップS31)。この処理は、更新後の記録アドレス(最新)A(トレースログ期間(最新)T2が最長であると判別された今回測定のトレースログが記録されたトレースメモリ11上のメモリ位置を示す)によって記録アドレス(前回)Bが複写されるように実施される。この複写記録により、記録されることが確定した記録アドレス(最新)Aが記録アドレス(前回)Bとして登録されることになる。次いで外部トリガ出力器9は、アドレス更新情報に応じた所定の波形を出力する(ステップS32)。この外部トリガ出力器9の動作が本実施の形態のポイントである。 If it is determined in step S20 that the trace log period (latest) T2 is the longest at the present time, the update timing controller 6 outputs the updated recording address (latest) A to the trace memory address manager 5 ( Step S31). This process is recorded by the updated recording address (latest) A (indicating the memory position on the trace memory 11 where the trace log of the current measurement in which the trace log period (latest) T2 is determined to be the longest) is recorded. This is performed so that the address (previous) B is copied. By this copy recording, the recording address (latest) A determined to be recorded is registered as the recording address (previous) B. Next, the external trigger output unit 9 outputs a predetermined waveform corresponding to the address update information (step S32). The operation of the external trigger output device 9 is the point of this embodiment.
 一方、ステップS20において、トレースログ期間(最新)T2は現時点において最長ではないと判別されると、更新タイミング制御器6は、記録アドレス(前回)Bによって記録アドレス(最新)Aが複写されるように、記録アドレス(前回)Bをトレースメモリアドレス管理器5に出力する(ステップS40)。この複写により、アドレスを戻してトレースログの上書きが許容され、これによりいままさに仮記録が完了したばかりのトレースログの仮記録が破棄されることになる。 On the other hand, if it is determined in step S20 that the trace log period (latest) T2 is not the longest at the present time, the update timing controller 6 causes the recording address (latest) A to be copied by the recording address (previous) B. Then, the recording address (previous) B is output to the trace memory address manager 5 (step S40). By this copying, the address is returned and overwriting of the trace log is permitted, so that the temporary recording of the trace log that has just been completed is discarded.
 本実施の形態によれば、トレースログ期間(最新)T2の最長値が更新されたときに、外部トリガ出力器9が最長値の更新/非更新を示す任意の出力波形(例えばオシロスコープによって取得されたアクチュエータ等の出力状態を示す波形)を外部に出力する。これにより、問題発生時に生じる前記出力波形の変化とトレースログとを対向付けて解析することにより、問題箇所の早急な発見と解決を実現することができる。 According to the present embodiment, when the longest value of the trace log period (latest) T2 is updated, the external trigger output device 9 acquires any output waveform (for example, acquired by an oscilloscope) indicating update / non-update of the longest value. Waveform indicating the output state of the actuator, etc.). As a result, the change in the output waveform that occurs when a problem occurs and the trace log are faced and analyzed, so that the problem part can be quickly discovered and solved.
 (実施の形態8)
 本発明の実施の形態8にかかわるプログラムデバッグ装置は、ソフトウェア上の問題箇所の早急な発見と解決を図るべく、トレースログ期間(最新)T2の最長値が更新されるとCPU1を停止させるブレーク制御器を備える。
(Embodiment 8)
The program debugging apparatus according to the eighth embodiment of the present invention has a break control for stopping the CPU 1 when the longest value of the trace log period (latest) T2 is updated in order to quickly find and solve a problem part in software. Equipped with a bowl.
 図17は実施の形態8のプログラムデバッグ装置の構成を示すブロック図である。図17において、実施の形態1の図1におけるのと同じ符号は同一構成要素を指している。本実施の形態は、ブレーク制御器10をさらに備えていることに特徴がある。更新タイミング制御器6は、記録アドレス(最新)Aの更新/非更新を示すアドレス更新情報を出力できる機能をさらに備える。ブレーク制御器10は、アドレス更新情報とCPU1の状態とに基づいて、CPU1を停止させるように構成されている。その他の構成については、実施の形態1と同様であるので、説明を省略する。 FIG. 17 is a block diagram showing the configuration of the program debugging apparatus according to the eighth embodiment. In FIG. 17, the same reference numerals as those in FIG. 1 of the first embodiment denote the same components. The present embodiment is characterized in that it further includes a break controller 10. The update timing controller 6 further includes a function capable of outputting address update information indicating update / non-update of the recording address (latest) A. The break controller 10 is configured to stop the CPU 1 based on the address update information and the state of the CPU 1. Since other configurations are the same as those in the first embodiment, description thereof is omitted.
 図18は実施の形態8のプログラムデバッグ装置においてトレースメモリ11のアドレスを操作する動作を示すフローチャートである。実施の形態1の場合の図3のフローチャートのステップS30が図18のステップS33に置き換わっており、さらにステップS34が追加されている。実施の形態1の場合の図2のフローチャートは本実施の形態に踏襲される。 FIG. 18 is a flowchart showing an operation for manipulating the address of the trace memory 11 in the program debugging apparatus of the eighth embodiment. Step S30 in the flowchart of FIG. 3 in the first embodiment is replaced with step S33 of FIG. 18, and step S34 is further added. The flowchart of FIG. 2 in the case of the first embodiment follows the present embodiment.
 最初に、任意の1つのイベントが成立することで(すなわち、トレースされた1つの任意状態が登録イベントと等価であると判断されることで)、トレースログの仮記録が開始される。そのうえでさらにもう一つの任意のイベントが成立することで(すなわち、トレースされたもう1つの任意状態がもう一つの登録イベントと等価であると判断されることで)、トレースログの仮記録が終了される。 First, when one arbitrary event is established (that is, when it is determined that one traced arbitrary state is equivalent to the registered event), temporary recording of the trace log is started. Furthermore, when another arbitrary event is established (that is, when it is determined that another traced optional state is equivalent to another registered event), the temporary recording of the trace log is terminated. The
 このようにして実行されるトレースログの仮記録において、トレースメモリアドレス管理器5は、トレースログ期間(最新)T2が現時点において最長であるか否かを判別する。以降の処理は、この判別に基づいて分岐される(ステップS10,S20)。 In the temporary recording of the trace log executed in this way, the trace memory address manager 5 determines whether or not the trace log period (latest) T2 is the longest at the present time. Subsequent processing branches based on this determination (steps S10 and S20).
 ステップS20において、トレースログ期間(最新)T2が現時点において最長であると判別されると、更新タイミング制御器6は、更新後の記録アドレス(最新)Aをトレースメモリアドレス管理器5に出力する(ステップS30)。この処理は、更新後の記録アドレス(最新)A(トレースログ期間(最新)T2が最長であると判別された今回測定のトレースログが記録されたトレースメモリ11上のメモリ位置を示す)によって記録アドレス(前回)Bが複写されるように実施される。この複写記録により、記録されることが確定した記録アドレス(最新)Aが記録アドレス(前回)Bとして登録されることになる。次いでブレーク制御器10はCPU1を停止させる(ステップS34)。このブレーク制御器10の動作が本実施の形態のポイントである。 If it is determined in step S20 that the trace log period (latest) T2 is the longest at the present time, the update timing controller 6 outputs the updated recording address (latest) A to the trace memory address manager 5 ( Step S30). This process is recorded by the updated recording address (latest) A (indicating the memory position on the trace memory 11 where the trace log of the current measurement in which the trace log period (latest) T2 is determined to be the longest) is recorded. This is performed so that the address (previous) B is copied. By this copy recording, the recording address (latest) A determined to be recorded is registered as the recording address (previous) B. Next, the break controller 10 stops the CPU 1 (step S34). The operation of the break controller 10 is the point of this embodiment.
 一方、トレースログ期間Tが現在までにおいて最長ではないとき、更新タイミング制御器6は、更新後の前回記録アドレスBを現在記録アドレスAに複写するようトレースメモリアドレス管理器5に出力する(ステップS40)。この複写により、アドレスを戻して上書きを許容して、いままさに仮記録が完了したばかりのトレースログの仮記録が破棄される。 On the other hand, when the trace log period T is not the longest up to now, the update timing controller 6 outputs to the trace memory address manager 5 so as to copy the updated previous recording address B to the current recording address A (step S40). ). By this copying, the address is returned to allow overwriting, and the temporary recording of the trace log that has just been completed is discarded.
 一方、ステップS20において、トレースログ期間(最新)T2は現時点において最長ではないと判別されると、更新タイミング制御器6は、記録アドレス(前回)Bによって記録アドレス(最新)Aが複写されるように、記録アドレス(前回)Bをトレースメモリアドレス管理器5に出力する(ステップS40)。この複写により、アドレスを戻してトレースログの上書きが許容され、これによりいままさに仮記録が完了したばかりのトレースログの仮記録が破棄される。 On the other hand, if it is determined in step S20 that the trace log period (latest) T2 is not the longest at the present time, the update timing controller 6 causes the recording address (latest) A to be copied by the recording address (previous) B. Then, the recording address (previous) B is output to the trace memory address manager 5 (step S40). By this copying, the address is returned and the overwriting of the trace log is allowed, so that the temporary recording of the trace log that has just been completed is discarded.
 本実施の形態によれば、トレースログ期間(最新)T2の最長値が更新されたときに、CPU1を停止する。これにより、期間(最新)T2の最長値が更新されたときのトレースログを用いてプログラムのデバッグを行うことができ、問題発生時の変数の状態や処理の状態をデバッグすることにより、問題箇所の早急な発見と解決を実現することができる。 According to this embodiment, when the longest value of the trace log period (latest) T2 is updated, the CPU 1 is stopped. As a result, the program can be debugged using the trace log when the longest value of the period (latest) T2 is updated, and the problem location can be obtained by debugging the variable status and the processing status when the problem occurs. Can be quickly discovered and resolved.
 (実施の形態9)
 本発明の実施の形態9はエミュレータシステムにかかわるものである。図19は本発明にかかわるエミュレータシステム20とその周辺の構成を示すブロック図である。
(Embodiment 9)
The ninth embodiment of the present invention relates to an emulator system. FIG. 19 is a block diagram showing the configuration of the emulator system 20 and its periphery according to the present invention.
 エミュレータシステム20は、ホストIF回路21,エミュレーション機能22,エミュレーションROM/RAM23,マイクロコンピュータ周辺回路24,および上述した実施の形態1~8のいずれかのプログラムデバッグ装置Xを備える。エミュレータシステム20はパソコン・ホストと、ユーザターゲットシステム40とに接続される。 The emulator system 20 includes a host IF circuit 21, an emulation function 22, an emulation ROM / RAM 23, a microcomputer peripheral circuit 24, and the program debug device X according to any one of the first to eighth embodiments described above. The emulator system 20 is connected to a personal computer host and a user target system 40.
 ホストIF回路21は、パソコン・ホスト30からデバッグの指令を受け、デバッグしている状態や結果をパソコン・ホスト30に送信することができる。送信するものにはトレースログも含まれる。 The host IF circuit 21 can receive a debug command from the personal computer / host 30 and transmit the debugging state and result to the personal computer / host 30. What is sent includes a trace log.
 プログラムデバッグ装置Xは、パソコン・ホスト30からデバッグの指令を受けて動作する。プログラムデバッグ装置XはCPU1を備える。CPU1は、エミュレーション機能22,エミュレーションROM/RAM23,およびマイクロコンピュータ周辺回路24の資源を利用してエミュレーションを行う。プログラムデバッグ装置Xは、エミュレーション動作中、マイクロコンピュータ周辺回路24によりユーザターゲットシステム40を制御してデバッグを行う。 The program debug device X operates in response to a debug command from the personal computer host 30. The program debug device X includes a CPU 1. The CPU 1 performs emulation using the resources of the emulation function 22, the emulation ROM / RAM 23, and the microcomputer peripheral circuit 24. The program debugging apparatus X performs debugging by controlling the user target system 40 by the microcomputer peripheral circuit 24 during the emulation operation.
 以下、プログラムデバッグ装置Xによるデバッグ操作の詳細を説明する。すなわち、エミュレータシステム20がユーザターゲットシステム40をデバッグしている間において、トレースログ期間(最新)T2の最長値が更新された時点におけるトレースログ(最新)を、トレースログ(記録)として取得したうえで、取得したトレースログ(記録)をパソコン・ホスト30で解析することによって、問題箇所の早急な発見と解決を行う。 The details of the debugging operation by the program debugging device X will be described below. That is, while the emulator system 20 is debugging the user target system 40, the trace log (latest) at the time when the longest value of the trace log period (latest) T2 is updated is acquired as the trace log (record). Then, the obtained trace log (record) is analyzed by the personal computer / host 30 to quickly find and solve the problem part.
 本発明のプログラムデバッグ装置は、ソフトウェア上の問題を含んでいる可能性が高いイベントに関係するトレースログを、効果的に絞り込んだうえでトレースメモリに記録することができるので、再現性が低く解析が難しい問題の特定を迅速・容易化する上で有用である。 The program debugging apparatus of the present invention can effectively narrow down the trace logs related to events that are likely to contain software problems, and record them in the trace memory. This is useful to quickly and easily identify difficult problems.
 1 CPU
 2 イベント制御器
 3 トレース制御器
 4 トレースログ記録確定制御器
 5 トレースメモリアドレス管理器
 6 更新タイミング制御器
 7 時間測定器
 8 更新タイミングマスク制御器
 9 外部トリガ出力器
 10 ブレーク制御器
 11 トレースメモリ
 20 エミュレータシステム
 21 ホストIF回路
 22 エミュレーション機能
 23 エミュレーションROM/RAM
 24 マイクロコンピュータ周辺回路
 30 パソコン・ホスト
 40 ユーザターゲットシステム
 A 現在記録アドレス
 B 前回記録アドレス
 C トレース開始アドレス
 X プログラムデバッグ装置
1 CPU
2 Event controller 3 Trace controller 4 Trace log record confirmation controller 5 Trace memory address manager 6 Update timing controller 7 Time measuring device 8 Update timing mask controller 9 External trigger output device 10 Break controller 11 Trace memory 20 Emulator System 21 Host IF circuit 22 Emulation function 23 Emulation ROM / RAM
24 Microcomputer peripheral circuit 30 PC / host 40 User target system A Current recording address B Previous recording address C Trace start address X Program debug device

Claims (13)

  1.  プログラムを実行するCPUと、
     前記CPUによる前記プログラムの実行時における任意状態を定義するイベントを保持したうえで、前記CPUによる実際のプログラム実行時における処理経過と前記イベントとを比較し、その比較結果に基づいて前記処理経過において前記イベントによってその開始と終了とが定義される部分経過が成立しているか否かを判断するイベント制御器と、
     前記部分経過を記録するためのトレースメモリと、
     前記イベント制御器によって成立していると判断された前記部分経過を、前記トレースメモリに仮記録するトレース制御器と、
     実際のプログラム実行時における一時点において前記部分経過が開始してから終了するまでの期間が、前記一時点を含むそれ以前に成立した部分経過群における前記期間の群の中で最長であるか否かの判断に基づいて、前記一時点において前記トレースメモリに仮記録させた前記部分経過を本記録するか否かを選択するトレースログ記録確定制御器と、
     を備えるプログラムデバッグ装置。
    A CPU for executing the program;
    After holding an event defining an arbitrary state at the time of execution of the program by the CPU, the process progress at the time of actual program execution by the CPU is compared with the event, and in the process progress based on the comparison result An event controller that determines whether or not a partial progress that defines the start and end of the event is established; and
    A trace memory for recording the partial progress;
    A trace controller for temporarily recording the partial progress determined to be established by the event controller in the trace memory;
    Whether the period from the start of the partial progress to the end at the temporary point at the time of actual program execution is the longest among the groups of the partial progress groups established before that including the temporary point A trace log recording confirmation controller for selecting whether to record the partial progress temporarily recorded in the trace memory at the temporary point based on the determination of
    A program debugging apparatus comprising:
  2.  前記トレースログ記録確定制御器はトレースメモリアドレス管理器を備え、
     前記トレースメモリアドレス管理器は、前記一時点において成立した前記部分経過を格納する前記トレースメモリにおけるメモリ位置を規定する記録アドレス(最新)の設定と、前記一時点より前の時点において成立した前記部分経過を格納する前記トレースメモリにおけるメモリ位置を規定する記録アドレス(前回)の設定とを行い、
     前記トレースメモリアドレス管理器は、前記期間が前記期間の群の中で最長であると判断すると、前記記録アドレス(最新)を更新する一方、前記期間が前記期間の群の中で最長でないと判断すると、前記記録アドレス(前回)を前記記録アドレス(最新)に設定する、
     請求項1のプログラムデバッグ装置。
    The trace log record confirmation controller comprises a trace memory address manager;
    The trace memory address manager sets a recording address (latest) that defines a memory position in the trace memory that stores the partial progress established at the temporary point, and the part established at a time before the temporary point. Set the recording address (previous) that defines the memory location in the trace memory that stores the progress,
    When the trace memory address manager determines that the period is the longest in the group of periods, the trace memory address manager updates the recording address (latest) while determining that the period is not the longest in the group of periods. Then, the recording address (previous) is set to the recording address (latest).
    The program debugging apparatus according to claim 1.
  3.  前記トレースメモリアドレス管理器は、前記期間が前記期間の群の中で最長であると判断すると、更新後の前記記録アドレス(最新)を前記記録アドレス(前回)に複写し、前記期間が前記期間の群の中で最長でないと判断すると、前記記録アドレス(前回)を前記記録アドレス(最新)に複写する、
     請求項2のプログラムデバッグ装置。
    When the trace memory address manager determines that the period is the longest in the group of periods, the trace memory address manager copies the updated recording address (latest) to the recording address (previous), and the period is the period. If it is determined that it is not the longest in the group, the recording address (previous) is copied to the recording address (latest).
    The program debugging apparatus according to claim 2.
  4.  更新タイミング制御器をさらに備え、
     前記更新タイミング制御器は、前記期間が前記期間の群の中で最長であるか否かの判断に基づいて、前記トレースメモリアドレス管理器による前記記録アドレス(最新)の設定タイミングと前記記録アドレス(前回)の設定タイミングとを制御する、
     請求項2のプログラムデバッグ装置。
    An update timing controller;
    The update timing controller determines the setting timing of the recording address (latest) by the trace memory address manager and the recording address (based on the determination whether the period is the longest in the group of periods. Control the timing of the previous)
    The program debugging apparatus according to claim 2.
  5.  前記トレースログ記録確定制御器は、前記記録アドレス(前回)をさらにトレース開始アドレスとして保持する、
     請求項2のプログラムデバッグ装置。
    The trace log record confirmation controller further holds the record address (previous) as a trace start address.
    The program debugging apparatus according to claim 2.
  6.  前記トレースログ記録確定制御器は、前記期間が前記期間の群の中で最長であると判断すると、前記記録アドレス(前回)を前記トレース開始アドレスに設定したうえで、更新後の記録アドレス(最新)を前記記録アドレス(前回)に複写する一方、前記期間が前記期間の群の中で最長でないと判断すると、前記記録アドレス(前回)を記録アドレス(最新)に複写する、
     請求項5のプログラムデバッグ装置。
    When the trace log recording confirmation controller determines that the period is the longest in the group of the periods, it sets the recording address (previous) as the trace start address and then updates the updated recording address (latest ) Is copied to the recording address (previous), and if the period is determined not to be the longest in the group of periods, the recording address (previous) is copied to the recording address (latest).
    The program debug device according to claim 5.
  7.  時間測定器をさらに備え、
     前記時間測定器は、前記期間が前記期間の群の中で最長であるか否かの判断結果を示す最長時間更新情報を生成し、
     前記更新タイミング制御器は、前記最長時間更新情報に基づいて前記トレースメモリアドレス管理器による前記記録アドレス(最新)の設定タイミングと前記記録アドレス(前回)の設定タイミングとを制御する、
     請求項4のプログラムデバッグ装置。
    A time measuring device,
    The time measuring device generates longest time update information indicating a determination result of whether or not the period is the longest in the group of the periods;
    The update timing controller controls the setting timing of the recording address (latest) and the setting timing of the recording address (previous) by the trace memory address manager based on the longest time update information.
    The program debugging apparatus according to claim 4.
  8.  前記更新タイミング制御器は、前記部分経過に付帯される時刻情報に基づいて、前記期間が前記期間の群の中で最長であるか否かを判断する、
     請求項4のプログラムデバッグ装置。
    The update timing controller determines whether or not the period is the longest in the group of periods based on time information attached to the partial progress.
    The program debugging apparatus according to claim 4.
  9.  前記更新タイミング制御器は、前記部分経過と前記イベントとに基づいて、前記期間が前記期間の群の中で最長であるか否かを判断する、
     請求項4のプログラムデバッグ装置。
    The update timing controller determines whether the period is the longest in the group of periods based on the partial progress and the event.
    The program debugging apparatus according to claim 4.
  10.  更新タイミングマスク制御器をさらに備え、
     前記更新タイミングマスク制御器は、前記更新タイミング制御器による前記記録アドレス(最新)の設定タイミングの制御動作の有効/無効を制御する、
     請求項4のプログラムデバッグ装置。
    An update timing mask controller;
    The update timing mask controller controls the validity / invalidity of the control operation of the setting timing of the recording address (latest) by the update timing controller.
    The program debugging apparatus according to claim 4.
  11.  外部トリガ出力器をさらに備え、
     前記更新タイミング制御器は、記録アドレス(最新)の更新/非更新を示すアドレス更新情報を出力し、
     前記外部トリガ出力器は、前記アドレス更新情報に基づいて任意の波形信号からなる外部トリガを生成して出力する、
     請求項4のプログラムデバッグ装置。
    An external trigger output device
    The update timing controller outputs address update information indicating update / non-update of the recording address (latest),
    The external trigger output unit generates and outputs an external trigger composed of an arbitrary waveform signal based on the address update information.
    The program debugging apparatus according to claim 4.
  12.  ブレーク制御器をさらに備え、
     前記更新タイミング制御器は、記録アドレス(最新)の更新/非更新を示すアドレス更新情報を出力し、
     前記ブレーク制御器は、前記アドレス更新情報に基づいて前記CPUの動作を停止させる、
     請求項4のプログラムデバッグ装置。
    A break controller,
    The update timing controller outputs address update information indicating update / non-update of the recording address (latest),
    The break controller stops the operation of the CPU based on the address update information;
    The program debugging apparatus according to claim 4.
  13.  ホストコンピュータとの間でデバッグに関する情報を授受するホストIF回路と、
     前記ホストIF回路を介した前記ホストコンピュータの指示に基づいてユーザターゲットシステムを制御してデバッグを行い、そのデバッグ結果を、前記ホストIF回路を介して前記ホストコンピュータに送信する請求項1のプログラムデバッグ装置と、
     を備える、
     エミュレータシステム。
    A host IF circuit that exchanges debugging information with the host computer;
    2. The program debugging according to claim 1, wherein debugging is performed by controlling a user target system based on an instruction of the host computer via the host IF circuit, and transmitting the debugging result to the host computer via the host IF circuit. Equipment,
    Comprising
    Emulator system.
PCT/JP2009/005543 2009-02-13 2009-10-22 Program debugging device and emulator system WO2010092641A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009030689A JP2010186361A (en) 2009-02-13 2009-02-13 Program debugging device and emulator system
JP2009-030689 2009-02-13

Publications (1)

Publication Number Publication Date
WO2010092641A1 true WO2010092641A1 (en) 2010-08-19

Family

ID=42561495

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/005543 WO2010092641A1 (en) 2009-02-13 2009-10-22 Program debugging device and emulator system

Country Status (2)

Country Link
JP (1) JP2010186361A (en)
WO (1) WO2010092641A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0573366A (en) * 1991-09-12 1993-03-26 Nec Corp Detecting/editing/output system for abnormal trace data
JP2000057013A (en) * 1998-08-13 2000-02-25 Nec Corp Trace information sampling device and mechanically readable recording medium recording program
JP2003076578A (en) * 2001-09-03 2003-03-14 Mitsubishi Electric Corp Microcomputer, debugging system and trace information collecting method
JP2004078338A (en) * 2002-08-12 2004-03-11 Fujitsu Ltd Method and system for evaluating computer performance
JP2007141072A (en) * 2005-11-21 2007-06-07 Sharp Corp Trace information output device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0573366A (en) * 1991-09-12 1993-03-26 Nec Corp Detecting/editing/output system for abnormal trace data
JP2000057013A (en) * 1998-08-13 2000-02-25 Nec Corp Trace information sampling device and mechanically readable recording medium recording program
JP2003076578A (en) * 2001-09-03 2003-03-14 Mitsubishi Electric Corp Microcomputer, debugging system and trace information collecting method
JP2004078338A (en) * 2002-08-12 2004-03-11 Fujitsu Ltd Method and system for evaluating computer performance
JP2007141072A (en) * 2005-11-21 2007-06-07 Sharp Corp Trace information output device

Also Published As

Publication number Publication date
JP2010186361A (en) 2010-08-26

Similar Documents

Publication Publication Date Title
US7185320B2 (en) System and method for processing breakpoint events in a child process generated by a parent process
US8141053B2 (en) Call stack sampling using a virtual machine
US7415699B2 (en) Method and apparatus for controlling execution of a child process generated by a modified parent process
JP5308098B2 (en) Information processing apparatus test program and method
CN111026601A (en) Monitoring method and device for Java application system, electronic equipment and storage medium
US20130096880A1 (en) System test method
JP2006260542A (en) Determination of actual amount of time a processor consumes in executing code portion
JPH1083326A (en) Trace data collecting method and computer readable code
EP3391224B1 (en) Method and apparatus for data mining from core traces
US7546585B2 (en) Method, system and computer program product for testing computer programs
US20120204182A1 (en) Program generating apparatus and program generating method
JP2007257441A (en) Processor and processor control method
US20080127118A1 (en) Method and system for dynamic patching of software
JP5151996B2 (en) Semiconductor integrated circuit and debug / trace circuit
Bligh et al. Linux kernel debugging on google-sized clusters
US20040168157A1 (en) System and method for creating a process invocation tree
US20180157571A1 (en) Method for the realistic estimation of function run times in pil simulation
Endo et al. Improving interactive performance using TIPME
US20110218654A1 (en) Method For Optimizing A Control Program For Actuators
WO2010092641A1 (en) Program debugging device and emulator system
JP2008135008A (en) Program module verification method
CN114564903A (en) Chip simulation design verification method, device, equipment and medium
CN114064378A (en) Application program time-consuming analysis method, device, equipment and storage medium
JP2007156822A (en) Simulated application test apparatus for computer system
JP2003281076A (en) Unauthorized access detection circuit of dma controller, unauthorized access detecting method and program thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09839964

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09839964

Country of ref document: EP

Kind code of ref document: A1