JPH01184551A - System for debugging program - Google Patents
System for debugging programInfo
- Publication number
- JPH01184551A JPH01184551A JP63008649A JP864988A JPH01184551A JP H01184551 A JPH01184551 A JP H01184551A JP 63008649 A JP63008649 A JP 63008649A JP 864988 A JP864988 A JP 864988A JP H01184551 A JPH01184551 A JP H01184551A
- Authority
- JP
- Japan
- Prior art keywords
- data
- register
- program
- address
- instruction
- 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
Links
- 238000000034 method Methods 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 6
- 230000002950 deficient Effects 0.000 abstract description 8
- 238000012360 testing method Methods 0.000 abstract description 2
- 238000012544 monitoring process Methods 0.000 abstract 1
- 230000000694 effects Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000006378 damage Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 241000277269 Oncorhynchus masou Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- PCHJSUWPFVWCPO-UHFFFAOYSA-N gold Chemical compound [Au] PCHJSUWPFVWCPO-UHFFFAOYSA-N 0.000 description 1
- 239000010931 gold Substances 0.000 description 1
- 229910052737 gold Inorganic materials 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
この発明はマイクロプロセッサ等におけるプログラムの
デバッギング方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for debugging programs in microprocessors and the like.
一般に電子計算機におけるプログラムの品質不良により
記憶装置内のデータワーキングエリアのデータが破壊さ
れることがある。このようなプログラムの不良箇所を特
定するために従来では、基本単位毎のマイクロプログラ
ムを起動させて、その実行時に参照のために読み出され
る所定のデータが、該マイクロプログラムの実行前と後
において一致しているかどうかを調べて、プログラムの
良不良を判定している。Generally, data in a data working area in a storage device may be destroyed due to poor quality of a program in a computer. Conventionally, in order to identify such a defective part of a program, a microprogram for each basic unit is activated, and predetermined data read for reference during execution is the same before and after execution of the microprogram. The program is checked to determine whether the program is good or bad.
従来この種の装置として第3図に示すものがあった0図
において、1はコンソール、Pはマイクロプロセッサが
行う一連の処理の軌跡、2は制御演算を行うマイクロプ
ロセッサ、3はマイクロプロセッサ2のメモリ、4はn
番地に置かれている命令であって、opコードおよびO
pランドで構成されているデバッグされるマイクロプロ
グラム、5はfi+1番地に置かれているインタラプト
命令で、これを実行すると、マイクロプロセッサ2内部
でインタラプトが発生し、メモリ上のあらかじめ決めら
れている番地へ強制的にジャンプさすものである。6は
デバッグモニターであって、メモリ3の内容、マイクロ
プロセッサ2の内容をコンソール1へ報告又は、コンソ
ールよりメモリ3へ表示し、若しくはマイクロプロセッ
サ2の内容を書き変えができるもので、ソフトウェアイ
ンタラプト命令5実行後ここへマイクロプロセッサ2の
実行が移されるものである。7はデータの操作エリアで
読み書きが可能である。Conventionally, there was a device of this type as shown in FIG. 3. In FIG. Memory, 4 is n
The instruction located at the address, including the op code and
In the microprogram to be debugged consisting of p-land, 5 is an interrupt instruction placed at address fi+1. When this is executed, an interrupt occurs inside the microprocessor 2, and a predetermined address on the memory is This will force a jump to. 6 is a debug monitor that can report the contents of the memory 3 and the contents of the microprocessor 2 to the console 1, display it from the console to the memory 3, or rewrite the contents of the microprocessor 2, and can receive software interrupt commands. 5, the execution of the microprocessor 2 is transferred here. 7 is a data operation area that can be read and written.
次に動作について説明する。まずコンソールlからメモ
リ3のfi+1番地にインタラプト命令5 。Next, the operation will be explained. First, interrupt command 5 is sent from console 1 to memory 3 at address fi+1.
をキー人力して書込む。その後、マイクロプロセッサ2
を観測される命令4から動作開始する様コンソールlよ
り指示を行う。するとマイクロプロセッサ2は、命令4
のopコードをフェッチ解析し、これに従いopランド
部のデータ参照アドレスの指定に基づいたデータワーキ
ングエリア7の特定の番地に置かれているデータを利用
することが可能である。n番地の命令4を実行すること
によりデータワーキングエリア7が破壊されるかどうか
を観測する。n番地命令4実行後、(n+1番地のイン
タラプト命令が実行されて、予め定めた番地の)デバッ
グモニタープログラム6ヘマイクロプロセツサ2を強制
的にその制御を移行させる。Write the key manually. Then microprocessor 2
An instruction is given from the console l to start the operation from instruction 4, which is observed. Then microprocessor 2 executes instruction 4
It is possible to fetch and analyze the op code of and use the data located at a specific address in the data working area 7 based on the designation of the data reference address in the op land section. It is observed whether the data working area 7 is destroyed by executing the instruction 4 at address n. After execution of the instruction 4 at address n, the microprocessor 2 forcibly transfers control to the debug monitor program 6 (at a predetermined address after the interrupt instruction at address n+1 is executed).
n番地命令4が、データワーキングエリア7で引き起し
たかもしれない不意なデータ破壊状況を、デバッグモニ
タープログラム6の指示に基づいて、データワーキング
エリア7のダウンプリスト及びマイクロプロセッサ2の
各種レジスタリストをコンソールlへ報告することで、
データ破壊箇所の追求が一命令づつ検証される。The down list of the data working area 7 and the various register lists of the microprocessor 2 are analyzed based on the instructions of the debug monitor program 6 to detect the unexpected data destruction situation that the n address instruction 4 may have caused in the data working area 7. By reporting to the console,
In pursuit of data corruption locations, each command is verified one by one.
従来のマイクロプロセッサ装置は以上の様に構成されて
いるので、巨大なプログラムの場合どこのどの命令によ
り、ワーキングエリアのデータが不意に破壊されている
かを発見するには、巨大なプログラムの全ての命令を一
つづつ実行し、そのたび、ワーキングエリアの所定のデ
ータを調べて確認しなければならないため、この種のデ
バッグ方法には、多大な労力と時間が必要であるなどの
問題点があった。Conventional microprocessor devices are configured as described above, so in the case of a huge program, in order to find out which instruction has accidentally destroyed the data in the working area, it is necessary to check all the instructions in the huge program. This type of debugging method has problems such as requiring a great deal of effort and time, as each instruction must be executed one by one and predetermined data in the working area must be examined and verified each time. Ta.
この発明は、上記の様な問題点を解消するためになされ
たもので、不良箇所がプログラムのどこの部分、若しく
はどのマイクロ命令かを瞬時に検索し、得た情報をモニ
ター等外界へ報告し、マイクロプロセッサのプログラム
開発、評価および試験環境の一層の向上を計ることが可
能なデバッグ方式を得ることを目的としている。This invention was made in order to solve the above-mentioned problems, and it instantly searches which part of the program or which microinstruction the defective part is in, and reports the obtained information to the outside world such as a monitor. The purpose of this study is to obtain a debugging method that can further improve microprocessor program development, evaluation, and testing environments.
(課題を解決するための手段〕
この発明においては、メモリ3上から所定番地のデータ
22をプロセッサ2の旧レジスタエリア24.25に移
し、プロセッサ2上で複数の単位プログラムからなるデ
バッグ対象のプログラムを実行させて、単位プログラム
が処理のため所定番地21のデータ22を参照したら、
該単位プログラム処理後の該当データを新レジスタエリ
ア27に移し、旧レジスタエリア25からのデータ22
と新レジスタエリア27からのデータとを比較器28で
比較し、この比較結果に基づきインタラプト制御器29
によりプログラムの実行を中止させ、単位プログラムを
入出力装置1に出力する。(Means for Solving the Problems) In the present invention, the data 22 at a predetermined location on the memory 3 is moved to the old register area 24.25 of the processor 2, and the program to be debugged consisting of a plurality of unit programs is transferred on the processor 2. When the unit program refers to the data 22 at the predetermined location 21 for processing,
The corresponding data after the unit program processing is moved to the new register area 27, and the data 22 from the old register area 25 is transferred to the new register area 27.
The comparator 28 compares the data from the new register area 27 with the data from the new register area 27, and based on the comparison result, the interrupt controller 29
The execution of the program is stopped and the unit program is output to the input/output device 1.
プログラムに不良箇所の単位プログラムがあれば、所定
番地21のデータ22が破壊され書き変えられることに
なる。単位プログラム処理後のデータと元のデータ22
とを比較して、異常があれば比較器28により検出する
。そしてインタラプト制御器29の出力により入出力装
置のコンソールl上に不良の単位プログラムを表示して
不良箇所を限定する。これにより復旧が即ちに行なわれ
る。If there is a defective unit program in the program, the data 22 at the predetermined location 21 will be destroyed and rewritten. Data after unit program processing and original data 22
The comparator 28 detects any abnormality. Then, the defective unit program is displayed on the console l of the input/output device by the output of the interrupt controller 29 to limit the defective location. Restoration is thereby performed immediately.
以下、この発明の一実施例を図面を参照して説明する。 An embodiment of the present invention will be described below with reference to the drawings.
第1図において、1は入出力装置のコンソール、2はマ
イクロプロセッサ、3は主記憶装置のメモリである。メ
モリ3内にはデバッグモニタープログラム6、データワ
ーキングエリア7及びアドレスエリア21が設けられて
いる。In FIG. 1, 1 is a console of an input/output device, 2 is a microprocessor, and 3 is a main memory. A debug monitor program 6, a data working area 7, and an address area 21 are provided within the memory 3.
アドレスエリア2工にはモニターされる番地の値が格納
される。この値はデータワーキングエリア7の特定番地
、例えば16進数のX″FEED”である、デバッグモ
ニタープログラム6はメモリ3の内容やプログラムの各
命令をコンソールlへ報告し表示させたり、逆にコンソ
ール1よりメモリ3やマイクロプロセッサ2にデータや
命令をキー人力するものである。Address area 2 stores the value of the address to be monitored. This value is a specific address in the data working area 7, for example X"FEED" in hexadecimal.The debug monitor program 6 reports the contents of the memory 3 and each command of the program to the console l for display, It is for manually inputting data and instructions to the memory 3 and microprocessor 2.
マイクロプロセッサ2内には以下の各種レジスタ23〜
27が設けられている。23はマイクロプロセッサ2の
プログラムステータスワード(PSW)でフラグレジス
タ、24はデバッグアドレスレジスタで、アドレス用の
旧レジスタでモニターされるデータのアドレス例えばX
”FEED”を格納する。25はオールド旧レジスタで
、プログラム実行前のアドレスX“FEED”上のデー
タ値′″CAFE″22を格納する。26はアドレスレ
ジスタで、アドレス用の新レジスタで現在マイクロプロ
セッサ2がメモリ3を利用している時のアドレスを格納
する。27は二ニー(新)データレジスタで、プログラ
ム実行後のアドレスX″FEED”上のデータ、場合に
よっては書き変えられた、若しくは同一のデータ値“C
AFE”22を格納する。28は比較器で各レジスタ2
3〜27の内容が与えられて論理成立を決めるロジック
回路で構成される。29はインタラプト制御器で比較器
28の出力で起動され、インタラプトが発生しプログラ
ムはデバッグモニタープログラム6ヘジヤンプするよう
になっている。The microprocessor 2 has the following various registers 23 to
27 are provided. 23 is the program status word (PSW) of the microprocessor 2 and is a flag register, 24 is a debug address register, and the address of the data monitored in the old address register, for example,
Store “FEED”. Reference numeral 25 denotes an old register which stores the data value ``CAFE'' 22 at address X ``FEED'' before program execution. Reference numeral 26 denotes an address register, which is a new register for addresses and stores the address when the microprocessor 2 is currently using the memory 3. 27 is a second (new) data register that stores the data at address X"FEED" after program execution, or the same data value "C
AFE" 22 is stored. 28 is a comparator and each register 2
It is composed of a logic circuit that determines whether the logic holds true based on the contents of numbers 3 to 27. An interrupt controller 29 is activated by the output of the comparator 28, and when an interrupt occurs, the program jumps to the debug monitor program 6.
又マイクロプロセッサ2には実行されるデバッグ対象の
プログラムのステップ毎の命令や処理の途中結果をその
都度格納するワーキングレジスタ30を備えている。The microprocessor 2 also includes a working register 30 that stores instructions and intermediate results of processing for each step of the program to be debugged.
次に動作について説明する。Next, the operation will be explained.
まずコンソール1を操作して、メモリ3上のアドレスエ
リア21に、ワーキングエリア7中の例えばアドレスX
“FEED”を書き込み、マイクロプロセッサ2にはデ
バッグモード移行を指示する。すると、マイクロプロセ
ッサ2はフラグレジスタ23にデバッグモードを示すフ
ラグlを立て、メモリ3上のアドレスエリアに格納され
ているFEED”をデバッグアドレスレジスタ24へ転
記し、メモリ3からFEED番地のデータCAFE22
をオールドデータレジスタ25へ転記する。これが済め
ば、あとは通常の運転と同様に、コンソールからの指令
により任意の番地よりデバッグされるプログラムを走ら
せる。First, operate the console 1 to input address X in the working area 7 to the address area 21 on the memory 3.
"FEED" is written to instruct the microprocessor 2 to shift to debug mode. Then, the microprocessor 2 sets a flag l indicating the debug mode in the flag register 23, transfers "FEED" stored in the address area on the memory 3 to the debug address register 24, and transfers the data CAFE22 at the FEED address from the memory 3.
is transferred to the old data register 25. Once this is done, the program to be debugged can be run from any address using commands from the console, just like normal operation.
デバッグ対象のプログラムを構成する各ステップの命令
やマイクロ(単位)プログラムがマイクロプロセッサ2
上で実行される。そしてそれらのうちの命令にはメモリ
3上のアドレス“FEED″にあるデータ′″CAFE
″を参照するものがあり、その実行の前・後にデータ″
CAFE″が破壊されたかどうかを、データ“CAFE
″を比較器28でモニターすることにより各命令プログ
ラムの良、不良を判断する。The instructions and micro (unit) programs of each step that make up the program to be debugged are processed by the microprocessor 2.
executed on. Among these instructions, the data ``CAFE'' at address ``FEED'' on memory 3 is
There is something that refers to ″, and the data ″ before and after its execution.
The data “CAFE” indicates whether or not the “CAFE” has been destroyed.
'' by the comparator 28, it is determined whether each instruction program is good or bad.
金板りに、アドレスX“FEED″のデータ“CAFE
”22を破壊して書変えている命令に出くわした場合、
アドレスレジスタ26とデバッグアドレスレジスタ24
とは、それぞれ内容が同一であるから論理が成立し、ま
た、この命令実行前のデータを格納しているオールドデ
ータレジスタ25と、この命令実行後のデータを格納す
るニエーデータレジスタ27とは、それぞれ内容が異な
るから、論理が成立し、また、PSW23がデバッグモ
ード実行中であることを知らせているため、比較器28
中のランダムロジックにより、インタラプト制御器29
へ異常発生の報告が上がる。On the gold plate, the data “CAFE” for address X “FEED”
``If you come across an order that destroys and rewrites 22,
Address register 26 and debug address register 24
The logic holds true because their contents are the same, and the old data register 25 that stores the data before this instruction is executed and the new data register 27 that stores the data after this instruction is executed. , since the contents are different, the logic is established, and since the PSW 23 is informing that the debug mode is being executed, the comparator 28
The random logic in the interrupt controller 29
A report of an abnormal occurrence is raised.
インクラブド要求されたマイクロプロセッサ2はデバッ
グモニタ6ヘジヤンプしマイクロプロセッサ2内部の各
レジスタ23〜30の内容をコンソールlへ報告するこ
とにより、特に実行中の不良ステップ命令、その途中結
果等がワーキングレジスタ30に記録されており、その
内容をコンソールl上で見ることができる。かくして“
良”とされたステップの命令はどんどん実行消化され、
“不良”命令のみが検出されて、コンソール1に表示さ
れていくことになる。The microprocessor 2 that has been requested to include jumps to the debug monitor 6 and reports the contents of each register 23 to 30 inside the microprocessor 2 to the console 1. In particular, the defective step instruction being executed, its intermediate results, etc. are reported to the working register 30. The contents are recorded on the console and can be viewed on the console. Thus “
The commands of the steps that are judged as “good” are executed and digested rapidly.
Only “bad” instructions will be detected and displayed on the console 1.
なお、上記の実施例はハードウェア中心の実現方法であ
ったが第2図の様に一部機能をソフトウェアに担当させ
、ハードウェアの機能を筒略化できる。In addition, although the above-mentioned embodiment was an implementation method centered on hardware, it is possible to simplify the functions of the hardware by assigning some functions to software as shown in FIG.
マイクロプロセッサにはデバッグモードだけ意味を持つ
コード、例えばX“FEED’″をデータとしてフェッ
チした場合、データレジスタ31に格納され、PSW、
23内の処理後のデータとの比較によりマイクロプロセ
ッサにインタラプトを要求し、デバッグモニタープログ
ラム6からコンソール1に対して報告が可能で上記実施
例と同様の効果を奏する。When the microprocessor fetches a code that has meaning only in debug mode, for example, X "FEED'" as data, it is stored in the data register 31 and the PSW,
By comparison with the processed data in 23, an interrupt is requested to the microprocessor, and the debug monitor program 6 can report to the console 1, producing the same effect as the above embodiment.
以上説明してきたように、この発明によれば、メモリ上
から所定番地のデータをプロセッサの旧レジスタエリア
に移し、プロセッサ上で複数の単位プログラムからなる
デバッグ対象のプログラムを実行させて、単位プログラ
ムが処理のため所定番地のデータを参照したら、該単位
プログラム処理後の該当データを新レジスタエリアに移
し、旧レジスタエリアからのデータと新レジスタエリア
からのデータとを比較器で比較し、この比較結果に基づ
きインクラット制御器によりプログラムの実行を中止さ
せ、単位プログラムを入出力装置に出力するようにして
、不良箇所の単位プログラムを限定できるようになった
。これにより、プログラム品質不良が引起すデータワー
キングエリア破壊原因を瞬時に検索でき今までのデバッ
グを著しく向上せしむる効果がある。As explained above, according to the present invention, data at a predetermined location on memory is moved to the old register area of the processor, and a program to be debugged consisting of a plurality of unit programs is executed on the processor. After referring to the data at a predetermined location for processing, move the corresponding data after processing the unit program to a new register area, compare the data from the old register area with the data from the new register area using a comparator, and compare the results of this comparison. Based on this, the execution of the program is stopped by the incrat controller and the unit program is output to the input/output device, making it possible to limit the unit program at the defective location. As a result, the cause of data working area destruction caused by poor program quality can be instantly searched for, which has the effect of significantly improving conventional debugging.
第1図は本発明のプログラムのデバッギング方式が適用
されるマイクロプロセッサの一例のレジスタ構成図、第
2図は本発明の他の例のマイクロプロセッサの構成図、
第3図は従来のデバッギング方式のメモリ構成図である
。
l・・・コンソール、2・・・マイクロプロセッサ、3
・・・メモリ、7・・・ワーキングエリア、21・・・
アドレスエリア、23・・・フラグレジスタ、24.2
5・・・旧レジスタ、26゜27・・・新レジスタ、2
8・・・比較器、29・・・インクラブド制御器、30
・・・ワーキングレジスタ。
代理人 大 岩 増 m<ほか2名)1色1図
本、t’gl、nマイクロッ・口ぜ・ソT第2回FIG. 1 is a register configuration diagram of an example of a microprocessor to which the program debugging method of the present invention is applied, and FIG. 2 is a configuration diagram of another example of a microprocessor of the present invention.
FIG. 3 is a memory configuration diagram of a conventional debugging method. l...Console, 2...Microprocessor, 3
...Memory, 7...Working area, 21...
Address area, 23...Flag register, 24.2
5... Old register, 26° 27... New register, 2
8...Comparator, 29...Included controller, 30
...working register. Agent Masu Oiwa m<and 2 others) 1 color 1 illustration Book, t'gl, nmicrokkuchize, sot 2nd edition
Claims (1)
タエリアに移し、前記プロセッサ上で複数の単位プログ
ラムからなるデバッグ対象のプログラムを実行させて、
前記単位プログラムが処理のため前記所定番地のデータ
を参照したら、該単位プログラム処理後の該当データを
新レジスタエリアに移し、前記旧レジスタエリアからの
データと前記新レジスタエリアからのデータとを比較器
で比較し、この比較結果に基づきインタラプト制御器に
より前記プログラムの実行を中止させ、前記単位プログ
ラムを入出力装置に出力するようにしたプログラムのデ
バッギング方式。Move data at a predetermined location from memory to an old register area of a processor, run a program to be debugged consisting of a plurality of unit programs on the processor,
When the unit program refers to the data at the predetermined location for processing, the corresponding data after processing of the unit program is moved to a new register area, and a comparator compares the data from the old register area and the data from the new register area. A debugging method for a program, in which execution of the program is stopped by an interrupt controller based on the comparison result, and the unit program is output to an input/output device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63008649A JPH01184551A (en) | 1988-01-19 | 1988-01-19 | System for debugging program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63008649A JPH01184551A (en) | 1988-01-19 | 1988-01-19 | System for debugging program |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH01184551A true JPH01184551A (en) | 1989-07-24 |
Family
ID=11698790
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63008649A Pending JPH01184551A (en) | 1988-01-19 | 1988-01-19 | System for debugging program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH01184551A (en) |
-
1988
- 1988-01-19 JP JP63008649A patent/JPH01184551A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101019209B1 (en) | Device of automatically extracting Interface of Embedded Software and Method thereof | |
US20080148238A1 (en) | Runtime Analysis of a Computer Program to Identify Improper Memory Accesses that Cause Further Problems | |
JPS5851292B2 (en) | Diagnosis/debug calculation system | |
EP0111952A2 (en) | Verification of a processor architecture having a partial instruction set | |
US8612720B2 (en) | System and method for implementing data breakpoints | |
US5280626A (en) | Multi-process emulator suitable for testing software under multi-process environments | |
JPH02294739A (en) | Fault detecting system | |
US6141635A (en) | Method of diagnosing faults in an emulated computer system via a heterogeneous diagnostic program | |
JP2009223714A (en) | Arithmetic circuit and failure analysis method of arithmetic circuit | |
JPH01184551A (en) | System for debugging program | |
JP3315266B2 (en) | Self-diagnosis status display method | |
JP2684966B2 (en) | I / O processor debug device | |
JP2550686B2 (en) | Information processing device | |
JP2002116926A (en) | Program processor and program processing method | |
JPH03294934A (en) | Debugger for high level program lenguage | |
JP2967741B2 (en) | CPU compatibility test equipment | |
JPH0830485A (en) | Debugging device | |
JPH07248935A (en) | Method and device for testing information processor | |
JPS6146535A (en) | Pseudo error setting control system | |
JPH05173829A (en) | Error generating method | |
JPS6091458A (en) | Program debug device of microprocessor | |
JPH04307636A (en) | Program test system | |
JPH11191072A (en) | Debug break processing method and debug processor | |
JPH04149746A (en) | Debug device | |
Sedman | Testing and diagnostic aids für real-time programming |