JPH0148564B2 - - Google Patents
Info
- Publication number
- JPH0148564B2 JPH0148564B2 JP58029159A JP2915983A JPH0148564B2 JP H0148564 B2 JPH0148564 B2 JP H0148564B2 JP 58029159 A JP58029159 A JP 58029159A JP 2915983 A JP2915983 A JP 2915983A JP H0148564 B2 JPH0148564 B2 JP H0148564B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- debug
- interrupt
- program
- address
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
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)
Description
【発明の詳細な説明】
〔発明の利用分野〕
本発明は、情報処理装置におけるプログラムの
デバグのため、プログラムの実行中にデバグ割込
みを発生する方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to a method for generating a debug interrupt during program execution in order to debug a program in an information processing device.
従来、プログラムのデバグには、デバグされる
被デバグプログラムから、デバグを制御するプロ
グラム(以下DUと称す)に制御を移行(以下デ
イレールと称す)させ、デイレール時点における
被デバグプログラムの状態をDUで調べる方法等
がとられてきた。すなわち、被デバグプログラム
が第1図aのごとく、その一部が命令1〜5から
成り、命令1,4,5は2バイト長の命令、命令
2,3は4バイト長の命令であり、命令3の実行
直前にデイレール点を設定する場合には、第1図
bのごとく、再コンパイルによつて命令3の前に
DUへの分岐命令6を埋め込む方法や、第1図c
のごとく第1図aの命令3をDUの作業域7に退
避した後に、命令3の先頭を未定義の命令8に置
き替え、プログラムエラーによる割込みでDUに
制御を移す方法があつた。しかし、前者の方法
は、デバグ完了後、再コンパイルによつてDUへ
の分岐命令を除去しなければならず、また、後者
の方法は、DUの制御下で作業域7に退避した命
令3を実行後、命令4に制御を戻すために命令4
のアドレスをDUが管理しなければならない欠点
があつた。
Conventionally, when debugging a program, control is transferred (hereinafter referred to as dayrail) from the debugged program to be debugged to a program that controls debugging (hereinafter referred to as DU), and the state of the debugged program at the time of the dayrail is transferred to the DU. Methods of investigation have been taken. That is, as shown in FIG. 1a, a part of the debugged program consists of instructions 1 to 5, where instructions 1, 4, and 5 are 2-byte long instructions, and instructions 2 and 3 are 4-byte long instructions. If you want to set the dayrail point immediately before the execution of instruction 3, as shown in Figure 1b, set the dayrail point before instruction 3 by recompiling.
How to embed branch instruction 6 into DU and Figure 1c
There was a method of saving instruction 3 in Figure 1a to the work area 7 of DU, replacing the beginning of instruction 3 with undefined instruction 8, and transferring control to DU by an interrupt caused by a program error. However, in the former method, the branch instruction to DU must be removed by recompilation after debugging is completed, and in the latter method, the instruction 3 saved to the work area 7 under the control of DU must be removed. After execution, to return control to instruction 4,
The disadvantage was that the DU had to manage the addresses.
本発明は、上記従来の欠点を除去するため、特
定のコードを持つデバグ割込み発生用の命令(以
下、DI命令と称す)により、該DI命令が通常状
態で発生される場合は、該命令によるオペレーシ
ヨンを行わずその直後にある命令を実行し、DI
命令がデバグ状態で発行される場合は、デバグ割
込みを発生し、該割込みに伴つてメモリに格納さ
れる命令アドレスは、該DI命令のアドレスに該
命令の所定フイールドの内容を加算することによ
つて得るようにしたものである。
In order to eliminate the above-mentioned conventional drawbacks, the present invention provides an instruction for generating a debug interrupt (hereinafter referred to as a DI instruction) having a specific code. Executes the instruction immediately after without performing any operation, and executes DI.
When an instruction is issued in a debug state, a debug interrupt is generated, and the instruction address stored in memory in response to the interrupt is determined by adding the contents of a predetermined field of the instruction to the address of the DI instruction. It was designed so that it could be obtained easily.
第2図はDI命令の形式を例示したものである。
第2図において、9はDI命令、10はDI命令の
命令コードフイールド(以下、Fフイールドと称
す)、11は次に実行される命令のアドレス生成
に利用される第1のフイールド(以下、R1フイ
ールドと称す)、12は割込みコードの作成に利
用される第2のフイールド(以下、R2フイール
ドと称す)である。以下、本DI命令の長さは2
バイトであるとする。
FIG. 2 shows an example of the format of the DI command.
In FIG. 2, 9 is the DI instruction, 10 is the instruction code field of the DI instruction (hereinafter referred to as the F field), and 11 is the first field (hereinafter referred to as R1) used to generate the address of the next instruction to be executed. 12 is a second field (hereinafter referred to as R2 field) used for creating an interrupt code. Below, the length of this DI command is 2
Suppose it is a part-time job.
第3図に本発明によるデバグ割込み方式の処理
フローを示す。以下の説明において、デバグ状態
であるか通常状態であるかを表示するビツトおよ
び次に実行すべき命令のアドレス(以下SCCと称
す)は、情報処理装置内のプログラム状態語(以
下、PSWと称す)と呼ばれるレジスタに保持さ
れているものとする。 FIG. 3 shows a processing flow of the debug interrupt method according to the present invention. In the following explanation, the bit indicating whether the program is in a debug state or a normal state and the address of the next instruction to be executed (hereinafter referred to as SCC) are referred to as the program status word (hereinafter referred to as PSW) in the information processing device. ) is held in a register called
いま、PSWのSCCで指定されたアドレスに第
2図のDI命令9が存在しており、情報処理装置
(いわゆるCPU)が読出された該命令のFフイー
ルド10を解読してDI命令であることを検出し
た時、PSWが通常状態を表示していれば、DI命
令の命令長(本例では2)をSCCに加算してDI
命令の実行を終える(→→)。これにより、
DI命令は一般にノーオペレーシヨン(NOP)命
令と呼ばれる命令と同様に何らプログラムの論理
に関与せずに終了し、DI命令の2バイトあとに
ある次の命令が実行される。 Now, the DI instruction 9 in Figure 2 exists at the address specified by the SCC of the PSW, and the information processing device (so-called CPU) decodes the F field 10 of the read instruction and determines that it is a DI instruction. When PSW is detected, if the PSW is displaying the normal state, add the instruction length of the DI instruction (2 in this example) to the SCC and
Finishes execution of the instruction (→→). This results in
The DI instruction, like an instruction generally called a no-operation (NOP) instruction, ends without any involvement in the logic of the program, and the next instruction two bytes after the DI instruction is executed.
一方、PSWのSCCで指定されたアドレスにDI
命令9が存在し、情報処理装置がFフイールドを
解読してDI命令であることを検出した時、PSW
がデバグ状態を表示していれば、情報処理装置は
そのSCCにDI命令9のR1フイールド11の値を
加算した値でPSW内のSCCを更新してデバグ割
込み信号を発生する(→→→)。この割
込みに伴なつて、公知の例に従つて、更新後の
SCCを含むPSWの内容は、所定のメモリアドレ
スに旧PSWとして格納される()。 On the other hand, DI is sent to the address specified by SCC of PSW.
When instruction 9 exists and the information processing device decodes the F field and detects that it is a DI instruction, the PSW
If the debug status is displayed, the information processing device updates the SCC in the PSW with the value obtained by adding the value of R1 field 11 of DI instruction 9 to that SCC and generates a debug interrupt signal (→→→) . Along with this interrupt, the updated
The contents of the PSW including the SCC are stored as the old PSW at a predetermined memory address ().
R1フイールドの値をDI命令自身の命令長であ
る2としたDI命令は、従来行われてきた第1図
bのデバグ方法において分岐命令6の代りに使用
することができる。この場合、デバグ状態で被デ
バグプログラムを実行させると、命令6の位置に
あるDI命令を実行するとデバグ割込みが発生す
る。このとき旧PSWとして格納された内容には、
DI命令のアドレス+2番地にある命令3のアド
レスが含まれている。割込みに伴ない、PSWに
はDUの入口アドレスを含む新しいPSWがロード
され()、DUに制御が移行し、DUでは被デバ
グプログラムの命令2の実行後で、かつ命令3の
実行前の状態を解析することができる()。そ
の後、DUはデバグ割込みに伴つて格納された旧
PSWをPSWにロードすることにより、被デバグ
プログラムの命令3に制御を戻すことができる
()。なお、この方法を用いたデバグでは、デバ
グ完了後、DI命令を除去するために再コンパイ
ルを行う必要はなく、通常状態下で、第1図aの
プログラムと同一の結果を得ることができる。 The DI instruction whose R1 field value is 2, which is the instruction length of the DI instruction itself, can be used in place of the branch instruction 6 in the conventional debugging method shown in FIG. 1b. In this case, when the debugged program is executed in a debug state, a debug interrupt occurs when the DI instruction at the instruction 6 position is executed. At this time, the contents stored as the old PSW include:
Contains the address of instruction 3 at address +2 of the DI instruction. Along with the interrupt, a new PSW containing the entrance address of the DU is loaded into the PSW (), control is transferred to the DU, and the state of the debugged program after execution of instruction 2 and before execution of instruction 3 is transferred to the DU. can be parsed(). After that, the DU is the old file stored with the debug interrupt.
By loading the PSW into the PSW, control can be returned to instruction 3 of the debugged program (). Note that in debugging using this method, there is no need to recompile to remove the DI instruction after debugging is completed, and the same result as the program in FIG. 1a can be obtained under normal conditions.
従来行われてきた第1図cのデバグ方法に対し
ては、未定義の命令8の代りに、命令3の命令長
(本例では4)をR1フイールドの値としたDI命令
を用いることができる。この場合も、デバグ状態
で命令8の位置にあるDI命令を実行すると、デ
バグ割込みが発生し、旧PSWが格納される
()。このとき旧PSWとして格納された内容に
は、DI命令のアドレス+4番地にある命令4の
アドレスが含まれている。割込みによつてDUに
制御が移行すると()、DUは被デバグプログ
ラムの命令2の実行後で、かつ命令3の実行前の
状態を解析する()。解析後はDUはDUの作業
域7に退避された命令3を実行し()、デバグ
割込みに伴つて格納された旧PSWをPSWにロー
ドすることにより、被デバグプログラムの命令4
に制御を戻すことができる()。命令4のアド
レスはDI命令により生成され旧PSWの一部とし
て格納されているためDUは命令4のアドレスを
管理する必要がない。 For the conventional debugging method shown in Figure 1c, it is possible to use a DI instruction with the instruction length of instruction 3 (4 in this example) as the value of the R1 field instead of undefined instruction 8. can. In this case as well, when the DI instruction at instruction 8 is executed in the debug state, a debug interrupt occurs and the old PSW is stored (). The contents stored as the old PSW at this time include the address of instruction 4 located at address +4 of the DI instruction. When control is transferred to DU due to an interrupt (), DU analyzes the state of the program to be debugged after execution of instruction 2 and before execution of instruction 3 (). After analysis, the DU executes the instruction 3 saved in the work area 7 of the DU (), and loads the old PSW stored with the debug interrupt into the PSW to execute the instruction 4 of the debugged program.
You can return control to (). Since the address of instruction 4 is generated by the DI instruction and stored as part of the old PSW, DU does not need to manage the address of instruction 4.
なお、DI命令のR2フイールドはそのまま、あ
るいはR2フイールドで指定するレジスタの内容
をデバグ割込みに伴つてメモリに格納される割込
みコードとして使用することによつて、DUはデ
イレールの種別等を割込みコードから判定するこ
とが可能である。さらに、R2フイールドの値が
特定の値(例えば0)のときには、デバグ状態に
おいてもDI命令によるデバグ割込みを禁止する
ことによつて、被デバグプログラム内に埋め込ま
れた複数のDI命令のうち一部のR2フイールドを
0とすることにより、デイレール点として不活性
化する手法としても用いることができる。 In addition, by using the R2 field of the DI instruction as is, or by using the contents of the register specified by the R2 field as the interrupt code stored in memory with the debug interrupt, DU can determine the type of day rail etc. from the interrupt code. It is possible to determine. Furthermore, when the value of the R2 field is a specific value (for example, 0), by disabling debug interrupts by DI instructions even in the debug state, some of the multiple DI instructions embedded in the debugged program can be disabled. By setting the R2 field of 0 to 0, it can also be used as a method of inactivating it as a day rail point.
以上説明したように、本発明によればDI命令
のR1フイールドは、DUから被デバグプログラム
へ制御を戻す際の命令アドレスをデイレールの時
点で旧PSWに設定しておく手段を提供しており、
DUの負担を軽減する効果がある。さらに、DI命
令を目的プログラムの生成時にあらかじめ埋め込
んだデバグ方法を採つた場合、デバグ終了後、被
デバグプログラムを再コンパイルすることなく使
用できる利点がある。
As explained above, according to the present invention, the R1 field of the DI instruction provides a means for setting the instruction address when returning control from the DU to the debugged program in the old PSW at the time of day rail.
This has the effect of reducing the burden on DU. Furthermore, if a debugging method is adopted in which DI instructions are embedded in advance when the target program is generated, there is an advantage that the program to be debugged can be used without recompiling after debugging is completed.
第1図a,b,cは従来のデバグ方法を説明す
る図、第2図はDI命令の形式例を示す図、第3
図は本発明によるデバグ割込み方式の処理フロー
図である。
1〜6,8……命令、7……デバグ制御プログ
ラムの作業域、9……DI命令。
Figures 1a, b, and c are diagrams explaining the conventional debugging method, Figure 2 is a diagram showing an example of the format of a DI instruction, and Figure 3 is a diagram explaining the conventional debugging method.
The figure is a processing flow diagram of the debug interrupt method according to the present invention. 1 to 6, 8...Instruction, 7...Work area of debug control program, 9...DI instruction.
Claims (1)
式であつて、プログラムの実行中にデバグ割込み
が発生し得るデバグ状態であるか、デバグ割込み
が発生しない通常状態であるかを表示するビツト
を情報処理装置内のプログラム制御可能なレジス
タに保持しておき、特定の命令コードを持つ命令
が通常状態で発行されると、該命令によるオペレ
ーシヨンを行わずに、該命令の直後にある命令を
実行し、前記特定の命令コードを持つ命令がデバ
グ状態で発行されると、デバグ割込みを発生し、
該割込みに伴つてメモリに格納される命令アドレ
スは該命令のアドレスに該命令の所定のフイール
ドの内容を加算することによつて得ることを特徴
とするデバグ割込み方式。1 A debug interrupt method for program debugging that uses a bit in the information processing device to indicate whether the program is in a debug state in which a debug interrupt can occur during program execution or in a normal state in which no debug interrupts can occur. When an instruction with a specific instruction code is issued in the normal state, the instruction immediately following the instruction is executed without performing the operation based on the instruction, and the When an instruction with a specific instruction code is issued in debug state, a debug interrupt is generated and
A debug interrupt method characterized in that an instruction address stored in a memory in response to the interrupt is obtained by adding the content of a predetermined field of the instruction to the address of the instruction.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP58029159A JPS59154553A (en) | 1983-02-23 | 1983-02-23 | Debugging interruption system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP58029159A JPS59154553A (en) | 1983-02-23 | 1983-02-23 | Debugging interruption system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS59154553A JPS59154553A (en) | 1984-09-03 |
| JPH0148564B2 true JPH0148564B2 (en) | 1989-10-19 |
Family
ID=12268478
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP58029159A Granted JPS59154553A (en) | 1983-02-23 | 1983-02-23 | Debugging interruption system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS59154553A (en) |
-
1983
- 1983-02-23 JP JP58029159A patent/JPS59154553A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS59154553A (en) | 1984-09-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0537309B1 (en) | System and method for preserving source instruction atomicity in translated program code | |
| US6308318B2 (en) | Method and apparatus for handling asynchronous exceptions in a dynamic translation system | |
| US5404466A (en) | Apparatus and method to set and reset a pipeline instruction execution control unit for sequential execution of an instruction interval | |
| JPH0810437B2 (en) | Guest execution control method for virtual machine system | |
| JP2922723B2 (en) | Information processing device | |
| JPH0148564B2 (en) | ||
| JP3183228B2 (en) | Program debugging device and debugging method | |
| JP2562838B2 (en) | Processor and store buffer control method | |
| JP2002351695A (en) | Program debugging method, debugging device, and recording medium for program debugging | |
| JPH08320813A (en) | Program simulator device and program debugging method | |
| JP3130798B2 (en) | Bus transfer device | |
| JPH02181236A (en) | Debug device | |
| JPH05108404A (en) | Debugger system | |
| JP2686801B2 (en) | Microcomputer program development tool | |
| JPS63178343A (en) | System for setting interrupting point | |
| JPH0250494B2 (en) | ||
| JPS63228237A (en) | Program debugging system | |
| JPS59202548A (en) | Debugging device | |
| JP2002014844A (en) | Debugging method and recording medium | |
| JPH0259829A (en) | Microcomputer | |
| JPS61233838A (en) | Information processor | |
| JPH04199336A (en) | microcomputer | |
| JPS6231434A (en) | Control system for instruction address | |
| JPH04186442A (en) | Brake point setting system | |
| JPH0772874B2 (en) | Interrupt receiving device |