JPH01251142A - Program trace system - Google Patents

Program trace system

Info

Publication number
JPH01251142A
JPH01251142A JP63076617A JP7661788A JPH01251142A JP H01251142 A JPH01251142 A JP H01251142A JP 63076617 A JP63076617 A JP 63076617A JP 7661788 A JP7661788 A JP 7661788A JP H01251142 A JPH01251142 A JP H01251142A
Authority
JP
Japan
Prior art keywords
trace
address
instruction
program
conditions
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
JP63076617A
Other languages
Japanese (ja)
Inventor
Eiji Ishibashi
石橋 英次
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP63076617A priority Critical patent/JPH01251142A/en
Publication of JPH01251142A publication Critical patent/JPH01251142A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To omit the rewriting of an address instruction and to reduce an OS load by setting all addresses showing the trace points at an address matching means and at the same time deciding the conditions via firmware based on a trace condition list. CONSTITUTION:An address matching register means 11 is provided for setting some addresses showing the trace points. Then a trace condition list is provided for setting the trace conditions for each address set at the means 11. An instruction address to be executed is compared with those addresses set at the means 11 for detection of the arrival at a trace pointer. In this case, the corresponding trace conditions are taken out of the trace condition list via the firmware processing. Then the conditions are decided. Based on the result of this decision, a trace interruption is produced to the OS.

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) この発明は、プログラム内 ースするのに好適なプログラムトレース方式に関する。[Detailed description of the invention] [Purpose of the invention] (Industrial application field) This invention Concerning a program tracing method suitable for tracing.

(従来の技術) プログラムの動作を動的にトレースしようとする場合、
従来はまず該当するプログラム内のトレースポイントと
する番地の命令(元の命令)を特別な命令に置換えると
共に元の命令を所定の領域に退避しておき、この状態で
トレースポイントにおいて特別な命令を実行したときに
割込みを発生させ、オペレーティングシステム(O8)
内でトレース情報を収集した後、退避しておいた元の命
令を実行し、割込み元に復帰させる処理を行っていた。
(Prior art) When trying to dynamically trace the behavior of a program,
Conventionally, the instruction (original instruction) at the address to be set as a trace point in the relevant program is first replaced with a special instruction, and the original instruction is saved in a predetermined area.In this state, the special instruction is replaced at the trace point. Generates an interrupt when executing the operating system (O8)
After collecting trace information within the program, the original instruction that had been saved was executed to return to the interrupt source.

また、トレースするか否かの各種条件の判定も全て割込
みが発生した後にO8内で(ソフトウェア処理で)行っ
ていた。
Further, all determinations of various conditions for whether or not to trace are performed within the O8 (by software processing) after an interrupt occurs.

このようなプログラムトレース方式では、次のような問
題があった。
This program tracing method has the following problems.

■トレースポイントとする番地(の命令語)に制約があ
り、任意のロケーションにトレースポイントを設定でき
ない。例えば間接指定の命令語が置かれる番地をトレー
スポイントとすることはできない。
■There are restrictions on the address (command word) that can be used as a trace point, and it is not possible to set a trace point at an arbitrary location. For example, the address where an indirect instruction instruction word is placed cannot be used as a trace point.

■トレースポイントとする番地に新たに設定された特別
な命令を実行するとO8への割込みが発生し、結果的に
トレースが不要となる場合にも割込み先のO8で各種の
トレース条件判定が必ず行われるため、処理のオーバヘ
ッドが増す。
■When a special instruction newly set at the address set as a trace point is executed, an interrupt to O8 occurs, and even if tracing becomes unnecessary as a result, various trace condition judgments are always performed at the interrupt destination O8. This increases processing overhead.

■特別の命令に置換えてトレース処理を挿入することか
らタイミングがずれ、トレースの目的が達せられなくな
ることがある。
(2) Inserting trace processing in place of a special instruction may result in a timing shift, making it impossible to achieve the purpose of tracing.

■トレースポイントの元の命令を実行するためには、命
令をシングルステップで実行させるという特別な手続き
を必要とする。
■In order to execute the original instruction at the trace point, a special procedure is required to execute the instruction in a single step.

(発明が解決しようとする課題) 上記したように従来のプログラムトレース方式では、ト
レースポイントの設定箇所に制約があり、またトレース
ポイントに達すると無条件でO8に割込みが入ってしま
うため、所望のプログラムトレースが効率的に行えない
という問題があった。
(Problems to be Solved by the Invention) As mentioned above, in the conventional program trace method, there are restrictions on where trace points can be set, and when a trace point is reached, an interrupt is unconditionally inserted into O8. There was a problem that program tracing could not be performed efficiently.

したがってこの発明は、トレースポイントの設定が何の
制約も受けずに且つ命令の書換えを要せずに行え、しか
もトレース処理に伴うO3(オペレーティングシステム
)のオーバヘッドの減少が図れるようにすることを解決
すべき課題とする。
Therefore, this invention solves the problem of making it possible to set trace points without any restrictions and without rewriting instructions, and to reduce O3 (operating system) overhead associated with trace processing. This is an issue that should be addressed.

[発明の構成コ (課題を解決するための手段) この発明は、トレースポイントを示す幾つがのアドレス
を設定するためのアドレスマツチレジスタ手段を設け、
このアドレスマツチレジスタ手段に設定された各アドレ
ス別にトレース条件が設定されるトレース条件リストと
を設け、次に実行すべき命令番地とアドレスマツチ手段
に設定された幾つかのアドレスとを比較することによっ
てトレースポイントへの到達を検出し、この到達検出時
にはファームウェア処理によってトレース条件リストか
ら対応するトレース条件を取出して条件判定を行い、こ
の判定結果に応じてO8にトレース割込みを発生するよ
うにしたことを特徴とする。
[Configuration of the Invention (Means for Solving the Problems) This invention provides address match register means for setting a number of addresses indicating trace points,
By providing a trace condition list in which trace conditions are set for each address set in this address match register means, and comparing the instruction address to be executed next with several addresses set in the address match means. The arrival at a trace point is detected, and when this arrival is detected, the corresponding trace condition is extracted from the trace condition list by firmware processing, the condition is judged, and a trace interrupt is generated in O8 according to the result of this judgment. Features.

(作用) 上記の構成によれば、トレースポイントを設定するには
、トレースポイントとしようとするアドレスの全てをア
ドレスマツチ手段に設定しておくだけでよく、該当アド
レスの命令を書換える必要がない。また、トレースポイ
ントに達すると、トレース条件リストに従う条件判定が
ファームウェア処理で行われ、条件成立時のみO8への
トレース割込みが発生するので、O8の負担が減少する
(Function) According to the above configuration, in order to set a trace point, it is only necessary to set all the addresses to be set as trace points in the address matching means, and there is no need to rewrite the instruction at the corresponding address. . Furthermore, when a trace point is reached, a condition determination according to the trace condition list is performed by firmware processing, and a trace interrupt to O8 is generated only when the condition is satisfied, so that the burden on O8 is reduced.

(実施例) 第1図はこの発明を適用する計算機システムの一実施例
を示すブロックtR成図である。同図において、llは
トレースポイントとする幾つかのアドレスを設定するた
めのレジスタ群を有するアドレスマツチレジスタ部(以
下、AMRと称する)、12は実行中プログラムの状態
を示すプログラムステータスワード(以下、PSWと称
する)である。
(Embodiment) FIG. 1 is a block tR diagram showing an embodiment of a computer system to which the present invention is applied. In the figure, 11 is an address match register unit (hereinafter referred to as AMR) having a group of registers for setting several addresses to be used as trace points, and 12 is a program status word (hereinafter referred to as AMR) indicating the status of the program being executed. (referred to as PSW).

PSW12には、実行中プログラムがトレース対象プロ
グラムであるか否かを指示するためのトレース指示ビッ
トTRCが割当てられている。13は次に実行すべき命
令の番地を示すネクストロケーションカウンタ(以下、
NLOCと称する)、14はPSW12内のトレース指
示ビットTRCが真値の場合にN L OC13の示す
命令番地とA M R11に設定されている幾つかのア
ドレスとを比較することにより、トレースポイントに到
達したか否かを判定するための比較回路である。
A trace instruction bit TRC is assigned to the PSW 12 to indicate whether the program being executed is a program to be traced. 13 is a next location counter (hereinafter referred to as
(referred to as NLOC), 14 indicates a trace point by comparing the instruction address indicated by NLOC13 and some addresses set in AMR11 when the trace instruction bit TRC in PSW12 is a true value. This is a comparison circuit for determining whether or not the target point has been reached.

15はA M R11の各レジスタに対応して用意され
、対応レジスタに設定されたトレースポイントのトレー
ス条件(を示す情報)の設定に供される情報域を有する
トレース条件リスト(以下、TCLと称する)、1Bは
T CL 15の先頭位置を指示するためのトレース条
件リストポインタ(以下、TCLPと称する)である。
15 is a trace condition list (hereinafter referred to as TCL) that is prepared corresponding to each register of AMR11 and has an information area used for setting (information indicating) trace conditions of trace points set in the corresponding registers. ), 1B is a trace condition list pointer (hereinafter referred to as TCLP) for indicating the starting position of T CL 15.

T CL 15およびT CL P 1Bは例えば主記
憶上に置かれ、特にT CL P 1Gは主記憶上の所
定位置に置かれる。
T CL P 15 and T CL P 1B are placed, for example, on the main memory, and in particular, T CL P 1G is placed at a predetermined position on the main memory.

17はO3(オペレーティングシステム)、18は比較
回路14によってトレースポイントに到達したことが判
定された時、TCL15を参照してトレース条件の判定
を行い、この判定結果に応じてOS 17へのトレース
割込みを発生するマイクロプロセッサである。
17 is an O3 (operating system), and 18 is an O3 (operating system) which, when it is determined by the comparison circuit 14 that a trace point has been reached, determines the trace condition by referring to the TCL 15, and according to the result of this determination, a trace interrupt is issued to the OS 17. It is a microprocessor that generates

次に第1図の構成の動作を説明する。まず、トレース対
象プログラムの実行に際して、トレースポイントとする
幾つかのアドレスがA M R11内のレジスタにセッ
トされる。また、A M R11内のレジスタにセット
した各トレースポイントに対するトレース条件(トレー
ス割込み条件)が、そのレジスタ番号に対応するTCL
15内情報域にセットされ、その先頭アドレスがTCL
Pl[iにセットされる。以上のセット動作は、ソフト
ウェアの指示に従ってタスク単位に行われるもので、例
えばタスクをディスバッチするときにPSW情報のセッ
ト動作と共に行われる。
Next, the operation of the configuration shown in FIG. 1 will be explained. First, when a program to be traced is executed, several addresses to be used as trace points are set in registers in the AMR 11. In addition, the trace conditions (trace interrupt conditions) for each trace point set in the register in AMR11 are set in the TCL corresponding to that register number.
15 internal information area, and its first address is TCL.
Set to Pl[i. The above setting operation is performed on a task-by-task basis according to instructions from the software, and is performed together with the PSW information setting operation when disbatching a task, for example.

さて、以上のセット動作が行われると、トレース対象プ
ログラムの実行開始時に、PSW12のトレース指示ビ
ットTRCが真値(ここでは“1”)となるようにセッ
トされる。このトレース指示ビットTRcは比較回路■
4に供給される。
Now, when the above setting operation is performed, the trace instruction bit TRC of the PSW 12 is set to the true value (here, "1") at the start of execution of the program to be traced. This trace instruction bit TRc is a comparison circuit.
4.

比較回路14は、PSW12のトレース指示ビットTR
Cが真値(“1”)の期間、即ちトレース対象プログラ
ムが実行状態にある期間、N L OC13の示す次に
実行すべき命令の番地とA M R11に設定されてい
る幾つかのアドレスとをそれぞれ比較する。そして比較
回路14は、N L OC13の示す命令番地に一致す
るアドレスがA M R11内に存在した場合には、N
 L OC13の示す命令番地がトレースポイントであ
るものと判断しマイクロプロセッサ18に対する割込み
を発生する。この割込みに際し、比較回路14は命令番
地に一致するアドレスがセットされていたA M R1
1内レジスタのレジスタ番号をマイクロプロセッサ18
に与える。
The comparison circuit 14 detects the trace instruction bit TR of the PSW12.
During the period when C is the true value (“1”), that is, the period when the trace target program is in the execution state, the address of the next instruction to be executed indicated by NLOC13 and some addresses set in AMR11 are Compare each. Then, the comparison circuit 14 compares the instruction address of N L OC13 with the instruction address indicated by N
It determines that the instruction address indicated by LOC 13 is a trace point and generates an interrupt to microprocessor 18. At the time of this interrupt, the comparator circuit 14 reads AMR1, which had been set to an address that matches the instruction address.
The register number of register 1 in microprocessor 18
give to

マイクロプロセッサ18は比較回路14からの割込みが
発生すると、該当番地の命令を実行した後に、TCLP
l6によって先頭アドレスが指定されるT CL 15
内の情報域のうち、OS 17から与えられたレジスタ
番号に対応する情報域にセットされているトレース条件
(トレース条件情報)を取出してチエツクし、トレース
条件が成立しているか否かを判定する。この判定は、例
えばPSW12の他、図示せぬ主記憶、各種レジスタ等
の内容の比較によって行われる。
When an interrupt from the comparison circuit 14 occurs, the microprocessor 18 executes the instruction at the corresponding address, and then executes the TCLP.
TCL 15 where the start address is specified by l6
Out of the information areas within, the trace conditions (trace condition information) set in the information area corresponding to the register number given by the OS 17 are retrieved and checked to determine whether the trace conditions are met. . This determination is made, for example, by comparing the contents of the main memory, various registers, etc. (not shown) in addition to the PSW 12.

マイクロプロセッサ18はトレース条件のチエツクによ
り条件成立を判定すると、OS 17に対するトレース
割込みを発生する。これにより、0817はトレース条
件成立を認識し、トレース情報の収集を行う。これに対
してトレース条件不成立を判定した場合には、マイクロ
プロセッサ18は0S17に対するトレース割込み発生
を控え、命令処理を続行する。
When the microprocessor 18 checks the trace condition and determines that the condition is met, it generates a trace interrupt to the OS 17. As a result, 0817 recognizes that the trace condition is met and collects trace information. On the other hand, if it is determined that the trace condition is not satisfied, the microprocessor 18 refrains from generating a trace interrupt for 0S17 and continues the instruction processing.

[発明の効果] 以上詳述したようにこの発明によれば、次に列挙する作
用効果を奏することができる・。
[Effects of the Invention] As detailed above, according to the present invention, the following effects can be achieved.

■トレースポイントを設定するには、トレースポイント
としようとするアドレスの全てをアドレスマツチ手段に
設定しておくだけでよく、設定箇所に同等制約がなく、
該当ポイントの命令書換えも不要である。
■To set a trace point, all you need to do is set all the addresses you want to use as trace points in the address matching means, and there are no equivalence restrictions on the setting locations.
There is no need to rewrite the instruction at the relevant point.

■トレース条件の判定がO5(オペレーティングシステ
ム)から独立にファームウェア処理によって行われ、条
件成立の場合だけO8へのトレース割込みが発生するの
で、O8における不要なトレース処理が減少しO8のオ
ーバヘッドが軽減する。
■Trace condition determination is performed by firmware processing independently from O5 (operating system), and a trace interrupt to O8 occurs only when the condition is met, reducing unnecessary trace processing in O8 and reducing O8 overhead. .

■従来とは異なり特別の命令に書換えてトレース処理を
挿入するのではないため、トレース処理に起因するタイ
ミングのずれが極力防止できる。
- Unlike the conventional method, trace processing is not inserted by rewriting a special instruction, so timing deviations caused by trace processing can be prevented as much as possible.

■トレースポイントの元の命令を実行するための特殊な
操作が不要となる。
■No special operations are required to execute the original instruction at the trace point.

■プログラムステータスワード(psw)中に実行中プ
ログラムがトレース対象プログラムであるか否かを指示
するトレース指示ビットを設けた場合には、トレースポ
イントをタスク毎に設定することができる。
(2) If a trace instruction bit is provided in the program status word (psw) to indicate whether the program being executed is a program to be traced, a trace point can be set for each task.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図はこの発明の一実施例に係るブロック構成図であ
る。 11・・・アドレスマツチレジスタ部(AMR)、12
・・・プログラムステータスワード(PSW)、13・
・・ネクストロケーションカウンタ(N L OC)、
14・・・比較回路、15・・・トレース条件リスト 
゛(TCL)、17・・・オペレーティングシステム(
OS)、18・・・マイクロプロセッサ、TRC・・・
トレース指示ビット。 出願人代理人  弁理士 鈴江武彦 ]1;1 フ ]p
FIG. 1 is a block diagram of an embodiment of the present invention. 11...Address match register section (AMR), 12
...Program status word (PSW), 13.
...Next location counter (NLOC),
14... Comparison circuit, 15... Trace condition list
゛(TCL), 17...Operating system (
OS), 18...Microprocessor, TRC...
Trace indication bit. Applicant's agent Patent attorney Takehiko Suzue]1;1 F]p

Claims (2)

【特許請求の範囲】[Claims] (1)トレースポイントを示す幾つかのアドレスを設定
するためのアドレスマッチレジスタ手段と、このアドレ
スマッチレジスタ手段に設定された各アドレス別にトレ
ース条件が設定されるトレース条件リストと、次に実行
すべき命令番地が上記トレースポイントであるか否かを
判定するために上記命令番地と上記アドレスマッチレジ
スタ手段に設定された各アドレスとを比較する比較手段
と、この比較手段の比較により上記トレースポイントに
到達したことが検出された場合に上記トレース条件リス
トから対応するトレース条件を取出して条件判定を行い
、この判定結果に応じてオペレーティングシステムにト
レース割込みを発生するファームウェア手段とを具備し
、上記ファームウェア手段からのトレース割込みに応じ
てトレース情報の収集を行うようにしたことを特徴とす
るプログラムトレース方式。
(1) Address match register means for setting several addresses indicating trace points, a trace condition list in which trace conditions are set for each address set in this address match register means, and a trace condition list to be executed next. a comparison means for comparing the instruction address with each address set in the address match register means in order to determine whether the instruction address is the trace point; and a comparison between the comparison means to reach the trace point. firmware means for extracting a corresponding trace condition from the trace condition list and making a condition determination, and generating a trace interrupt to the operating system according to the determination result; A program tracing method characterized in that trace information is collected in response to a trace interrupt.
(2)実行中プログラムがトレース対象プログラムであ
るか否かを指示するトレース指示ビットをプログラムス
テータスワード中に設け、上記トレース指示ビットが真
値の場合だけ上記比較手段の比較結果が有効となること
を特徴とする特許請求の範囲第1請求項記載のプログラ
ムトレース方式。
(2) A trace instruction bit is provided in the program status word to indicate whether the program being executed is a program to be traced, and the comparison result of the comparison means is valid only when the trace instruction bit is a true value. A program tracing method according to claim 1, characterized in that:
JP63076617A 1988-03-31 1988-03-31 Program trace system Pending JPH01251142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63076617A JPH01251142A (en) 1988-03-31 1988-03-31 Program trace system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63076617A JPH01251142A (en) 1988-03-31 1988-03-31 Program trace system

Publications (1)

Publication Number Publication Date
JPH01251142A true JPH01251142A (en) 1989-10-06

Family

ID=13610312

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63076617A Pending JPH01251142A (en) 1988-03-31 1988-03-31 Program trace system

Country Status (1)

Country Link
JP (1) JPH01251142A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07271608A (en) * 1994-03-30 1995-10-20 Nec Corp Interruption generating circuit
JP2013531292A (en) * 2010-06-28 2013-08-01 インテル・コーポレーション Replay architecture execution with probeless trace collection

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07271608A (en) * 1994-03-30 1995-10-20 Nec Corp Interruption generating circuit
JP2013531292A (en) * 2010-06-28 2013-08-01 インテル・コーポレーション Replay architecture execution with probeless trace collection
US8924788B2 (en) 2010-06-28 2014-12-30 Intel Corporation Replaying architectural execution with a probeless trace capture

Similar Documents

Publication Publication Date Title
JPH0454255B2 (en)
US4839895A (en) Early failure detection system for multiprocessor system
EP0098172B1 (en) Register control processing system
US20060053350A1 (en) Semiconductor circuit device and method of detecting runaway
US8601488B2 (en) Controlling the task switch timing of a multitask system
JPH01251142A (en) Program trace system
JP2000020352A (en) Stack overflow detecting method and stack underflow detecting method
JPH04266141A (en) Stack overflow detection system
KR960014825B1 (en) Information processing system
JP2716310B2 (en) Function call / return detection method
JP3145937B2 (en) Runaway detection method for microcomputer
JPH0451329A (en) Context switching device
JPS60134351A (en) System for registration of queue and detection of malfunction
JPH074669Y2 (en) Interrupt request processing circuit
JPH08137703A (en) Task switching device
JPS63303440A (en) Measuring instrument
JPH02176946A (en) Program runaway detecting method
JPH09128232A (en) Recognition device for program normality
JPH03268034A (en) Program execution monitoring method
JPH07334376A (en) Microprocessor and multitask managing method
JPS6398010A (en) Method for distinguishing power application and reset of microcomputer
JPH04128961A (en) Multi-processor control system
JPH11167500A (en) Event circuit and debug system for emulator device
JPS63255751A (en) Automatic detector for main memory capacity
JPS638841A (en) Interruption accepting system