JP2000076095A - Device and method for tracing program and storage medium storing program therefor - Google Patents

Device and method for tracing program and storage medium storing program therefor

Info

Publication number
JP2000076095A
JP2000076095A JP10242670A JP24267098A JP2000076095A JP 2000076095 A JP2000076095 A JP 2000076095A JP 10242670 A JP10242670 A JP 10242670A JP 24267098 A JP24267098 A JP 24267098A JP 2000076095 A JP2000076095 A JP 2000076095A
Authority
JP
Japan
Prior art keywords
interrupt
information
trace
program
holding
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
JP10242670A
Other languages
Japanese (ja)
Inventor
Satoshi Hirai
聡 平井
Masao Yamamoto
昌生 山本
Koichi Kumon
耕一 久門
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP10242670A priority Critical patent/JP2000076095A/en
Publication of JP2000076095A publication Critical patent/JP2000076095A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To trace a program without correcting an operating system or hardware concerning a device and a method for tracing program and a storage medium storing program therefor. SOLUTION: This device is provided with an original interruption information holding means 1 for holding the position information of an interruption means, a trace means 5 for acquiring the trace information of a program, and an interruption information generating means for trace for generating an interruption information holding means 2 for trace for holding the position information of a trace information collecting means 5' and the interruption information holding means to be used is switched from the original interruption information holding means 1 to the interruption information holding means 2 for trace. When an interruption occurs, while referring to the internal information of a CPU and a main memory, trace information is collected by the trace information collecting means 5' corresponding to the position information of generated interruption held in the interruption information holding means 2 for trace.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、プログラムのトレ
ース情報を収集するプログラムトレース装置およびプロ
グラムトレース方法およびそのプログラムを記憶する記
憶媒体に関するものである。
The present invention relates to a program tracing device and a program tracing method for collecting trace information of a program, and a storage medium for storing the program.

【0002】[0002]

【従来の技術】従来のプログラムトレースの手法は次の
ようなものである。 インストラクション・セット・エミュレーション
(Instruction-set Emulation) ターゲットシステムの命令を実行可能なエミュレーショ
ンシステムを作成し、その上でオペレーティングシステ
ムやユーザプログラムを動作させ、1命令毎の情報を収
集する。
2. Description of the Related Art A conventional program trace technique is as follows. Instruction-set Emulation Creates an emulation system that can execute the instructions of the target system, and then operates the operating system and user programs to collect information for each instruction.

【0003】 スタティック・コード・アノテーショ
ン(Static Code Annotation) オペレーティングシステムやユーザプログラムのコード
の一部を書き替えて、データアクセスや分岐履歴等の情
報を収集する。
[0003] Static Code Annotation [0003] Information such as data access and branch history is collected by rewriting a part of the code of an operating system or a user program.

【0004】 シングル・ステップ・エグゼキューシ
ョン(Single Step Execution ) オペレーティングシステムが提供するデバッグ機能を用
いて、1命令毎にトレースルーチンを呼び出し、情報を
収集する。
[0004] Using a debugging function provided by the operating system, a trace routine is called for each instruction and information is collected.

【0005】[0005]

【発明が解決しようとする課題】上記の従来のプログラ
ムトレースをする手法には次のよう問題点があった。 インストラクション・セット・エミュレーション
(Instruction-set Emulation) 取得できる情報の制限はないが、ターゲットシステムの
エミュレーションシステムの開発が必要である。特に、
プロセッサアーキテクチャに関する詳細な情報が必要で
あり、作成に多大な工数を必要とする。
However, the above-described conventional method of tracing a program has the following problems. Instruction-set Emulation There is no limit on the information that can be acquired, but it is necessary to develop an emulation system for the target system. In particular,
It requires detailed information about the processor architecture and requires a lot of man-hours to create.

【0006】 スタティック・コード・アノテーショ
ン(Static Code Annotation) ソースコードあるいは、オブジェクトコードを書き替え
るために、特定命令にしか、トレースコードを挿入でき
ず、1命令単位のトレースは行なえない。
[0006] Static code annotation (Static Code Annotation) In order to rewrite a source code or an object code, a trace code can be inserted only into a specific instruction, and tracing in units of one instruction cannot be performed.

【0007】 シングル・ステップ・エグゼキューシ
ョン(Single Step Execution ) オペレーティングシステムが提供する機能を利用するた
め、指定プロセスしかトレースできず、オペレーティン
グシステムの内部情報や別プロセスのトレースが行なえ
ない。
[0009] Single Step Execution [0007] Since a function provided by the operating system is used, only a specified process can be traced, and internal information of the operating system and a trace of another process cannot be traced.

【0008】本発明は、オペレーティングシステムやハ
ードウェアに手を加えることなく容易にプログラムのト
レース情報を取得できるプログラムトレース装置および
プログラムトレース方法およびそのプログラムを記憶す
る記憶媒体を提供することを目的とする。
It is an object of the present invention to provide a program tracing device and a program tracing method capable of easily acquiring program trace information without modifying an operating system or hardware, and a storage medium for storing the program. .

【0009】[0009]

【課題を解決するための手段】本発明は、割り込み手段
についての情報を保持する割り込み情報保持手段を備
え、割り込みが発生したとき該割り込み情報保持手段を
参照して、割り込み手段の位置情報を求め、割り込み処
理をするシステムにおけるプログラムトレース装置にお
いて、割り込み手段の位置情報を保持するオリジナル割
り込み情報保持手段と、プログラムのトレース情報を取
得するトレース手段とを備え、トレース手段は、CPU
の内部情報および主記憶を参照してトレース情報を取得
するトレース情報収集手段と、トレース情報収集手段の
位置情報を保持するトレース用割り込み情報保持手段を
作成するトレース用割り込み情報作成手段とを備え、ト
レース情報を収集する時、使用する割り込み情報保持手
段をオリジナル割り込み情報保持手段からトレース用割
り込み情報保持手段に切り替え、割り込みが発生した時
に、トレース用割り込み情報保持手段に保持されている
発生した割り込みの位置情報に対応するトレース情報収
集手段により,CPUの内部情報および主記憶を参照し
てトレース情報を収集するようにした。
According to the present invention, there is provided interrupt information holding means for holding information on an interrupt means, and when an interrupt occurs, the interrupt information holding means is referred to to obtain the position information of the interrupt means. A program trace device in a system that performs interrupt processing, comprising: an original interrupt information holding unit that holds position information of an interrupt unit; and a trace unit that acquires trace information of a program.
Trace information collecting means for acquiring trace information by referring to the internal information and main storage of the trace information generating means for generating trace interrupt information holding means for holding the position information of the trace information collecting means, When collecting trace information, switch the interrupt information holding means to be used from the original interrupt information holding means to the trace interrupt information holding means. When an interrupt occurs, the interrupt information held by the trace interrupt information holding means The trace information is collected by referring to the internal information and the main memory of the CPU by the trace information collecting means corresponding to the position information.

【0010】図1は本発明の基本構成を示す。図1にお
いて、1はオリジナル割り込み情報保持手段であって、
各ポインタはそれぞれの割り込み手段のあるアドレスを
指定するものである。
FIG. 1 shows the basic configuration of the present invention. In FIG. 1, reference numeral 1 denotes an original interrupt information holding unit,
Each pointer specifies a certain address of each interrupt means.

【0011】2はトレース用割り込み情報保持部手段で
あって、プログラムトレース用に作成されたものであ
る。トレース用割り込み情報保持手段2の各ポインタは
トレース手段5のそれぞれの割り込みに対するトレース
手段のアドレスを指している。
Reference numeral 2 denotes a trace interrupt information holding unit, which is created for program tracing. Each pointer of the trace interrupt information holding means 2 points to the address of the trace means for each interrupt of the trace means 5.

【0012】3はオペレーティングシステムである。4
は割り込み手段であって、割り込みハンドラ0、割り込
みハンドラ1、・・・割り込みハンドラnをもつもので
ある。
Reference numeral 3 denotes an operating system. 4
Is an interrupt means having interrupt handler 0, interrupt handler 1,..., Interrupt handler n.

【0013】5はトレース手段であって、制御手段9で
発行された割り込みに対してCPUの内部情報および主
記憶を参照してその割り込みに対応するトレース手段に
より、そのトレース情報を取得するものである。
Reference numeral 5 denotes a tracing means, which refers to the internal information and main memory of the CPU for the interrupt issued by the control means 9 and acquires the trace information by the tracing means corresponding to the interrupt. is there.

【0014】5’はトレース情報収集手段であって、C
PUの内部情報および主記憶からトレース情報を収集す
るものである。6は、トレース用割り込み情報作成手段
であって、トレース情報収集のための割り込み情報を作
成し、トレース用割り込み情報保持手段に保持するもの
である。
5 'is a trace information collecting means,
This is to collect trace information from the PU internal information and main memory. Reference numeral 6 denotes a trace interrupt information creating means for creating interrupt information for collecting trace information and storing it in the trace interrupt information holding means.

【0015】7はトレース記録領域である。8はアプリ
ケーションプログラムである。9は制御手段である。
Reference numeral 7 denotes a trace recording area. 8 is an application program. 9 is a control means.

【0016】図1の本発明の基本構成の動作を説明す
る。図1において、点線は制御手段9で割り込みが発行
されてからトレース情報を取得し、オペレーティングシ
ステムにおいて割り込み手段が実行されるまでの動作の
流れを示す。
The operation of the basic configuration of the present invention shown in FIG. 1 will be described. In FIG. 1, the dotted line shows the flow of operation from when an interrupt is issued by the control means 9 to when trace information is acquired and when the interrupt means is executed in the operating system.

【0017】通常の動作では、オペレーティングシステ
ム3は、制御手段9で割り込みが発行されるとオリジナ
ル割り込み情報保持手段1が参照され、該当する割り込
みについてポインタが参照され、オペレーティングシス
テム3においてその割り込み命令を実行する割り込み手
段4により割り込み処理が実行される。
In a normal operation, when an interrupt is issued by the control means 9, the operating system 3 refers to the original interrupt information holding means 1, refers to a pointer for the corresponding interrupt, and sends the interrupt instruction to the operating system 3. Interrupt processing is executed by the interrupting means 4 to be executed.

【0018】トレースモードにおいて、トレース手段5
のトレース用割り込み情報作成手段6は、トレース用割
り込み情報保持手段2にトレース情報収集のための割り
込み情報を作成する。その時、トレース用割り込み情報
保持手段2の各割り込みのポインタはそれぞれのポイン
タに対応するトレースプログラムを指すようにする。
In the trace mode, the tracing means 5
The trace interrupt information creating means 6 creates interrupt information for collecting trace information in the trace interrupt information holding means 2. At that time, the pointer of each interrupt of the trace interrupt information holding means 2 points to the trace program corresponding to each pointer.

【0019】 制御手段9で割り込みが発行される
と、トレース用割り込み情報保持手段2が参照される。 トレース情報収集手段5’は該当する割り込みにつ
いての情報を取得し、トレース情報とする。
When an interrupt is issued by the control means 9, the trace interrupt information holding means 2 is referred to. The trace information collecting means 5 'acquires information on the corresponding interrupt and sets it as trace information.

【0020】 トレース情報収集手段5’はトレース
情報をトレース記録領域に記録する。 次にオリジナル割り込み情報保持手段が参照され、
該当する割り込み手段のあるアドレスが求められる。
The trace information collecting means 5 ′ records trace information in a trace recording area. Next, the original interrupt information holding means is referred to,
The address of the corresponding interrupt means is determined.

【0021】 オペレーティングシステム3におい
て、該当する割り込み手段により割り込み処理が実行さ
れる。 以上の処理を、割り込み毎に繰り返し、トレース情報を
取得することができる。
In the operating system 3, an interrupt process is executed by a corresponding interrupt unit. The above processing is repeated for each interrupt, and trace information can be obtained.

【0022】上記により、本発明のトレース手段によ
り、任意のハードウェアイベント、オペレーティングシ
ステム割り込みイベント、エラーイベント等のトレース
情報をオペレーティングシステム3に関知しないで取得
できる。さらに、後述するように、ハードウェア(制御
手段9)とオペレーティングシステム3との間に位置す
ることでシングルステップモード、あるいはブロックス
テップモードにおいてオペレーティングシステム3より
先に制御を取り込むことができ、1命令毎もしくは分岐
命令毎にアプリケーションプログラム8のみならずオペ
レーティングシステム内部もトレースできる。
As described above, the tracing means of the present invention makes it possible to acquire trace information such as an arbitrary hardware event, operating system interrupt event, error event, etc., irrespective of the operating system 3. Further, as described later, by being located between the hardware (control means 9) and the operating system 3, the control can be taken in before the operating system 3 in the single step mode or the block step mode. Every time or every branch instruction, not only the application program 8 but also the inside of the operating system can be traced.

【0023】既存のソフトウェアに一切手を加える必要
がないので、トレースプログラム(トレース手段)のロ
ードおよびアンロードによりトレース機能のシステムへ
の動的な付加、切り離しが可能である。
Since it is not necessary to modify existing software at all, loading and unloading of a trace program (trace means) enables dynamic addition and detachment of a trace function to and from the system.

【0024】このように、本発明は、既存のハードウェ
アを一切変更することなく、またオペレーティングシス
テムやアプリケーションプログラムに一切手を加えるこ
となく、任意の割り込みトレースが可能になる。また、
1命令毎のトレース、分岐ブロック単位でのトレースが
可能なので、システムの全挙動のトレースが可能にな
る。さらに、指定タスクのみのトレース、ユーザ空間も
しくはカーネル空間のみのトレースを指定することによ
り指定された空間のみのトレースを取得することが可能
になる。
As described above, according to the present invention, an arbitrary interrupt trace can be performed without changing the existing hardware at all and without changing the operating system or the application program. Also,
Since tracing for each instruction and tracing for each branch block are possible, it is possible to trace the entire behavior of the system. Further, it is possible to acquire a trace of only the designated space by designating a trace of only the designated task and a trace of only the user space or the kernel space.

【0025】[0025]

【発明の実施の形態】本発明の実施の形態1は、オリジ
ナル割り込みテーブルの位置を割り込みテーブルレジス
タにセットした値により定め、割り込み処理機能を備え
たシステム上で動作させる。トレースプログラムは、動
作時に全割り込みをフックする(横取りする)ことによ
り、ハードウェアとオペレーティングシステムとの間に
位置して、割り込み毎にCPUの内部情報および主記憶
を参照して各レジスタの情報やシステムテーブル等の情
報取得を行なう。また、取得したトレース情報をメモリ
あるいは補助記憶装置内領域へ出力する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS In the first embodiment of the present invention, the position of an original interrupt table is determined by a value set in an interrupt table register, and the system is operated on a system having an interrupt processing function. The trace program is located between the hardware and the operating system by hooking (intercepting) all the interrupts during operation, and refers to the internal information of the CPU and the main memory for each interrupt, and reads information of each register. Obtain information such as a system table. The acquired trace information is output to a memory or an area in an auxiliary storage device.

【0026】割り込みハンドラの機能としては、タイマ
割り込み、キーボード割り込み、ディスク割り込み等の
ハードウェア割り込み、OSサービス等のソフトウェア
割り込み、CPUエラー等の例外割り込み処理、シング
ルステップトレース、ブロックトレース等のデバッグ割
り込み等がある。
The functions of the interrupt handler include a hardware interrupt such as a timer interrupt, a keyboard interrupt, a disk interrupt, a software interrupt such as an OS service, an exception interrupt processing such as a CPU error, and a debug interrupt such as a single step trace and a block trace. There is.

【0027】図2は本発明の実施の形態1を示す。本発
明の実施の形態1は、トレース用割り込みテーブルを作
成し、オリジナル割り込みテーブルの位置を指し示す割
り込みテーブルレジスタの内容をトレース用割り込みテ
ーブルを作成する位置に変更する。
FIG. 2 shows a first embodiment of the present invention. In the first embodiment of the present invention, a trace interrupt table is created, and the contents of the interrupt table register indicating the position of the original interrupt table are changed to the position where the trace interrupt table is created.

【0028】このトレース用割り込みテーブルの作成お
よび割り込みテーブルレジスタの変更は、プログラムの
ロード、アンロードをできるシステムにおいて、システ
ムを起動後のどの時点でも動的に可能であり、何度でも
挿抜可能である。
The creation of the trace interrupt table and the change of the interrupt table register can be dynamically performed at any time after the system is started in a system capable of loading and unloading a program, and can be inserted and removed any number of times. is there.

【0029】各割り込みが発生した際に、トレースプロ
グラムがその割り込みを取得し、その割り込みについて
の情報を取得し、トレース情報としてトレース領域にス
トアする。その後オリジナル割り込みテーブルを参照し
て割り込みハンドラのアドレスを求め、その割り込みハ
ンドラに処理を移行し、指示された割り込み処理を行な
う。このようにして、オペレーティングシステムにいっ
さい関知させないでトレース情報の収集を行なうととも
にその割り込み処理を実行することができる。
When each interrupt occurs, the trace program obtains the interrupt, obtains information about the interrupt, and stores it in the trace area as trace information. Thereafter, the address of the interrupt handler is obtained by referring to the original interrupt table, the processing is shifted to the interrupt handler, and the specified interrupt processing is performed. In this manner, trace information can be collected without interrupting the operating system, and interrupt processing can be executed.

【0030】図2において、11はオリジナル割り込み
テーブルである(図1のオリジナル割り込み情報保持手
段1に相当する)。
In FIG. 2, reference numeral 11 denotes an original interrupt table (corresponding to the original interrupt information holding means 1 in FIG. 1).

【0031】15はトレース用割り込みテーブルである
(図1のトレース用割り込み情報保持手段2に相当す
る)。21はオペレーティングシステムである。
Reference numeral 15 denotes a trace interrupt table (corresponding to the trace interrupt information holding means 2 in FIG. 1). 21 is an operating system.

【0032】22は割り込みハンドラである(図1の割
り込み手段4に相当する)。41は制御部である。4
1、42はCPUを構成する。
Reference numeral 22 denotes an interrupt handler (corresponding to the interrupt means 4 in FIG. 1). 41 is a control unit. 4
Reference numerals 1 and 42 constitute a CPU.

【0033】42は割り込みテーブルレジスタである。
51はトレースプログラムである(図1のトレース手段
5に相当する)。。
Reference numeral 42 denotes an interrupt table register.
Reference numeral 51 denotes a trace program (corresponding to the trace means 5 in FIG. 1). .

【0034】511はトレース情報収集プログラムであ
る。52は、トレース用割り込みテーブル作成手段であ
る(図1のトレース用割り込み情報作成手段に相当す
る)。
Reference numeral 511 denotes a trace information collection program. Reference numeral 52 denotes a trace interrupt table creating means (corresponding to the trace interrupt information creating means in FIG. 1).

【0035】61はトレース記録領域である。62はア
プリケーションプログラムである。図2の構成の動作を
説明する。点線は動作の流れを示す。
Reference numeral 61 denotes a trace recording area. 62 is an application program. The operation of the configuration of FIG. 2 will be described. Dotted lines indicate the flow of operation.

【0036】(1) トレースプログラム動作前(初期
状態) 割り込みテーブルレジタ42はオペレーティングシ
ステムによって作成されたオリジナル割り込みテーブル
のアドレスが保持されている。例では、オリジナル割り
込みテーブルのアドレス80036400がセットされ
ている。
(1) Before Trace Program Operation (Initial State) The interrupt table register 42 holds the address of the original interrupt table created by the operating system. In the example, the address 80036400 of the original interrupt table is set.

【0037】(2)トレース用割り込みテーブル15の
作成 トレース用割り込みテーブル作成手段52は,トレ
ース情報収集のためのトレース用割り込みテーブル15
を作成する。この時、トレース用割り込みテーブル15
の各割り込みハンドラへのポインタはトレース情報収集
プログラム511を指すように設定する。
(2) Creation of the trace interrupt table 15 The trace interrupt table creation means 52 provides the trace interrupt table 15 for collecting trace information.
Create At this time, the trace interrupt table 15
Are set to point to the trace information collection program 511.

【0038】 トレースを行う時は、トレースプログ
ラム51の割り込みテーブルレジスタ書き替え手段53
により、割り込みテーブルレジスタ42の値を、作成し
たトレース用割り込みテーブル15のアドレスに変更す
る。例えば、割り込みテーブルレジスタ42にF886
5400をセットする。
When tracing is performed, the interrupt table register rewriting means 53 of the trace program 51
Thereby, the value of the interrupt table register 42 is changed to the address of the created trace interrupt table 15. For example, F886 is set in the interrupt table register 42.
Set 5400.

【0039】(3) 割り込みが発生した時の動作 制御部41で割り込みが発生すると、割り込みテーブル
レジスタ42が参照される。
(3) Operation when an Interrupt Occurs When an interrupt occurs in the control unit 41, the interrupt table register 42 is referred to.

【0040】 割り込みが発生すると、制御部41は
割り込みテーブルレジスタ42を参照する。 割り込みテーブル(トレース用割り込みテーブル1
5)のあるアドレスが求められる。
When an interrupt occurs, the control unit 41 refers to the interrupt table register 42. Interrupt table (Interrupt table for trace 1
An address with 5) is obtained.

【0041】 割り込みテーブルから該当する割り込
みハンドラ(トレース情報収集プログラム)が求めら
れ、トレース情報収集プログラム511はCPUの内部
情報および主記憶を参照してトレース情報を取得する。
A corresponding interrupt handler (trace information collection program) is obtained from the interrupt table, and the trace information collection program 511 acquires trace information by referring to the internal information and main memory of the CPU.

【0042】 トレース記録領域61に取得したトレ
ース情報を記録する。 、’オリジナル割り込みテーブル11が参照され、
該当する割り込みハンドラのアドレスが求められ、オペ
レーティングシステム21においてその割り込みハンド
ラにより割り込み処理が実行される。
The acquired trace information is recorded in the trace recording area 61. , 'The original interrupt table 11 is referenced,
The address of the corresponding interrupt handler is obtained, and the interrupt processing is executed by the interrupt handler in the operating system 21.

【0043】図3は本発明の実施の形態2である。図3
はトレース用割り込みテーブルを作成する別の実施の形
態を示す。本実施の形態2では割り込みレジスタの値を
変更しない。その代わりに、オペレーティングシステム
のもつオリジナル割り込みテーブルを退避領域に退避
し、オリジナル割り込みテーブルのあった領域にトレー
ス用割り込みテーブルを作成する。このようにすること
により、割り込みテーブルレジスタをもたずにオリジナ
ル割り込みテーブルを作成する位置が固定的にテーブル
位置が設定されているか、あるいは割り込みテーブルレ
ジスタの値をユーザが変更できない場合にも対応するこ
とができる。以下、割り込みテーブルレジスタがあるが
ユーザが簡単に変更することのできないシステムの場合
を例として説明する。
FIG. 3 shows a second embodiment of the present invention. FIG.
Shows another embodiment for creating a trace interrupt table. In the second embodiment, the value of the interrupt register is not changed. Instead, the original interrupt table of the operating system is saved in a save area, and a trace interrupt table is created in the area where the original interrupt table was. By doing so, it is possible to cope with the case where the position where the original interrupt table is created without the interrupt table register is fixedly set at the table position or the value of the interrupt table register cannot be changed by the user. be able to. Hereinafter, an example of a system that has an interrupt table register but cannot be easily changed by a user will be described.

【0044】割り込みが発生した時は、トレースプログ
ラムは、CPUの内部情報および主記憶を参照しトレー
ス情報を作成し、トレース領域に記録する。その後、退
避領域に退避してあるオリジナル割り込みテーブルを参
照し、指示された割り込みのポインタにより、割り込み
ハンドラのあるアドレスが求められる。そして、その割
り込みハンドラに移行し、割り込み処理をする。このシ
ーケンスを繰り返すことにより、オペレーティングシス
テムに関知させないでトレース情報を収集できる。
When an interrupt occurs, the trace program creates trace information by referring to the internal information and main memory of the CPU, and records it in the trace area. After that, the original interrupt table saved in the save area is referred to, and the address of the interrupt handler is obtained by the designated interrupt pointer. Then, the process shifts to the interrupt handler and performs an interrupt process. By repeating this sequence, trace information can be collected without any knowledge of the operating system.

【0045】図3において、図2と同じ参照番号は同じ
ものを表す。11は退避領域に退避したオリジナル割り
込みテーブルである。15はトレース用割り込みテーブ
ルであって、割り込みテーブルレジスタに保持されてい
るアドレスに、トレース情報収集のために作成されたも
のである。オリジナル割り込みテーブル11の各割り込
みのポインタはそれぞれの割り込みハンドラのアドレス
を指しているが、トレース用割り込みテーブルのポイン
タはトレース情報収集プログラム511の領域を指して
いる。
In FIG. 3, the same reference numerals as those in FIG. 2 denote the same items. Reference numeral 11 denotes an original interrupt table saved in the save area. Reference numeral 15 denotes a trace interrupt table, which is created at an address held in the interrupt table register for collecting trace information. The pointer of each interrupt in the original interrupt table 11 points to the address of each interrupt handler, while the pointer in the trace interrupt table points to the area of the trace information collection program 511.

【0046】54はオリジナル割り込みテーブル退避手
段であって、オリジナル割り込みテーブルを退避するも
のである。図3の構成において、例えば、割り込みテー
ブルレジスタ42は、オペレーティングシステムにより
作成されたオリジナル割り込みテーブル11のアドレス
80036400を保持しているとする。トレースをす
る時は、オリジナル割り込みテーブルは退避領域に退避
される。そして、オリジナル割り込みテーブル11が退
避する前にあったアドレス80036400にトレース
用割り込みテーブル11を作成する。トレース用割り込
みテーブル11のポインタはトレースプログラムの領域
を指すようにする。
Reference numeral 54 denotes original interrupt table saving means for saving the original interrupt table. In the configuration of FIG. 3, for example, it is assumed that the interrupt table register 42 holds the address 80036400 of the original interrupt table 11 created by the operating system. When tracing, the original interrupt table is saved in a save area. Then, the trace interrupt table 11 is created at the address 80036400 before the original interrupt table 11 was saved. The pointer of the trace interrupt table 11 points to the area of the trace program.

【0047】制御部41から割り込みの指示が与えられ
ると、割り込みテーブルレジスタ42の値に従って、ト
レース用割り込みテーブル15が参照される。そして、
トレース情報取得プログラム511により対応する割り
込みの情報を取得し、トレース記録領域61に記録す
る。その後、退避領域のオリジナル割り込みテーブル1
1が参照されて指示された割り込みハンドラが実際にあ
るアドレスが求められ、その割り込みハンドラにより割
り込みが実行される。
When an interrupt instruction is given from the control unit 41, the trace interrupt table 15 is referred to according to the value of the interrupt table register 42. And
The corresponding interrupt information is acquired by the trace information acquisition program 511 and recorded in the trace recording area 61. Then, the original interrupt table 1 in the save area
1 is referenced to find the address where the designated interrupt handler is actually located, and the interrupt handler executes the interrupt.

【0048】図4は本発明の実施の形態1と実施の形態
2のフローチャートである。トレース用割り込みテーブ
ルを作成し、オリジナル割り込みテーブルと切り替えた
後のトレースのフローチャートを示すものである。
FIG. 4 is a flow chart of the first and second embodiments of the present invention. FIG. 8 shows a flowchart of a trace after creating a trace interrupt table and switching to an original interrupt table.

【0049】S1 割り込みが発生する。 S2 指示された割り込みについてトレース割り込みテ
ーブルが参照される。そして、そのポインタによりトレ
ースプログラムの領域に動作がJUMPする。
S1 An interrupt occurs. S2 The trace interrupt table is referred to for the indicated interrupt. Then, the operation jumps to the area of the trace program by the pointer.

【0050】S3 その割り込みをトレースするのな
ら、S4でトレース処理を行ない、トレースを行なわな
いならS5の処理をする。 S4 トレースプログラムは、指示された割り込みのト
レースを取得し、トレース記録領域にトレース情報を記
録する。
S3 If the interruption is to be traced, the tracing process is performed in S4. If the tracing is not performed, the process in S5 is performed. S4 The trace program acquires the trace of the designated interrupt, and records the trace information in the trace recording area.

【0051】S5 S3で割り込みをトレースしない
か、あるいはS4で割り込みのトレースを記録し終えた
ら、指示された割り込みについてオリジナル割り込みテ
ーブルを参照し、そのポインタで指示されるアドレスに
ある割り込みハンドラにJUMPする。そして、その割
り込みハンドラにより割り込み処理が実行される。
In step S5, if the interrupt is not traced in step S3, or if the trace of the interrupt is completed in step S4, the original interrupt table is referenced for the designated interrupt, and the interrupt handler at the address indicated by the pointer is jumped. . Then, an interrupt process is executed by the interrupt handler.

【0052】図5は本発明の実施の形態3である。本発
明の実施の形態3は、シングルステップモード(1命令
毎割り込み制御)を備えるシステムに対して、実施の形
態1にさらにシングルステップでの命令実行のトレース
をとることができるようにしたものである。
FIG. 5 shows a third embodiment of the present invention. In the third embodiment of the present invention, a single step mode instruction (interrupt control for each instruction) can be traced in the single step mode in the first embodiment. is there.

【0053】プロセッサ内のシングルステップモードフ
ラグをオンにすることにより、1命令毎のステップ割り
込みが発生する。トレースプログラムでその制御フラグ
をオンにすることにより、1命令毎にステップ割り込み
が発生し、トレースプログラムはトレース情報を取得す
る。命令列の1連の命令に対してこれを繰り返し、一命
令毎のトレース情報を取得する。
Turning on the single step mode flag in the processor causes a step interrupt for each instruction. When the control flag is turned on by the trace program, a step interrupt occurs for each instruction, and the trace program acquires trace information. This is repeated for a series of instructions in the instruction sequence to acquire trace information for each instruction.

【0054】本実施の形態3により、割り込み毎にトレ
ース情報を取得する実施の形態1に加え、1命令毎にト
レース情報を取得できるので、プログラムの全挙動のト
レース情報を取得することが可能になる。
According to the third embodiment, in addition to the first embodiment in which the trace information is obtained for each interrupt, the trace information can be obtained for each instruction, so that it is possible to obtain the trace information of all the behaviors of the program. Become.

【0055】図5において、図2、図3と共通の番号は
同じものを表す。44はシングルステップフラグであ
り、制御フラグレジスタ441に保持されている。命令
実行をシングルステップモード(1命令毎割り込み制
御)で行なうか、行なわないかを表すフラグを保持する
ものである。
In FIG. 5, the same reference numerals as those in FIGS. 2 and 3 denote the same items. 44 is a single step flag, which is held in the control flag register 441. This holds a flag indicating whether or not instruction execution is performed in the single step mode (interrupt control for each instruction).

【0056】55はシングルステップ割り込みトレース
ブログラムであり、1命令毎のトレース情報を取得する
ものである。71’は命令1、72’は命令2、73は
命令nであり、シングルステップモードでの命令列を表
す。
Reference numeral 55 denotes a single-step interrupt trace program for acquiring trace information for each instruction. 71 ′ is instruction 1, 72 ′ is instruction 2 and 73 is instruction n, and represents an instruction sequence in the single step mode.

【0057】図5の実施の形態3の動作を説明する。シ
ングルステップモードでは、シングルステップモードを
表すフラグがシングルステップフラグ44がセットされ
る。
The operation of the third embodiment shown in FIG. 5 will be described. In the single step mode, the flag indicating the single step mode is set to the single step flag 44.

【0058】CPUが命令1を発行すると、シングルス
テップ割り込みが発生する。トレース用割り込みテーブ
ル15が参照され、シングルステップ割り込みハンドラ
であるシングルステップ割り込みトレースプログラム5
5により命令1のトレース情報が取得され、トレース記
録領域61に記録される。そして、その命令1がCPU
1により実行される。さらに、シングルステップモード
を継続するなら、シングルステップ制御フラグをセット
したままとする。このようにして、命令nまでのトレー
ス情報を取得できる。
When the CPU issues the instruction 1, a single-step interrupt occurs. The single-step interrupt trace program 5 which is a single-step interrupt handler is referred to by referring to the trace interrupt table 15.
5, the trace information of the instruction 1 is obtained and recorded in the trace recording area 61. And the instruction 1 is CPU
1 is executed. Furthermore, if the single step mode is continued, the single step control flag is kept set. In this manner, trace information up to the instruction n can be obtained.

【0059】シングルステップでのトレースを終了する
時は、シングルステップ割り込みトレースプログラム5
5はシングルステップ制御フラグをオフとする。図5の
構成において、シングルステップモードでない場合の割
り込み毎のトレース情報の取得は、図2の本発明の実施
の形態1、実施の形態2と同様である。
When ending the trace in the single step, the single step interrupt trace program 5
5 turns off the single step control flag. In the configuration of FIG. 5, acquisition of trace information for each interrupt when the mode is not the single step mode is the same as in the first and second embodiments of the present invention in FIG.

【0060】図6は本発明の実施の形態3のフローチャ
ートである。トレース用割り込みテーブルを作成し、オ
リジナル割り込みテーブルと切り替えた後のフローチヤ
ートである。
FIG. 6 is a flowchart according to the third embodiment of the present invention. This is a flowchart after creating a trace interrupt table and switching to the original interrupt table.

【0061】S1 割り込みが発生する。 S2 トレース用割り込みテーブルを参照してトレース
プログラムへJUMPする。
S1 An interrupt occurs. S2 JUMP to the trace program with reference to the trace interrupt table.

【0062】S3 その割り込みのトレースを取得する
かしないかを判定する。トレースを取得するならS4で
トレースを行ない、そのトレースをとらないならS5の
処理を行なう。
S3: It is determined whether or not a trace of the interrupt is acquired. If a trace is obtained, a trace is performed in S4, and if the trace is not taken, the process of S5 is performed.

【0063】S4 トレース情報をトレース記録領域に
出力する(S1の割り込みがシングルステップ割り込み
ならシングルステップでの命令のトレースをとる)。 S5 シングルステップ割り込みか判定する。シングル
ステップ割り込みならS6の処理を行ない、シングルス
テップ割り込みでなければS8の処理を行なう。
S4 Trace information is output to the trace recording area (if the interrupt in S1 is a single step interrupt, the instruction is traced in a single step). S5 It is determined whether it is a single step interrupt. If it is a single step interrupt, the process of S6 is performed, and if it is not a single step interrupt, the process of S8 is performed.

【0064】S6 次の命令でシングルステップを実行
するかしないかをきめるために、シングルステップフラ
グ制御をする。次の命令でもシングルステップ実行する
ならシングルステップフラグを立てたままにし、シング
ルステップ実行をしないならシングルステップフラグを
下ろす。
S6 The single step flag is controlled to determine whether or not to execute the single step with the next instruction. For the next instruction, if the single step is to be executed, the single step flag is kept set.

【0065】S7 割り込み元へリターンし、次の割り
込みを待つ。 S8 オリジナルの割り込みハンドラでシングルステッ
プ実行するか、あるいはシングルステップ実行しないか
を定めるためにシングルステップフラグ制御をする。シ
ングルステップ実行をするならシングルステップフラグ
を立てたままにし、シングルステップ実行をしないなら
シングルステップフラグを下ろす。
S7 Return to the interrupt source and wait for the next interrupt. S8 Single step flag control is performed to determine whether to execute single step or not to execute single step in the original interrupt handler. If single-step execution is to be performed, the single-step flag is left set. If not, the single-step flag is lowered.

【0066】S9 オリジナル割り込みテーブルを参照
して、割り込みハンドラへJUMPする。 図7は本発明の実施の形態4であって、ブロックトレー
スモード(分岐命令毎割り込み制御)を備えるシステム
において、分岐命令毎の割り込みのトレースをとるよう
にした場合の構成である。
S9 Referring to the original interrupt table, JUMP to the interrupt handler. FIG. 7 shows a fourth embodiment of the present invention, in which a system provided with a block trace mode (interrupt control for each branch instruction) traces an interrupt for each branch instruction.

【0067】本実施の形態4は、実施の形態1もしくは
実施の形態2に加えて、ブロックトレースモードにおい
て、分岐毎にトレースをとるようにしたものである。本
実施の形態4によれば、分岐命令割り込みの情報を取得
でき、プログラムコードと突き合わせることにより、プ
ログラム全体のトレースを容易に得ることができる。
In the fourth embodiment, in addition to the first or second embodiment, a trace is taken for each branch in the block trace mode. According to the fourth embodiment, the information of the branch instruction interrupt can be obtained, and the trace of the entire program can be easily obtained by matching with the program code.

【0068】図7において、図2、図3と共通の番号は
同じものを表す。45は分岐命令割り込み制御フラグで
あって、分岐命令割り込み制御をするかしないかを示す
ために保持されるフラグである。
In FIG. 7, the same reference numerals as those in FIGS. 2 and 3 denote the same items. Reference numeral 45 denotes a branch instruction interrupt control flag, which is held to indicate whether or not to perform branch instruction interrupt control.

【0069】56は分岐命令割り込みトレースプログラ
ムである。図7の構成の動作を説明する。分岐命令割り
込み制御フラグが立てられているとする。分岐命令割り
込みが発生すると、トレース用割り込みテーブル15が
参照され、分岐命令制御割り込みトレースプログラム5
6はその分岐命令割り込みのトレース情報を収集し、ト
レース記録領域61に記録する。そして、その分岐命令
がCPUで実行される。
Reference numeral 56 denotes a branch instruction interrupt trace program. The operation of the configuration of FIG. 7 will be described. It is assumed that the branch instruction interrupt control flag is set. When a branch instruction interrupt occurs, the trace interrupt table 15 is referred to, and the branch instruction control interrupt trace program 5
6 collects the trace information of the branch instruction interrupt and records it in the trace recording area 61. Then, the branch instruction is executed by the CPU.

【0070】なお、図7の構成において、分岐命令割り
込み以外の割り込みのトレースは図1の本発明の実施の
形態1、もしくは実施の形態2と同様である。図8は分
岐命令割り込み制御のトレースをとるためのフローチャ
ートである。
In the configuration of FIG. 7, the trace of the interrupt other than the branch instruction interrupt is the same as in the first or second embodiment of the present invention shown in FIG. FIG. 8 is a flowchart for taking a trace of the branch instruction interrupt control.

【0071】S1 割り込みが発生する。 S2 トレース用割り込みテーブルを参照してトレース
プログラムへJUMPする。
S1 An interrupt occurs. S2 JUMP to the trace program with reference to the trace interrupt table.

【0072】S3 その割り込みのトレースを取得する
かしないかを判定する。トレースを取得するならS4で
トレースを行ない、そのトレースをとらないならS5の
処理を行なう。
S3: It is determined whether or not a trace of the interrupt is acquired. If a trace is obtained, a trace is performed in S4, and if the trace is not taken, the process of S5 is performed.

【0073】S4 トレース情報をトレース記録領域に
出力する(S1の割り込みが分岐命令割り込みなら分岐
命令割り込みのトレースをとる)。 S5 分岐命令割り込みか判定する。分岐命令割り込み
ならS6の処理を行ない、分岐命令割り込みでなければ
S8の処理を行なう。
S4 Trace information is output to the trace recording area (if the interrupt in S1 is a branch instruction interrupt, a trace of a branch instruction interrupt is taken). S5 Determine whether it is a branch instruction interrupt. If it is a branch instruction interrupt, the process at S6 is performed, and if it is not a branch instruction interrupt, the process at S8 is performed.

【0074】S6 分岐命令割り込み制御をするかしな
いかをきめるために、分岐命令割り込み制御フラグをセ
ットする。分岐命令割り込み制御をするなら、分岐命令
割り込み制御フラグを立てたままにし、分岐命令割り込
み制御をしないなら分岐命令割り込み制御フラグを下ろ
す。
S6: A branch instruction interrupt control flag is set to determine whether or not to execute the branch instruction interrupt control. If the branch instruction interrupt control is to be performed, the branch instruction interrupt control flag is kept set. If the branch instruction interrupt control is not performed, the branch instruction interrupt control flag is lowered.

【0075】S7 割り込み元へリターンし、次の割り
込みを待つ。 S8 オリジナルの割り込みハンドラで分岐命令割り込
み制御をするかしないかをきめるために分岐命令割り込
み制御フラグをセットする。分岐命令割り込み制御をす
るなら分岐命令割り込み制御フラグを立て、分岐命令割
り込み制御をしないならフラグを下ろす。
S7 Return to the interrupt source and wait for the next interrupt. S8: A branch instruction interrupt control flag is set to determine whether or not to perform branch instruction interrupt control in the original interrupt handler. If the branch instruction interrupt control is to be performed, a branch instruction interrupt control flag is set. If the branch instruction interrupt control is not performed, the flag is lowered.

【0076】S9 オリジナル割り込みテーブルを参照
して、割り込みハンドラへJUMPする。図9は本発明
の実施の形態5を示す。
S9 JUMPs to the interrupt handler with reference to the original interrupt table. FIG. 9 shows a fifth embodiment of the present invention.

【0077】本実施の形態5はマルチタスク機能をも
ち、タスク毎にシングルステップ割り込み制御を行なう
ことができるシステムを対象とする。このようなシステ
ムではタスク毎に保存されているシングルステップ制御
フラグをセットするかしないかに応じて(制御フラグを
イネーブルもしくはディセーブルにする)任意のタスク
で割り込みを発生させたり、発生させないことができ
る。
The fifth embodiment is directed to a system having a multitask function and capable of performing single-step interrupt control for each task. In such a system, depending on whether a single step control flag stored for each task is set or not (enable or disable the control flag), an arbitrary task may or may not generate an interrupt. it can.

【0078】本実施の形態5は、任意のタスクでシング
ルステップ割り込みによりトレース情報を収集するよう
にしたものである。タスク毎にシングルステップ制御を
行なうか行なわないかを示すフラグをセットする。そし
て、タスク切り替えによりタスクが切り替わった際にそ
のフラグを反映され、シングルステップ制御でトレース
をとるか等が決定される。
In the fifth embodiment, trace information is collected by a single step interrupt in an arbitrary task. A flag indicating whether or not to perform the single step control for each task is set. Then, when the task is switched by the task switching, the flag is reflected, and it is determined whether or not the trace is taken by the single step control.

【0079】このようにして、指定したタスクのみシン
グルステップによりトレース情報を収集することがで
き、その他のタスクは通常時と同様にリアルタイムで処
理することができる。
As described above, only the designated task can collect trace information by a single step, and the other tasks can be processed in real time as in the normal case.

【0080】図9において、他の図と同じ参照番号はそ
れぞれに同じものである。25はタスク管理テーブルで
ある。441は制御フラグレジスタで制御フラグを保持
するレジスタである。
In FIG. 9, the same reference numerals as those in the other drawings denote the same parts. 25 is a task management table. Reference numeral 441 denotes a control flag register which holds a control flag.

【0081】57はタスクトレースプログラムである。
図9の構成において、例えば、タスクA、タスクBはタ
スク管理テーブル25のシングルステップ制御フラグが
オンであるので、タスクA、タスクBに実行が切り替わ
った際にシングルステップ割り込みが発生する。そこで
トレース用割り込みテーブル15が参照され、シングル
ステップ割り込みトレースプログラム55およびタスク
トレースプログラム57はタスクA、タスクBの割り込
み情報(タスクA、タスクBが処理されたことを表す情
報)を取得できる。
Reference numeral 57 denotes a task trace program.
In the configuration of FIG. 9, for example, since the single-step control flag of the task management table 25 is on for the tasks A and B, a single-step interrupt occurs when the execution is switched to the tasks A and B. Then, the trace interrupt table 15 is referred to, and the single-step interrupt trace program 55 and the task trace program 57 can acquire the interrupt information of the tasks A and B (information indicating that the tasks A and B have been processed).

【0082】その他の割り込みについてのトレース情報
の取得方法は、発明の実施の形態1、2もしくは実施の
形態3の場合と同様である。図10は本発明の実施の形
態5のフローチャートである。
The method of acquiring trace information on other interrupts is the same as in the first, second, or third embodiment of the present invention. FIG. 10 is a flowchart according to the fifth embodiment of the present invention.

【0083】S1 割り込みが発生する。 S2 トレース用割り込みテーブルを参照し、トレース
プログラムへJUMPする。
S1 An interrupt occurs. S2 JUMP to the trace program with reference to the trace interrupt table.

【0084】S3 その割り込みのトレース情報を取得
するか判定する。トレース情報を取得する必要があるな
らS4の処理を行ない、トレース情報を取得する必要が
ないならS5の処理をする。
S3: It is determined whether to acquire the trace information of the interrupt. If it is necessary to acquire the trace information, the process of S4 is performed, and if it is not necessary to acquire the trace information, the process of S5 is performed.

【0085】S4 トレース領域へトレー情報を出力す
る。 S5 トレース情報を取得する必要がないか、もしくは
S5のトレース情報をトレース記録領域へ出力したら、
シングルステップ割り込みか判定する。シングルステッ
プ割り込みであればS6の処理を行ない、シングルステ
ップ割り込みでなければ、S8の処理を行なう。
S4 Outputs the tray information to the trace area. If it is not necessary to acquire the S5 trace information or if the trace information of S5 is output to the trace recording area,
Determine whether it is a single step interrupt. If it is a single step interrupt, the process of S6 is performed, and if it is not a single step interrupt, the process of S8 is performed.

【0086】S6 次のステップでもシングルステップ
割り込みをするか判定する。シングルステップ割り込み
フラグ制御をする。即ち、次のステップでもシングルス
テップ割り込みをするならシングルステップフラグを立
てたままにし、シングルステップ割り込みをしないなら
シングルステップフラグを下ろす。
S6 It is determined whether a single step interrupt is to be performed in the next step. Performs single-step interrupt flag control. That is, if a single step interrupt is to be performed in the next step, the single step flag is kept set, and if the single step interrupt is not to be performed, the single step flag is lowered.

【0087】S7 割り込み元へリターンし、次の割り
込みを待つ。 S8 S5でシングルステップ割り込みでないなら、オ
リジナルな割り込みハンドラのためのシングルステップ
フラグ制御をする。オリジナル割り込みハンドルの処理
において、シングルステップ制御をするなら、シングル
ステップフラグを立て、シングルステップ制御をしない
なら、シングルステップフラグを立てない。
S7: Return to the interrupt source and wait for the next interrupt. S8 If not a single step interrupt in S5, a single step flag control for the original interrupt handler is performed. In the processing of the original interrupt handle, a single step flag is set if single step control is performed, and a single step flag is not set if single step control is not performed.

【0088】S9 オリジナル割り込みテーブルを参照
して、割り込みハンドラへJUMPする。図11は本発
明の実施の形態6である。
S9 JUMP to the interrupt handler with reference to the original interrupt table. FIG. 11 shows a sixth embodiment of the present invention.

【0089】図11は、マルチタスク機能をもちタスク
毎の制御や、シングルステップ割り込み制御をフラグ管
理によりユーザが簡単には行なう事のできないシステム
において、所定のタスク毎にトレース情報の収集をでき
るようにしたものである。
FIG. 11 shows a system in which the user can easily perform trace control for each predetermined task in a system having a multi-task function and which cannot be easily controlled by the user through flag management for single-step interrupt control. It was made.

【0090】タスク切り替えは、特定の命令ないしは特
定の割り込みにおいて行なわれる。このタスクの切り替
えを認識し、タスク番号をチェックし、必要なタスクの
みのトレース情報をとる。
The task switching is performed at a specific instruction or a specific interrupt. Recognizing this task switching, the task number is checked, and trace information of only necessary tasks is obtained.

【0091】また、特定命令に対して、シングルステッ
プ割り込みを発生させるように設定することにより、タ
スク切り替えを認識し、必要なタスクのみ1命令毎のス
テップ割り込みによるトレース情報の取得ができる。
By setting a single instruction to generate a single step interrupt for a specific instruction, task switching can be recognized, and trace information can be obtained by a step interrupt for each instruction only for a necessary task.

【0092】このようにして、指定したタスクのみ、シ
ングルステップ制御におけるトレース情報を収集でき、
その他のタスクはリアルタイムで通常の処理を行なうこ
とができる。
In this way, only the designated task can collect trace information in the single step control.
Other tasks can perform normal processing in real time.

【0093】図11において、他の図と共通の参照番号
は共通部分を表す。25はタスク管理テーブルであっ
て、タスクとタスク番号をもつものである。58はタス
ク切り替え判定部であって、オペレーティングシステム
21におけるタスクの切り替えを判定するものである。
In FIG. 11, the same reference numerals as those in the other drawings indicate the common parts. A task management table 25 has a task and a task number. Reference numeral 58 denotes a task switching determination unit, which determines task switching in the operating system 21.

【0094】59はタスク番号判定部であって、切り替
えられたタスクの番号を判定するものである。592は
タスク番号保持部であって、トレースをとるタスクのタ
スク番号を保持するものである。
Reference numeral 59 denotes a task number determining unit for determining the number of the task switched. Reference numeral 592 denotes a task number holding unit which holds a task number of a task to be traced.

【0095】図11の本発明の実施の形態6の動作を説
明する。図11において、オペレーティングシステム2
1はタスク管理テーブル25に記録されているタスクを
処理するように制御する。
The operation of the sixth embodiment of the present invention shown in FIG. 11 will be described. In FIG. 11, the operating system 2
1 controls to process a task recorded in the task management table 25.

【0096】トレースプログラム51において、タスク
切り替え判定部58はオペレーティングシステム21の
制御におけるタスクの切り替わりと切り替えられたタス
ク番号を判定する。タスク番号判定部59はタスク番号
保持部592を参照し、切り替えられたタスクのトレー
ス情報を取得する必要があるかないかを判定する。そし
て、トレース情報を取得する必要があればトレース情報
を取得してトレース記録領域に出力する。また、その
際、シングルステップでのトレースが必要であれば、制
御フラグレジスタ441にシングルステップ制御フラグ
をセットし、シングルステップ制御トレースプログラム
によりシングルステップ割り込みによるトレースをと
り、トレース記録領域に記録する。
In the trace program 51, the task switching determination section 58 determines the task switching under the control of the operating system 21 and the switched task number. The task number determining unit 59 refers to the task number holding unit 592 and determines whether it is necessary to acquire trace information of the switched task. Then, if it is necessary to acquire the trace information, it acquires the trace information and outputs it to the trace recording area. Also, at this time, if tracing in single step is necessary, a single step control flag is set in the control flag register 441, a single step interrupt is traced by the single step control trace program, and the trace is recorded in the trace recording area.

【0097】図12は、本発明の実施の形態6のフロー
チャートである。 S1 割り込みが発生する。 S2 トレース用割り込みテーブルを参照し、トレース
プログラムへJUMPする。
FIG. 12 is a flowchart according to the sixth embodiment of the present invention. An S1 interrupt occurs. S2 JUMP to the trace program with reference to the trace interrupt table.

【0098】S3 タスクの切り替わりを認識し、タス
ク番号を判定する。タスク番号判定部に記録されている
番号に一致すればS4の処理を行ない、一致していなれ
ばS11の処理を行なう。
S3 Recognizes task switching and determines the task number. If the number matches the number recorded in the task number determination unit, the process of S4 is performed, and if not, the process of S11 is performed.

【0099】S4 その割り込みのトレース情報を取得
するか判定し、取得するのであればS5の処理を行な
い、取得しないのであればS6の処理を行なう。 S5 トレース領域へトレース情報を出力する。
In step S4, it is determined whether or not to acquire the trace information of the interrupt. If so, the process in step S5 is performed, and if not, the process in step S6 is performed. S5 Output the trace information to the trace area.

【0100】S6 シングルステップ割り込みか判定す
る。シングルステップ割り込みであれば、S7の処理を
行ない、シングルステップ割り込みでなければ、S9の
処理を行なう。
S6: Determine whether a single step interrupt occurs. If it is a single step interrupt, the process of S7 is performed, and if it is not a single step interrupt, the process of S9 is performed.

【0101】S7 次のステップでもシングルステップ
割り込みをするかを判定し、シングルステップ割り込み
フラグ制御をする。即ち、次のステップでもシングルス
テップ割り込みをするならシングルステップフラグを立
てたままにし、シングルステップ割り込みをしないなら
シングルステップフラグを下ろす。
S7 It is determined whether a single step interrupt is to be performed in the next step, and a single step interrupt flag is controlled. That is, if a single step interrupt is to be performed in the next step, the single step flag is kept set, and if the single step interrupt is not to be performed, the single step flag is lowered.

【0102】S8 割り込み元へリターンし、次の割り
込みを待つ。 S9 オリジナル割り込みハンドラのためのシングルス
テップフラグ制御をする。シングル制御ステップフラグ
制御をする。オリジナル割り込みハンドラの処理におい
て、シングルステップ制御をするなら、シングルステッ
プフラグを立て、シングルステップ制御をしないなら、
シングルステップフラグを立てない。
S8: Return to the interrupt source and wait for the next interrupt. S9 Single step flag control for the original interrupt handler is performed. Perform single control step flag control. In the processing of the original interrupt handler, set the single step flag if you want to perform single step control, and if you do not perform single step control,
Do not set the single step flag.

【0103】S10 オリジナル割り込みテーブルを参
照して、割り込みハンドラへJUMPする。 S11 S3で番号が合致しなければ、シングル割り込
み制御であるか判定する。シングルステップ制御であれ
ば、S12の処理を行ない、シングルステップ制御でな
ければS13の処理を行なう。
S10 JUMPs to the interrupt handler with reference to the original interrupt table. If the numbers do not match in S11 S3, it is determined whether or not the single interrupt control is performed. If it is the single step control, the process of S12 is performed, and if it is not the single step control, the process of S13 is performed.

【0104】S12 シングルステップフラグを強制的
にオフにする。 S13 割り込み元へリターンする。 S14 オリジナル割り込みテーブルを参照して、割り
込みハンドラへJUMPする。
S12 The single step flag is forcibly turned off. S13 Return to the interrupt source. S14 JUMP to the interrupt handler with reference to the original interrupt table.

【0105】図13は本発明の実施の形態7である。本
実施の形態7は、オペレーティングシステムが動作する
カーネル空間(ユーザにより内容が書き替えられないよ
うに保護されている領域)とユーザ空間(ユーザが利用
できる領域)が分離されているシステムであり、割り込
みによりユーザ空間からカーネル空間に移行できるシス
テムに関するものである。
FIG. 13 shows a seventh embodiment of the present invention. The seventh embodiment is a system in which a kernel space in which an operating system operates (an area protected from being rewritten by a user) and a user space (an area usable by a user) are separated. The present invention relates to a system that can transition from user space to kernel space by interruption.

【0106】アプリケーションプログラムから割り込み
によりオペレーティングシステムに移行する。例えば、
ユーザ空間を走行中にハードウェア割り込みやオペレー
ティングシステムへのシステムコール(ソフトウェア割
り込み)が発生すると、ただちにカーネル空間に移行す
る。この動作を利用して、ユーザ空間のみの、もしくは
カーネル空間のみのトレース情報を取得することができ
る。本実施の形態7はユーザ空間のみのトレース情報を
取得するようにしたものである。
The application program shifts to the operating system by interruption. For example,
When a hardware interrupt or a system call (software interrupt) to the operating system occurs while running in the user space, the operation immediately shifts to the kernel space. By utilizing this operation, trace information only in the user space or only in the kernel space can be acquired. In the seventh embodiment, trace information only in the user space is obtained.

【0107】ユーザ空間では、割り込みもしくはシング
ルステップモードによりトレース情報を取得するが、カ
ーネル空間に移行してユーザ空間に戻るまでの間は割り
込みによるトレース情報の収集もしくはシングルステッ
プモードによる割り込みを抑制することにより、アプリ
ケーションプログラムのみトレース情報を収集するが、
オペレーティングシステム内は通常のモードで動作させ
ることができる。
In the user space, trace information is acquired by an interrupt or a single step mode. However, until transition to the kernel space and return to the user space, collection of trace information by the interrupt or suppression of the interrupt by the single step mode are performed. Collects trace information only for application programs,
The operating system can be operated in a normal mode.

【0108】図13は本発明の実施の形態7である。図
13において、他の図と共通の参照番号は共通部分を表
す。71はユーザ空間トレースプログラムであって、ユ
ーザ空間からカーネル空間への移行、カーネル空間から
ユーザ空間への戻りを判定するものである。
FIG. 13 shows a seventh embodiment of the present invention. In FIG. 13, the same reference numerals as those in the other drawings indicate the common parts. A user space tracing program 71 determines a transition from the user space to the kernel space and a return from the kernel space to the user space.

【0109】図13において、OS移行割り込み判定プ
ログラムが、ユーザ空間からカーネル空間への移行、カ
ーネル空間からユーザ空間への戻りを判定する。そし
て、カーネル空間での処理は通常の方法で行ない、ユー
ザ空間では割り込みに基づいてトレース情報を取得す
る。このトレースの方法は、図1の本発明の実施の形態
1もしくは2の場合と同様である。また、シングルステ
ップモードをセットして、シングルステップ割り込みに
より1命令毎にトレース情報をとることもでき、その場
合の動作は本発明の実施の形態3の動作と同様である。
In FIG. 13, the OS transition interrupt determination program determines a transition from the user space to the kernel space and a return from the kernel space to the user space. Then, processing in the kernel space is performed by a normal method, and in the user space, trace information is obtained based on an interrupt. This tracing method is the same as that of the first or second embodiment of the present invention shown in FIG. Further, the single step mode can be set, and trace information can be obtained for each instruction by a single step interrupt. In this case, the operation is the same as the operation of the third embodiment of the present invention.

【0110】上記のようにトレース制御を行なうことに
より、ユーザ空間でのみトレース情報を取得し、カーネ
ル空間でのトレース情報の取得は抑制される。図14
は、本発明の実施の形態7のフローチャートである。
By performing trace control as described above, trace information is acquired only in the user space, and acquisition of trace information in the kernel space is suppressed. FIG.
Is a flowchart according to the seventh embodiment of the present invention.

【0111】S1 割り込みが発生する。 S2 トレース用割り込みテーブルを参照し、トレース
プログラムへJUMPする。
S1 An interrupt is generated. S2 JUMP to the trace program with reference to the trace interrupt table.

【0112】S3 割り込み元がユーザ空間であるかな
いかを判定する。ユーザ空間であればトレースをとる対
象なのでS4の処理をする。ユーザ空間でなくオペレー
ティングシステムの空間(カーネル空間)での割り込み
であればトレースをとらないので、S11の処理をす
る。
S3: It is determined whether or not the interrupt source is the user space. If it is a user space, the process of S4 is performed because it is a target to be traced. If an interrupt occurs not in the user space but in the operating system space (kernel space), no trace is taken, so the process of S11 is performed.

【0113】S4 その割り込みのトレース情報を取得
するか判定する。トレース情報を取得する必要があるな
らS5の処理を行ない、トレース情報を取得する必要が
ないならS6の処理をする。
S4: It is determined whether the trace information of the interrupt is obtained. If it is necessary to acquire the trace information, the process of S5 is performed, and if it is not necessary to acquire the trace information, the process of S6 is performed.

【0114】S5 トレース領域へトレース情報を出力
する。 S6 トレース情報を取得する必要がないか、もしくは
S6のトレース情報をトレース記録領域へ出力したら、
シングルステップ制御フラグを判定し、シングルステッ
プ割り込みモードであるか判定する。シングルステップ
割り込みであればS7の処理を行ない、シングルステッ
プ割り込みでなければ、S9の処理を行なう。 S7 次のステップでもシングルステップ割り込みをす
るかを判定し、シングルステップ割り込みフラグ制御を
する。即ち、次のステップでもシングルステップ割り込
みをするならシングルステップフラグを立てたままに
し、シングルステップ割り込みをしないならシングルス
テップフラグを下ろす。
S5 Outputs trace information to the trace area. If it is not necessary to acquire the S6 trace information, or if the trace information of S6 is output to the trace recording area,
The single-step control flag is determined, and it is determined whether the mode is the single-step interrupt mode. If it is a single step interrupt, the process of S7 is performed, and if it is not a single step interrupt, the process of S9 is performed. S7 It is determined whether a single step interrupt is to be performed in the next step, and the single step interrupt flag is controlled. That is, the single step flag is kept set if a single step interrupt is to be performed in the next step, and the single step flag is lowered if the single step interrupt is not to be performed.

【0115】S8 割り込み元へリターンし、次の割り
込みを待つ。 S9 S6でシングルステップ割り込みでないと判定さ
れたら、オリジナル割り込みハンドラのためのシングル
ステップフラグ制御をする。オリジナル割り込みハンド
ラの処理において、シングルステップ制御をするなら、
シングルステップフラグを立て、シングルステップ制御
をしないなら、シングルステップフラグを立てない。
S8: Return to the interrupt source and wait for the next interrupt. S9 If it is determined in S6 that the interrupt is not a single step interrupt, a single step flag control for the original interrupt handler is performed. If single-step control is performed in the processing of the original interrupt handler,
If the single step flag is set and the single step control is not performed, the single step flag is not set.

【0116】S10 オリジナル割り込みテーブルを参
照して、割り込みハンドラへJUMPする。 S11 S3で割り込み元がユーザ空間でないのでトレ
ースをとらない。そこで、シングルステップ割り込みか
判定する。シングルステップ割り込みであれば、S12
の処理を行ない、シングルステップ割り込みでなけれ
ば、S14の処理を行なう。
S10 JUMPs to the interrupt handler with reference to the original interrupt table. S11 In S3, no trace is taken because the interrupt source is not in the user space. Therefore, it is determined whether the interrupt is a single step interrupt. If it is a single step interrupt, S12
If the processing is not a single step interrupt, the processing of S14 is performed.

【0117】S12 シングルステップ制御としないた
めに、シングルステップフラグを強制的にオフにする。 S13 割り込み元へリターンする。
S12: The single step flag is forcibly turned off so as not to perform the single step control. S13 Return to the interrupt source.

【0118】S14 オリジナル割り込みテーブルを参
照し、割り込みハンドラへJUMPし、割り込みハンド
ラで割り込み処理をする。 図15は本発明の実施の形態8である。
S14 Referring to the original interrupt table, JUMP to the interrupt handler, and the interrupt handler processes the interrupt. FIG. 15 shows an eighth embodiment of the present invention.

【0119】本発明の実施の形態8は、カーネル空間で
の割り込みのみをトレースし、ユーザ空間での割り込み
のトレースは行なわないようにしたものである。この点
以外は本発明の実施の形態7と同様である。
Embodiment 8 of the present invention traces only interrupts in the kernel space and does not trace interrupts in the user space. Except for this point, it is the same as the seventh embodiment of the present invention.

【0120】図15において他の図面と同じ参照番号は
同じものを表す。72はカーネル空間トレースプログラ
ムであって、カーネル空間への移行、ユーザ空間への戻
りを判定するものである。
In FIG. 15, the same reference numerals as those in the other drawings denote the same parts. Reference numeral 72 denotes a kernel space tracing program for determining a shift to the kernel space and a return to the user space.

【0121】図16は、本発明の実施の形態8のフロー
チャートである。S3で、割り込み元がカーネル空間で
あるかないかを判定する以外は、図14のフローチャー
トと同様である。
FIG. 16 is a flowchart according to the eighth embodiment of the present invention. The process is the same as the flowchart in FIG. 14 except that it is determined in S3 whether the interrupt source is in the kernel space.

【0122】図17は本発明のシステム構成の実施の形
態である。図17において、81はコンピュータであ
る。
FIG. 17 shows an embodiment of the system configuration of the present invention. In FIG. 17, reference numeral 81 denotes a computer.

【0123】82はCPUである。83は主記憶であ
る。84は入出力インタフェースである。
Reference numeral 82 denotes a CPU. 83 is a main memory. 84 is an input / output interface.

【0124】85は内部補助記憶装置であって、内部磁
気ディスク装置等である。86は内部補助記憶装置にロ
ードされたオペレーションプログラムである。87は内
部補助記憶装置にロードされたアプリケーションプログ
ラムである。
Reference numeral 85 denotes an internal auxiliary storage device such as an internal magnetic disk device. Reference numeral 86 denotes an operation program loaded in the internal auxiliary storage device. Reference numeral 87 denotes an application program loaded in the internal auxiliary storage device.

【0125】88は内部補助記憶装置にロードされた本
発明のトレースプログラムである。91は、ドライブ装
置であって、記憶媒体92のプログラムをコンピュータ
にロードする装置である。
Reference numeral 88 denotes a trace program of the present invention loaded in the internal auxiliary storage device. Reference numeral 91 denotes a drive device, which is a device for loading a program of the storage medium 92 into a computer.

【0126】92は記憶媒体であって、磁気ディスク装
置、CDROM等の本発明のトレースプログラムを格納
する記憶媒体である。93は外部補助記憶装置である。
Reference numeral 92 denotes a storage medium, such as a magnetic disk device or a CDROM, for storing the trace program of the present invention. 93 is an external auxiliary storage device.

【0127】図17の構成において、本発明を実施する
時は、記憶媒体に格納されている本発明のトレースプロ
グラムをコンピュータに81にロードし、トレースを収
集するアプリケーションプログラムもしくはオペレーテ
ィングシステムのトレースをとる。
In the configuration of FIG. 17, when implementing the present invention, the trace program of the present invention stored in the storage medium is loaded into the computer 81, and the trace of the application program or operating system for collecting the trace is taken. .

【0128】図18は本発明の記憶媒体の実施の形態で
ある。記憶媒体に本発明のトレースプログラムを格納す
る。記憶媒体は磁気ディスク装置等の磁気記憶媒体、あ
るいはCDROM等の光記憶媒体、もしくはその他、プ
ログラムを記憶できる記憶媒体を使用することができ
る。
FIG. 18 shows an embodiment of the storage medium of the present invention. The trace program of the present invention is stored in a storage medium. As the storage medium, a magnetic storage medium such as a magnetic disk device, an optical storage medium such as a CDROM, or a storage medium capable of storing a program can be used.

【0129】[0129]

【発明の効果】本発明によれば、ハードウェアやオペレ
ーティングシステム、もしくはアプリケーションプログ
ラムに手を加えることなくトレース情報を容易に取得す
ることができる。また、シングルステップモードにより
1命令毎のトレースも可能なので、システムの全挙動の
トレースが可能である。
According to the present invention, trace information can be easily obtained without modifying the hardware, operating system, or application program. In addition, since tracing for each instruction can be performed in the single step mode, tracing of all behaviors of the system is possible.

【0130】また、トレース対象とするタスクもしくは
空間(ユーザ空間、カーネル空間)を絞ったトレースも
行なうことが可能である。トレースプログラムを動的に
ロードもしくはアンロードできるので、任意のシステム
において任意の時にトレースの収集を行なうことができ
る。従って、本発明によれば、ユーザのいかなる環境で
もシステムを停止、変更することなく任意のトレース情
報を収集できる。
It is also possible to perform a trace in which the task or space (user space, kernel space) to be traced is narrowed. Since the trace program can be dynamically loaded or unloaded, the trace can be collected at any time in any system. Therefore, according to the present invention, arbitrary trace information can be collected in any environment of the user without stopping or changing the system.

【0131】以上の説明に更に以下の項を開示する。 (1)割り込み手段についての情報を保持する割り込み
情報保持手段を備え、割り込みが発生したとき該割り込
み情報保持手段を参照して、割り込み手段の位置情報を
求め、割り込み処理をするシステムにおけるプログラム
トレース装置において、割り込み手段の位置情報を保持
するオリジナル割り込み情報保持手段と、プログラムの
トレース情報を取得するトレース手段とを備え、該トレ
ース手段は、CPUの内部情報および主記憶を参照して
トレース情報を取得するトレース情報収集手段と、トレ
ース情報収集手段の位置情報を保持するトレース用割り
込み情報保持手段を作成するトレース用割り込み情報作
成手段とを備え、トレース情報を収集する時、使用する
割り込み情報保持手段をオリジナル割り込み情報保持手
段からトレース用割り込み情報保持手段に切り替え、割
り込みが発生した時に、トレース用割り込み情報保持手
段に保持されている発生した割り込みの位置情報に対応
するトレース情報収集手段により,CPUの内部情報お
よび主記憶を参照してトレース情報を収集することを特
徴とするプログラムトレース装置。
The following items are further disclosed in the above description. (1) A program trace device in a system that includes interrupt information holding means for holding information on an interrupt means, refers to the interrupt information holding means when an interrupt occurs, obtains position information of the interrupt means, and performs interrupt processing. And an original interrupt information holding means for holding position information of the interrupt means, and a trace means for obtaining trace information of a program, wherein the trace means obtains trace information by referring to internal information and main memory of the CPU. Trace information collecting means, and trace interrupt information creating means for creating trace interrupt information holding means for holding position information of the trace information collecting means, wherein the interrupt information holding means to be used when collecting trace information is provided. For trace from the original interrupt information holding means When the interrupt occurs, the trace information collecting means corresponding to the position information of the generated interrupt held in the trace interrupt information holding means refers to the internal information and main memory of the CPU. A program tracing device for collecting trace information by using a computer.

【0132】(2)該システムは、1命令毎に割り込み
制御が可能なシステムであり、1命令毎にトラップ割り
込みを発生させることにより1命令毎の情報をトレース
することを特徴とする(1)項に記載のプログラムトレ
ース装置。
(2) The system is capable of interrupt control for each instruction, and traces information for each instruction by generating a trap interrupt for each instruction. (1) The program trace device according to the paragraph.

【0133】(3)該システムは、分岐割り込み毎に制
御が可能なシステムであり、分岐毎にトラップ割り込み
を発生させることにより分岐ブロック毎の情報をトレー
スすることを特徴とする(1)項もしくは(2)項に記
載のプログラムトレース装置。
(3) The system is a system capable of controlling for each branch interrupt, and traces information for each branch block by generating a trap interrupt for each branch. (2) The program trace apparatus according to (2).

【0134】(4)該システムは、タスク毎に割り込み
制御情報を保持し、タスク単位で1命令毎あるいは分岐
命令毎の割り込み制御を行うことのできるマルチタスク
機能を備えるものであり、タスク毎に割り込み制御を設
定することにより所定のタスクのみトレース情報を取得
することを特徴とする(1)項もしくは(2)項もしく
は(3)項に記載のプログラムトレース装置。
(4) The system has a multitask function capable of holding interrupt control information for each task and performing interrupt control for each instruction or each branch instruction in a task unit. The program trace apparatus according to the above mode (1), (2) or (3), wherein trace information is obtained only for a predetermined task by setting interrupt control.

【0135】(5)該システムは、タスク毎に一意の番
号を保持するマルチタスク機能を備えるものであり、タ
スクが切り替えられた時に該トレース手段は切り替えら
れたタスク番号を認識し、トレースを行なうタスクであ
ればトレース情報を取得することにより所定のタスクの
みトレース情報を取得することを特徴とする(1)項も
しくは(2)項もしくは(3)項に記載のプログラムト
レース装置。
(5) The system is provided with a multitask function for holding a unique number for each task. When a task is switched, the tracing means recognizes the switched task number and traces. The program tracing device according to the above mode (1), (2) or (3), wherein if the task is a task, the trace information is obtained by acquiring the trace information only for a predetermined task.

【0136】(6)該システムは、オペレーションシス
テムが動作するカーネル空間とアプリケーションプログ
ラムが動作するユーザ空間が分離され、ユーザ空間から
カーネル空間への呼出しに割り込み命令を使用するもの
であり、該ユーザ空間からカーネル空間への移行とユー
ザ空間への戻りを認識し、ユーザ空間もしくはカーネル
空間に対してのみトレースすることを特徴とする(1)
項もしくは(2)項もしくは(3)項に記載のプログラ
ムトレース装置。
(6) In the system, a kernel space in which an operation system operates and a user space in which an application program operates are separated, and an interrupt instruction is used for calling from the user space to the kernel space. (1) that recognizes the transition from the user to the kernel space and the return to the user space, and traces only to the user space or the kernel space.
Item or the program tracing device according to item (2) or (3).

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

【図1】本発明の基本構成を示す図である。FIG. 1 is a diagram showing a basic configuration of the present invention.

【図2】本発明の実施の形態1を示す図である。FIG. 2 is a diagram showing a first embodiment of the present invention.

【図3】本発明の実施の形態2を示す図である。FIG. 3 is a diagram showing a second embodiment of the present invention.

【図4】本発明の実施の形態1、実施の形態2のフロー
チャートを示す図である。
FIG. 4 is a diagram showing a flowchart of Embodiments 1 and 2 of the present invention.

【図5】本発明の実施の形態3を示す図である。FIG. 5 is a diagram showing a third embodiment of the present invention.

【図6】本発明の実施の形態3のフローチャートを示す
図である。
FIG. 6 is a diagram showing a flowchart of a third embodiment of the present invention.

【図7】本発明の実施の形態4を示す図である。FIG. 7 is a diagram showing a fourth embodiment of the present invention.

【図8】本発明の実施の形態4のフローチャートを示す
図である。
FIG. 8 is a diagram showing a flowchart of a fourth embodiment of the present invention.

【図9】本発明の実施の形態5を示す図である。FIG. 9 is a diagram showing a fifth embodiment of the present invention.

【図10】本発明の実施の形態5のフローチャートを示
す図である。
FIG. 10 is a diagram showing a flowchart of a fifth embodiment of the present invention.

【図11】本発明の実施の形態6を示す図である。FIG. 11 shows a sixth embodiment of the present invention.

【図12】本発明の実施の形態6のフローチャートを示
す図である。
FIG. 12 is a diagram showing a flowchart of a sixth embodiment of the present invention.

【図13】本発明の実施の形態7を示す図である。FIG. 13 is a diagram showing a seventh embodiment of the present invention.

【図14】本発明の実施の形態7のフローチャートを示
す図である。
FIG. 14 is a diagram showing a flowchart of a seventh embodiment of the present invention.

【図15】本発明の実施の形態8を示す図である。FIG. 15 is a diagram showing an eighth embodiment of the present invention.

【図16】本発明の実施の形態8のフローチャートを示
す図である。
FIG. 16 is a view showing a flowchart of the eighth embodiment of the present invention.

【図17】本発明のシステム構成の実施の形態を示す図
である。
FIG. 17 is a diagram showing an embodiment of a system configuration of the present invention.

【図18】本発明の記憶媒体の実施の形態を示す図であ
る。
FIG. 18 is a diagram showing an embodiment of a storage medium of the present invention.

【符号の説明】 1:オリジナル割り込み情報保持手段 2:トレース用割り込み情報保持手段 3:オペレーティングシステム 4:割り込み手段 5:トレース手段 6:トレース用割り込み情報作成手段 7:トレース記録領域 8:アプリケーションプログラム 9:制御手段[Description of Signs] 1: Original interrupt information holding means 2: Trace interrupt information holding means 3: Operating system 4: Interrupt means 5: Trace means 6: Trace interrupt information creating means 7: Trace recording area 8: Application program 9 : Control means

───────────────────────────────────────────────────── フロントページの続き (72)発明者 久門 耕一 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内 Fターム(参考) 5B042 AA03 BB23 BB25 CC11 DD06 EA03 EA18 FD01 FD07  ────────────────────────────────────────────────── ─── Continued on the front page (72) Inventor Koichi Kumon 4-1-1, Kamidadanaka, Nakahara-ku, Kawasaki-shi, Kanagawa F-term in Fujitsu Limited (Reference) 5B042 AA03 BB23 BB25 CC11 DD06 EA03 EA18 FD01 FD07

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 割り込み手段についての情報を保持する
割り込み情報保持手段を備え、割り込みが発生したとき
該割り込み情報保持手段を参照して、割り込み手段の位
置情報を求め、割り込み処理をするシステムにおけるプ
ログラムトレース装置において、 割り込み手段の位置情報を保持するオリジナル割り込み
情報保持手段と、プログラムのトレース情報を取得する
トレース手段とを備え、 該トレース手段は、CPUの内部情報および主記憶を参
照してトレース情報を取得するトレース情報収集手段
と、トレース情報収集手段の位置情報を保持するトレー
ス用割り込み情報保持手段を作成するトレース用割り込
み情報作成手段とを備え、 トレース情報を収集する時、使用する割り込み情報保持
手段をオリジナル割り込み情報保持手段からトレース用
割り込み情報保持手段に切り替え、割り込みが発生した
時に、トレース用割り込み情報保持手段に保持されてい
る発生した割り込みの位置情報に対応するトレース情報
収集手段により,CPUの内部情報および主記憶を参照
してトレース情報を収集することを特徴とするプログラ
ムトレース装置。
1. A program in a system, comprising: interrupt information holding means for holding information on an interrupt means, wherein when an interrupt occurs, position information of the interrupt means is obtained by referring to the interrupt information holding means and interrupt processing is performed. A tracing device, comprising: original interrupt information holding means for holding position information of the interrupt means; and tracing means for acquiring trace information of the program, wherein the tracing means refers to the internal information and the main memory of the CPU for the trace information Trace information collecting means for acquiring the position information of the trace information collecting means, and trace interrupt information creating means for creating the trace interrupt information holding means for holding the trace information collecting means, and holding the interrupt information used when collecting the trace information From the original interrupt information holding means. Switch to the race interrupt information holding means, and when an interrupt occurs, refer to the internal information and main memory of the CPU by the trace information collecting means corresponding to the position information of the generated interrupt held in the trace interrupt information holding means. A program tracing device, which collects trace information by performing a program.
【請求項2】 該システムは、割り込み情報保持手段の
領域のアドレスを保持する割り込みテーブルレジスタを
備え、オリジナル割り込み情報保持手段のアドレスをア
ドレスA、およびトレース用割り込み情報保持手段の作
成されるアドレスをアドレスBとした時、 トレース情報を収集する時に、割り込みテーブルレジス
タの値をアドレスAからアドレスBに変更することを特
徴とする請求項1に記載のプログラムトレース装置。
2. The system according to claim 1, further comprising: an interrupt table register for holding an address of an area of the interrupt information holding means. 2. The program tracing apparatus according to claim 1, wherein when the trace information is collected, the value of the interrupt table register is changed from the address A to the address B when the trace information is collected.
【請求項3】 オリジナル割り込み情報保持手段を退避
領域に退避する手段を備え、 トレース情報を収集する時は、該オリジナル割り込み情
報保持手段を退避領域に退避し、オリジナル割り込み情
報保持手段の退避前にあったアドレスにトレース用割り
込み保持手段を作成することを特徴とする請求項1に記
載のプログラムトレース装置。
3. The system according to claim 1, further comprising means for saving the original interrupt information holding means in a save area. When collecting trace information, the original interrupt information holding means is saved in a save area, and before the original interrupt information holding means is saved. 2. The program tracing apparatus according to claim 1, wherein a trace interrupt holding unit is created at a given address.
【請求項4】 割り込み手段についての割り込み情報を
保持し、割り込みが発生したとき該割り込み情報を参照
して、割り込み手段の位置情報を求め、割り込み処理を
するシステムにおけるプログラムトレース方法におい
て、 割り込み手段の位置情報を保持するオリジナル割り込み
情報を保持し、 トレース情報収集手段の位置情報を保持するトレース用
割り込み情報を作成して保持し、 トレース情報を取得する時、オリジナル割り込み情報の
参照からトレース用割り込み情報の参照に切り替え、割
り込みが発生した時に、トレース用割り込み情報の発生
した割り込みの位置情報に対応するトレース情報収集手
段により,CPUの内部情報および主記憶を参照してト
レース情報を収集することを特徴とするプログラムトレ
ース方法。
4. A program tracing method in a system for holding interrupt information on an interrupt means, referring to the interrupt information when an interrupt occurs, obtaining position information of the interrupt means, and performing an interrupt process. Holds the original interrupt information that holds the position information. Creates and holds the trace interrupt information that holds the position information of the trace information collection means. When acquiring the trace information, the trace interrupt information is obtained by referring to the original interrupt information. When an interrupt occurs, trace information is collected by referring to the internal information and main memory of the CPU by a trace information collecting means corresponding to the position information of the interrupt in which the trace interrupt information has occurred. Program tracing method.
【請求項5】 割り込みプログラムについての情報を保
持する割り込み情報を保持し、割り込みが発生したとき
該保持されている割り込み情報を参照して、割り込みプ
ログラムの位置情報を求め、割り込み処理をするシステ
ムにおけるトレースプログラムを記憶した記憶媒体にお
いて、 プログラムのトレース情報を取得するトレースプログラ
ムを備え、 該トレースプログラムは、CPUの内部情報および主記
憶を参照してトレース情報を取得するトレース情報収集
プログラムと、トレース情報収集プログラムの位置情報
を作成して保持するトレース用割り込み情報作成プログ
ラムを含み、 トレース情報を取得する時、割り込み手段の位置情報を
もつオリジナル割り込み情報の参照からトレース用割り
込み情報の参照に切り替え、割り込みが発生した時に、
トレース用割り込み情報の発生した割り込みの位置情報
に対応するトレース情報収集プログラムにより,CPU
の内部情報および主記憶を参照してトレース情報を収集
するトレースプログラムを記憶することを特徴とする記
憶媒体。
5. A system which holds interrupt information for holding information on an interrupt program, refers to the held interrupt information when an interrupt occurs, obtains position information of the interrupt program, and performs interrupt processing. A storage medium storing a trace program, comprising: a trace program for acquiring trace information of the program; the trace program comprising: a trace information collection program for acquiring trace information by referring to internal information and main storage of a CPU; Includes a trace interrupt information creation program that creates and holds the location information of the collection program. When acquiring trace information, switches from referencing the original interrupt information that has the location information of the interrupt means to referring to the trace interrupt information, and interrupts Departs When born
The trace information collection program corresponding to the position information of the interrupt where the trace interrupt information occurred generates a CPU
A storage medium for storing a trace program for collecting trace information by referring to internal information and a main storage of the storage medium.
JP10242670A 1998-08-28 1998-08-28 Device and method for tracing program and storage medium storing program therefor Pending JP2000076095A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10242670A JP2000076095A (en) 1998-08-28 1998-08-28 Device and method for tracing program and storage medium storing program therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10242670A JP2000076095A (en) 1998-08-28 1998-08-28 Device and method for tracing program and storage medium storing program therefor

Publications (1)

Publication Number Publication Date
JP2000076095A true JP2000076095A (en) 2000-03-14

Family

ID=17092498

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10242670A Pending JP2000076095A (en) 1998-08-28 1998-08-28 Device and method for tracing program and storage medium storing program therefor

Country Status (1)

Country Link
JP (1) JP2000076095A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7350110B2 (en) 2002-01-14 2008-03-25 International Business Machines Corporation Method and system using hardware assistance for continuance of trap mode during or after interruption sequences
JP2012164098A (en) * 2011-02-06 2012-08-30 Mitsubishi Electric Corp Entry rewriting device and entry rewriting program
JP2012194707A (en) * 2011-03-15 2012-10-11 Fujitsu Ltd Information processing device, portable terminal device, and control method of log output in information processing device
JP2014508367A (en) * 2011-03-14 2014-04-03 エイアールエム リミテッド Diagnostic code using single-step execution

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7350110B2 (en) 2002-01-14 2008-03-25 International Business Machines Corporation Method and system using hardware assistance for continuance of trap mode during or after interruption sequences
US7506207B2 (en) 2002-01-14 2009-03-17 International Business Machines Corporation Method and system using hardware assistance for continuance of trap mode during or after interruption sequences
JP2012164098A (en) * 2011-02-06 2012-08-30 Mitsubishi Electric Corp Entry rewriting device and entry rewriting program
JP2014508367A (en) * 2011-03-14 2014-04-03 エイアールエム リミテッド Diagnostic code using single-step execution
JP2012194707A (en) * 2011-03-15 2012-10-11 Fujitsu Ltd Information processing device, portable terminal device, and control method of log output in information processing device

Similar Documents

Publication Publication Date Title
JPH06222952A (en) Debug supporting device
US7765434B2 (en) Resource efficient software tracing for problem diagnosis
US5095426A (en) Data processing system for effectively handling exceptions during execution of two different types of instructions
CN113778838B (en) Binary program dynamic stain analysis method and device
US6347368B1 (en) Microcomputing device for exchanging data while executing an application
JP2000076095A (en) Device and method for tracing program and storage medium storing program therefor
CN116450398A (en) Exception backtracking method, device, equipment and medium
JPH1196006A (en) Information processor
JPH0668725B2 (en) Device for responding to interrupt condition in data processing system and method for responding to asynchronous interrupt condition
CN115470151B (en) Application operation analysis method, computing device and storage medium
JP2663895B2 (en) CPU simulator
JP2658982B2 (en) Specific instruction execution detection method
JP3110391B2 (en) Program re-execution method
JP2842571B2 (en) Procedure call method
JP3309792B2 (en) Stack pointer trace device, stack pointer trace method, and recording medium
JPH0561717A (en) Program debugging device
JPH08320813A (en) Program simulator device and program debugging method
JPS6270947A (en) Control system for debug interruption
JPS5835648A (en) Program execution controlling system
JPS6042968B2 (en) information processing equipment
JP2591818B2 (en) Auxiliary function selection control method
JP3130421B2 (en) Program analysis method and apparatus
JPH0535499A (en) Data processing device and method
JPH0721057A (en) Method and equipment for debugging of programmed computer
JPH08263324A (en) Debug facilitation device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040406