JP2002014843A - Program execution trace system - Google Patents

Program execution trace system

Info

Publication number
JP2002014843A
JP2002014843A JP2000198342A JP2000198342A JP2002014843A JP 2002014843 A JP2002014843 A JP 2002014843A JP 2000198342 A JP2000198342 A JP 2000198342A JP 2000198342 A JP2000198342 A JP 2000198342A JP 2002014843 A JP2002014843 A JP 2002014843A
Authority
JP
Japan
Prior art keywords
trace
address
program
data
exception
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2000198342A
Other languages
Japanese (ja)
Inventor
Yukinori Endo
幸典 遠藤
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2000198342A priority Critical patent/JP2002014843A/en
Publication of JP2002014843A publication Critical patent/JP2002014843A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a program execution trace system for instantaneously presenting trace information related with a data change history when any failure is generated due to memory destruction. SOLUTION: This system is provided with a table to be checked in which the address of certain data in a program to be debugged and an exceptional stop condition for stopping the program to be debugged when any writing protection exception is generated for the data, a writing protection attribute setting part for setting information related with the address to be checked and the exceptional stop condition in the table to be checked, and for operating a memory control unit to inhibit writing in a page including the data, and a writing protection exception handler to be started at the time of receiving the notification of the writing protection exception for the address to be checked for stopping the program to be debugged, and for presenting trace information until that time when the exceptional stop condition is fulfilled.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、主メモリをページ
と呼ばれる固定長単位で管理し、ページ単位でアクセス
制御を可能にする保護機構を有するコンピュータシステ
ム上で、たとえば、不正なデータアクセスを契機とする
プログラム実行障害が発生した時に、デバッガと連携し
て、障害の契機となったデータの変更履歴を保持するプ
ログラム実行トレース方式に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer system having a protection mechanism that manages a main memory in fixed length units called pages and enables access control in page units. The present invention relates to a program execution tracing method that, when a program execution failure occurs, cooperates with a debugger to retain a change history of data that triggered the failure.

【0002】[0002]

【従来の技術】プログラムのデバッグを行う場合、主メ
モリ上の特定アドレスに配置されたデータの内容がある
特定の値に変更される時点で、プログラムの実行状況を
確認することが要求される場合がある。従来のデバッグ
装置には、専用のハードウェアを付加することなくソフ
トウェアのみで、ある特定のデータの値が変更される瞬
間に遅延なくプログラムの実行を停止することにより、
このような要求を実現しているものがある。例えば、特
開平8−30485に示されたデバッグ装置がこれに該
当する。
2. Description of the Related Art When debugging a program, it is required to confirm the execution status of the program when the content of data located at a specific address on a main memory is changed to a specific value. There is. Conventional debugging devices are designed to stop execution of a program without delay at the moment when the value of certain data is changed, using only software without adding dedicated hardware.
Some have fulfilled such demands. For example, the debug device disclosed in Japanese Patent Application Laid-Open No. 8-30485 corresponds to this.

【0003】次に、動作について説明する。図14は、
従来のデバッグ装置を示す図である。デバッグ対象プロ
グラム1のデバッグを行う時、まずオペレータは、コン
ソール7を操作してデバッガ本体6にブレーク条件を設
定する。ここで設定されたブレーク条件は、メモリ3内
の検査対象アドレス4の内容がある特定の値になったと
きにブレークするという条件である。デバッガ本体6か
らブレーク条件を通知されたブレーク条件設定手段8
は、ブレーク条件を書込み保護例外ハンドラ5に通知す
ると共に、メモリ管理ユニット2を操作して検査対象ア
ドレス4を含むページに対して書込み禁止属性を設定す
る。その後、デバッガ本体6はデバッグ対象プログラム
1を起動する。デバッグ対象プログラム1が検査対象ア
ドレス4を含むページに書込みを行うと、メモリ管理ユ
ニット2で書込み保護例外が発生し、書込み保護例外ハ
ンドラ5が起動される。書込み保護例外ハンドラ5内で
は、検査対象アドレス4を含むページ内で書込み保護例
外を発生させたアドレスがブレーク条件に設定された検
査対象アドレス4と一致するかどうかを調べる。書込み
保護例外の設定はページ単位なので、書き込み禁止にし
たページ内の任意のアドレスに対してデータ変更(書き
込み)を行おうとした時に例外が発生する。すなわち、
検査対象アドレスと一致しない近傍アドレスに対しても
書込み保護例外は発生するので書込み保護例外を発生さ
せたアドレスがブレーク条件に設定された検査対象アド
レスと一致するかというチェックをする。一致する場合
は、さらに変更値がブレーク条件に該当しているかどう
かを調べる。ブレーク条件に該当している場合は、デバ
ッガ本体6を呼び出す。これにより、オペレータはコン
ソール7を介してデバッグ対象プログラム1の状態を検
査することができる。なお、上記の各検査の過程で検査
対象アドレス4及びブレーク条件に一致しない場合、及
びデバッグ対象プログラム1の実行を継続する場合は、
一旦書込み禁止属性の設定を解除し、メモリアドレスに
書込みを実行したあと、デバッグ対象プログラム1に復
帰する。
Next, the operation will be described. FIG.
FIG. 9 is a diagram illustrating a conventional debugging device. When debugging the debug target program 1, first, the operator operates the console 7 to set a break condition in the debugger body 6. The break condition set here is a condition that a break occurs when the content of the inspection target address 4 in the memory 3 reaches a specific value. Break condition setting means 8 notified of a break condition from debugger body 6
Notifies the write protection exception handler 5 of the break condition, and operates the memory management unit 2 to set the write protection attribute for the page including the inspection target address 4. After that, the debugger body 6 starts the debug target program 1. When the debug target program 1 writes to the page including the inspection target address 4, a write protection exception occurs in the memory management unit 2, and the write protection exception handler 5 is activated. In the write protection exception handler 5, it is checked whether or not the address that caused the write protection exception in the page including the check target address 4 matches the check target address 4 set in the break condition. Since the setting of the write protection exception is performed on a page basis, an exception occurs when an attempt is made to change (write) data at an arbitrary address in a write-protected page. That is,
Since a write protection exception also occurs for a neighboring address that does not match the inspection target address, it is checked whether the address that caused the write protection exception matches the inspection target address set in the break condition. If they match, it is further checked whether the changed value meets the break condition. If the break condition is met, the debugger body 6 is called. As a result, the operator can inspect the state of the debug target program 1 via the console 7. In the case where the inspection target address 4 and the break condition do not match in the course of each of the above inspections, and when the execution of the debug target program 1 is continued,
The setting of the write prohibition attribute is temporarily released, and after writing to the memory address, the program returns to the debug target program 1.

【0004】以上のように、従来のデバッグ装置では、
メモリ管理ユニット2による書込み保護例外の発生を契
機として、ソフトウェアのみにより、指定したメモリア
ドレスへのデータ書込み時点で遅延なく、デバッグ対象
プログラム1を停止させることができる。
As described above, in the conventional debugging device,
Triggered by the occurrence of the write protection exception by the memory management unit 2, the debug target program 1 can be stopped without delay at the time of writing data to the specified memory address only by software.

【0005】[0005]

【発明が解決しようとする課題】メモリ破壊に起因する
障害では、メモリ上のデータを損傷させるコードが存在
する場所と、そのデータを使用することによって障害を
起こす場所とはしばしば無関係であり、時間的にも離れ
ていることがある。従って、この種の障害に関するデバ
ッグ作業は困難を伴う。従来のデバッグ装置では、ブレ
ーク条件に一致するたびにデバッグ対象プログラムが停
止し、その都度オペレータがデバッグ対象プログラムの
状態を検査し、必要ならプログラムの実行を継続する操
作を行う。プログラムの実行を継続する場合、データの
変更履歴が保持されないため、オペレータは必要に応じ
て変更履歴を紙に記録しておき、あとで不正なデータ書
込みが行われたと判断されるポイントを検討する手間が
発生する。また、ブレーク条件の指定において、不正と
判断されるデータ値は個別に異なるため、最初から適切
なブレーク条件を指定するのは困難であり、ブレーク条
件を変更して始めから再実行する必要が生じる場合もあ
る。このように、実際にデバッグ作業を行う上で効率が
悪いという問題点があった。
In a fault due to memory corruption, the location of the code that damages the data in memory is often independent of the location where the failure occurs by using that data. May be far away. Therefore, debugging work for this type of failure is difficult. In the conventional debugging device, the debug target program stops every time a break condition is met, and each time the operator checks the state of the debug target program, and performs an operation to continue the program execution if necessary. When the program execution is continued, since the data change history is not retained, the operator records the change history on paper as necessary, and examines a point at which it is determined that unauthorized data writing has been performed later. It takes time. Also, in specifying break conditions, it is difficult to specify an appropriate break condition from the beginning because data values determined to be invalid are individually different, and it is necessary to change the break condition and re-execute from the beginning. In some cases. As described above, there is a problem that the efficiency of the actual debugging operation is low.

【0006】本発明は上記のような問題点を解決するた
めになされたもので、メモリ上のデータ変更をトレース
し、メモリ破壊に起因して障害が発生した際に即座にデ
ータ変更履歴に関するトレース情報を提示することによ
り、デバッグ効率を向上させることを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and traces data changes in a memory, and immediately traces a data change history when a failure occurs due to memory corruption. An object of the present invention is to improve debugging efficiency by presenting information.

【0007】[0007]

【課題を解決するための手段】この発明に係るプログラ
ム実行トレース方式は、デバッグ対象プログラム内のあ
るデータを検査対象のデータとして指定し、デバッグ対
象プログラムを停止させる例外停止条件を指定し、その
データを含むページを書込み禁止にし、そのデータに対
する書込み保護例外の発生を契機としてそのデータに対
するトレース情報を記憶するとともに、発生した書込み
保護例外が例外停止条件に一致した時にデバッグ対象プ
ログラムを停止させそのデータに関するそれまでのトレ
ース情報を提示することを特徴とする。
A program execution trace method according to the present invention designates certain data in a program to be debugged as data to be inspected, designates an exceptional stop condition for stopping the program to be debugged, and specifies the data. And write-protect the page containing the data, store the trace information for that data in response to the occurrence of a write protection exception for that data, and stop the program to be debugged when the generated write protection exception matches the exception stop condition. The present invention is characterized in that trace information up to that point is presented.

【0008】この発明に係るプログラム実行トレース方
式は、 (a)オペレータがデバッグ操作を行うためのデバッガ
本体 (b)デバッグ対象プログラムを実行するための命令実
行ユニット (c)デバッグ対象プログラムの命令やデータが配置さ
れるメモリユニット (d)メモリユニットをページ単位でアクセス制御を可
能にする保護機構を有し、書込み保護を設定しているペ
ージ内のデータに対して書込みが発生した時に書込み保
護例外を通知するメモリ管理ユニット (e)デバッグ対象プログラム内のあるデータのアドレ
ス(これを検査対象アドレスと呼ぶ)と、そのデータに
対して書込み保護例外が発生した時にデバッグ対象プロ
グラムを停止させるための例外停止条件とを保持する検
査対象テーブル (f)デバッグ対象プログラム内の検査対象アドレスと
例外停止条件に関する情報を検査対象テーブルに設定す
ると共に、そのデータを含むページに対する書込みを禁
止するようにメモリ管理ユニットを操作する書込み保護
属性設定部 (g)デバッグ対象プログラム内の検査対象アドレスに
対する書込み保護例外の通知を受けて起動され、例外停
止条件が満足される場合はデバッグ対象プログラムを停
止しそれまでのトレース情報を提示するとともに、満足
されない場合はトレース処理を依頼する書込み保護例外
ハンドラ (h)書込み保護例外ハンドラのトレース処理の依頼に
基づき、検査対象アドレスに対して書込みが発生した時
に、トレース情報を記憶するトレース本体。
The program execution trace method according to the present invention includes: (a) a debugger body for an operator to perform a debugging operation; (b) an instruction execution unit for executing a debug target program; and (c) instructions and data of the debug target program. (D) The memory unit has a protection mechanism that enables access control of the memory unit in page units. When a write occurs to data in a page for which write protection is set, a write protection exception is generated. Memory management unit for notification (e) Address of certain data in the program to be debugged (this is called an address to be inspected) and an exception stop for stopping the program to be debugged when a write protection exception occurs for the data Inspection target table that holds conditions (f) Debugging target program A write protection attribute setting unit that sets information on the address to be inspected and the exceptional stop condition in the table to be inspected and operates the memory management unit so as to prohibit writing to the page containing the data. Is activated upon receiving a write protection exception notification for the address to be inspected. If the exception stop condition is satisfied, the debug target program is stopped and the trace information up to that point is presented. If the exception stop condition is not satisfied, a trace process is requested. Write protection exception handler (h) A trace body that stores trace information when a write occurs to an inspection target address based on a trace processing request of the write protection exception handler.

【0009】この発明に係るプログラム実行トレース方
式は、(i)トレース本体内でトレース情報を保持する
トレースバッファと、(j)トレース本体内でトレース
バッファに対してトレース情報の書込みを行うトレース
情報管理部と、(k)トレース本体内でトレースバッフ
ァからトレース情報の読出しを行うトレースバッファ制
御部とを備えたことを特徴とする。
The program execution trace method according to the present invention comprises: (i) a trace buffer for holding trace information in a trace body; and (j) trace information management for writing trace information to the trace buffer in the trace body. And (k) a trace buffer control unit for reading trace information from the trace buffer within the trace body.

【0010】この発明に係るプログラム実行トレース方
式のトレースバッファは、トレース情報として、少なく
とも、変更しようとした値、例外が発生した時の命令実
行アドレス、例外を発生させたプロセス情報を保持する
ことを特徴とする。
[0010] The trace buffer of the program execution trace method according to the present invention stores at least a value to be changed, an instruction execution address when an exception occurs, and process information that caused the exception as trace information. Features.

【0011】この発明に係るプログラム実行トレース方
式が有するトレース本体は、さらに、書込み保護を設定
しているデータの近傍アドレスに対するサブトレースを
行うかどうかを指定するトレースフラグを保持し、上記
トレース本体は、検査対象アドレスの近傍アドレスに対
してサブトレースを行うことを特徴とする。
The trace body included in the program execution trace method according to the present invention further holds a trace flag for specifying whether to perform a subtrace for an address in the vicinity of write-protected data. The sub-trace is performed on an address in the vicinity of the inspection target address.

【0012】この発明に係るプログラム実行トレース方
式が有する検査対象テーブルは、デバッグ対象プログラ
ムを停止させる条件のひとつとしてあるプロセスを指定
した第2の例外停止条件を備え、書込み保護例外ハンド
ラは、この第2の例外停止条件を用いて、そのプロセス
からの書込み保護例外が発生した時にデバッグ対象プロ
グラムを停止することを特徴とする。
The inspection target table included in the program execution trace method according to the present invention has a second exception stop condition that designates a process as one of the conditions for stopping the debug target program, and the write-protection exception handler uses the second exception stop condition. The method is characterized in that the debug target program is stopped when a write protection exception from the process occurs using the exception stop condition of (2).

【0013】この発明に係るプログラム実行トレース方
式では、検査対象テーブルは検査対象アドレス毎にトレ
ース選択フラグを備え、書込み保護例外ハンドラは、こ
のトレース選択フラグを用いて、検査対象アドレス毎に
トレースを実行するかどうか選択することを特徴とする
ことを特徴とする。
In the program execution trace method according to the present invention, the inspection target table has a trace selection flag for each inspection target address, and the write protection exception handler executes a trace for each inspection target address using the trace selection flag. It is characterized by selecting whether or not to perform.

【0014】この発明に係るプログラム実行トレース方
式では、検査対象テーブルは、あるプロセス又は、ある
実行レベル条件を満たすプロセスをトレース対象のプロ
セスとして指定したトレース対象プロセス条件を備え、
上記トレース本体は、このトレース対象プロセス条件を
用いて、指定したプロセスまたは指定した実行レベル条
件を満たすプロセスが検査対象アドレスに書込みをした
場合のみトレースを実行することを特徴とする。
[0014] In the program execution trace method according to the present invention, the inspection target table includes a trace target process condition in which a certain process or a process satisfying a certain execution level condition is designated as a trace target process.
The trace body is characterized in that the trace is executed only when a designated process or a process that satisfies the designated execution level condition writes to the inspection target address using the trace target process condition.

【0015】この発明に係るプログラム実行トレース方
式は、トレース本体をデバッガ本体内に配置したことを
特徴とする。
The program execution trace method according to the present invention is characterized in that a trace body is arranged in a debugger body.

【0016】[0016]

【発明の実施の形態】実施の形態1.図1は、実施の形
態1の構成を示すブロック図である。図1において、1
0はオペレータが操作を行うデバッガ本体、11はデバ
ッグ対象プログラム、12は命令実行ユニット、13は
メモリユニット14をページと呼ばれる固定長サイズで
管理し、このページ単位で書込み保護を実施できるメモ
リ管理ユニット、14はメモリユニット、15はメモリ
ユニット14内の検査対象アドレス、16は書込み保護
属性が設定されたページへの書込み命令が実行された時
にメモリ管理ユニット13から命令実行ユニット12を
経由して起動される書込み保護例外ハンドラ、17はデ
バッグ対象プログラム11のデータへの書込みを禁止す
るためメモリ管理ユニット13にその設定を行う書込み
保護属性設定部、18はデバッグ対象プログラム11中
の検査対象データに関するアドレス情報を保持する検査
対象テーブル、19は検査対象テーブル18内で書込み
禁止となっているデータに対して書込みが発生した場合
にトレースを行うトレース本体、20はトレース情報を
保持するトレースバッファ、21は検査対象アドレス1
5以外の近傍アドレスに対するサブトレースを行うかど
うかを指定するトレースフラグ、22は書込み保護例外
ハンドラ16からの指示に基づきトレース情報を書込む
ためのトレース情報管理部、23はデバッガ本体10か
らの指示に基づきトレース情報を読出すためのトレース
バッファ制御部である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiment 1 FIG. 1 is a block diagram showing a configuration of the first embodiment. In FIG. 1, 1
0 is a debugger main body operated by an operator, 11 is a program to be debugged, 12 is an instruction execution unit, 13 is a memory management unit which manages a memory unit 14 in a fixed length called a page, and can implement write protection in page units. , 14 is a memory unit, 15 is an inspection target address in the memory unit 14, and 16 is a memory management unit 13 which is activated via a command execution unit 12 when a write command to a page to which a write protection attribute is set is executed. A write-protection exception handler 17 to be written; a write-protection attribute setting unit 17 for setting the memory management unit 13 to prohibit writing to the data of the program 11 to be debugged; Inspection target table holding information, 1 Trace body for tracing when a write occurs to the data that is the write-protected inside the inspection object table 18, 20 is the trace buffer that stores the trace information, 21 inspection target address 1
A trace flag for designating whether or not to perform sub-trace for a neighboring address other than 5; 22, a trace information management unit for writing trace information based on an instruction from the write protection exception handler 16; Is a trace buffer control unit for reading trace information based on.

【0017】図2は、実施の形態1における検査対象テ
ーブル18の構成を示す図である。図2において、30
は検査対象とするデータのデータアドレス、31はデー
タサイズ、32は検査対象アドレス15が特定の値にな
った時に停止する条件を示す例外停止条件、33は前記
三つ組から構成される検査対象エントリである。検査対
象テーブル18は、複数の検査対象エントリ33から構
成される。実際には、書込み保護例外が発生したアドレ
スが検査対象アドレスに一致するかを調べる時に、検査
対象エントリ33の検索を高速にまたは予測可能な時間
内に行えるようにするため、データアドレス30をキー
とするハッシュテーブルや二進木などのデータ構造で構
成する。
FIG. 2 is a diagram showing a configuration of the inspection target table 18 according to the first embodiment. In FIG. 2, 30
Is a data address of data to be inspected, 31 is a data size, 32 is an exceptional stop condition indicating a condition to stop when the address to be inspected 15 has a specific value, and 33 is an entry to be inspected composed of the above three sets. is there. The inspection target table 18 includes a plurality of inspection target entries 33. In practice, when checking whether the address where the write protection exception has occurred matches the check target address, the data address 30 is keyed so that the search for the check target entry 33 can be performed at high speed or within a predictable time. And a data structure such as a hash table or a binary tree.

【0018】図3は、実施の形態1におけるトレースバ
ッファ20(及びサブトレースバッファ)の構成を示す
図である。図3において、40は検査対象のデータアド
レス、41は検査対象のデータアドレス40に書込みを
行おうとした時の変更値、42は検査対象のデータアド
レス40に書込みを行おうとした時の命令実行アドレ
ス、43は検査対象のデータアドレス40に書込みを行
おうとしたプロセスの実行プロセスID、44は前記四
つ組から構成されるトレースバッファ・エントリであ
る。トレースバッファ20は、複数のトレースバッファ
・エントリ44から構成され、検査対象のデータアドレ
ス40への書込みが発生した順番を維持する。サブトレ
ースバッファは、後述するサブトレースの情報を記憶す
る。サブトレースバッファの構成は、図3に示したトレ
ースバッファと同一である。
FIG. 3 is a diagram showing a configuration of the trace buffer 20 (and sub-trace buffer) according to the first embodiment. In FIG. 3, reference numeral 40 denotes a data address to be inspected, 41 denotes a changed value when an attempt is made to write to the data address 40 to be inspected, and 42 denotes an instruction execution address when an attempt is made to write to the data address 40 to be inspected. , 43 are the execution process IDs of the processes that attempted to write to the data address 40 to be inspected, and 44 is a trace buffer entry composed of the four sets. The trace buffer 20 is composed of a plurality of trace buffer entries 44 and maintains the order in which writing to the data address 40 to be inspected has occurred. The sub-trace buffer stores sub-trace information to be described later. The configuration of the sub trace buffer is the same as that of the trace buffer shown in FIG.

【0019】図4は、実施の形態1におけるトレースフ
ラグ21の構成を示す図である。図4において、50は
後述するサブトレースを実行するかどうかを判定するサ
ブトレースビットから構成される。
FIG. 4 is a diagram showing a configuration of the trace flag 21 according to the first embodiment. In FIG. 4, reference numeral 50 denotes a sub-trace bit for determining whether to execute a sub-trace described later.

【0020】次に、動作について説明する。まずオペレ
ータは、デバッガ本体10上でデバッグ対象プログラム
11を指定する。そして、デバッグ対象プログラム11
中のあるデータのアドレスを検査対象アドレス15と
し、その内容が特定の値になった時に停止するための条
件を指示する。この時オペレータは検査対象アドレス1
5と共に、具体的な例外停止条件を指定する。書込み保
護属性設定部17は、デバッガ本体10から渡された検
査対象アドレス15(データアドレス30)、データ型
(データサイズ31)および例外停止条件32を検査対
象テーブル18に保持すると共に、メモリ管理ユニット
13を操作して検査対象アドレス15を含むページに対
して書込み禁止属性を設定する。なお、オペレータは検
査対象アドレス15(データアドレス30)として同時
に複数設定することができる。その後、デバッガ本体1
0は、デバッグ対象プログラム11を起動する。デバッ
グ対象プログラム11の実行中に検査対象アドレス15
を含むページへの書込みが発生した場合、書込み保護例
外ハンドラ16が起動される。
Next, the operation will be described. First, the operator specifies the debug target program 11 on the debugger body 10. Then, the debug target program 11
The address of certain data in the address is set as the inspection target address 15, and a condition for stopping when the content reaches a specific value is indicated. At this time, the operator sets the inspection target address 1
5 together with a specific exception stop condition. The write protection attribute setting unit 17 holds the inspection target address 15 (data address 30), data type (data size 31), and exception stop condition 32 passed from the debugger body 10 in the inspection target table 18 and a memory management unit. 13 to set the write-protection attribute for the page including the inspection target address 15. Note that the operator can set a plurality of inspection target addresses 15 (data addresses 30) at the same time. Then, the debugger body 1
0 activates the debug target program 11. During the execution of the debug target program 11, the check target address 15
, The write protection exception handler 16 is activated.

【0021】図5は、書込み保護例外ハンドラ16のフ
ローチャートを示す図である。図5を用いて、書込み保
護例外ハンドラ16の処理を説明する。まず、ステップ
S1で、書込み保護例外が発生したアドレスは検査対象
アドレスであるかを調べるため、検査対象テーブル18
を検索する。通常、書込み禁止属性を設定したページの
サイズは検査対象アドレス15よりも大きいので、検査
対象テーブル18内のデータアドレス30(すなわち、
先頭アドレス)とデータサイズ31を元に検査対象アド
レス15に一致するかを調べる。一致しない場合はステ
ップS2に進み、書込み禁止属性を設定したページ内の
検査対象アドレス以外のアドレスに対するトレース(こ
れをサブトレースと呼ぶ)を実行するため、トレース本
体19を呼び出す。トレース本体19内のトレース情報
管理部22では検査対象アドレス15に対するトレース
とページ内の検査対象アドレス以外のアドレスに対する
サブトレースとを認識区別してそれぞれのトレースバッ
ファ20及びサブトレースバッファにトレースバッファ
・エントリ44を追加記録する。トレースを実行したあ
とステップS9に進み、所望のアドレスに書込みを行っ
て、デバッグ対象プログラム11に復帰する。一方、検
査対象アドレス15に一致する場合はステップS3に進
み、トレース本体19を呼び出す。トレース本体19内
のトレース情報管理部22では検査対象アドレス15に
対するトレースとしてトレースバッファ20にトレース
バッファ・エントリ44を追加記録する。トレースを実
行したあとステップS4に進み、検査対象アドレス15
に対する変更値は例外停止条件32を満たすかを調べ
る。条件を満たさない場合はステップS9に進み、検査
対象アドレス15に書込みを行って、デバッグ対象プロ
グラム11に復帰する。条件を満たす場合はステップS
5に進み、デバッガ本体10を呼び出す。デバッガ本体
10が呼び出されると、デバッグ対象プログラム11の
状態を検査することができる。さらにステップS6に進
み、デバッガ本体10からトレース本体19を呼び出
す。トレース本体19内のトレースバッファ制御部23
は、トレースバッファ20から現在の検査対象アドレス
15に関するトレース情報を読み出す。デバッガ本体1
0は、取得したトレース情報を適切に加工して表示す
る。デバッグ対象プログラム11の実行を中止する場合
はステップS8に進み、検査対象アドレス15への書込
みを行わずに終了する。実行を継続する場合はステップ
S9に進み、検査対象アドレス15に書込みを行って、
デバッグ対象プログラム11に復帰する。
FIG. 5 is a diagram showing a flowchart of the write protection exception handler 16. The processing of the write protection exception handler 16 will be described with reference to FIG. First, in step S1, the check target table 18 is used to check whether the address where the write protection exception has occurred is the check target address.
Search for. Normally, the size of the page set with the write-protected attribute is larger than the address 15 to be inspected, so that the data address 30 (that is,
It is checked whether it matches the inspection target address 15 based on the (head address) and the data size 31. If they do not match, the process proceeds to step S2, where the trace main body 19 is called to execute a trace (referred to as a subtrace) for an address other than the inspection target address in the page in which the write-protection attribute is set. The trace information management unit 22 in the trace body 19 recognizes and distinguishes the trace for the inspection target address 15 and the sub-trace for the address other than the inspection target address in the page, and stores the trace buffer entry 44 in the respective trace buffer 20 and sub-trace buffer. Is additionally recorded. After executing the trace, the process proceeds to step S9, where writing is performed at a desired address, and the process returns to the debug target program 11. On the other hand, when the address matches the inspection target address 15, the process proceeds to step S3, and the trace body 19 is called. The trace information management unit 22 in the trace body 19 additionally records a trace buffer entry 44 in the trace buffer 20 as a trace for the inspection target address 15. After executing the trace, the process proceeds to step S4, and the inspection target address 15
A check is made to see if the change value for satisfies the exception stop condition 32. If the condition is not satisfied, the process proceeds to step S9, where writing to the inspection target address 15 is performed, and the process returns to the debug target program 11. If the condition is satisfied, step S
Proceed to step 5, and call the debugger body 10. When the debugger body 10 is called, the state of the debug target program 11 can be checked. In step S6, the debugger 10 calls the trace body 19. Trace buffer control unit 23 in trace body 19
Reads the trace information on the current inspection target address 15 from the trace buffer 20. Debugger body 1
0 indicates that the acquired trace information is appropriately processed and displayed. If the execution of the debug target program 11 is to be stopped, the process proceeds to step S8, and the process ends without writing to the test target address 15. If the execution is to be continued, the process proceeds to step S9, where writing is performed on the inspection target address 15, and
The program returns to the debug target program 11.

【0022】図6は、前記ステップS2およびステップ
S3におけるトレース本体19内のトレース情報管理部
22の処理のフローチャートを示す図である。図6を用
いて、トレース本体19内のトレース情報管理部22の
処理を説明する。書込み保護例外ハンドラ16は、トレ
ースバッファ・エントリ44に書き込む四つ組データ
と、例外アドレスが検査対象アドレス15に一致するか
そうでないかを示す識別情報をトレース情報管理部22
に渡す。前記ステップS2からトレース本体19を呼び
出す場合は、例外アドレスが検査対象アドレス15に一
致しないという意味の識別情報を設定しておく。また、
前記ステップS3からトレース本体19を呼び出す場合
は、例外アドレスが検査対象アドレス15に一致すると
いう意味の識別情報を設定しておく。ステップS20
で、前記の識別情報を参照して例外アドレスが検査対象
アドレス15に一致するかそうでないかを判定する。一
致しない場合はステップS21に進み、トレースフラグ
21を参照して現在の設定ではサブトレースを実行する
かどうか判定する。サブトレースを実行しない場合は直
ちにリターンする。サブトレースを実行する場合はステ
ップS22に進み、前述の四つ組データからなるトレー
スバッファ・エントリ44をサブトレースバッファに書
込む。ステップS23で、サブトレースバッファの管理
情報を更新したあとリターンする。一方、識別情報を参
照した結果、例外アドレスが検査対象アドレス15に一
致する場合はステップS24に進み、前述の四つ組デー
タからなるトレースバッファ・エントリ44をトレース
バッファ20に書込む。ステップS25で、トレースバ
ッファの管理情報を更新したあとリターンする。
FIG. 6 is a flowchart showing the processing of the trace information management section 22 in the trace main body 19 in steps S2 and S3. The processing of the trace information management unit 22 in the trace main body 19 will be described with reference to FIG. The write protection exception handler 16 writes the quad data to be written to the trace buffer entry 44 and identification information indicating whether or not the exception address matches the check target address 15 or not.
Pass to. When the trace body 19 is called from the step S2, identification information indicating that the exceptional address does not match the inspection target address 15 is set. Also,
When the trace body 19 is called from the step S3, identification information indicating that the exceptional address matches the inspection target address 15 is set. Step S20
Then, it is determined whether or not the exceptional address matches the check target address 15 with reference to the identification information. If they do not match, the process proceeds to step S21, and it is determined with reference to the trace flag 21 whether sub-trace is to be executed with the current setting. If no subtrace is to be executed, return immediately. When the sub-trace is to be executed, the process proceeds to step S22, and the trace buffer entry 44 including the above-mentioned quadruple data is written in the sub-trace buffer. In step S23, the process returns after updating the management information of the sub trace buffer. On the other hand, as a result of referring to the identification information, if the exceptional address matches the inspection target address 15, the process proceeds to step S24, and the trace buffer entry 44 including the above-described quad data is written in the trace buffer 20. In step S25, the process returns after updating the management information of the trace buffer.

【0023】図7は、前記ステップS6におけるトレー
ス本体19内のトレースバッファ制御部23の処理のフ
ローチャートを示す図である。図7を用いて、トレース
本体19内のトレースバッファ制御部23の処理を説明
する。例外アドレスが検査対象アドレス15と一致し、
さらに変更値が例外停止条件32と一致した場合、前記
ステップS6においてデバッガ本体10は現在の検査対
象アドレス15を指定して、トレースバッファ制御部2
3にトレース情報の読出し要求を発行する。また、前記
ステップS6では検査対象アドレス15以外の近傍アド
レスを指定して、サブトレースバッファからトレース情
報を読み出す場合もあり、ステップS30で読出し対象
のトレースバッファを切替える。ステップS31でデバ
ッガ本体10からの読出し要求が前回からの継続かどう
かを判定する。継続でない場合はステップS32に進
み、最後に書込みを行ったトレースバッファ・エントリ
44を指すライトポインタを取得し、渡された検査対象
アドレス15に一致するトレースバッファ・エントリ4
4の内容をデバッガ本体10に返す。一方、継続してデ
バッガ本体10から次のエントリの読出し要求が発行さ
れた場合はステップS33に進み、カレント検索ポイン
タを起点として次のエントリを検索し、見つかった時点
でデバッガ本体10にそのトレース情報を返す。
FIG. 7 is a flowchart showing the processing of the trace buffer control unit 23 in the trace main body 19 in the step S6. The processing of the trace buffer control unit 23 in the trace main body 19 will be described with reference to FIG. The exception address matches the inspection target address 15,
Further, when the changed value matches the exception stop condition 32, the debugger main body 10 specifies the current inspection target address 15 in step S6 and
3 and issues a trace information read request. In step S6, a trace address may be read from the sub-trace buffer by specifying a neighboring address other than the inspection target address 15. In step S30, the trace buffer to be read is switched. In step S31, it is determined whether or not the read request from the debugger body 10 is a continuation from the previous time. If the continuation is not continued, the process proceeds to step S32, in which a write pointer pointing to the trace buffer entry 44 that has been written last is obtained, and the trace buffer entry 4 matching the passed inspection target address 15 is obtained.
4 is returned to the debugger body 10. On the other hand, if the request for reading the next entry is continuously issued from the debugger main body 10, the process proceeds to step S33, where the next entry is searched starting from the current search pointer, and the trace information is transmitted to the debugger main body 10 at the time of finding. return it.

【0024】以上のように、書込み保護属性を設定した
データに対する書込み保護例外の発生を契機としてトレ
ースを行い、データの変更履歴を保持するようにしてい
るので、例外停止条件32に一致した時に直ちにそれま
での変更履歴を提示することができる。この変更履歴の
提示により、どのプロセスがどこの実行箇所においてど
のような値を書込んだのかが分かり、不正なデータ書込
みの追跡が容易になると共に、データアクセスに関連す
るプログラムの動作解析を支援することも可能であり、
デバッグ効率を向上することができる。さらに、一般的
にデータのアクセスに関しては局所性があると言われて
おり、検査対象アドレスに一致しない近傍アドレスにつ
いても同時に変更履歴を提示することが可能であり、デ
バッグ効率を向上することができる。
As described above, tracing is performed upon occurrence of a write protection exception for data for which the write protection attribute is set, and the data change history is retained. The change history up to that time can be presented. By presenting this change history, it is possible to know which process wrote what value in which execution place, and it is easy to track illegal data writing, and to assist in the operation analysis of programs related to data access It is also possible to
Debugging efficiency can be improved. Furthermore, it is generally said that there is locality in data access, and it is possible to simultaneously present a change history for neighboring addresses that do not match the inspection target address, thereby improving debugging efficiency. .

【0025】実施の形態2.以上の実施の形態1では、
検査対象テーブル18内の例外停止条件32として変更
値に関する条件を指定しているが、次に第2の例外停止
条件として、例外を発生させたプロセス情報を設定する
ようにし、変更値に関する条件に加え指定プロセスから
のアクセスを契機としてデバッガ本体10を呼び出すよ
うにする場合の実施の形態を示す。図8は、図2を修正
した実施の形態2における検査対象テーブル18の構成
を示す図である。図8において、34は例外を発生させ
たプロセスを指定する条件を示し、そのプロセスからの
アクセスを契機としてデバッガ本体10を呼び出すため
の例外停止条件2(第2の例外停止条件ともいう)であ
る。
Embodiment 2 In the first embodiment,
Although the condition relating to the change value is specified as the exception stop condition 32 in the inspection target table 18, the process information which caused the exception is set as the second exception stop condition, and the condition relating to the change value is set as the second exception stop condition. An embodiment in which the debugger body 10 is called in response to an access from a designated process will be described. FIG. 8 is a diagram showing a configuration of the inspection target table 18 according to the second embodiment in which FIG. 2 is modified. In FIG. 8, reference numeral 34 denotes a condition for designating a process that has caused an exception, and is an exception stop condition 2 (also referred to as a second exception stop condition) for calling the debugger body 10 upon access from the process. .

【0026】まずオペレータは、デバッガ本体10上で
デバッグ対象プログラム11を指定する。そして、デバ
ッグ対象プログラム11中のあるデータのアドレスを検
査対象アドレス15とし、その内容が特定の値になり、
かつ特定のプロセスが検査対象アドレス15に書込みを
行った時に停止するための条件を指示する。この時オペ
レータは検査対象アドレス15と共に、具体的な第1の
例外停止条件32と第2の例外停止条件34を指定す
る。その後、デバッガ本体10は、デバッグ対象プログ
ラム11を起動する。デバッグ対象プログラム11の実
行中に検査対象アドレスを含むページへの書込みが発生
した場合、書込み保護例外ハンドラ16が起動される。
First, the operator specifies a program 11 to be debugged on the debugger body 10. Then, an address of a certain data in the debug target program 11 is set as a check target address 15, and its content becomes a specific value,
In addition, a condition for stopping when a specific process writes to the inspection target address 15 is indicated. At this time, the operator specifies specific first exceptional stop conditions 32 and second exceptional stop conditions 34 together with the inspection target address 15. After that, the debugger body 10 starts the debug target program 11. When writing to the page including the inspection target address occurs during execution of the debug target program 11, the write protection exception handler 16 is activated.

【0027】図5は、実施の形態1で説明した書込み保
護例外ハンドラ16のフローチャートを示す図である。
図5を用いて、実施の形態2における書込み保護例外ハ
ンドラ16の特徴的な処理を説明する。ステップS4に
おいて実施の形態1の場合は、検査対象アドレス15に
対する変更値が例外停止条件32を満たすかを調べる。
これに対して実施の形態2の場合は、変更値に関する例
外停止条件32を満たし、かつ例外を発生させたプロセ
スに関する第2の例外停止条件34を満たす時、ステッ
プS5に進み、デバッガ本体10を呼び出す。前記二つ
の例外停止条件のうち一方でも満たさない場合は、ステ
ップS9に進み、検査対象アドレス15に書込みを行っ
て、デバッグ対象プログラム11に復帰する。
FIG. 5 is a diagram showing a flowchart of the write protection exception handler 16 described in the first embodiment.
The characteristic processing of the write protection exception handler 16 according to the second embodiment will be described with reference to FIG. In the case of the first embodiment in step S4, it is checked whether or not the changed value for the inspection target address 15 satisfies the exception stop condition 32.
On the other hand, in the case of the second embodiment, when the exception stop condition 32 relating to the change value is satisfied and the second exception stop condition 34 relating to the process that caused the exception is satisfied, the process proceeds to step S5, and the debugger main body 10 is reset. call. If at least one of the two exception stop conditions is not satisfied, the process proceeds to step S 9, where the write to the inspection target address 15 is performed, and the process returns to the debug target program 11.

【0028】以上のように、検査対象テーブル18内に
第2の例外停止条件34を設けることによって検査対象
アドレス15に対する変更値と共に、書込み保護例外を
発生させた指定プロセスからのアクセスを契機としてデ
バッガ本体10を呼び出すようにしたので、より的確な
データ書込みタイミングでデバッグ対象プログラム11
を停止することが可能となる。
As described above, by providing the second exception stop condition 34 in the inspection target table 18, the debugger can be triggered by the access from the designated process that has caused the write protection exception, together with the change value for the inspection target address 15. Since the main unit 10 is called, the debug target program 11 can be
Can be stopped.

【0029】実施の形態3.以上の実施の形態2では、
検査対象アドレス15として指定した全てのデータ書込
みをトレースするが、次に検査対象テーブル18内に新
たに検査対象アドレス15毎のトレース選択フラグを設
けて個々にトレースを行うかどうかを選択可能にする場
合の実施の形態を示す。図9は、図2を修正した実施の
形態3における検査対象テーブル18の構成を示す図で
ある。図9において、35は検査対象アドレス15毎に
トレースを行うかどうかを示すトレース選択フラグであ
る。
Embodiment 3 In Embodiment 2 described above,
All data writing specified as the inspection target address 15 is traced. Next, a new trace selection flag for each inspection target address 15 is provided in the inspection target table 18 so that it is possible to select whether to individually perform tracing. An embodiment of the case will be described. FIG. 9 is a diagram illustrating a configuration of the inspection target table 18 according to the third embodiment in which FIG. 2 is modified. In FIG. 9, reference numeral 35 denotes a trace selection flag indicating whether or not tracing is performed for each inspection target address 15.

【0030】図10は、図6を修正した実施の形態3に
おけるトレース情報管理部22のフローチャートを示す
図である。まず、オペレータは既に設定している検査対
象アドレス15のうちのいくつかを特定してトレースを
行わないように指示する。デバッガ本体10は特定され
た検査対象アドレス15に対応する検査対象テーブル1
8内のトレース選択フラグ35をトレースを行わないよ
うに設定する。その後、デバッグ対象プログラム11の
実行中に検査対象アドレスを含むページへの書込みが発
生して書込み保護例外ハンドラ16が起動され、例外ア
ドレスが検査対象アドレス15に一致した場合は、トレ
ース情報管理部22を呼び出す。次に、図10を用いて
実施の形態3におけるトレース情報管理部22の特徴的
な処理を説明する。ステップS20において、書込み保
護例外ハンドラ16から渡された識別情報を見て、例外
アドレスが検査対象アドレス15かどうかを調べる。検
査対象アドレス15である場合はステップS26に進
み、検査対象テーブル18内のトレース選択フラグ35
の設定状況を調べる。トレースを実行するように設定さ
れていたらステップS24に進み、トレースバッファへ
の書込みを行う。トレースを実行しないように設定され
ていたら、直ちに書込み保護例外ハンドラ16にリター
ンする。
FIG. 10 is a diagram showing a flowchart of the trace information management section 22 in the third embodiment, which is a modification of FIG. First, the operator specifies some of the inspection target addresses 15 already set and instructs not to perform tracing. The debugger body 10 checks the inspection target table 1 corresponding to the specified inspection target address 15.
The trace selection flag 35 in 8 is set so that tracing is not performed. Thereafter, during execution of the debug target program 11, writing to a page including the inspection target address occurs, the write protection exception handler 16 is activated, and if the exception address matches the inspection target address 15, the trace information management unit 22 Call. Next, a characteristic process of the trace information management unit 22 according to the third embodiment will be described with reference to FIG. In step S20, by checking the identification information passed from the write protection exception handler 16, it is checked whether the exception address is the check target address 15. If the address is the inspection target address 15, the process proceeds to step S26, where the trace selection flag 35 in the inspection target table 18 is set.
Check the setting status of. If the setting has been made to execute the trace, the process proceeds to step S24, and writing to the trace buffer is performed. If it is set not to execute the trace, the process immediately returns to the write protection exception handler 16.

【0031】以上のように、検査対象テーブル18内に
トレース選択フラグ35を設けることによって検査対象
アドレス15毎にトレースを実行するかどうかを選択で
きるようにしたので、トレース情報を削減すると共にト
レース処理のオーバヘッドを低減することが可能とな
る。なお、トレース選択フラグ35の設定はトレースを
実行するような設定のみを明示的に行い、設定がなされ
ていなければトレースは実行しないとみなしてもよい。
あるいは逆にトレースを実行しないという設定のみを明
示的に行い、設定がなされていなければトレースは実行
するとみなしてもよい。
As described above, the provision of the trace selection flag 35 in the inspection target table 18 makes it possible to select whether or not to execute tracing for each inspection target address 15, so that trace information can be reduced and trace processing can be performed. Can be reduced. It should be noted that the setting of the trace selection flag 35 may only be explicitly set to execute tracing, and if no setting has been made, tracing may not be executed.
Alternatively, on the contrary, only the setting of not executing the trace may be explicitly performed, and if the setting has not been made, it may be considered that the trace is executed.

【0032】実施の形態4.以上の実施の形態3では、
検査対象テーブル18内にトレース選択フラグ35を設
けることによって検査対象アドレス15毎にトレースを
実行するかどうかを選択できるようにしたが、次に検査
対象テーブル18内に新たにトレース対象プロセス条件
を設けて、指定したプロセス、または指定した実行レベ
ル条件を満たすプロセスが検査対象アドレス15に書込
みをした時のみトレースを実行する場合の実施の形態を
示す。図11は、図2を修正した実施の形態4における
検査対象テーブル18の構成を示す図である。図11に
おいて、36は検査対象アドレス15毎のデータ書込み
プロセスのうちトレース対象とするプロセスの条件を示
すトレース対象プロセス条件である。
Embodiment 4 FIG. In Embodiment 3 described above,
By providing a trace selection flag 35 in the inspection target table 18, it is possible to select whether or not to execute a trace for each inspection target address 15. Next, a new trace target process condition is provided in the inspection target table 18. In this embodiment, a trace is executed only when a specified process or a process that satisfies a specified execution level condition writes to the inspection target address 15. FIG. 11 is a diagram illustrating a configuration of the inspection target table 18 according to the fourth embodiment in which FIG. 2 is modified. In FIG. 11, reference numeral 36 denotes a trace target process condition indicating a condition of a process to be traced among data write processes for each inspection target address 15.

【0033】図12は、図6を修正した実施の形態4に
おけるトレース情報管理部22のフローチャートを示す
図である。まず、オペレータは検査対象アドレス15を
指定する際に、具体的な例外停止条件32と共にトレー
ス対象プロセス条件36を指定する。ここで指定するト
レース対象プロセス条件36としては、デバッグ対象プ
ログラム11内のプロセス自身や、デバッグ対象プログ
ラム11内のプロセスと同一以上の実行レベルなどがあ
る。なお、デバッグ対象プログラム11内のプロセスと
カーネルなどのように複数の条件を指定し、全ての条件
を満たす場合のみトレースを実行するようにすることも
できる。デバッガ本体10は特定された検査対象アドレ
ス15に対応する検査対象テーブル18内のトレース対
象プロセス条件36を設定する。その後、デバッグ対象
プログラム11の実行中に検査対象アドレスを含むペー
ジへの書込みが発生して書込み保護例外ハンドラ16が
起動され、例外アドレスが検査対象アドレス15に一致
した場合は、トレース情報管理部22を呼び出す。次
に、図12を用いて実施の形態4におけるトレース情報
管理部22の特徴的な処理を説明する。ステップS20
において、書込み保護例外ハンドラ16から渡された識
別情報を見て、例外アドレスが検査対象アドレス15か
どうかを調べる。検査対象アドレス15である場合はス
テップS27に進み、書込み保護例外を発生させたプロ
セスがトレース対象プロセス条件36に一致するかどう
かを調べる。条件に一致する場合はステップS24に進
み、トレースバッファへの書込みを行う。条件に一致し
ない場合は、直ちに書込み保護例外ハンドラ16にリタ
ーンする。
FIG. 12 is a diagram showing a flowchart of the trace information management unit 22 in the fourth embodiment, which is a modification of FIG. First, when specifying the inspection target address 15, the operator specifies the trace target process condition 36 together with the specific exception stop condition 32. The trace target process condition 36 specified here includes the process itself in the debug target program 11, the execution level equal to or higher than the process in the debug target program 11, and the like. Note that it is also possible to specify a plurality of conditions such as a process and a kernel in the debug target program 11 and execute the trace only when all the conditions are satisfied. The debugger body 10 sets a trace target process condition 36 in the test target table 18 corresponding to the specified test target address 15. Thereafter, during execution of the debug target program 11, writing to a page including the inspection target address occurs, the write protection exception handler 16 is activated, and if the exception address matches the inspection target address 15, the trace information management unit 22 Call. Next, a characteristic process of the trace information management unit 22 according to the fourth embodiment will be described with reference to FIG. Step S20
In step (1), the identification information passed from the write-protection exception handler 16 is checked to determine whether the exception address is the check target address 15. If the address is the inspection target address 15, the process proceeds to step S27, and it is checked whether or not the process that has caused the write protection exception matches the trace target process condition 36. If the condition is met, the process proceeds to step S24, where writing to the trace buffer is performed. If the condition is not met, the process immediately returns to the write protection exception handler 16.

【0034】以上のように、検査対象テーブル18内に
トレース対象プロセス条件36を設けることによって検
査対象アドレス15毎にアクセスするプロセスの切り分
けをできるようにしたので、不正な書込みを行うプロセ
スの特定と実行箇所を素早く見つけ出すことが可能にな
ると共に、トレース情報を削減すると共にトレース処理
のオーバヘッドを低減することができる。
As described above, by setting the trace target process condition 36 in the test target table 18, the process to be accessed can be separated for each test target address 15. It is possible to quickly find an execution position, reduce trace information, and reduce the overhead of trace processing.

【0035】実施の形態5.以上の実施の形態3及び4
では、検査対象テーブル18内に検査対象アドレス15
毎のトレースの可否を判定するためのトレース選択フラ
グ35及びトレース対象プロセス条件36を設けること
によってトレースを行う対象をよりきめ細かに制御する
ようにしたものであるが、次にトレース本体19をデバ
ッガ本体10内に配置する場合の実施の形態を示す。
Embodiment 5 FIG. Embodiments 3 and 4 above
Then, the inspection target address 15 is stored in the inspection target table 18.
By providing a trace selection flag 35 and a trace target process condition 36 for determining whether or not tracing can be performed for each trace, the trace target can be more finely controlled. 10 shows an embodiment in the case of arranging in the apparatus 10.

【0036】図13は、実施の形態5の構成を示すブロ
ック図である。図13において、個々の構成要素は図1
に示した実施の形態1の構成を示すブロック図と同じで
ある。ただし、トレースバッファ20、トレースフラグ
21、トレース情報管理部22、及びトレースバッファ
制御部23から構成されるトレース本体19はデバッガ
本体10内に配置している。図6、図7、図10及び図
12を用いて説明したトレース本体19内の各処理は、
それらの処理を実行する上で外部機能部との依存性がな
いようにしているので、トレース本体19自身をデバッ
ガ本体10内に配置することが可能である。図5を用い
て説明した書込み保護例外ハンドラ16のフローチャー
トを示す図において、ステップS2及びS3でトレース
を実行するためトレース本体19を呼び出しているが、
本実施の形態5の場合はデバッガ本体10を経由してト
レース情報管理部22に処理の依頼を通知する。また、
ステップS6でトレース情報の読出しを行うためデバッ
ガ本体10からの指示に基づきトレース本体19を呼び
出しているが、本実施の形態5の場合は既存のシステム
ソフトウェアとは独立に、デバッガ本体10とその内部
のトレースバッファ制御部23との間でトレース情報の
読出しや整形表示などを行うこととなる。
FIG. 13 is a block diagram showing the structure of the fifth embodiment. In FIG. 13, individual components are shown in FIG.
Is the same as the block diagram showing the configuration of the first embodiment shown in FIG. However, the trace main body 19 including the trace buffer 20, the trace flag 21, the trace information management unit 22, and the trace buffer control unit 23 is disposed in the debugger main body 10. Each process in the trace body 19 described with reference to FIGS. 6, 7, 10 and 12 is as follows.
Since there is no dependency on the external function unit in executing those processes, the trace body 19 itself can be arranged in the debugger body 10. In the flow chart of the write protection exception handler 16 described with reference to FIG. 5, the trace main body 19 is called to execute the trace in steps S2 and S3.
In the case of the fifth embodiment, a request for processing is sent to the trace information management unit 22 via the debugger body 10. Also,
In step S6, the trace main body 19 is called based on an instruction from the debugger main body 10 to read out the trace information. In the fifth embodiment, the debugger main body 10 and its internal part are independent of the existing system software. The trace information is read out or displayed in a format with the trace buffer control unit 23.

【0037】以上のように、トレース本体19をデバッ
ガ本体10内に配置することによって既存システムソフ
トウェアからの独立性を高めることができ、デバッグ終
了後の通常運用形態ではトレース本体19を容易に取り
外すことが可能となる。
As described above, by arranging the trace body 19 in the debugger body 10, the independence from the existing system software can be enhanced, and the trace body 19 can be easily removed in the normal operation mode after the end of debugging. Becomes possible.

【0038】[0038]

【発明の効果】以上のように、この発明によれば、メモ
リ上のデータ変更をトレースし、メモリ破壊に起因して
障害が発生した際に即座にデータ変更履歴に関するトレ
ース情報を提示することにより、デバッグ効率を向上さ
せる。
As described above, according to the present invention, data change in the memory is traced, and when a failure occurs due to memory destruction, trace information relating to the data change history is immediately presented. Improve debugging efficiency.

【0039】また、この発明によれば、書込み保護属性
を設定したデータに対する書込み保護例外の発生を契機
としてトレースを行い、データの変更履歴を保持するよ
うにしているので、例外停止条件32に一致した時に直
ちにそれまでの変更履歴を提示することができる。ま
た、この変更履歴の提示により、どのプロセスがどこの
実行箇所においてどのような値を書込んだのかが分か
り、不正なデータ書込みの追跡が容易になると共に、デ
ータアクセスに関連するプログラムの動作解析を支援す
ることも可能であり、デバッグ効率を向上することがで
きる。また、さらに、一般的にデータのアクセスに関し
ては局所性があると言われており、検査対象アドレスに
一致しない近傍アドレスについても同時に変更履歴を提
示することが可能であり、デバッグ効率を向上すること
ができる。
Further, according to the present invention, the trace is performed upon occurrence of a write protection exception to the data for which the write protection attribute is set, and the change history of the data is retained. When it is done, the change history up to that point can be presented immediately. In addition, by presenting this change history, it is possible to know what process wrote what value at which execution location, and it is easy to trace illegal data writing, and to analyze the operation of a program related to data access. Can be supported, and the debugging efficiency can be improved. Further, it is generally said that there is locality in data access, and it is possible to simultaneously present a change history for neighboring addresses that do not match the inspection target address, thereby improving debugging efficiency. Can be.

【0040】また、トレース本体の処理をトレース本体
内で行えるようにしているので、トレース本体19内の
各処理は、それらの処理を実行する上で外部機能部との
依存性がない。
Further, since the processing of the trace main body can be performed in the trace main body, each processing in the trace main body 19 does not depend on an external function unit in executing the processing.

【0041】また、トレース情報に例外が発生したとき
の命令実行アドレス、例外を発生させたプロセス情報を
有しているので、データを変更したプロセスの命令を容
易に知ることができる。
Further, since the trace information includes the instruction execution address when an exception occurs and the process information that caused the exception, it is possible to easily know the instruction of the process whose data has been changed.

【0042】また、サブトレースを行うので、さらに、
デバッグ効率を向上することができる。
Further, since the sub trace is performed,
Debugging efficiency can be improved.

【0043】また、書込み保護例外を発生させた指定プ
ロセスからのアクセスを契機としてデバッガ本体10を
呼び出すようにしたので、より的確なデータ書込みタイ
ミングでデバッグ対象プログラム11を停止することが
可能となる。
Further, since the debugger body 10 is called upon access from a designated process that has generated a write protection exception, the debug target program 11 can be stopped at more accurate data write timing.

【0044】また、検査対象テーブル18内にトレース
選択フラグ35を設けることによって検査対象アドレス
15毎にトレースを実行するかどうかを選択できるよう
にしたので、トレース情報を削減すると共にトレース処
理のオーバヘッドを低減することが可能となる。
Further, by providing a trace selection flag 35 in the inspection target table 18, it is possible to select whether or not to execute the trace for each inspection target address 15, so that the trace information is reduced and the overhead of the trace processing is reduced. It becomes possible to reduce.

【0045】また、検査対象テーブル18内にトレース
対象プロセス条件36を設けることによって検査対象ア
ドレス15毎にアクセスするプロセスの切り分けをでき
るようにしたので、不正な書込みを行うプロセスの特定
と実行箇所を素早く見つけ出すことが可能になると共
に、トレース情報を削減すると共にトレース処理のオー
バヘッドを低減することができる。
Further, since the process to be accessed for each inspection target address 15 can be separated by providing the trace target process condition 36 in the inspection target table 18, the identification and execution location of the process to perform the illegal writing can be determined. It is possible to find out quickly, and it is possible to reduce the trace information and the overhead of the trace processing.

【0046】また、トレース本体19をデバッガ本体1
0内に配置することによって既存システムソフトウェア
からの独立性を高めることができ、デバッグ終了後の通
常運用形態ではトレース本体19を容易に取り外すこと
が可能となる。
The trace body 19 is connected to the debugger body 1
By arranging it in 0, the independence from the existing system software can be enhanced, and in the normal operation mode after the end of debugging, the trace main body 19 can be easily removed.

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

【図1】 実施の形態1の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing a configuration of a first embodiment.

【図2】 実施の形態1における検査対象テーブル18
の構成を示す図である。
FIG. 2 is an inspection target table 18 according to the first embodiment.
FIG. 3 is a diagram showing the configuration of FIG.

【図3】 実施の形態1におけるトレースバッファ20
(及びサブトレースバッファ)の構成を示す図である。
FIG. 3 shows a trace buffer 20 according to the first embodiment.
FIG. 3 is a diagram illustrating a configuration of a sub-trace buffer (and a sub-trace buffer).

【図4】 実施の形態1におけるトレースフラグ21の
構成を示す図である。
FIG. 4 is a diagram showing a configuration of a trace flag 21 according to the first embodiment.

【図5】 書込み保護例外ハンドラ16のフローチャー
トを示す図である。
FIG. 5 is a diagram showing a flowchart of a write protection exception handler 16;

【図6】 ステップS2およびステップS3におけるト
レース本体19内のトレース情報管理部22の処理のフ
ローチャートを示す図である。
FIG. 6 is a diagram showing a flowchart of processing of the trace information management unit 22 in the trace main body 19 in steps S2 and S3.

【図7】 ステップS6におけるトレース本体19内の
トレースバッファ制御部23の処理のフローチャートを
示す図である。
FIG. 7 is a diagram showing a flowchart of processing of the trace buffer control unit 23 in the trace main body 19 in step S6.

【図8】 図2を修正した実施の形態2における検査対
象テーブル18の構成を示す図である。
FIG. 8 is a diagram showing a configuration of an inspection target table 18 according to the second embodiment in which FIG. 2 is modified.

【図9】 図2を修正した実施の形態3における検査対
象テーブル18の構成を示す図である。
FIG. 9 is a diagram showing a configuration of an inspection target table 18 according to the third embodiment in which FIG. 2 is modified.

【図10】 図6を修正した実施の形態3におけるトレ
ース情報管理部22のフローチャートを示す図である。
FIG. 10 is a diagram showing a flowchart of the trace information management unit 22 in the third embodiment in which FIG. 6 is modified.

【図11】 図2を修正した実施の形態4における検査
対象テーブル18の構成を示す図である。
FIG. 11 is a diagram showing a configuration of an inspection target table 18 according to the fourth embodiment in which FIG. 2 is modified.

【図12】 図6を修正した実施の形態4におけるトレ
ース情報管理部22のフローチャートを示す図である。
FIG. 12 is a diagram showing a flowchart of the trace information management unit 22 according to the fourth embodiment in which FIG. 6 is modified.

【図13】 実施の形態5の構成を示すブロック図であ
る。
FIG. 13 is a block diagram showing a configuration of the fifth embodiment.

【図14】 従来のデバッグ装置を示す図である。FIG. 14 is a diagram showing a conventional debugging device.

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

10 デバッガ本体、11 デバッグ対象プログラム、
12 命令実行ユニット、13 メモリ管理ユニット、
14 メモリユニット、15 検査対象アドレス、16
書込み保護例外ハンドラ、17 書込み保護属性設定
部、18 検査対象テーブル、19 トレース本体、2
0 トレースバッファ、21 トレースフラグ、22
トレース情報管理部、23 トレースバッファ制御部。
10 debugger body, 11 debug target program,
12 instruction execution unit, 13 memory management unit,
14 memory unit, 15 inspection target address, 16
Write-protection exception handler, 17 write-protection attribute setting unit, 18 inspection target table, 19 trace body, 2
0 trace buffer, 21 trace flag, 22
Trace information management unit, 23 Trace buffer control unit.

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 デバッグ対象プログラム内のあるデータ
を検査対象のデータとして指定し、デバッグ対象プログ
ラムを停止させる例外停止条件を指定し、そのデータを
含むページを書込み禁止にし、 そのデータに対する書込み保護例外の発生を契機として
そのデータに対するトレース情報を記憶するとともに、
発生した書込み保護例外が例外停止条件に一致した時に
デバッグ対象プログラムを停止させそのデータに関する
それまでのトレース情報を提示することを特徴とするプ
ログラム実行トレース方式。
1. A method according to claim 1, wherein certain data in the program to be debugged is specified as data to be inspected, an exception stop condition for stopping the program to be debugged is specified, a page including the data is write-protected, and a write-protection exception for the data is specified. Trace information for that data is stored in response to the occurrence of
A program execution tracing method characterized in that when a generated write protection exception matches an exception stop condition, a debug target program is stopped and trace information on the data is presented so far.
【請求項2】 以下の要素を有するプログラム実行トレ
ース方式 (a)オペレータがデバッグ操作を行うためのデバッガ
本体 (b)デバッグ対象プログラムを実行するための命令実
行ユニット (c)デバッグ対象プログラムの命令やデータが配置さ
れるメモリユニット (d)メモリユニットをページ単位でアクセス制御を可
能にする保護機構を有し、書込み保護を設定しているペ
ージ内のデータに対して書込みが発生した時に書込み保
護例外を通知するメモリ管理ユニット (e)デバッグ対象プログラム内のあるデータのアドレ
ス(これを検査対象アドレスと呼ぶ)と、そのデータに
対して書込み保護例外が発生した時にデバッグ対象プロ
グラムを停止させるための例外停止条件とを保持する検
査対象テーブル (f)デバッグ対象プログラム内の検査対象アドレスと
例外停止条件に関する情報を検査対象テーブルに設定す
ると共に、そのデータを含むページに対する書込みを禁
止するようにメモリ管理ユニットを操作する書込み保護
属性設定部 (g)デバッグ対象プログラム内の検査対象アドレスに
対する書込み保護例外の通知を受けて起動され、例外停
止条件が満足される場合はデバッグ対象プログラムを停
止しそれまでのトレース情報を提示するとともに、満足
されない場合はトレース処理を依頼する書込み保護例外
ハンドラ (h)書込み保護例外ハンドラのトレース処理の依頼に
基づき、検査対象アドレスに対して書込みが発生した時
に、トレース情報を記憶するトレース本体。
2. A program execution tracing method having the following elements: (a) a debugger body for an operator to perform a debugging operation; (b) an instruction execution unit for executing a program to be debugged; A memory unit in which data is placed. (D) A protection mechanism that enables access control of the memory unit in page units, and a write protection exception occurs when data is written to data in a page for which write protection is set. (E) The address of certain data in the program to be debugged (this is called an address to be inspected) and an exception for stopping the program to be debugged when a write protection exception occurs for that data Inspection target table holding stop conditions (f) Debugging target program A write protection attribute setting unit that sets information on an address to be inspected and an exceptional stop condition in the inspection target table and operates a memory management unit to prohibit writing to a page including the data; The program is started in response to the write protection exception notification for the address to be checked in the program. If the exception stop condition is satisfied, the debug target program is stopped and the trace information up to that point is presented. (H) A trace body that stores trace information when a write occurs to a check target address based on a trace processing request of the write protection exception handler.
【請求項3】 上記トレース本体は、(i)トレース本
体内でトレース情報を保持するトレースバッファと、
(j)トレース本体内でトレースバッファに対してトレ
ース情報の書込みを行うトレース情報管理部と、(k)
トレース本体内でトレースバッファからトレース情報の
読出しを行うトレースバッファ制御部とを備えた請求項
2記載のプログラム実行トレース方式。
3. The trace body includes: (i) a trace buffer for holding trace information in the trace body;
(J) a trace information management unit for writing trace information to a trace buffer within the trace body; (k)
3. The program execution trace method according to claim 2, further comprising a trace buffer control unit for reading trace information from a trace buffer in the trace body.
【請求項4】 上記トレースバッファは、トレース情報
として、少なくとも、変更しようとした値、例外が発生
した時の命令実行アドレス、例外を発生させたプロセス
情報を保持することを特徴とする請求項3記載のプログ
ラム実行トレース方式。
4. The trace buffer according to claim 3, wherein the trace information holds at least a value to be changed, an instruction execution address when an exception occurs, and process information that caused the exception, as trace information. The described program execution trace method.
【請求項5】 上記トレース本体は、さらに、書込み保
護を設定しているデータの近傍アドレスに対するサブト
レースを行うかどうかを指定するトレースフラグを保持
し、上記トレース本体は、検査対象アドレスの近傍アド
レスに対してサブトレースを行うことを特徴とする請求
項3記載のプログラム実行トレース方式。
5. The trace body further holds a trace flag for designating whether or not to perform sub-trace on an address near the data for which write protection is set, and the trace body includes an address near the address to be inspected. 4. A program execution tracing method according to claim 3, wherein a sub-trace is performed on the program execution trace.
【請求項6】 上記検査対象テーブルは、デバッグ対象
プログラムを停止させる条件のひとつとしてあるプロセ
スを指定した第2の例外停止条件を備え、上記書込み保
護例外ハンドラは、この第2の例外停止条件を用いて、
そのプロセスからの書込み保護例外が発生した時にデバ
ッグ対象プログラムを停止することを特徴とする請求項
2記載のプログラム実行トレース方式。
6. The inspection target table has a second exception stop condition that designates a process as one of the conditions for stopping the debug target program, and the write protection exception handler sets the second exception stop condition make use of,
3. The program execution trace method according to claim 2, wherein the debug target program is stopped when a write protection exception from the process occurs.
【請求項7】 上記検査対象テーブルは検査対象アドレ
ス毎にトレース選択フラグを備え、上記書込み保護例外
ハンドラは、このトレース選択フラグを用いて、検査対
象アドレス毎にトレースを実行するかどうか選択するこ
とを特徴とする請求項2記載のプログラム実行トレース
方式。
7. The inspection target table includes a trace selection flag for each inspection target address, and the write protection exception handler uses the trace selection flag to select whether to execute a trace for each inspection target address. The program execution trace method according to claim 2, wherein:
【請求項8】 上記検査対象テーブルは、あるプロセス
又は、ある実行レベル条件を満たすプロセスをトレース
対象のプロセスとして指定したトレース対象プロセス条
件を備え、上記トレース本体は、このトレース対象プロ
セス条件を用いて、指定したプロセスまたは指定した実
行レベル条件を満たすプロセスが検査対象アドレスに書
込みをした場合のみトレースを実行することを特徴とす
る請求項2記載のプログラム実行トレース方式。
8. The inspection target table includes a trace target process condition in which a certain process or a process satisfying a certain execution level condition is designated as a trace target process, and the trace body uses the trace target process condition. 3. The program execution trace method according to claim 2, wherein the trace is executed only when the designated process or the process satisfying the designated execution level condition writes to the inspection target address.
【請求項9】 上記トレース本体をデバッガ本体内に配
置したことを特徴とする請求項2記載のプログラム実行
トレース方式。
9. The program execution trace method according to claim 2, wherein said trace main body is arranged in a debugger main body.
JP2000198342A 2000-06-30 2000-06-30 Program execution trace system Withdrawn JP2002014843A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000198342A JP2002014843A (en) 2000-06-30 2000-06-30 Program execution trace system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000198342A JP2002014843A (en) 2000-06-30 2000-06-30 Program execution trace system

Publications (1)

Publication Number Publication Date
JP2002014843A true JP2002014843A (en) 2002-01-18

Family

ID=18696519

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000198342A Withdrawn JP2002014843A (en) 2000-06-30 2000-06-30 Program execution trace system

Country Status (1)

Country Link
JP (1) JP2002014843A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013528853A (en) * 2010-04-19 2013-07-11 インターナショナル・ビジネス・マシーンズ・コーポレーション Method, system, and computer program for debugging multithreaded code

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013528853A (en) * 2010-04-19 2013-07-11 インターナショナル・ビジネス・マシーンズ・コーポレーション Method, system, and computer program for debugging multithreaded code

Similar Documents

Publication Publication Date Title
US5132971A (en) In-circuit emulator
JP4476193B2 (en) Information processing method and information processing apparatus
US7711914B2 (en) Debugging using virtual watchpoints
JP5905911B2 (en) Diagnostic code using single-step execution
US7353500B2 (en) Suppressing execution of monitoring measurement program pointed to by inserted branch after threshold number of coverage to reduce instruction testing overhead
KR940003318B1 (en) Processor having cache memory
US8612720B2 (en) System and method for implementing data breakpoints
US20060294433A1 (en) Debugging using watchpoints
JP2002014843A (en) Program execution trace system
JPS60159951A (en) Tracing system in information processing device
JP2008140124A (en) Data processor
JP2653412B2 (en) How to set breakpoints
JPH0830485A (en) Debugging device
KR940007675A (en) Data Processor and Debug Device Using It
JP2000353109A (en) Emulator and emulation system
JPH08123734A (en) Methods for checking occurrence of data destruction in data storing area and program runaway and methods for searching causes of data destruction occurrence and program runaway
JPH0795288B2 (en) Microcomputer
JPH0944413A (en) Page boundary testing method
JPS59202546A (en) Debugging device
JPS6227421B2 (en)
JPH01145740A (en) Emulator for multi-process
JPS59202550A (en) Debugging device
JPH06150025A (en) Chip for evaluation and in-circuit emulator ued for debugging of patch correction enable electronic device
JPS6170644A (en) Program debugging system
JPS63196952A (en) Information processor

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20051018

A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070904