JP2754899B2 - Return address monitoring circuit of debug device - Google Patents

Return address monitoring circuit of debug device

Info

Publication number
JP2754899B2
JP2754899B2 JP28361489A JP28361489A JP2754899B2 JP 2754899 B2 JP2754899 B2 JP 2754899B2 JP 28361489 A JP28361489 A JP 28361489A JP 28361489 A JP28361489 A JP 28361489A JP 2754899 B2 JP2754899 B2 JP 2754899B2
Authority
JP
Japan
Prior art keywords
return
microcomputer
address
return address
time
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.)
Expired - Lifetime
Application number
JP28361489A
Other languages
Japanese (ja)
Other versions
JPH03223938A (en
Inventor
秋広 上垣
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP28361489A priority Critical patent/JP2754899B2/en
Publication of JPH03223938A publication Critical patent/JPH03223938A/en
Application granted granted Critical
Publication of JP2754899B2 publication Critical patent/JP2754899B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Manufacturing Optical Record Carriers (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、プログラムを実行してプログラムの誤りを
訂正するデバッグ装置のプログラムミス検出手段に関す
るものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program error detecting means of a debugging device that executes a program and corrects a program error.

〔従来の技術〕 第2図は従来のデバッグ装置を示す構成図であり、ア
ドレスバス、データバスの値をリアルタイムに検出する
部分の構成例を示す。
[Prior Art] FIG. 2 is a configuration diagram showing a conventional debug device, and shows a configuration example of a portion for detecting values of an address bus and a data bus in real time.

第2図において、1はデバッグの対象となるマイクロ
コンピュータ、2はマイクロコンピュータのリード・ラ
イトサイクルに応答するデバイス(ROM,RAM,周辺IC
等)、3はデバッグ装置を操作するユーザが指定する検
出したいアドレスバス5、データバス6の値をラッチす
る比較データラッチ、4は比較データラッチ3の値とマ
イクロコンピュータ1出力のアドレスバス5,データバス
6の値との一致を検出する比較器、7は制御バスであ
る。
In FIG. 2, 1 is a microcomputer to be debugged, and 2 is a device (ROM, RAM, peripheral IC) responding to a read / write cycle of the microcomputer.
Etc.) 3 is a comparison data latch for latching a value of an address bus 5 and a data bus 6 to be detected specified by a user who operates the debugging device, and 4 is an address bus 5 of the value of the comparison data latch 3 and an output of the microcomputer 1. A comparator for detecting a match with the value of the data bus 6, and 7 is a control bus.

次に動作について説明する。 Next, the operation will be described.

マイクロコンピュータ1がデバイス2をアクセスする
ために出力したアドレスバス5の値と比較データラッチ
3に設定した値とを比較器4で比較する。比較する際、
マイクロコンピュータ1から出力される制御バス7の信
号も併せて比較すれば、マイクロコンピュータ1の特定
アドレスへの特定アクセスの検出が可能となる。次い
で、一致検出信号を使用してプログラム実行の中止、リ
アルタイムトレースの開始等の動作を行なう。
The comparator 4 compares the value of the address bus 5 output by the microcomputer 1 for accessing the device 2 with the value set in the comparison data latch 3. When comparing,
By comparing the signals of the control bus 7 output from the microcomputer 1 together, a specific access to a specific address of the microcomputer 1 can be detected. Next, using the coincidence detection signal, operations such as stop of program execution and start of real-time trace are performed.

マイクロコンピュータ1がデバイス2に対してリード
・ライトする時のデータバス6の値と比較データラッチ
3に設定した値とを比較器4で比較する。比較する際、
マイクロコンピュータ1から出力される制御バス7の信
号も併せて比較すれば、マイクロコンピュータ1の特定
データへの特定アクセスの検出が可能となる。次いで、
一致検出信号を使用してプログラム実行の中止、リアル
タイムトレースの開始等の動作を行なう。
The value of the data bus 6 when the microcomputer 1 reads / writes the device 2 is compared with the value set in the comparison data latch 3 by the comparator 4. When comparing,
By comparing the signals of the control bus 7 output from the microcomputer 1 together, it is possible to detect a specific access of the microcomputer 1 to specific data. Then
Using the coincidence detection signal, operations such as stop of program execution and start of real-time trace are performed.

上記とを組み合わせることにより、特定アドレス
への特定データのリード・ライト等の動作を検出するこ
とが可能となる。
By combining the above, it is possible to detect operations such as reading / writing specific data to a specific address.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

従来のデバッグ装置では、特定アドレスへの特定デー
タの書込みの検出、特定アドレスへの特定アクセスの検
出は可能であったが、サブルーチンコール時に退避され
るリターンアドレスとリターン時に取り出されるリター
ンアドレスの一致を検出することは不可能であった。
In the conventional debug device, it was possible to detect writing of specific data to a specific address and to detect specific access to a specific address. However, it is necessary to match a return address saved at the time of a subroutine call with a return address extracted at the time of return. It was impossible to detect.

本発明はこのような点に鑑みてなされたものであり、
その目的とするところは、サブルーチンコール時にマイ
クロコンピュータによって退避したリターンアドレスと
リターン時にマイクロコンピュータが取り出すリターン
アドレスの一致をリアルタイムに監視できるデバッグ装
置を実現することにある。
The present invention has been made in view of such a point,
An object of the present invention is to realize a debugging device capable of monitoring in real time whether a return address saved by a microcomputer at the time of a subroutine call matches a return address retrieved by the microcomputer at the time of return.

〔課題を解決するための手段〕[Means for solving the problem]

このような目的を達成するために本発明は、デバッグ
対象となるマイクロコンピュータのサブルーチンコール
時にスタック領域に退避したリターンアドレスとサブル
ーチンコール時に記憶回路に書き込まれたリターンアド
レスとをリターン時にリアルタイムに比較する比較回路
を設けるようにしたものである。
In order to achieve such an object, the present invention compares a return address saved in a stack area at the time of a subroutine call of a microcomputer to be debugged with a return address written in a storage circuit at the time of a subroutine call in real time at the time of return. A comparison circuit is provided.

〔作用〕[Action]

本発明によるデバッグ装置のリターンアドレス監視回
路においては、サブルーチンコール時にマイクロコンピ
ュータによって退避したリターンアドレスとリターン時
にマイクロコンピュータが取り出すリターンアドレスの
比較は、サブルーチンコール命令によりスタック領域に
退避されるデータの値とその値がライトされるアドレス
の値とを順次記憶し、リターン命令により取り出される
データの値およびその値がリードされるアドレスの値と
上記記憶した値とを比較することにより行なわれる。
In the return address monitoring circuit of the debugging device according to the present invention, the comparison between the return address saved by the microcomputer at the time of the subroutine call and the return address taken out by the microcomputer at the time of the return is based on the value of the data saved in the stack area by the subroutine call instruction. This is performed by sequentially storing the value of the address to which the value is written, and comparing the value of the data extracted by the return instruction and the value of the address from which the value is read with the stored value.

〔実施例〕〔Example〕

第1図は、本発明によるリターンアドレス監視回路の
一実施例が適用されるデバッグ装置を示す構成図であ
る。第1図においては、リターンアドレスの一致検出に
直接関係した部分だけを図示した。
FIG. 1 is a configuration diagram showing a debug device to which an embodiment of a return address monitoring circuit according to the present invention is applied. FIG. 1 shows only the part directly related to the return address coincidence detection.

第1図において、1はデバッグの対象となるマイクロ
コンピュータ、2はスタック領域となるメモリ、4は比
較回路、5はアドレスバス、6はデータバス、7は制御
バス、8はデータバス6、制御バス7を監視し、サブル
ーチンコール命令、リターン命令を検出する命令デコー
ダ、9はサブルーチンコール命令により退避されるデー
タとアドレスの値を記憶する記憶回路、10はデバッグ装
置全体を制御するデバッグ装置制御部である。比較回路
4は、リターン命令によりメモリ2より取り出したデー
タおよびそのアドレスの値と記憶回路9中の対応する値
とを比較する。
In FIG. 1, 1 is a microcomputer to be debugged, 2 is a memory serving as a stack area, 4 is a comparison circuit, 5 is an address bus, 6 is a data bus, 7 is a control bus, 8 is a data bus 6, and control is An instruction decoder that monitors the bus 7 and detects a subroutine call instruction and a return instruction, 9 is a storage circuit that stores data and address values saved by the subroutine call instruction, and 10 is a debug device control unit that controls the entire debug device. It is. The comparison circuit 4 compares the data fetched from the memory 2 by the return instruction and the value of the address with the corresponding value in the storage circuit 9.

次に、本実施例の動作を第1図を参照しながら説明す
る。マイクロコンピュータ1は、サブルーチンコール命
令を実行すると、リターンアドレスをメモリ2に退避す
る。同時に命令デコーダ8はサブルーチンコール命令の
実行を検出し、マイクロコンピュータ1が退避したリタ
ーンアドレス値および退避に使用したメモリのアドレス
を記憶回路9に書き込む。記憶回路9は、先に書き込ん
だ値が後に読み出されるFILO(ファーストインラストア
ウト)の回路構成とする。記憶回路9からの読出しはリ
ターン命令の実行により行なう。
Next, the operation of this embodiment will be described with reference to FIG. When executing the subroutine call instruction, the microcomputer 1 saves the return address in the memory 2. At the same time, the instruction decoder 8 detects the execution of the subroutine call instruction, and writes the return address value saved by the microcomputer 1 and the address of the memory used for saving into the storage circuit 9. The storage circuit 9 has a FILO (First In Last Out) circuit configuration in which a previously written value is read later. Reading from the storage circuit 9 is performed by executing a return instruction.

次に、マイクロコンピュータ1は、リターン命令を実
行すると、リターンアドレスをメモリ2から取り出す。
同時に命令デコーダ8はリターン命令の実行を検出し、
マイクロコンピュータ1がリターンアドレスを取り出す
ために出力したアドレスの値およびメモリ2が出力した
データと記憶回路9の対応した値とを比較回路4により
比較する。比較回路4は、値が不一致であった場合、デ
バッグ装置制御部10は不一致検出信号aを送る。デバッ
グ装置制御部10はマイクロコンピュータ1の実行を停止
させるなどの動作を行ない、デバッグ装置はプログラマ
にリターンアドレスの不一致を通知する。
Next, when the microcomputer 1 executes the return instruction, it retrieves the return address from the memory 2.
At the same time, the instruction decoder 8 detects the execution of the return instruction,
The comparison circuit 4 compares the value of the address output by the microcomputer 1 for extracting the return address and the data output by the memory 2 with the corresponding value of the storage circuit 9. In the comparison circuit 4, when the values do not match, the debug device control unit 10 sends a mismatch detection signal a. The debug device control unit 10 performs operations such as stopping the execution of the microcomputer 1, and the debug device notifies the programmer of the mismatch of the return addresses.

なお、上記実施例では、サブルーチンコール命令とリ
ターン命令の組合せだけを示したが、これ以外に、ソフ
トウェア割込み命令と割込みからのリターン命令の組合
せ、および内部・外部の要因によるハードウェア割込み
と割込みからのリターン命令の組合せを使用してもよ
い。
In the above embodiment, only the combination of the subroutine call instruction and the return instruction is shown. In addition to the above, the combination of the software interrupt instruction and the return instruction from the interrupt, and the hardware interrupt and the interrupt due to internal / external factors are also used. May be used.

さらに、上記3つの組合せは単独で使用しても、複数
同時に使用してもよいことはいうまでもない。
Furthermore, it goes without saying that the above three combinations may be used alone or in combination.

〔発明の効果〕〔The invention's effect〕

以上説明したように本発明は、サブルーチンコール時
にスタック領域に退避したリターンアドレスとサブルー
チンコール時に記憶回路に書き込まれたリターンアドレ
スとをリターン時にリアルタイムに比較することによ
り、プログラムミスによってスタックポインタが変化し
てリターン命令の実行後にマイクロコンピュータが異常
動作することをリアルタイム動作中に検出することがで
き、プログラムミスを発見することによってデバッグ時
間を短縮できる効果がある。
As described above, the present invention compares the return address saved in the stack area at the time of a subroutine call with the return address written to the storage circuit at the time of the subroutine call in real time at the time of return, so that the stack pointer changes due to a program error. Thus, the abnormal operation of the microcomputer after the execution of the return instruction can be detected during the real-time operation, and there is an effect that the debugging time can be reduced by finding a program error.

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明によるリターンアドレス監視回路の一実
施例が適用されるデバッグ装置を示す構成図、第2図は
従来のデバッグ装置を示す構成図である。 1……マイクロコンピュータ、2……メモリ、4……比
較回路、5……アドレスバス、6……データバス、7…
…制御バス、8……命令デコーダ、9……記憶回路、10
……デバッグ装置制御部。
FIG. 1 is a block diagram showing a debug device to which an embodiment of a return address monitoring circuit according to the present invention is applied, and FIG. 2 is a block diagram showing a conventional debug device. 1 ... microcomputer, 2 ... memory, 4 ... comparison circuit, 5 ... address bus, 6 ... data bus, 7 ...
... Control bus, 8 ... Instruction decoder, 9 ... Storage circuit, 10
... Debug device control unit.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】プログラムを実行してプログラムの誤りを
訂正するデバッグ装置において、デバッグ対象となるマ
イクロコンピュータのサブルーチンコール時にスタック
領域に退避したリターンアドレスと前記サブルーチンコ
ール時に記憶回路に書き込まれたリターンアドレスとを
リターン時にリアルタイムに比較する比較回路を備えた
ことを特徴とするデバッグ装置のリターンアドレス監視
回路。
In a debugging apparatus for executing a program and correcting an error in the program, a return address saved in a stack area at the time of a subroutine call of a microcomputer to be debugged and a return address written in a storage circuit at the time of the subroutine call. A return address monitoring circuit for a debug device, comprising: a comparison circuit for comparing in real time upon return.
JP28361489A 1989-04-24 1989-04-24 Return address monitoring circuit of debug device Expired - Lifetime JP2754899B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28361489A JP2754899B2 (en) 1989-04-24 1989-04-24 Return address monitoring circuit of debug device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28361489A JP2754899B2 (en) 1989-04-24 1989-04-24 Return address monitoring circuit of debug device

Publications (2)

Publication Number Publication Date
JPH03223938A JPH03223938A (en) 1991-10-02
JP2754899B2 true JP2754899B2 (en) 1998-05-20

Family

ID=17667787

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28361489A Expired - Lifetime JP2754899B2 (en) 1989-04-24 1989-04-24 Return address monitoring circuit of debug device

Country Status (1)

Country Link
JP (1) JP2754899B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09179753A (en) * 1995-12-26 1997-07-11 Nec Software Ltd Stack information collecting system using timing of return processing

Also Published As

Publication number Publication date
JPH03223938A (en) 1991-10-02

Similar Documents

Publication Publication Date Title
EP0638864B1 (en) Development support system for microcomputer with internal cache
JP2754899B2 (en) Return address monitoring circuit of debug device
JPH0581087A (en) Processor monitoring system
JPS59112494A (en) Memory testing system
JP2684966B2 (en) I / O processor debug device
JPH05224985A (en) Microprogram controller
JP2978658B2 (en) Program development support device
JPH04284544A (en) Micro-controller
JP3013517B2 (en) Write buffer error address detection circuit
JPS59183443A (en) Debug device
JPS63196952A (en) Information processor
JPS6270947A (en) Control system for debug interruption
JPH01114945A (en) Tracing system for data processor
JP2000353109A (en) Emulator and emulation system
JPH04338842A (en) Information processor with error detecting function
JPH04310138A (en) Debugging method for data transmitter
JPH0573347A (en) Emulation device
JPS60225948A (en) Debugging device
JPS6286441A (en) Data trace system
JP2001265619A (en) Data tracing system
JPH02297225A (en) Microprocessor
JPS61292756A (en) Program debug auxiliary circuit
JPH0793180A (en) Microprocessor
JPH01114947A (en) Tracing system for data processor
JPH02242444A (en) Debugging mechanism for information processor