JPH05100902A - Debug support mechanism - Google Patents

Debug support mechanism

Info

Publication number
JPH05100902A
JPH05100902A JP3262053A JP26205391A JPH05100902A JP H05100902 A JPH05100902 A JP H05100902A JP 3262053 A JP3262053 A JP 3262053A JP 26205391 A JP26205391 A JP 26205391A JP H05100902 A JPH05100902 A JP H05100902A
Authority
JP
Japan
Prior art keywords
instruction
branch
area
trace
exception
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.)
Withdrawn
Application number
JP3262053A
Other languages
Japanese (ja)
Inventor
Rimiko Iwanaga
理美子 岩永
Teruhiko Ohara
輝彦 大原
Koichi Takeda
浩一 武田
Kenji Katou
研児 加藤
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP3262053A priority Critical patent/JPH05100902A/en
Publication of JPH05100902A publication Critical patent/JPH05100902A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the overhead by designating whether a branch trace is executed at every kind of branch instruction or not, and also, designating whether a condition is true or not, and moreover, executing the branch trace whose object is only an instruction of a specific area. CONSTITUTION:In a trace exception detecting circuit 30, a trace exception generating condition designating register 31 having a function as a branch trace designating means designates whether a branch trace is executed at every kind of instruction execution defined by a central processing unit 1 or not. Also, when the branch instruction is conditional, designation of the condition is also executed. Moreover, in an area deciding circuit 10, an area upper limit designating register 11 and an area lower limit designating register 12 having a function as an area designating means execute area designation for executing the branch trace whose object is only an instruction of a specific area. In such a way, tuning can be executed efficiently.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、中央処理装置(CP
U)で実行するプログラムのエラーの検出とそのエラー
の是正を支援するデバッグ支援機構に関するものであ
る。
BACKGROUND OF THE INVENTION The present invention relates to a central processing unit (CP
U) relates to a debug support mechanism that supports the detection of errors in the program executed and the correction of those errors.

【0002】[0002]

【従来の技術】従来、このような分野の技術としては、
例えば次のような文献に記載されるものがあった。 飯塚・田中 共著「ソフトウエア指向アーキテクチャ」
(1985)オーム社、P.205−216 前記文献に記載されているように、プログラムのデバッ
グ作業は、大きく2つの段階に分けることができる。プ
ログラムの論理的な動作を検証する論理デバッグと、チ
ューニング(高速化)である。これらを支援する機構と
して (a) 命令トレース機構 (b) ブレークポイント機構 (c) ブランチトレース機構 等が用いられている。
2. Description of the Related Art Conventionally, as a technique in such a field,
For example, some documents were described in the following documents. Iizuka and Tanaka, "Software Oriented Architecture"
(1985) Ohmsha, P. 205-216 As described in the above-mentioned document, the debugging work of a program can be roughly divided into two stages. They are logic debugging that verifies the logical operation of the program and tuning (speeding up). (A) Instruction trace mechanism (b) Breakpoint mechanism (c) Branch trace mechanism etc. are used as a mechanism for supporting these.

【0003】(a)は、機械命令を1つつづ実行して実
行時の情報を収集分析する方法であり、1命令毎に例外
を発生させることによって実現されていることが多い。 (b)は、プログラムの中断点(ブレークポイント)を
設定し、そこでプログラム実行を中断してその時点の状
態を調べたり、変更したりすることを可能とした方法で
ある。ブレークポイントアドレスを格納するレジスタを
用いた方式や、中断点の命令を別の命令に置き換えて例
外を発生させる方式が一般的である。 (c)は、分岐命令の履歴をとることにより、分岐判定
ミス、飛び先アドレスの指定ミス等のデバッグを支援す
るものである。ブランチトレースの実現方法としては、
ブランチ命令でブランチ成功時に例外を発生する機能を
設けたり、ブランチ系命令でブランチ成功時の命令アド
レスをレジスタに記憶しておき、異常を検出した時、プ
ログラムが読み出せたり、例外発生時に報告させたりす
る方法がある。
The method (a) is a method of executing machine instructions one by one and collecting and analyzing information at the time of execution, which is often realized by generating an exception for each instruction. The method (b) is a method in which a break point of a program is set, and the program execution is interrupted at that point so that the state at that time can be checked or changed. A method using a register for storing a breakpoint address and a method for generating an exception by replacing the instruction at the breakpoint with another instruction are general. (C) supports the debugging of branch determination mistakes, jump address designation mistakes, etc. by collecting the history of branch instructions. As a method of implementing branch trace,
A branch instruction has a function to generate an exception when a branch succeeds, or a branch instruction stores the instruction address when a branch succeeds in a register, and when an abnormality is detected, the program can be read or it is reported when an exception occurs. There is a way to do it.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、従来の
デバッグ支援機構では、次のような課題があった。プロ
グラムのチューニングを行う場合、プログラム実行のネ
ックとなるポイントを検出することが重要である。この
ネックポイント検出を支援する機構として、従来技術の
前記(a)〜(c)を適用した場合、次のような問題が
生じる。即ち、前記(a)では、1命令を実行する度に
ブレークするので、オーバーヘッド(必要動作時間)が
大きい。前記(b)では、複数のブレークポイントを設
定した場合、オーバーヘッドが大きくなる。さらに、前
記(c)では、CPUで定義されている全ての分岐命令
でブレークするため、オーバーヘッドが大きい。従っ
て、未だ技術的に充分満足のゆくデバッグ支援機構を提
供することが困難であった。
However, the conventional debug support mechanism has the following problems. When tuning a program, it is important to detect points that are the bottleneck of program execution. When the above-mentioned prior arts (a) to (c) are applied as a mechanism for supporting this neck point detection, the following problems occur. That is, in (a) above, since a break occurs each time one instruction is executed, the overhead (required operating time) is large. In (b) above, when a plurality of breakpoints are set, the overhead becomes large. Further, in (c) above, since all branch instructions defined in the CPU break, the overhead is large. Therefore, it is still difficult to provide a debugging support mechanism that is technically satisfactory.

【0005】本発明は、前記従来技術が持っていた課題
として、論理デバッグのチューニングを支援するための
従来のブランチトレース機構が持つ、オーバーヘッドが
大きいという点について解決したデバッグ支援機構を提
供するものである。
The present invention provides a debugging support mechanism that solves the problem of the conventional technique that the conventional branch trace mechanism for supporting the tuning of logic debug has a large overhead. is there.

【0006】[0006]

【課題を解決するための手段】本発明は、前記課題を解
決するために、CPUで実行するプログラムのエラーの
検出とそのエラーの是正を支援するデバッグ支援機構に
おいて、前記CPUで定義されている分岐命令の種類毎
にブランチトレースを行うか否かの指定を行い、該分岐
命令が条件付きのときにはその条件の真偽の指定も行う
ブランチトレース指定手段と、特定の領域の命令だけを
対象としたブランチトレースを行うための領域指定を行
う領域指定手段とを、備えている。
In order to solve the above-mentioned problems, the present invention is defined in the CPU in a debug support mechanism for supporting the detection of an error in a program executed by the CPU and the correction of the error. Branch trace specifying means for specifying whether or not to perform a branch trace for each kind of branch instruction, and also for specifying whether the condition is true or false when the branch instruction is conditional, and only the instruction in a specific area is targeted. Area specifying means for specifying an area for performing the branch trace.

【0007】[0007]

【作用】本発明によれば、以上のようにデバッグ支援機
構を構成したので、ブランチトレース指定手段では、C
PUで定義されている命令実行の種類毎にブランチトレ
ースを行うか否かの指定が行え、さらに分岐命令が条件
付きであるときには条件の指定も行える。また、領域指
定手段では、特定の領域の命令だけを対象としたブラン
チトレースを行うための領域指定が行え、それによって
チューニングの効率化が図れる。従って、前記課題を解
決できるのである。
According to the present invention, since the debug support mechanism is configured as described above, the branch trace designating means can use C
Whether or not branch trace is to be performed can be specified for each type of instruction execution defined in PU, and when the branch instruction is conditional, the condition can also be specified. Further, the area designating means can carry out area designation for performing the branch trace only for the instruction in the specific area, whereby the tuning efficiency can be improved. Therefore, the above problem can be solved.

【0008】[0008]

【実施例】図1は、本発明の実施例を示すデバッグ支援
機構の要部構成図である。このデバッグ支援機構は、C
PU1で実行するプログラムエラーの検出とそのエラー
の是正を支援するものであり、ブランチトレースを行う
領域の判定及び指定を行う領域判定回路10と、ブラン
チトレース等の種々の命令を解読する命令解読回路20
と、ブランチトレースを行うか否かの検出及び指定等を
行うトレース例外検出回路30とを、備えている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT FIG. 1 is a block diagram of the essential portions of a debug support mechanism showing an embodiment of the present invention. This debug support mechanism is C
An area determination circuit 10 for supporting the detection of a program error executed by the PU1 and the correction of the error and for determining and specifying an area for branch tracing, and an instruction decoding circuit for decoding various instructions such as branch tracing. 20
And a trace exception detection circuit 30 for detecting and designating whether or not to perform branch trace.

【0009】領域判定回路10は、ブランチトレースを
行う命令領域の上限を指定する32ビットの命令上限指
定レジスタ(UCAR)11と、ブランチトレースを行
う命令領域の下限を指定する32ビットの命令下限指定
レジスタ(LCAR)12と、プログラムカウンタ(P
C)13とを備えている。領域上限指定レジスタ11及
びプログラムカウンタ13は比較器14に接続され、さ
らに領域下限指定レジスタ12及びプログラムカウンタ
13が、比較器15に接続されている。各比較器14,
15の出力信号UPPER,LOWERは、トレース例
外検出回路30へ入力される。
The area determination circuit 10 includes a 32-bit instruction upper limit specification register (UCAR) 11 for specifying an upper limit of an instruction area for branch tracing, and a 32-bit instruction lower limit specification for specifying a lower limit of an instruction area for branch tracing. Register (LCAR) 12 and program counter (P
C) 13 and. The region upper limit designation register 11 and the program counter 13 are connected to the comparator 14, and the region lower limit designation register 12 and the program counter 13 are further connected to the comparator 15. Each comparator 14,
The output signals UPPER and LOWER of 15 are input to the trace exception detection circuit 30.

【0010】命令解読回路20は、CPU1で実行する
命令の解読を行い、その解読結果をトレース例外検出回
路30へ与える回路であり、実行中の命令を保持する命
令保持レジスタ(CODEREG)21と、該レジスタ
21の内容を解読して各種の制御信号INSTBR
A,INSTBRACC,INSTJMP,INS
JMPCC,INSTBSR,INSTRET
をトレース例外検出回路30へ与える命令解読器22と
で、構成されている。
The instruction decoding circuit 20 is a circuit for decoding an instruction executed by the CPU 1 and supplying the decoded result to the trace exception detection circuit 30, and an instruction holding register (CODEREG) 21 for holding the instruction being executed, The contents of the register 21 are decoded and various control signals INST -- BR
A, INST - BRACC, INST - JMP, INS
T - JMPCC, INST - BSR, INST - RET
To the trace exception detection circuit 30.

【0011】トレース例外検出回路30は、領域判定回
路10及び命令解読回路20の出力信号に基づき、命令
領域の検出及び指定を行う回路であり、トレース例外を
発生させる条件を指定する32ビットのトレース例外発
生条件指定レジスタ(TECR)31と、トレース例外
検出回路32とで、構成されている。トレース例外検出
回路32は、トレース例外発生条件指定レジスタ31、
領域判定回路10の出力、命令解読回路20の出力、及
び条件付き分岐命令における条件の真偽を示す制御信号
CCに基づき、トレース例外を発生させるか否かを決定
し、その決定結果に応じた信号TREXCPを出力する
回路である。
The trace exception detection circuit 30 is a circuit for detecting and designating an instruction region based on the output signals of the region judging circuit 10 and the instruction decoding circuit 20, and is a 32-bit trace designating a condition for generating a trace exception. An exception generation condition designation register (TECR) 31 and a trace exception detection circuit 32 are included. The trace exception detection circuit 32 includes a trace exception generation condition designation register 31,
Based on the output of the area determination circuit 10, the output of the instruction decoding circuit 20, and the control signal CC indicating the truth of the condition in the conditional branch instruction, it is determined whether or not to generate the trace exception, and according to the determination result. This is a circuit that outputs the signal TREXCP.

【0012】領域上限指定レジスタ11、領域下限指定
レジスタ12、及びトレース例外発生条件指定レジスタ
31は特種レジスタである。その内、領域上限指定レジ
スタ11及び領域下限指定レジスタ12は、領域指定レ
ジスタ、つまり領域指定手段としての機能を有してい
る。さらに、トレース例外発生条件指定レジスタ31
は、ブランチトレース指定手段としての機能を有してい
る。
The area upper limit designation register 11, the area lower limit designation register 12, and the trace exception occurrence condition designation register 31 are special registers. Among them, the area upper limit specifying register 11 and the area lower limit specifying register 12 have a function as an area specifying register, that is, an area specifying means. Furthermore, the trace exception generation condition designation register 31
Has a function as branch trace designating means.

【0013】次に、図1におけるデバッグ支援機構の動
作を、図2及び図3を参照しつつ説明する。図2は、C
PU1で定義されている分岐命令の一覧を示す図、及び
図3はトレース例外検出回路30の論理を示す図であ
る。図1のデバッグ支援機構は、例えば図2に示すよう
な分岐命令に対してそのデバッグを支援する機能を有し
ている。図2の分岐命令は、次のような内容である。
Next, the operation of the debug support mechanism in FIG. 1 will be described with reference to FIGS. FIG. 2 shows C
FIG. 3 is a diagram showing a list of branch instructions defined in PU1, and FIG. 3 is a diagram showing the logic of the trace exception detection circuit 30. The debugging support mechanism of FIG. 1 has a function of supporting the debugging of branch instructions as shown in FIG. 2, for example. The branch instruction of FIG. 2 has the following contents.

【0014】(i)は、プログラムカウンタ(PC)1
3からオフセットdで示されるアドレスに、無条件に分
岐する命令である。 (ii)は、指定した条件が成立した場合、プログラムカ
ウンタ(PC)13からオフセットdで示されるアドレ
スに、分岐する命令である。 (iii)は、jで示される絶対アドレスに無条件に分岐す
る命令である。 (iV)は、指定した条件が成立した場合、jで示される
絶対アドレスに分岐する命令である。 (v)は、プログラムカウンタ(PC)13からオフセ
ットdで示されるアドレスにあるサブルーチンに、ジャ
ンプする命令である。 (vi)は、サブルーチンからcaller(呼)側へ戻
る命令である。
(I) is a program counter (PC) 1
The instruction unconditionally branches from 3 to the address indicated by the offset d. (Ii) is an instruction for branching from the program counter (PC) 13 to the address indicated by the offset d when the specified condition is satisfied. (Iii) is an instruction that branches unconditionally to the absolute address indicated by j. (IV) is an instruction that branches to the absolute address indicated by j when the specified condition is satisfied. (V) is an instruction to jump from the program counter (PC) 13 to the subroutine at the address indicated by the offset d. (Vi) is an instruction to return from the subroutine to the caller side.

【0015】領域判定回路10において、プログラムカ
ウンタ13の値は、比較器14で領域上限指定レジスタ
11の内容と比較される。プログラムカウンタ13の値
が領域上限指定レジスタ11の値以下であれば、比較器
14の出力信号UPPERの値が1となる。さらに、プ
ログラムカウンタ13の値は比較器15で領域下限指定
レジスタ12の内容と比較される。プログラムカウンタ
13の値が領域下限指定レジスタ12の値以上であれ
ば、その比較器15の出力信号LOWERの値が1とな
る。なお、領域の指定を行う場合はLCAR<UCAR
となるようにする。これらの比較器14,15の出力信
号UPPER,LOWERは、トレース例外検出回路3
2へ与えられる。
In the area determination circuit 10, the value of the program counter 13 is compared with the contents of the area upper limit designation register 11 by the comparator 14. If the value of the program counter 13 is less than or equal to the value of the area upper limit designation register 11, the value of the output signal UPPER of the comparator 14 becomes 1. Further, the value of the program counter 13 is compared with the contents of the area lower limit designation register 12 by the comparator 15. If the value of the program counter 13 is greater than or equal to the value of the area lower limit designation register 12, the value of the output signal LOWER of the comparator 15 becomes 1. When specifying the area, LCAR <UCAR
So that The output signals UPPER and LOWER of these comparators 14 and 15 are output to the trace exception detection circuit 3
Given to 2.

【0016】命令解読回路20において、命令解読器2
2は、命令保持レジスタ21の内容を解読し、各種の制
御信号INSTBRA,INSTBRACC,IN
STJMP,INSTJMPCC,INSTBS
R,INSTRETをトレース例外検出回路32へ出
力する。即ち、 命令が無条件相対分岐命令である場合、INST
BRAを1にする。 命令が条件付き相対分岐命令である場合、INST
BRACCを1にする。 命令が無条件絶対分岐命令である場合、INST
JMPを1にする。 命令が条件付き絶対分岐命令である場合、INST
JMPCCを1にする。 命令がサブルーチン分岐命令である場合、INST
BSRを1にする。 命令がサブルーチン戻り命令である場合、INST
RETを1にする。 また、トレース例外検出回路30において、トレース例
外発生条件指定レジスタ31は、トレース例外検出回路
32に対してトレース例外を発生させる条件を指定す
る。このレジスタ31は、32ビットのレジスタであ
り、各ビットが次の(a)〜(i)のように割り当てら
れる。なお、9〜31ビットは未使用である。
In the instruction decoding circuit 20, the instruction decoder 2
2 decodes the contents of the instruction holding register 21 and various control signals INST - BRA, INST - BRACC, IN
ST - JMP, INST - JMPCC, INST - BS
R, INST - RET is output to the trace exception detection circuit 32. That is, when the instruction is a unconditional relative branch instruction, INST -
Set BRA to 1. INST if the instruction is a conditional relative branch instruction
- the BRACC to 1. If the instruction is an unconditional absolute branch instruction, INST -
Set JMP to 1. INST if the instruction is a conditional absolute branch instruction
- the JMPCC to 1. INST if the instruction is a subroutine branch instruction
- the BSR to 1. INST if the instruction is a subroutine return instruction
- the RET to 1. Further, in the trace exception detection circuit 30, the trace exception generation condition designation register 31 specifies a condition for causing the trace exception detection circuit 32 to generate a trace exception. The register 31 is a 32-bit register, and each bit is assigned as shown in (a) to (i) below. Note that 9 to 31 bits are unused.

【0017】(a)ビット0 1:無条件相対分岐命令を実行したときに例外を発生す
る。 0:無条件相対分岐命令を実行しても例外を発生させな
い。 (b)ビット1 1:条件付き相対分岐命令を実行し、かつ条件が真であ
ったときに例外を発生する。 0:条件付き相対分岐命令を実行し、かつ条件が真であ
っても例外を発生させない。 (c)ビット2 1:条件付き相対分岐命令を実行し、かつ条件が偽であ
ったときに例外を発生する。 0:条件付き相対分岐命令を実行し、かつ条件が偽であ
っても例外を発生させない。 (d)ビット3 1:無条件絶対分岐命令を実行したときに例外を発生す
る。 0:無条件絶対分岐命令を実行しても例外を発生させな
い。 (e)ビット4 1:条件付き絶対分岐命令を実行し、かつ条件が真であ
ったときに例外を発生する。 0:条件付き絶対分岐命令を実行し、かつ条件が真であ
っても例外を発生させない。 (f)ビット5 1:条件付き絶対分岐命令を実行し、かつ条件が偽であ
ったときに例外を発生する。 0:条件付き絶対分岐命令を実行し、かつ条件が偽であ
っても例外を発生させない。 (g)ビット6 1:サブルーチン分岐命令を実行したときに例外を発生
する。 0:サブルーチン分岐命令を実行しても例外を発生させ
ない。 (h)ビット7 1:サブルーチン戻り命令を実行したときに例外を発生
する。 0:サブルーチン戻り命令を実行しても例外を発生させ
ない。 (i)ビット8 1:領域指定を有効とする。 0:領域指定を無効とする。
(A) Bit 0 1: An exception is generated when an unconditional relative branch instruction is executed. 0: No exception is generated even if an unconditional relative branch instruction is executed. (B) Bit 1 1: A conditional relative branch instruction is executed, and an exception is generated when the condition is true. 0: A conditional relative branch instruction is executed, and an exception is not generated even if the condition is true. (C) Bit 2 1: A conditional relative branch instruction is executed, and an exception is generated when the condition is false. 0: A conditional relative branch instruction is executed, and no exception occurs even if the condition is false. (D) Bit 3 1: An exception is generated when an unconditional absolute branch instruction is executed. 0: No exception is generated even if an unconditional absolute branch instruction is executed. (E) Bit 4 1: The conditional absolute branch instruction is executed, and an exception is generated when the condition is true. 0: Executes a conditional absolute branch instruction and does not generate an exception even if the condition is true. (F) Bit 5 1: A conditional absolute branch instruction is executed, and an exception is generated when the condition is false. 0: The conditional absolute branch instruction is executed, and no exception is generated even if the condition is false. (G) Bit 6 1: An exception is generated when a subroutine branch instruction is executed. 0: No exception is generated even if a subroutine branch instruction is executed. (H) Bit 7 1: An exception is generated when a subroutine return instruction is executed. 0: No exception is generated even if a subroutine return instruction is executed. (I) Bit 8 1: The area designation is made valid. 0: The area designation is invalid.

【0018】なお、レジスタ31中のビット8はビット
0から7までの付加条件となる。例えば、ビット8とビ
ット0がセットされていた場合、例外発生の条件は“無
条件相対分岐命令を実行し”、かつ“その命令が領域下
限指定レジスタ12と領域上限指定レジスタ11で指定
された領域にあった”場合となる。
Bit 8 in the register 31 is an additional condition for bits 0 to 7. For example, when bit 8 and bit 0 are set, the condition for exception occurrence is "execute an unconditional relative branch instruction" and "the instruction is specified by the area lower limit designation register 12 and the area upper limit designation register 11. If it was in the area.

【0019】トレース例外検出回路32では、図3に示
す論理に従い、トレース例外発生条件指定レジスタ31
の8番目のビットが1の場合と0の場合とに場合分け
し、トレース例外を発生させるかどうかを決定し、その
決定結果の信号TREXCPを出力する。トレース例外
を発生させる場合は、信号TREXCPを1にする。こ
れにより、CPU1で定義されている分岐命令の内、必
要な分岐命令のみでブレークする。そのため、オーバー
ヘッドが小さくなる。
The trace exception detection circuit 32 follows the logic shown in FIG.
The 8th bit of 1 is divided into the case where it is 1 and the case where it is 0, it is determined whether or not to generate a trace exception, and the signal TREXCP of the determination result is output. The signal TREXCP is set to 1 to generate a trace exception. As a result, among the branch instructions defined by the CPU 1, only the necessary branch instruction breaks. Therefore, the overhead becomes small.

【0020】以上のように、本実施例のデバッグ支援機
構により、プログラムのチューニングを効率よく行うこ
とが可能である。その具体的な利点(1)〜(3)を、
図4及び図5を参照しつつ説明する。なお、図4はプロ
グラム例1を示すフローチャート、図5はプログラム例
2を示すフローチャートである。
As described above, the debugging support mechanism of this embodiment enables efficient program tuning. The specific advantages (1) to (3) are
This will be described with reference to FIGS. 4 and 5. 4 is a flowchart showing the program example 1, and FIG. 5 is a flowchart showing the program example 2.

【0021】(1) 領域指定ができることによる利点 図4に示すプログラム例1において、func −1,…,
unc −nは関数とする。このプログラム例1で関数f
unc −2をチューニングする場合を考える。関数f
unc −2の命令列がロードされている領域を、領域上限
指定レジスタ11及び領域下限指定レジスタ12からな
る領域指定レジスタで指定することにより、領域外(チ
ューニングの対象とする関数以外)でトレース例外が発
生することがなくなる。そのため、大変効率がよい。
(1) Advantages of being able to specify a region In the program example 1 shown in FIG. 4, func- 1, ...,
func- n is a function. In this program example 1, the function f
Consider the case of tuning unc- 2. Function f
By specifying the area in which the instruction string of unc- 2 is loaded with the area specification register consisting of the area upper limit specification register 11 and the area lower limit specification register 12, a trace exception occurs outside the area (other than the function to be tuned). Will not occur. Therefore, it is very efficient.

【0022】(2) 分岐命令の種類毎にトレース例外
の発生の可否を指定できるこによる利点 図5のプログラム例2は、ある条件が満足するときに処
理Aを行い、不満足のときに処理Bを行うフローチャー
トであるが、ここで処理Aをチューニングする場合を考
える。トレース例外発生条件指定レジスタ31により、
if文の条件が真であったときのみ例外が発生するよう
に指定すると、処理Bに制御が移った場合、トレース例
外が発生しないので、大変効率がよい。
(2) An advantage of being able to specify whether or not a trace exception is to be generated for each type of branch instruction In the program example 2 of FIG. Here, a case where the process A is tuned will be considered. By the trace exception occurrence condition specification register 31,
If an exception is specified to occur only when the condition of the if statement is true, a trace exception does not occur when the control is transferred to the process B, which is very efficient.

【0023】(3) その他の利点 トレース例外発生条件指定レジスタ31により、プログ
ラム例1でサブルーチン分岐命令の実行のときにだけト
レース例外が発生するようにすると、各関数f
unc −1,…,func −nの実行時間を最小のオーバー
ヘッドで測定できるので、チューニングの効率が上が
る。
(3) Other advantages When the trace exception generation condition designation register 31 is used to generate the trace exception only when the subroutine branch instruction is executed in the program example 1, each function f
Since the execution time of unc- 1, ..., Func- n can be measured with a minimum overhead, tuning efficiency is improved.

【0024】なお、本発明は、上記実施例に限定され
ず、種々の変形が可能である。例えば、図1において、
領域上限指定レジスタ11及び領域下限指定レジスタ1
2からなる領域指定レジスタを、他の構成の領域指定手
段で構成することも可能である。また、トレース例外発
生条件指定レジスタ31は、他の記憶手段を用いたブラ
ンチトレース指定手段で構成してもよい。さらに、デバ
ッグ支援効率を向上させるための機能ブロック等を図1
に設けてもよい。
The present invention is not limited to the above embodiment, and various modifications can be made. For example, in FIG.
Area upper limit specification register 11 and area lower limit specification register 1
It is also possible to configure the area designating register consisting of 2 by area designating means having another structure. Also, the trace exception occurrence condition designation register 31 may be configured by a branch trace designation means using another storage means. Furthermore, the functional blocks etc. for improving the debugging support efficiency are shown in FIG.
It may be provided in.

【0025】[0025]

【発明の効果】以上詳細に説明したように、本発明によ
れば、ブランチトレース指定手段及び領域指定手段を設
けたので、ブランチトレース手段により、分岐命令の種
類毎にブランチトレースを行うか否かの指定ができ、さ
らに分岐命令が条件付きであるときには条件の真偽の指
定も行える。その上、領域指定手段により、特定の領域
の命令だけを対象としたブランチトレースが行える。こ
れにより、ブレーク数が減少してオーバーヘッドが小さ
くなるばかりか、プログラムのチューニング効率がより
向上する。
As described in detail above, according to the present invention, since the branch trace designating means and the area designating means are provided, whether or not the branch tracing means performs branch tracing for each type of branch instruction. Can be specified, and if the branch instruction is conditional, the condition can be specified as true or false. In addition, the area designating means can perform branch trace only for instructions in a specific area. This not only reduces the number of breaks and reduces the overhead, but also improves the tuning efficiency of the program.

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

【図1】本発明の実施例を示すデバッグ支援機構の要部
構成図である。
FIG. 1 is a configuration diagram of a main part of a debug support mechanism showing an embodiment of the present invention.

【図2】CPUで定義されている分岐命令の一覧を示す
図である。
FIG. 2 is a diagram showing a list of branch instructions defined by a CPU.

【図3】トレース例外検出回路の論理を示す図である。FIG. 3 is a diagram showing a logic of a trace exception detection circuit.

【図4】プログラム例1を示すフローチャートである。FIG. 4 is a flowchart showing a program example 1.

【図5】プログラム例2を示すフローチャートである。FIG. 5 is a flowchart showing a second program example.

【符号の説明】[Explanation of symbols]

1 CPU 10 領域判定回路 11 領域上限指定レジスタ 12 領域下限指定レジスタ 20 命令解読回路 30 トレース例外検出回路 31 トレース例外発生条件指定レジスタ 32 トレース例外検出回路 1 CPU 10 Area Judgment Circuit 11 Area Upper Limit Designation Register 12 Area Lower Limit Designation Register 20 Instruction Decoding Circuit 30 Trace Exception Detection Circuit 31 Trace Exception Generation Condition Designation Register 32 Trace Exception Detection Circuit

フロントページの続き (72)発明者 加藤 研児 東京都港区虎ノ門1丁目7番12号 沖電気 工業株式会社内Front Page Continuation (72) Inventor Kenji Kato 1-7-12 Toranomon, Minato-ku, Tokyo Oki Electric Industry Co., Ltd.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 中央処理装置で実行するプログラムのエ
ラーの検出とそのエラーの是正を支援するデバッグ支援
機構において、 前記中央処理装置で定義されている分岐命令の種類毎に
ブランチトレースを行うか否かの指定を行い、該分岐命
令が条件付きのときにはその条件の真偽の指定も行うブ
ランチトレース指定手段と、 特定の領域の命令だけを対象としたブランチトレースを
行うための領域指定を行う領域指定手段とを、 備えたことを特徴とするデバッグ支援機構。
1. A debug support mechanism for assisting detection of an error in a program executed by a central processing unit and correction of the error, whether or not branch tracing is performed for each type of branch instruction defined in the central processing unit. Whether the branch instruction is conditional or not, the branch trace specifying means for specifying whether the condition is true or false, and the area for specifying the area for performing the branch trace only for the instruction in the specific area. A debugging support mechanism characterized by comprising a designating means.
JP3262053A 1991-10-09 1991-10-09 Debug support mechanism Withdrawn JPH05100902A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3262053A JPH05100902A (en) 1991-10-09 1991-10-09 Debug support mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3262053A JPH05100902A (en) 1991-10-09 1991-10-09 Debug support mechanism

Publications (1)

Publication Number Publication Date
JPH05100902A true JPH05100902A (en) 1993-04-23

Family

ID=17370382

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3262053A Withdrawn JPH05100902A (en) 1991-10-09 1991-10-09 Debug support mechanism

Country Status (1)

Country Link
JP (1) JPH05100902A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5901283A (en) * 1996-09-04 1999-05-04 Mitsubishi Electric Semiconductor Software Co., Ltd Microcomputer
JP2012190137A (en) * 2011-03-09 2012-10-04 Lapis Semiconductor Co Ltd Emulator device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5901283A (en) * 1996-09-04 1999-05-04 Mitsubishi Electric Semiconductor Software Co., Ltd Microcomputer
JP2012190137A (en) * 2011-03-09 2012-10-04 Lapis Semiconductor Co Ltd Emulator device

Similar Documents

Publication Publication Date Title
US5386565A (en) Method and system for controlling/monitoring computer system having plural operating systems to run thereon
US5142679A (en) Method and apparatus for collecting execution status data of structured program
JP2005317023A (en) Breakpoint logic unit, debug logic, and breakpoint method for data processing apparatus
US7620802B2 (en) Instruction execution device, debugging method, debugging device, and debugging program
US6611909B1 (en) Method and apparatus for dynamically translating program instructions to microcode instructions
US7376820B2 (en) Information processing unit, and exception processing method for specific application-purpose operation instruction
US6654877B1 (en) System and method for selectively executing computer code
CN115576608A (en) Processor core, processor, chip, control equipment and instruction fusion method
JPH05100902A (en) Debug support mechanism
US20060041788A1 (en) Protecting code from breakpoints
US20050050524A1 (en) Generating software test information
US20030084272A1 (en) Handling problematic events in a data processing apparatus
JP2525492B2 (en) Programmable controller
US7631166B1 (en) Processing instruction without operand by inferring related operation and operand address from previous instruction for extended precision computation
EP0569987A1 (en) Microprocessor incorporating cache memory enabling efficient debugging
JP2581565B2 (en) Data processing device that executes guarded instructions
JP2646957B2 (en) Microprocessor with built-in cache and its trace system
JP3068578B2 (en) In-circuit emulator and saturation calculation processing method
JPH05100896A (en) Debugging support mechanism
JP2021144426A (en) Processor and error detection method
JPH01231126A (en) Information processor
JPH06202907A (en) Debug support device
JPH0535499A (en) Data processing device and method
JPH0760386B2 (en) Data processing device having branch prediction function
JPH0991167A (en) Instruction detector

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990107