JP2005284542A - Program debugging method, debugging program and program debugging device - Google Patents

Program debugging method, debugging program and program debugging device Download PDF

Info

Publication number
JP2005284542A
JP2005284542A JP2004095531A JP2004095531A JP2005284542A JP 2005284542 A JP2005284542 A JP 2005284542A JP 2004095531 A JP2004095531 A JP 2004095531A JP 2004095531 A JP2004095531 A JP 2004095531A JP 2005284542 A JP2005284542 A JP 2005284542A
Authority
JP
Japan
Prior art keywords
program
instruction
breakpoint
debugging
debugged
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
JP2004095531A
Other languages
Japanese (ja)
Inventor
Shinobu Aoki
忍 青木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Electronics Corp
Original Assignee
NEC Electronics Corp
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 NEC Electronics Corp filed Critical NEC Electronics Corp
Priority to JP2004095531A priority Critical patent/JP2005284542A/en
Publication of JP2005284542A publication Critical patent/JP2005284542A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program debugging method enabling reexecution without rewriting a break point in rerunning a user program from the break point. <P>SOLUTION: This program debugging method for debugging a program by emulating a debugged device having a program to be debugged comprises steps of: setting a break point to the program; a step of rewriting a command set to the break point, into a command for stopping the execution of the program; executing the program; stopping the program at the break point; simulating the original command to the command set to the break point; writing information based on the result of simulation, in the debugged device; and executing the program from the next command of the break point. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明はマイクロコンピュータのプログラム開発におけるソフトウェアのエミュレーション技術に関し、特にプログラムのブレークポイント設定とプログラム実行に関する。   The present invention relates to a software emulation technique in program development of a microcomputer, and more particularly to program breakpoint setting and program execution.

マイクロコンピュータで動作するプログラムのデバッグを行なう方式として、プログラムをエミュレーションし、ブレークポイントを設定することによって前記プログラムのデバッグを部分的に行なう方式が知られている。このソフトウェアブレークポイントによるデバッグ方式は、ブレークポイントを設定したいプログラム中の命令を、プログラムを制御するための命令、たとえば割り込みを発生させる命令(トラップ命令)に一時的に置き換えるようにしている。このソフトウェアブレークポイントによるデバッグ方式をフラッシュROMに適応することによりROMであってもソフトウェアブレークポイントを設定することが可能となった。   As a method of debugging a program operating on a microcomputer, a method of partially debugging the program by emulating the program and setting a breakpoint is known. In this debugging method using software breakpoints, an instruction in a program for which a breakpoint is to be set is temporarily replaced with an instruction for controlling the program, for example, an instruction for generating an interrupt (trap instruction). By applying this software breakpoint debugging method to flash ROM, software breakpoints can be set even for ROM.

ソフトウェアのエミュレーション環境は、ユーザーが操作するホストマシンと、ホストマシン上で動作するデバッグプログラムと、デバッグ対象であるユーザープログラムを有するマイクロコンピュータと、マイクロコンピュータとホストコンピュータとの間に設けられるエミュレータと、それらを接続するケーブル類とを備えている。エミュレータはホストマシン上のデバッグプログラムと、マイクロコンピュータとの情報の橋渡しの役目をもつ。ユーザーはホストマシンを通してデバッグプログラムを操作し、その命令はデバッグプログラムからエミュレータを介してマイクロコンピュータへ伝達される。マイクロコンピュータの状態はエミュレータによって観察され、エミュレータはその情報をホストマシンへ伝達している。   A software emulation environment includes a host machine operated by a user, a debug program operating on the host machine, a microcomputer having a user program to be debugged, an emulator provided between the microcomputer and the host computer, And cables for connecting them. The emulator serves as a bridge between the debugging program on the host machine and the microcomputer. The user operates the debug program through the host machine, and the instructions are transmitted from the debug program to the microcomputer via the emulator. The state of the microcomputer is observed by the emulator, and the emulator transmits the information to the host machine.

図1にデバッガ7の構成およびエミュレータ1、マイクロコンピュータ4との接続関係を示す。デバッグプログラムであるデバッガ7とエミュレータ1とはホストインターフェースケーブル3によって接続さる。これにより両者間でのデータのやり取りが可能とされる。また、エミュレータ1とマイクロコンピュータ4とはインターフェースケーブル6によって接続される。これによりエミュレータ1において所定のエミュレーション動作が可能とされる。マイクロコンピュータ4は内部にフラッシュROM8を有し、フラッシュROM8にデバッグ対象プログラムが格納されている。   FIG. 1 shows the configuration of the debugger 7 and the connection relationship between the emulator 1 and the microcomputer 4. The debugger 7 which is a debugging program and the emulator 1 are connected by a host interface cable 3. As a result, data can be exchanged between the two. The emulator 1 and the microcomputer 4 are connected by an interface cable 6. As a result, the emulator 1 can perform a predetermined emulation operation. The microcomputer 4 has a flash ROM 8 inside, and a program to be debugged is stored in the flash ROM 8.

デバッガ7は実行制御部17、ブレークポイント制御部18、データ転送制御部19、ユーザーインターフェース20およびデバッグ対象情報表示部21を備えており、ユーザーからの操作に基づいてデバッグ作業を行なう。実行制御部17はブレークポイント制御部18、データ転送制御部19、ユーザーインターフェース20およびデバッグ対象情報表示部21の全体的な動作を制御する。   The debugger 7 includes an execution control unit 17, a breakpoint control unit 18, a data transfer control unit 19, a user interface 20, and a debug target information display unit 21, and performs a debugging operation based on an operation from the user. The execution control unit 17 controls the overall operation of the breakpoint control unit 18, the data transfer control unit 19, the user interface 20, and the debug target information display unit 21.

ユーザーインターフェース20はブレークポイントの設定や解除、プログラムの実行、停止等の命令をユーザーから受け、それを実行制御部17およびブレークポイント制御部18へ伝える役割を持つ。デバッグ対象情報表示部21はデバッグ対象であるマイクロコンピュータ4の情報を、エミュレータ1の観察に基づいて表示する。   The user interface 20 has a role of receiving instructions from the user such as setting and canceling breakpoints, program execution, and stopping from the user and transmitting them to the execution control unit 17 and the breakpoint control unit 18. The debug target information display unit 21 displays information of the microcomputer 4 that is a debug target based on observation of the emulator 1.

ブレークポイント制御部18はユーザーインターフェース20からのブレークポイント設定に基づき、ブレークポイントを設定したプログラムのプログラムカウンターおよびブレーク命令に変更する前の元の命令を記憶しておく役割を持つ。データ転送制御部19はデバッガ7とエミュレータ1の間の情報の伝達をする役割を有し、ホストインターフェースケーブル3を介してエミュレータ1と接続されている。   Based on the breakpoint setting from the user interface 20, the breakpoint control unit 18 has a role of storing the program counter of the program in which the breakpoint is set and the original instruction before changing to the break instruction. The data transfer control unit 19 has a role of transmitting information between the debugger 7 and the emulator 1 and is connected to the emulator 1 via the host interface cable 3.

次に、従来のデバッグ方法について図2と図3を用いて説明する。図2はデバッグ対象のプログラムの一例であり、フラッシュROMに記憶されている。ここでは図2に示すように04b6番地にソフトウェアブレークを設定している。図3は具体的なデバッグ手順を表している。まず、デバッガ7から04b6番地にソフトウェアブレークを設定する(S101)。すると、デバッガ7は図2に示すようにブレークポイントを設定した命令をブレーク命令に置き換えたユーザープログラム16をエミュレータ1に送る。エミュレータ1はそのプログラムをデータ転送回路10からフラッシュROM8に書き込む(S102)。そして、デバッガ7がユーザープログラム16を実行する(S103)。ブレークポイントを設定した命令を実行しようとするとプログラム実行が停止する(S104)。   Next, a conventional debugging method will be described with reference to FIGS. FIG. 2 shows an example of a program to be debugged, which is stored in the flash ROM. Here, as shown in FIG. 2, a software break is set at address 04b6. FIG. 3 shows a specific debugging procedure. First, a software break is set at address 04b6 from the debugger 7 (S101). Then, the debugger 7 sends to the emulator 1 a user program 16 in which an instruction that sets a breakpoint is replaced with a break instruction as shown in FIG. The emulator 1 writes the program from the data transfer circuit 10 to the flash ROM 8 (S102). Then, the debugger 7 executes the user program 16 (S103). If an instruction to set a breakpoint is to be executed, program execution stops (S104).

ブレークポイントで動作が停止した状態から再びプログラム実行を開始すると、04b6番地の命令がブレーク命令に書き換えられているため、その命令で再度停止してしまう。デバッガ7は04b6番地の命令を元の命令に書き換えたユーザープログラム16をエミュレータ1に送る。エミュレータ1はそのプログラムをデータ転送回路10からフラッシュROM8に書き込む。04b6番地の元の命令をステップ実行、すなわち書き換えられる前の04b6番地の一命令のみを実行する(S105)。その後、デバッガ7は再び04b6番地の命令をブレーク命令に置き換えたユーザープログラム16をフラッシュROM8に書き込む(S106)。   If the program execution is restarted from the state where the operation is stopped at the breakpoint, the instruction at address 04b6 has been rewritten to the break instruction, and the program stops again at that instruction. The debugger 7 sends the user program 16 in which the instruction at address 04b6 is rewritten to the original instruction to the emulator 1. The emulator 1 writes the program from the data transfer circuit 10 to the flash ROM 8. The original instruction at address 04b6 is stepped, that is, only one instruction at address 04b6 before being rewritten is executed (S105). Thereafter, the debugger 7 writes again the user program 16 in which the instruction at address 04b6 is replaced with a break instruction in the flash ROM 8 (S106).

そして、デバッガ7は再度ユーザープログラム16の実行を開始する(S107)。デバッグ作業が終了したら、デバッガ7はブレークポイントの設定を解除する(S108)。するとデバッガ7はブレーク命令に置き換えられていた命令を元の命令に戻したユーザープログラム16をエミュレータ1に送る。エミュレータ1はそのプログラムをデータ転送回路10からフラッシュROM8に書き込む(S109)。図4は上記の従来の動作を含む、デバッグ開始から終了までの流れを表したフローチャートである。太枠のブロックはプログラムの書き換えが行なわれる事を示している。このようなソフトウェアブレークポイントによるデバッグ方法は、例えば特許文献1や特許文献2に記載されている。   Then, the debugger 7 starts executing the user program 16 again (S107). When the debugging operation is completed, the debugger 7 cancels the breakpoint setting (S108). Then, the debugger 7 sends to the emulator 1 a user program 16 in which the instruction replaced with the break instruction is returned to the original instruction. The emulator 1 writes the program from the data transfer circuit 10 to the flash ROM 8 (S109). FIG. 4 is a flowchart showing a flow from the start to the end of debugging including the above-described conventional operation. A bold frame indicates that the program is rewritten. Such a debugging method using software breakpoints is described in Patent Document 1 and Patent Document 2, for example.

従来の方法でソフトウェアブレークポイントによるデバッグを実現した場合、ブレークポイントの設定、解除、ブレークポイントからのユーザープログラムの再実行においてフラッシュROMの書き換えが行われることになる。しかしながら、フラッシュROMの書き換えは、一般的に100回程度しか保証されていない。従ってすぐにこの保証回数を超えてしまうおそれがある。そのためフラッシュROMの書き換え回数を出来得る限り少なくすることが求められる。   When debugging with software breakpoints is realized by the conventional method, the flash ROM is rewritten in setting and canceling breakpoints and re-executing the user program from the breakpoints. However, flash ROM rewriting is generally guaranteed only about 100 times. Therefore, there is a risk that this guaranteed number of times will be exceeded immediately. Therefore, it is required to reduce the number of flash ROM rewrites as much as possible.

また、書き換え回数が多いと、フラッシュROMの書き換え制限回数を消費するだけでなく、データ転送およびフラッシュROMの書き換えに時間がかかり、デバッグ作業に時間がかかることになる。さらに、ブレークポイントの設定および解除によるフラッシュROMの書き換えは各々1回しか行なわれないが、ブレークポイントからのユーザープログラムの再実行においては、ブレークポイントを設定する前のプログラムに書き換える動作と、再度ブレーク命令に書き換える動作の計2度行なわれる。   If the number of rewrites is large, not only the flash ROM rewrite limit number is consumed, but also data transfer and flash ROM rewrite take time, and debugging work takes time. In addition, the flash ROM can be rewritten only once each time a breakpoint is set or released. However, when re-executing a user program from a breakpoint, the program is rewritten to the program before the breakpoint is set, and the breakpoint is re-executed. The operation of rewriting to an instruction is performed twice in total.

ここで、プログラムのデバッグ作業において、ブレークポイントからのユーザープログラムの再実行は複数回行なわれることが想定されるので、ブレークポイントからのユーザープログラムの再実行時のプログラムの書き換えはフラッシュROMの書き換え制限回数の消費の面からも、ユーザープログラムの実行に時間がかかりデバッグ効率を悪化させる面からも好ましくないと考えられる。
特開2002−82819号公報 特開平5−73348号公報
Here, since it is assumed that the re-execution of the user program from the breakpoint is performed a plurality of times during the debugging of the program, the rewriting of the program when the user program is re-executed from the breakpoint is limited to rewriting the flash ROM. From the aspect of consumption of the number of times, it is considered undesirable from the viewpoint of the time taken to execute the user program and the deterioration of debugging efficiency.
JP 2002-82819 A JP-A-5-73348

上述のように、従来のソフトウェアブレークポイントを用いたデバッグ方法では、プログラムの書き換え回数が増加してしまうという問題があった。本発明はこのような問題点を解決するためになされたものであり、デバッグ時における、プログラムの書き換え回数を少なくすることができるデバッグ方法、装置プログラムを提供する事を目的とする。   As described above, the conventional debugging method using software breakpoints has a problem that the number of program rewrites increases. The present invention has been made to solve such problems, and an object of the present invention is to provide a debugging method and an apparatus program that can reduce the number of times of program rewriting during debugging.

本発明にかかわるプログラムデバッグ方法は、デバッグ対象となるプログラムを有する被デバッグ装置をエミュレーションし、前記プログラムのデバッグを行うプログラムのデバッグ方法であって、前記プログラムにブレークポイントを設定するステップと、前記プログラムの前記ブレークポイントに設定された命令を前記プログラムの実行が停止されるブレーク命令に書き換えるステップと、前記ブレークポイントに設定された命令の前の命令まで前記プログラムを実行するステップと、前記ブレークポイントに設定された命令で前記プログラムを停止するステップと、前記ブレークポイントに設定された命令に対して、前記ブレーク命令に書き換えられる前の命令をシミュレーションするステップと、前記シミュレーションの結果に基づく情報を前記被デバッグ装置に書き込むステップと、前記ブレークポイントに設定された命令の次の命令からプログラムを実行するステップと、を備えるプログラムデバッグ方法である。このような構成により、プログラムの書き換え回数を少なくすることができる。   A program debugging method according to the present invention is a program debugging method for emulating a device to be debugged having a program to be debugged and debugging the program, the step of setting a breakpoint in the program, and the program Rewriting the instruction set at the breakpoint to a break instruction at which execution of the program is stopped, executing the program up to the instruction before the instruction set at the breakpoint, and A step of stopping the program at a set instruction; a step of simulating an instruction set to the breakpoint before being rewritten to the break instruction; and a result of the simulation. And writing the information to the debug target device, and executing the program from the next instruction of the set command to the breakpoint, a program debugging method comprising. With this configuration, the number of program rewrites can be reduced.

また、前記ブレークポイントに設定された命令の次の命令からプログラムを実行した後、前記ブレーク命令を前記ブレーク命令に書き込まれる前の命令に書き換えるステップをさらに有してもよい。こうすることにより、再度プログラムを実行してデバッグを行なう必要が無い場合に、プログラムの実行終了後、ブレーク命令の解除を行なう手間が省ける。   The program may further include a step of rewriting the break instruction to an instruction before being written in the break instruction after executing a program from the instruction next to the instruction set at the breakpoint. In this way, when there is no need to execute the program again for debugging, it is possible to save the trouble of releasing the break instruction after the execution of the program is completed.

本発明にかかるデバッグプログラムは、デバッグ対象となるプログラムを有する被デバッグ装置の前記プログラムにブレークポイントを設定して、前記プログラムのデバッグを行う、プログラムであって、(a)前記デバッグ対象プログラムの前記ブレークポイントに設定された命令を前記デバッグ対象プログラムの実行が停止されるブレーク命令に書き換えるステップと、(b)前記ブレークポイントに設定された命令の前の命令まで前記プログラムを実行するステップと、(c)前記ブレークポイントに設定された命令で前記プログラムを停止するステップと、(d)前記ブレークポイントに設定された命令に対して、前記ブレーク命令に書き換えられる前の命令をシミュレーションするステップと、(e)前記シミュレーションの結果に基づく情報を前記被デバッグ装置に書き込むステップと、(f)前記ブレークポイントに設定された命令の次の命令からプログラムを実行するステップと、があり、コンピュータに前記ステップ(a)、(b)、(c)、(d)、(e)、(f)を実行させるためのプログラムである。このような構成により、プログラムの書き換え回数を少なくすることができる。   A debug program according to the present invention is a program for setting a breakpoint in the program of a debugged device having a program to be debugged, and debugging the program, (a) the debug target program Rewriting an instruction set at a breakpoint to a break instruction at which execution of the debug target program is stopped; (b) executing the program up to an instruction before the instruction set at the breakpoint; c) stopping the program at an instruction set at the breakpoint; (d) simulating an instruction before being rewritten to the break instruction with respect to the instruction set at the breakpoint; e) Results of the simulation Writing information to the debugged device; and (f) executing a program from an instruction next to the instruction set at the breakpoint. The computer includes the steps (a), (b), This is a program for executing (c), (d), (e), and (f). With this configuration, the number of program rewrites can be reduced.

また、ステップ(f)の後、前記ブレーク命令を前記ブレーク命令に書き込まれる前の命令に書き換えるステップをさらに有してもよい。こうすることにより、再度プログラムを実行してデバッグを行なう必要が無い場合に、プログラムの実行終了後、ブレーク命令の解除を行なう手間が省ける。   Further, after the step (f), there may be further included a step of rewriting the break instruction to an instruction before being written in the break instruction. In this way, when there is no need to execute the program again for debugging, it is possible to save the trouble of releasing the break instruction after the execution of the program is completed.

本発明にかかわるプログラムデバッグ装置は、デバッグ対象となるプログラムを有する被デバッグ装置をエミュレーションするエミュレータと、前記エミュレータを操作し前記デバッグ対象プログラムに対してブレークポイント設定を行なうデバッグプログラムと、前記デバッグプログラムを動作させるホストマシンと、を有するプログラムデバッグ装置であって、前記プログラムにブレークポイントを設定する手段と、前記プログラムの前記ブレークポイントに設定された命令を前記プログラムの実行が停止されるブレーク命令に書き換える手段と、前記ブレーク命令に書き換えられた命令を有するプログラムを実行する手段と、前記ブレークポイントに設定された命令で前記プログラムを停止する手段と、前記ブレークポイントに設定された命令に対して、前記ブレーク命令に書き換えられる前の命令をシミュレーションする手段と、前記シミュレーションの結果に基づく情報を前記被デバッグ装置に書き込む手段と、前記ブレークポイントに設定された命令の次の命令からプログラムを実行する手段と、を備えるプログラムデバッグ装置である。このような構成により、プログラムの書き換え回数を少なくすることができる。   A program debug apparatus according to the present invention includes an emulator that emulates a debug target apparatus having a program to be debugged, a debug program that operates the emulator and sets a breakpoint for the debug target program, and the debug program. A program debugging apparatus comprising: a host machine that operates; a program that sets a breakpoint in the program; and an instruction that is set at the breakpoint of the program is rewritten to a break instruction that stops execution of the program Means for executing a program having an instruction rewritten to the break instruction; means for stopping the program at an instruction set at the breakpoint; and Means for simulating the instruction before being rewritten to the break instruction, means for writing information based on the result of the simulation to the debugged device, and an instruction next to the instruction set at the breakpoint A program debugging device comprising: With this configuration, the number of program rewrites can be reduced.

また、前記ブレークポイントに設定された命令の次の命令からプログラムを実行した後、前記ブレーク命令を前記ブレーク命令に書き込まれる前の命令に書き換える手段をさらに有してもよい。こうすることにより、再度プログラムを実行してデバッグを行なう必要が無い場合に、プログラムの実行終了後、ブレーク命令の解除を行なう手間が省ける。   The program may further include means for rewriting the break instruction to an instruction before being written in the break instruction after executing a program from an instruction next to the instruction set at the breakpoint. In this way, when there is no need to execute the program again for debugging, it is possible to save the trouble of releasing the break instruction after the execution of the program is completed.

ここで、デバッグ対象プログラムが格納されている記憶媒体はフラッシュROMであってもよい。その場合、プログラムの書き換え回数を低減することにより、フラッシュROMの書き換え制限回数の消費を抑える事ができる。   Here, the storage medium storing the debug target program may be a flash ROM. In that case, by reducing the number of rewrites of the program, consumption of the rewrite limit number of the flash ROM can be suppressed.

本発明によりデバッグ時のプログラムの書き換え回数を低減することができるデバッグ方法、装置、プログラムを提供する事ができる。それによりデバッグ効率を向上させると共に、デバッグ対象プログラムがフラッシュROMに記憶されている場合は、フラッシュROMの書き換え制限回数の消費を抑える事ができる。   According to the present invention, it is possible to provide a debugging method, apparatus, and program that can reduce the number of times of program rewriting during debugging. As a result, debugging efficiency can be improved, and when the program to be debugged is stored in the flash ROM, consumption of the flash ROM rewrite limit number can be suppressed.

以下に、本発明を適用可能な実施の形態が説明される。以下の説明は、本発明の実施形態を説明するものであり、本発明が以下の実施形態に限定されるものではない。また、説明の明確化のため、以下の記載は、適宜、省略及び簡略化がなされている。又、当業者であれば、以下の実施形態の各要素を、本発明の範囲において容易に変更、追加、変換することが可能である。   Hereinafter, embodiments to which the present invention can be applied will be described. The following description is to describe the embodiment of the present invention, and the present invention is not limited to the following embodiment. For the sake of clarity, the following description is omitted and simplified as appropriate. Moreover, those skilled in the art can easily change, add, and convert each element of the following embodiments within the scope of the present invention.

ソフトウェアのエミュレーション環境は図5のように構成されている。すなわちホストマシン2と、エミュレータ1と、マイクロコンピュータ4が実装されたプリント基板5とを備えている。ホストマシン2にはデバッグ用のプログラムが記憶されている。すなわち、ホストマシン2上でデバッガ7が動作する。マイクロコンピュータ4にはデバッグ対象となるユーザープログラムが記憶されている。すなわち、マイクロコンピュータ4はデバッグの対象となる被デバッグ装置である。ホストマシン2とエミュレータ1とはホストインターフェースケーブル3で接続されている。また、エミュレータ1とプリント基板5とはインターフェースケーブル6で接続されている。プリント基板5にはマイクロコンピュータ4とインターフェースケーブル6との間の配線が接続されている。すなわち、インターフェースケーブル6からの信号はプリント基板5を介してマイクロコンピュータ4に入力される。エミュレータ1はホストマシン2からの命令をマイクロコンピュータ4に送信する。また、エミュレータ1はユーザーがホストマシン2上で確認できるよう、マイクロコンピュータの状態をエミュレートする。   The software emulation environment is configured as shown in FIG. That is, it includes a host machine 2, an emulator 1, and a printed circuit board 5 on which a microcomputer 4 is mounted. The host machine 2 stores a debugging program. That is, the debugger 7 operates on the host machine 2. The microcomputer 4 stores a user program to be debugged. That is, the microcomputer 4 is a debugged device to be debugged. The host machine 2 and the emulator 1 are connected by a host interface cable 3. The emulator 1 and the printed circuit board 5 are connected by an interface cable 6. A wiring between the microcomputer 4 and the interface cable 6 is connected to the printed circuit board 5. That is, a signal from the interface cable 6 is input to the microcomputer 4 via the printed circuit board 5. The emulator 1 transmits a command from the host machine 2 to the microcomputer 4. The emulator 1 emulates the state of the microcomputer so that the user can check on the host machine 2.

図5の例では、エミュレータ1はホストインターフェースケーブル3を介してホストマシン2に接続されているがこれに限定されるものではなく、エミュレータ1は例えばPCMCIA(Personal Computer Memory Card International Association)カード、あるいはPCI(Peripheral Component Interconnect)カード等でもよい。この場合ホストマシン2はPCMCIAスロット、あるいはPCIスロット等を搭載したパーソナルコンピュータ等である。   In the example of FIG. 5, the emulator 1 is connected to the host machine 2 via the host interface cable 3, but is not limited to this, and the emulator 1 is, for example, a PCMCIA (Personal Computer Memory Card International Association) card, or A PCI (Peripheral Component Interconnect) card may be used. In this case, the host machine 2 is a PCMCIA slot or a personal computer equipped with a PCI slot or the like.

ホストマシン2は上記の場合も含め、一般的にはパーソナルコンピュータである。以下にホストマシン2の構成例について説明する。図6はホストマシン2のハードウェア構成の概要を示している。中央処理装置(メインCPU)201とメインメモリ204とを含んでいる。メインCPU201とメインメモリ204とは、バスを介して補助記憶装置としてのハードディスク装置と接続される。   The host machine 2 is generally a personal computer including the above case. A configuration example of the host machine 2 will be described below. FIG. 6 shows an outline of the hardware configuration of the host machine 2. A central processing unit (main CPU) 201 and a main memory 204 are included. The main CPU 201 and the main memory 204 are connected to a hard disk device as an auxiliary storage device via a bus.

フレキシビルディスク装置(FDD)220、ハードディスク装置(HDD)213、230、CD−ROMドライブ226、229、MOドライブ228等の記憶媒体駆動装置は、フレキシビルディスク・コントローラ(FDC)219、IDEコントローラ225、SCSIコントローラ227などの各種コントローラを介してバスに接続される。   Storage medium drive devices such as a flexi building disk device (FDD) 220, hard disk devices (HDD) 213 and 230, CD-ROM drives 226 and 229, and MO drive 228 are a flexi building disk controller (FDC) 219 and an IDE controller 225. Are connected to the bus through various controllers such as a SCSI controller 227.

FDD220等の記憶媒体駆動装置には、フレキシビルディスク等の可搬型記憶媒体が挿入される。記憶媒体にはオペレーティングシステムと共同してメインCPU201等に命令を与え、本実施形態を実施するためのコンピュータ・プログラム(デバッガ7)を記憶することができ、メインメモリ204にロードされることによって実行される。コンピュータ・プログラムは圧縮し、又、複数に分割して記憶することができる。   A portable storage medium such as a flexiville disk is inserted into a storage medium driving device such as the FDD 220. The storage medium can store a computer program (debugger 7) for executing the present embodiment by giving an instruction to the main CPU 201 and the like in cooperation with the operating system, and is executed by being loaded into the main memory 204 Is done. The computer program can be compressed and divided and stored.

ホストマシン2は、さらに、ユーザ・インターフェース・ハードウェアを備えたシステムとすることができる。ユーザ・インターフェース・ハードウェアとしては、例えば、入力をするためのポインティング・デバイス(マウス207、図示しないジョイスティック等)またはキーボード206や視覚データをユーザーに提示するための表示装置211もしくはCRT212があり、キーボード206、マウス207はキーボードマウスコントローラ205を介してバスに接続され、表示装置211はDAC/LCDC210およびVGA208を介してバスに接続される。又、パラレルポート216を介してプリンタを接続することもできる。   The host machine 2 can further be a system provided with user interface hardware. Examples of user interface hardware include a pointing device (mouse 207, joystick not shown) for inputting, a keyboard 206, and a display device 211 or CRT 212 for presenting visual data to the user. 206 and the mouse 207 are connected to the bus via the keyboard mouse controller 205, and the display device 211 is connected to the bus via the DAC / LCDC 210 and the VGA 208. A printer can also be connected via the parallel port 216.

ホストマシン2は、シリアルポート215を介してモデムを接続することが可能であり、シリアルポート215、モデムまたはトークンリングや通信用アダプタ218を介してネットワークに接続し、他のコンピュータシステムと通信を行っている。このように、本形態のホストマシン2は、通常のパーソナルコンピュータ(PC)、ワークステーション、汎用機などによって実現可能である。なお、これらの構成は例示であり、そのすべての構成が本実施の形態に必須というものではない。   The host machine 2 can be connected to a modem via the serial port 215, and connected to the network via the serial port 215, modem or token ring or communication adapter 218, and communicates with other computer systems. ing. As described above, the host machine 2 of the present embodiment can be realized by a normal personal computer (PC), a workstation, a general-purpose machine, or the like. In addition, these structures are illustrations and all the structures are not essential for this Embodiment.

図7にデバッガ7の構成を示す。デバッガ7は実行制御部17、ブレークポイント制御部18、データ転送制御部19、ユーザーインターフェース20、デバッグ対象情報表示部21、命令シミュレーション部22を備えている。実行制御部17は、ブレークポイント制御部18、データ転送制御部19、ユーザーインターフェース20およびデバッグ対象情報表示部21の全体的な動作を制御する。ユーザーインターフェース20はブレークポイントの設定や解除、プログラムの実行、停止等の命令をユーザーから受ける。ユーザーインターフェース20はそれを実行制御部17およびブレークポイント制御部18へ伝える役割を持つ。   FIG. 7 shows the configuration of the debugger 7. The debugger 7 includes an execution control unit 17, a breakpoint control unit 18, a data transfer control unit 19, a user interface 20, a debug target information display unit 21, and an instruction simulation unit 22. The execution control unit 17 controls the overall operation of the breakpoint control unit 18, the data transfer control unit 19, the user interface 20, and the debug target information display unit 21. The user interface 20 receives instructions from the user for setting and canceling breakpoints, program execution, and stopping. The user interface 20 has a role of transmitting it to the execution control unit 17 and the breakpoint control unit 18.

ブレークポイント制御部18はユーザーインターフェース20からのブレークポイント設定に基づき、ブレークポイントを設定したプログラムのプログラムカウンターおよびブレーク命令に変更する前の元の命令を記憶しておく役割を持つ。すなわち、ブレークポイント制御部18はブレークポイントが設定される命令の番地と、その内容を対応づけて記憶する。データ転送制御部19はデバッガ7とエミュレータ1の間の情報の伝達を制御する。デバッグ対象情報表示部21はエミュレータ1により観察されているデバッグ対象であるマイクロコンピュータ4内の情報を表示する。   Based on the breakpoint setting from the user interface 20, the breakpoint control unit 18 has a role of storing the program counter of the program in which the breakpoint is set and the original instruction before changing to the break instruction. That is, the breakpoint control unit 18 stores the address of the instruction at which the breakpoint is set and the contents thereof in association with each other. The data transfer control unit 19 controls transmission of information between the debugger 7 and the emulator 1. The debug target information display unit 21 displays information in the microcomputer 4 that is a debug target observed by the emulator 1.

さらに、命令をシミュレーションするために命令シミュレーション部22を導入する。命令シミュレーション部22は実行制御部17から呼び出されて動作し、呼び出されたときのマイクロコンピュータ4のエミュレーション情報に基づいて、ソフト上でマイクロコンピュータ4の動作をシミュレーションする。命令シミュレーション部22はシミュレーションした結果をデータ転送制御部19からエミュレータ1に転送する。   Further, an instruction simulation unit 22 is introduced to simulate the instruction. The instruction simulation unit 22 is called from the execution control unit 17 and operates, and the operation of the microcomputer 4 is simulated on software based on the emulation information of the microcomputer 4 at the time of the call. The instruction simulation unit 22 transfers the simulation result from the data transfer control unit 19 to the emulator 1.

また、デバッグ対象であるマイクロコンピュータ4は図8に示すようにフラッシュROM8、プロセッサ9、データ転送回路10、RAM11、外部I/O12および割り込みコントローラ13を備えおり、これらのそれぞれがバス15を介して接続されている。フラッシュROM8は電気的に記憶の消去および書き込みができるROMであり、マイクロコンピュータ4のユーザープログラム16が格納されている。プロセッサ9はフラッシュROM8に格納されたユーザープログラム16を実行する。さらに、プロセッサ9はレジスタ14を含む。書き換え可能なフラッシュROMを用いることにより、上述のとおりROMであってもソフトウェアブレークポイントを設定することが可能となった。このマイクロコンピュータ4に格納されたユーザープログラム16がデバッグ対象のプログラムであり、エミュレータ1を介してデバッガ7によりデバッグされる。   The microcomputer 4 to be debugged includes a flash ROM 8, a processor 9, a data transfer circuit 10, a RAM 11, an external I / O 12, and an interrupt controller 13 as shown in FIG. It is connected. The flash ROM 8 is a ROM that can be electrically erased and written, and stores a user program 16 of the microcomputer 4. The processor 9 executes a user program 16 stored in the flash ROM 8. Further, the processor 9 includes a register 14. By using a rewritable flash ROM, software breakpoints can be set even in the ROM as described above. A user program 16 stored in the microcomputer 4 is a program to be debugged, and is debugged by the debugger 7 via the emulator 1.

データ転送回路10は、エミュレータ1とマイクロコンピュータ4との間で送受信が行なわれるインターフェース回路である。RAM11はフラッシュROM8に格納されているユーザープログラムなどのデータを一時的に格納する。外部I/O12はマイクロコンピュータ4の外部入出力を行なう。割り込みコントローラ13は割り込みが発生した事をプロセッサ9に知らせる役割を持つ。   The data transfer circuit 10 is an interface circuit that performs transmission and reception between the emulator 1 and the microcomputer 4. The RAM 11 temporarily stores data such as user programs stored in the flash ROM 8. The external I / O 12 performs external input / output of the microcomputer 4. The interrupt controller 13 has a role of notifying the processor 9 that an interrupt has occurred.

本実施の形態の動作を図2に示すように04b6番地にソフトウェアブレークを設定した場合の例を、図9を用いて説明する。まず、デバッガ7から04b6番地にソフトウェアブレークを設定する(S201)。すると、デバッガ7は図2に示すように04b6番地の命令をブレーク命令に置き換えたユーザープログラム16をエミュレータ1に送る。エミュレータ1はそのプログラムをマイクロコンピュータ4に送信する。エミュレータ1により送信されたプログラムはデータ転送回路により受信される。プロセッサ9はそのプログラムをフラッシュROM8に書き込む(S202)。そして、デバッガ7はエミュレータ1を介してマイクロコンピュータ4のユーザープログラム16を実行する(S203)。0000−04b6番地までの命令が実行される。ブレーク命令である04b6番地でプログラム実行が停止する(S204)。   An example of the operation of the present embodiment when a software break is set at address 04b6 as shown in FIG. 2 will be described with reference to FIG. First, a software break is set at address 04b6 from the debugger 7 (S201). Then, the debugger 7 sends to the emulator 1 a user program 16 in which the instruction at address 04b6 is replaced with a break instruction as shown in FIG. The emulator 1 transmits the program to the microcomputer 4. The program transmitted by the emulator 1 is received by the data transfer circuit. The processor 9 writes the program in the flash ROM 8 (S202). Then, the debugger 7 executes the user program 16 of the microcomputer 4 via the emulator 1 (S203). Instructions up to addresses 0000-04b6 are executed. Program execution stops at address 04b6, which is a break instruction (S204).

ユーザープログラムの実行がソフトウェアブレークポイントで停止した状態で再実行しようとした場合、実行制御部17はブレークポイント制御部18に記憶しておいたブレークポイントを設定した命令を命令シミュレーション部22に通知する。命令シミュレーション部22は受け取った命令をデコードし、エミュレータ1から受け取ったレジスタ、メモリ、I/Oの情報に基づいて書き換える前の命令をシミュレーションする。さらに、シミュレーションしたことによって状態の変化したレジスタ、メモリ、I/Oの情報を、データ転送制御部19からエミュレータ1に転送する。ここで、変化したレジスタ、メモリ、I/Oの情報とはシミュレーション上の情報であり、ホストマシン2すなわちデバッガ7内部の情報である。シミュレーション上の情報は、実際にマイクロコンピュータ4に、書き換えられる前の04b6番地の命令を実行させた場合の情報と対応している。   When execution of the user program is attempted to be re-executed while stopped at the software breakpoint, the execution control unit 17 notifies the instruction simulation unit 22 of the instruction that sets the breakpoint stored in the breakpoint control unit 18. . The instruction simulation unit 22 decodes the received instruction and simulates the instruction before rewriting based on the register, memory, and I / O information received from the emulator 1. Further, the information on the register, memory, and I / O whose state has changed as a result of the simulation is transferred from the data transfer control unit 19 to the emulator 1. Here, the changed register, memory, and I / O information is information on the simulation, and is information inside the host machine 2, that is, the debugger 7. The information on the simulation corresponds to the information when the microcomputer 4 is actually caused to execute the instruction at address 04b6 before being rewritten.

エミュレータ1はその情報をインターフェースケーブル6通してデバッグ対象であるマイクロコンピュータ4に転送する。マイクロコンピュータ4のプロセッサ内部のレジスタ14、RAM11および外部I/O12を変化させる(S205)。すなわちシミュレーションによって変化したレジスタ、メモリ、I/Oの情報に基づいて、レジスタ14、RAM11および外部I/O12の状態が変化する。また、実行制御部17はプロセッサ9内部のプログラムカウンターを次の命令、すなわち04b7番地に移動させる命令をエミュレータ1へ送信し、エミュレータ1はそれをマイクロコンピュータ4へ転送する。データ転送回路10でその命令を受け取り、プロセッサ9はプログラムカウンターを04b7番地に移動させる(S206)。さらに、実行制御部17は移動したプログラムカウンターからプログラム実行を再開させる命令を送信するようデータ転送制御部19を制御する。データ転送制御部19はその情報をエミュレータ1に送信する(S207)。エミュレータ1はその命令を受け取りマイクロコンピュータ4に転送する。プロセッサ9は04b7番地の命令からユーザープログラム16を実行する。   The emulator 1 transfers the information to the microcomputer 4 to be debugged through the interface cable 6. The register 14, RAM 11 and external I / O 12 in the processor of the microcomputer 4 are changed (S205). That is, the state of the register 14, the RAM 11, and the external I / O 12 changes based on the register, memory, and I / O information changed by the simulation. The execution control unit 17 transmits to the emulator 1 a command for moving the program counter in the processor 9 to the next command, that is, the address 04b7, and the emulator 1 transfers it to the microcomputer 4. The data transfer circuit 10 receives the instruction, and the processor 9 moves the program counter to address 04b7 (S206). Further, the execution control unit 17 controls the data transfer control unit 19 to transmit a command for resuming program execution from the moved program counter. The data transfer control unit 19 transmits the information to the emulator 1 (S207). The emulator 1 receives the instruction and transfers it to the microcomputer 4. The processor 9 executes the user program 16 from the instruction at address 04b7.

デバッグ作業が終了したら、デバッガ7からブレークポイントの設定を解除する(S208)。するとデバッガ7はブレーク命令に置き換えられていた命令を元の命令に戻したユーザープログラム16をエミュレータ1に送る。エミュレータ1はそのプログラムをデータ転送回路10からフラッシュROM8に書き込む(S209)。図10は上記の本実施の形態にかかる動作を含む、デバッグ開始から終了までの流れを表したフローチャートである。太枠のブロックはプログラムの書き換えが行なわれる事を示している。   When the debugging operation is completed, the breakpoint setting is canceled from the debugger 7 (S208). Then, the debugger 7 sends to the emulator 1 a user program 16 in which the instruction replaced with the break instruction is returned to the original instruction. The emulator 1 writes the program from the data transfer circuit 10 to the flash ROM 8 (S209). FIG. 10 is a flowchart showing the flow from the start to the end of debugging, including the operation according to the present embodiment. A bold frame indicates that the program is rewritten.

すなわち、デバッグ作業が開始されるとユーザーはまずデバッガ7に対してブレークポイントの設定を行なう(S201)。エミュレータ1はブレークポイントの設定に基づき、マイクロコンピュータ4内のユーザープログラムを書き換える(S202)。ブレーク命令への書き換えが終わると、マイクロコンピュータ4においてプロセッサ9によりユーザープログラム16が実行される(S203)。0000番地から04b6番地のブレークポイントにヒットするまでプログラムが実行され、04b6番地のブレーク命令でプログラムが停止する(S204)。デバッガ7がユーザーからプログラムの再実行命令を受け取ると、実行制御部17は命令シミュレーション部22を呼び出す。命令シミュレーション部22はブレークポイント制御部18に記録されている、04b6番地のブレーク命令に書き換えられる前の命令をデコードし実行(シミュレーション)する。このシミュレーションの際、呼び出されたときのマイクロコンピュータ4のエミュレーション情報、すなわちレジスタ14、RAM11、外部I/O12の状態に基づき、命令シミュレーション部22はシミュレーションを行なう。   That is, when the debugging operation is started, the user first sets a breakpoint for the debugger 7 (S201). The emulator 1 rewrites the user program in the microcomputer 4 based on the breakpoint setting (S202). When the rewriting to the break instruction is completed, the user program 16 is executed by the processor 9 in the microcomputer 4 (S203). The program is executed until a breakpoint at address 0000 to address 04b6 is hit, and the program is stopped by a break instruction at address 04b6 (S204). When the debugger 7 receives a program re-execution instruction from the user, the execution control unit 17 calls the instruction simulation unit 22. The instruction simulation unit 22 decodes and executes (simulates) the instruction recorded in the breakpoint control unit 18 before being rewritten to the break instruction at address 04b6. At the time of this simulation, the instruction simulation unit 22 performs a simulation based on the emulation information of the microcomputer 4 when called, that is, the state of the register 14, the RAM 11, and the external I / O 12.

04b6番地の元の命令のシミュレーションが終了すると、実行制御部17がシミュレーションによって変化したレジスタ14、RAM11、外部I/O12の状態をエミュレータ1へ送信するようデータ転送制御部19を制御する。エミュレータ1はその情報をマイクロコンピュータ4へ転送する。データ転送回路10がその情報を受け取り、レジスタ14、RAM11、外部I/O12の状態の変化が書き込まれる(S205)。次に、実行制御部17はプロセッサ9内部のプログラムカウンターを次の命令、すなわち04b7番地に移動させる命令をエミュレータ1へ送信し、エミュレータ1はそれをマイクロコンピュータ4へ転送する。データ転送回路10でその命令を受け取り、プロセッサ9はプログラムカウンターを04b7番地に移動させる(S206)。プログラムがブレーク命令の次の命令から再実行される(S207)。   When the simulation of the original instruction at address 04b6 is completed, the execution control unit 17 controls the data transfer control unit 19 to transmit the state of the register 14, RAM 11, and external I / O 12 changed by the simulation to the emulator 1. The emulator 1 transfers the information to the microcomputer 4. The data transfer circuit 10 receives the information, and changes in the state of the register 14, RAM 11, and external I / O 12 are written (S205). Next, the execution control unit 17 transmits a program counter in the processor 9 to the next instruction, that is, an instruction to move to address 04b7 to the emulator 1, and the emulator 1 transfers it to the microcomputer 4. The data transfer circuit 10 receives the instruction, and the processor 9 moves the program counter to address 04b7 (S206). The program is re-executed from the instruction next to the break instruction (S207).

上記の作業でデバッグ作業が終了しなければ上記の作業を繰り返す。その際、前回の作業と同じブレークポイントで作業するならばS203に、別のブレークポイントを設定するならばS201に戻る。デバッグ作業が終了したならばデバッガ7でブレークポイント解除の命令を出す(S208)。すると、実行制御部17はブレークポイント制御部18に記憶されているブレークポイント情報を参照し、ブレークポイントを設定したプログラムカウンターの命令を元に戻す命令をエミュレータ1に送信する。エミュレータ1はその命令をマイクロコンピュータ4へ転送する。データ転送回路10がその命令を受け取り、プロセッサ9によってフラッシュROM8に格納されているユーザープログラムが書き換えられる(S209)。   If the debugging operation is not completed by the above operation, the above operation is repeated. At this time, if the work is performed at the same breakpoint as the previous work, the process returns to S203, and if another breakpoint is set, the process returns to S201. If the debugging operation is completed, the debugger 7 issues a breakpoint release command (S208). Then, the execution control unit 17 refers to the breakpoint information stored in the breakpoint control unit 18 and transmits an instruction for returning the instruction of the program counter in which the breakpoint is set to the emulator 1. The emulator 1 transfers the instruction to the microcomputer 4. The data transfer circuit 10 receives the command, and the user program stored in the flash ROM 8 is rewritten by the processor 9 (S209).

以上、説明したように、本実施の形態にかかるプログラムデバッグ方法では、ユーザープログラムの実行がソフトウェアブレークポイントで停止した状態で再実行しようとした場合、ブレークポイントを書き換えるのではなくブレークポイントを設定する前の命令をシミュレーションする。そうすることによってプログラムを書き換えることなく命令を再実行する事ができ、結果的に書き換え回数が低減される。書き換えの回数が低減されることにより、データの書き込み、転送にかかる時間が短縮されるので、ユーザープログラムの実行にかかる時間を短縮する事ができる。   As described above, in the program debugging method according to the present embodiment, when execution of a user program is stopped at a software breakpoint and re-execution is attempted, a breakpoint is set instead of rewriting the breakpoint. Simulate the previous instruction. By doing so, the instruction can be re-executed without rewriting the program, and as a result, the number of rewrites is reduced. Since the number of times of rewriting is reduced, the time required for writing and transferring data is shortened, so that the time required for executing the user program can be shortened.

具体的には、デバッグ作業の中でブレークポイントの設定、ブレークポイントからの再実行、ブレークポイントの解除を各1回行なった場合、図4にも示されるように従来技術では設定、解除で各1回、再実行で2回、書き換えを行なっていたので合計で4回のユーザープログラム書き換えが必要であったが、本実施の形態で行なわれるプログラムの書き換えは図10にも示されるように設定、解除の2回のみなので、ユーザープログラムの書き換え回数が半分に低減される。   Specifically, when setting a breakpoint, re-execution from a breakpoint, and canceling a breakpoint once each time during debugging, the prior art sets and cancels each as shown in FIG. Since the user program was rewritten once and re-executed twice, a total of four user program rewrites were necessary. However, the program rewrite performed in this embodiment is set as shown in FIG. Since the release is only twice, the number of rewrites of the user program is reduced to half.

さらに、実際のデバッグ作業では、ブレークポイントからのユーザープログラムの再実行は複数回行なわれることが想定されるので、ブレークポイントからの再実行を行なう程その効果は倍増する。また、本実施の形態ではユーザープログラムを格納する記憶媒体としてフラッシュROMを用いている。そのような場合、書き換え回数を低減する事によりフラッシュROMの書き換え制限回数の消費を抑えることができる。   Further, in actual debugging work, it is assumed that the re-execution of the user program from the breakpoint is performed a plurality of times, so the effect is doubled as the re-execution from the breakpoint is performed. In this embodiment, a flash ROM is used as a storage medium for storing the user program. In such a case, the consumption of the flash ROM rewrite limit number can be suppressed by reducing the number of rewrite times.

従来技術におけるデバッガの構成を表すブロック図である。It is a block diagram showing the structure of the debugger in a prior art. デバッガにブレーク命令が設定されるユーザープログラムの一例を示す説明図である、It is an explanatory diagram showing an example of a user program in which a break instruction is set in the debugger. 従来技術におけるデバッグ作業の動作を表す図である。It is a figure showing the operation | movement of the debugging operation | work in a prior art. 従来技術におけるデバッグ作業の流れを表すフローチャートである。It is a flowchart showing the flow of the debugging work in a prior art. ソフトウェアのエミュレーション環境を表す概略図である。It is the schematic showing the emulation environment of software. ホストマシン2の構成を表す概略図である。2 is a schematic diagram illustrating a configuration of a host machine 2. FIG. 本発明の実施の形態におけるデバッガの構成を表すブロック図である。It is a block diagram showing the structure of the debugger in embodiment of this invention. デバッグ対象であるマイクロコンピュータ4の構成を示すブロック図である。It is a block diagram which shows the structure of the microcomputer 4 which is a debug object. 本発明の実施の形態におけるデバッグ作業の動作を表す図である。It is a figure showing the operation | movement of the debug operation | work in embodiment of this invention. 本発明の実施の形態におけるデバッグ作業の流れを表すフローチャートである。It is a flowchart showing the flow of the debugging operation | work in embodiment of this invention.

符号の説明Explanation of symbols

1 エミュレータ、2 ホストマシン、3 ホストインターフェースケーブル、
4 マイクロコンピュータ、5 プリント基板、6 インターフェースケーブル、
7 デバッガ、8 フラッシュROM、9 プロセッサ、10 データ転送回路、
11 RAM、12 外部I/O、13 割り込みコントローラ、14 レジスタ、
15 バス、16 ユーザープログラム、17 実行制御部、
18 ブレークポイント制御部、19 データ転送制御部、
20 ユーザーインターフェース、21 デバッグ対象情報表示部、
22 命令シミュレーション部、201 メインCPU、204 メインメモリ、
205 キーボードマウスコントローラ、206 キーボード、207 マウス、
208 VGA、209 VRAM、210 DAC/LCDC、
211 表示装置、212 CRT、213、230 HDD、
214 ROM、215 シリアルポート、216 パラレルポート、
217 タイマ、218 通信用アダプタカード、219 FDC、
220 FDD、225 IDEコントローラ、226、229 CD−ROMドライブ
227 SCSIコントローラ
1 emulator, 2 host machine, 3 host interface cable,
4 Microcomputer, 5 Printed circuit board, 6 Interface cable,
7 debugger, 8 flash ROM, 9 processor, 10 data transfer circuit,
11 RAM, 12 external I / O, 13 interrupt controller, 14 registers,
15 buses, 16 user programs, 17 execution control units,
18 breakpoint control unit, 19 data transfer control unit,
20 user interface, 21 debug target information display section,
22 instruction simulation unit, 201 main CPU, 204 main memory,
205 keyboard mouse controller, 206 keyboard, 207 mouse,
208 VGA, 209 VRAM, 210 DAC / LCDC,
211 Display device, 212 CRT, 213, 230 HDD,
214 ROM, 215 serial port, 216 parallel port,
217 timer, 218 adapter card for communication, 219 FDC,
220 FDD, 225 IDE controller, 226, 229 CD-ROM drive 227 SCSI controller

Claims (9)

デバッグ対象となるプログラムを有する被デバッグ装置をエミュレーションし、前記プログラムのデバッグを行うプログラムのデバッグ方法であって、
前記プログラムにブレークポイントを設定するステップと、
前記プログラムの前記ブレークポイントに設定された命令を前記プログラムの実行が停止されるブレーク命令に書き換えるステップと、
前記ブレークポイントに設定された命令の前の命令まで前記プログラムを実行するステップと、
前記ブレークポイントに設定された命令で前記プログラムを停止するステップと、
前記ブレークポイントに設定された命令に対して、前記ブレーク命令に書き換えられる前の命令をシミュレーションするステップと、
前記シミュレーションの結果に基づく情報を前記被デバッグ装置に書き込むステップと、
前記ブレークポイントに設定された命令の次の命令からプログラムを実行するステップと、
を備えるプログラムデバッグ方法。
A program debugging method for emulating a device to be debugged having a program to be debugged and debugging the program,
Setting a breakpoint in the program;
Rewriting the instruction set at the breakpoint of the program to a break instruction that stops execution of the program;
Executing the program up to an instruction before the instruction set at the breakpoint;
Stopping the program with an instruction set at the breakpoint;
Simulating an instruction before being rewritten to the break instruction with respect to the instruction set at the breakpoint;
Writing information based on the result of the simulation to the debugged device;
Executing a program from an instruction next to the instruction set at the breakpoint;
A program debugging method comprising:
前記ブレークポイントに設定された命令の次の命令からプログラムを実行した後、前記ブレーク命令を前記ブレーク命令に書き込まれる前の命令に書き換えるステップをさらに有する請求項1記載のデバッグ方法。   The debugging method according to claim 1, further comprising a step of rewriting the break instruction to an instruction before being written to the break instruction after executing a program from an instruction next to the instruction set at the breakpoint. 前記デバッグ対象となるプログラムが前記被デバッグ装置に設けられたフラッシュROMに記憶されている請求項1又は2記載のデバッグ方法。   The debugging method according to claim 1 or 2, wherein the program to be debugged is stored in a flash ROM provided in the debugged device. デバッグ対象となるプログラムを有する被デバッグ装置の前記プログラムにブレークポイントを設定して、前記プログラムのデバッグを行う、プログラムであって、
(a)前記プログラムの前記ブレークポイントに設定された命令を前記プログラムの実行が停止されるブレーク命令に書き換えるステップと、
(b)前記ブレークポイントに設定された命令の前の命令まで前記プログラムを実行するステップと、
(c)前記ブレークポイントに設定された命令で前記プログラムを停止するステップと、
(d)前記ブレークポイントに設定された命令に対して、前記ブレーク命令に書き換えられる前の命令をシミュレーションするステップと、
(e)前記シミュレーションの結果に基づく情報を前記被デバッグ装置に書き込むステップと、
(f)前記ブレークポイントに設定された命令の次の命令からプログラムを実行するステップと、
があり、コンピュータに前記ステップ(a)、(b)、(c)、(d)、(e)、(f)を実行させるためのプログラム。
A program for setting a breakpoint in the program of the debugged device having a program to be debugged and debugging the program,
(A) rewriting an instruction set at the breakpoint of the program to a break instruction at which execution of the program is stopped;
(B) executing the program up to an instruction before the instruction set at the breakpoint;
(C) stopping the program with an instruction set at the breakpoint;
(D) simulating an instruction set at the breakpoint before the instruction is rewritten to the break instruction;
(E) writing information based on the result of the simulation into the debugged device;
(F) executing a program from an instruction next to the instruction set at the breakpoint;
And a program for causing a computer to execute the steps (a), (b), (c), (d), (e), and (f).
前記ブレークポイントに設定された命令の次の命令からプログラムを実行した後、前記ブレーク命令を前記ブレーク命令に書き込まれる前の命令に書き換えるステップをさらにコンピュータに実行させる請求項4記載のプログラム   5. The program according to claim 4, further comprising: causing the computer to execute a step of rewriting the break instruction to an instruction before being written to the break instruction after executing the program from an instruction next to the instruction set at the breakpoint. 前記デバッグ対象となるプログラムが前記被デバッグ装置に設けられたフラッシュROMに記憶されている請求項4又は5記載のプログラム。   6. The program according to claim 4, wherein the program to be debugged is stored in a flash ROM provided in the device to be debugged. デバッグ対象となるプログラムを有する被デバッグ装置をエミュレーションするエミュレータと、前記エミュレータを操作し前記デバッグ対象プログラムに対してブレークポイント設定を行なうデバッグプログラムと、前記デバッグプログラムを動作させるホストコンピュータと、を有するプログラムデバッグ装置であって、
前記プログラムにブレークポイントを設定する手段と、
前記プログラムの前記ブレークポイントに設定された命令を前記プログラムの実行が停止されるブレーク命令に書き換える手段と、
前記ブレーク命令に書き換えられた命令を有するプログラムを実行する手段と、
前記ブレークポイントに設定された命令に対して、前記ブレーク命令に書き換えられる前の命令をシミュレーションする手段と、
前記シミュレーションの結果に基づく情報を前記被デバッグ装置に書き込む手段と、
前記ブレークポイントに設定された命令の次の命令からプログラムを実行する手段と、
を備えるプログラムデバッグ装置。
A program comprising: an emulator for emulating a device to be debugged having a program to be debugged; a debug program for operating the emulator to set a breakpoint for the debug target program; and a host computer for operating the debug program A debugging device,
Means for setting a breakpoint in the program;
Means for rewriting an instruction set at the breakpoint of the program to a break instruction at which execution of the program is stopped;
Means for executing a program having an instruction rewritten to the break instruction;
Means for simulating an instruction before being rewritten to the break instruction with respect to the instruction set at the breakpoint;
Means for writing information based on the result of the simulation to the debugged device;
Means for executing a program from an instruction next to the instruction set at the breakpoint;
A program debugging apparatus comprising:
前記ブレークポイントに設定された命令の次の命令からプログラムを実行した後、前記ブレーク命令を前記ブレーク命令に書き込まれる前の命令に書き換える手段をさらに有する請求項7記載のプログラム」デバッグ装置。   8. The program debugging device according to claim 7, further comprising means for rewriting the break instruction to an instruction before being written to the break instruction after executing the program from the instruction next to the instruction set at the breakpoint. 前記デバッグ対象となるプログラムが前記被デバッグ装置に設けられたフラッシュROMに記憶されている請求項1又は2記載のプログラムデバッグ装置
3. The program debugging apparatus according to claim 1, wherein the program to be debugged is stored in a flash ROM provided in the debugged apparatus.
JP2004095531A 2004-03-29 2004-03-29 Program debugging method, debugging program and program debugging device Pending JP2005284542A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004095531A JP2005284542A (en) 2004-03-29 2004-03-29 Program debugging method, debugging program and program debugging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004095531A JP2005284542A (en) 2004-03-29 2004-03-29 Program debugging method, debugging program and program debugging device

Publications (1)

Publication Number Publication Date
JP2005284542A true JP2005284542A (en) 2005-10-13

Family

ID=35182873

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004095531A Pending JP2005284542A (en) 2004-03-29 2004-03-29 Program debugging method, debugging program and program debugging device

Country Status (1)

Country Link
JP (1) JP2005284542A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0540654A (en) * 1991-08-05 1993-02-19 Tohoku Nippon Denki Software Kk Optional instruction tracing system
JPH1011315A (en) * 1996-06-27 1998-01-16 Kawasaki Steel Corp In-circuit emulator device and in-circuit emulation method
JP2004046716A (en) * 2002-07-15 2004-02-12 Renesas Technology Corp Debugging system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0540654A (en) * 1991-08-05 1993-02-19 Tohoku Nippon Denki Software Kk Optional instruction tracing system
JPH1011315A (en) * 1996-06-27 1998-01-16 Kawasaki Steel Corp In-circuit emulator device and in-circuit emulation method
JP2004046716A (en) * 2002-07-15 2004-02-12 Renesas Technology Corp Debugging system

Similar Documents

Publication Publication Date Title
US7171653B2 (en) Systems and methods for providing communication between a debugger and a hardware simulator
JP5270330B2 (en) Multicore microcomputer system simulation method and simulation apparatus
KR20190078681A (en) System and Method for Artificial Neural Network Learning and Simulation
JP2008282308A (en) Cooperation verification device, cooperation verification method, and cooperation verification program
US7043717B2 (en) Debugging apparatus and method
JP2007058813A (en) Verification device and verification method
JP2005284542A (en) Program debugging method, debugging program and program debugging device
JP2005353020A (en) Simulation system for computer program
JPH0477833A (en) Integrated circuit provided with debugging environment
US8914274B1 (en) Method and system for instruction set simulation with concurrent attachment of multiple debuggers
JP2008077176A (en) Emulation system and emulation method
JP4345545B2 (en) Simulation device
JPS63271542A (en) Rom debugger
JPH02186448A (en) Integrated circuit with debugging environment
JPS584461A (en) Program debugging control system
CN117170798A (en) Loongson 1E300 simulator based on UBQ-SIMTest framework
JP2005235047A (en) Power source intermittent disconnection debugging device and recording medium with program for realizing the method recorded thereon
JPH01159743A (en) Firm soft simulator
JP2006139440A (en) Emulator apparatus and its control method
JPH04123235A (en) Debugging method and system for microprogram
JP2013137707A (en) Processor and debug device using the same
JP2000322289A (en) Method and system for controller emulation and computer readable recording medium for storing program for implementation of controller emulation method by computer
Phillips Enhanced Debugging with Traces: An essential technique used in emulator development is a useful addition to any programmer’s toolbox.
JPS61239345A (en) I/o simulator
JPS5968034A (en) Input and output port simulator for microcomputer developing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070110

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091104

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100104

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100126

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20100525