JP2001325122A - Debugging system and its method - Google Patents

Debugging system and its method

Info

Publication number
JP2001325122A
JP2001325122A JP2000144686A JP2000144686A JP2001325122A JP 2001325122 A JP2001325122 A JP 2001325122A JP 2000144686 A JP2000144686 A JP 2000144686A JP 2000144686 A JP2000144686 A JP 2000144686A JP 2001325122 A JP2001325122 A JP 2001325122A
Authority
JP
Japan
Prior art keywords
breakpoint
execution
instruction
debugger
unit
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
JP2000144686A
Other languages
Japanese (ja)
Inventor
Naohito Sugai
尚人 菅井
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 JP2000144686A priority Critical patent/JP2001325122A/en
Publication of JP2001325122A publication Critical patent/JP2001325122A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To set up a brake point in a performance code to be performed in a kernel mode. SOLUTION: A brake point setting part 110 rewrites an address instruction for setting up a brake point by an exceptional processing instruction in order to set up the brake point in a performance code to be performed in the kernel mode included in a process 10 to be debugged which has a performance code to be performed in a user mode and the performance mode to be performed in the kernel mode. A debugger 20 starts the performance of the process 10, and when the process 10 arrives at the exceptional processing instruction of the set brake point, allows a brake point exceptional processing part 112 to interrupt the performance of the process 10 and debugs the performance code included in the process 10.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、計算機システムに
おけるソフトウェアのデバッグ方式及びデバッグ方法に
関し、特にカーネルモードで動作するオペレーティング
システムのデバッグ方式及びデバッグ方法に関する。
The present invention relates to a debugging method and a debugging method for software in a computer system, and more particularly, to a debugging method and a debugging method for an operating system operating in a kernel mode.

【0002】[0002]

【従来の技術】オペレーティングシステム(OS)上で
は、プログラムの実行単位であるプロセスが複数存在
し、時分割により並行して動作している。アプリケーシ
ョンプロセスは、通常ユーザモードで動作している。ア
プリケーションプロセスがOSの機能を呼び出す場合に
は、システムコールを発行し、動作モードをカーネルモ
ードに変え、OS内のコードを実行する。カーネルモー
ドでは、プロセス間で共通に使用されるOS内のすべて
のデータへのアクセスが可能となる。
2. Description of the Related Art On an operating system (OS), a plurality of processes, which are execution units of a program, exist, and operate in parallel by time division. The application process normally operates in the user mode. When the application process calls a function of the OS, it issues a system call, changes the operation mode to the kernel mode, and executes the code in the OS. In the kernel mode, it is possible to access all data in the OS commonly used between processes.

【0003】従来、カーネルモードにおけるデバッグ方
式としては、カーネルデバッガによるものがあった。カ
ーネルデバッガはOS内に組み込まれたデバッグ機能で
あって、ブレークポイントによる実行制御やカーネル内
のデータ参照を行うことができる。カーネルデバッガの
起動時には、カーネルデバッガ以外のOSの動作は停止
するため、OS上のプロセスの実行もすべて停止する。
Conventionally, as a debugging method in the kernel mode, there has been a method using a kernel debugger. The kernel debugger is a debugging function incorporated in the OS, and can perform execution control by breakpoints and reference data in the kernel. When the kernel debugger is started, the operation of the OS other than the kernel debugger is stopped, so that all execution of the processes on the OS is also stopped.

【0004】また、カーネルモードにおけるデバッグ方
式としては、特開平8−6819に記載のような、ユー
ザプロセス内で本来カーネルモードで動作するコードを
動作させ、その中でOSの環境を模擬することでデバッ
グを行う方式もあった。
[0004] As a debugging method in the kernel mode, as described in Japanese Patent Application Laid-Open No. H8-6819, a code originally operating in the kernel mode is operated in a user process, and an OS environment is simulated therein. There was also a debugging method.

【0005】[0005]

【発明が解決しようとする課題】前記のカーネルデバッ
ガによる方法では、OS上のプロセスの実行がすべて停
止してしまうため、システムの動作状態(オンライン状
態)でのデバッグを行うことはできなかった。
In the above-described method using the kernel debugger, the execution of all processes on the OS is stopped, so that debugging cannot be performed in the operating state (on-line state) of the system.

【0006】また、前記のユーザプロセスでカーネルモ
ードでの動作とOSの環境を模擬する方法では、デバイ
スドライバなどOSの機能の一部分のデバッグを行うこ
とはできるが、実際に動作しているOSの任意の機能に
ついてデバッグを行うことはできなかった。
In the above-described method of simulating the operation in the kernel mode and the environment of the OS by the user process, it is possible to debug a part of the functions of the OS such as a device driver. You could not debug any features.

【0007】さらに、OS内のデバッグについては、プ
ロセス切り替え禁止状態の存在という問題もある。プロ
セス間共通データの整合性を保つため、OS内には1つ
プロセスが連続して実行しなければならない部分があ
り、この部分のコードを実行している間は、プロセス切
り替え禁止状態となる。デバッグ時においてもプロセス
の実行を中断することができないため、デバッグ効率が
低下する原因となる。
[0007] Furthermore, there is a problem in the process of debugging in the OS that a process switching prohibition state exists. In order to maintain the consistency of the inter-process common data, there is a portion in the OS where one process must be continuously executed, and the process switching is prohibited while the code of this portion is being executed. Since the execution of the process cannot be interrupted even at the time of debugging, the debugging efficiency is reduced.

【0008】本発明は、上記のような課題を解決するた
めになされたもので、プロセスからのシステムコールの
発行によりカーネルモードで実行されるOS内のコード
について、オンライン状態でのデバッグを可能にするこ
とを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and enables online debugging of code in an OS executed in a kernel mode by issuing a system call from a process. The purpose is to do.

【0009】また、本発明は、プロセス切り替え禁止状
態でのデバッグ時に、デバッグ効率を向上させることを
目的とする。
Another object of the present invention is to improve debugging efficiency when debugging in a process switching prohibited state.

【0010】[0010]

【課題を解決するための手段】この発明に係るデバッグ
方式は、ユーザモードとカーネルモードの2つの動作モ
ードを有するオペレーティングシステムで命令が実行さ
れるプロセスのデバッグ方式において、ユーザモードで
実行される実行コードと、カーネルモードで実行される
実行モードとを有するデバッグ対象プロセスに含まれる
カーネルモードで実行される実行コード内にブレークポ
イントを設定するブレークポイント設定部と、上記デバ
ッグ対象プロセスの実行を開始させ、上記ブレークポイ
ント設定部によって設定された実行コード内のブレーク
ポイントへデバッグ対象プロセスが到達したときに、デ
バッグ対象プロセスの実行を中断させ、上記デバッグ対
象プロセスに含まれる実行コードをカーネルモードで実
行させてデバッグするデバッガとを備えたことを特徴と
する。
SUMMARY OF THE INVENTION A debugging method according to the present invention is a debugging method for a process in which an instruction is executed in an operating system having two operation modes of a user mode and a kernel mode. A breakpoint setting unit for setting a breakpoint in the execution code executed in the kernel mode included in the debug target process having the code and the execution mode executed in the kernel mode; and causing the debug target process to start executing When the debug target process reaches a break point in the execution code set by the break point setting unit, the execution of the debug target process is interrupted, and the execution code included in the debug target process is executed in kernel mode. Debug Characterized in that a debugger that.

【0011】上記ブレークポイント設定部は、上記デバ
ッガから、ブレークポイントを設定する実行コードを含
むデバッグ対象プロセスを識別するデバッグ対象プロセ
ス識別子と、ブレークポイントを設定する実行コードの
アドレスを示すブレークポイント設定アドレスとをブレ
ークポイント設定指示として通知され、通知されたブレ
ークポイント設定指示に基づいて、ブレークポイントを
設定することを特徴とする。
[0011] The breakpoint setting unit is provided from the debugger to identify a debug target process including an execution code for setting a breakpoint, and a breakpoint setting address indicating an address of the execution code for setting a breakpoint. Is notified as a breakpoint setting instruction, and a breakpoint is set based on the notified breakpoint setting instruction.

【0012】上記デバッグ方式は、さらに、上記ブレー
クポイント設定アドレスと、上記デバッグ対象プロセス
識別子と、上記ブレークポイント設定指示を通知したデ
バッガを識別するデバッガ識別子とを記録するブレーク
ポイント記録部と、実行中のデバッグ対象プロセスが上
記ブレークポイント設定アドレスが示すブレークポイン
トに到達した時に、実行中のデバッグ対象プロセスが上
記ブレークポイント記録部に記録されたデバッグ対象プ
ロセス識別子によって識別されるデバッグ対象プロセス
と同一であるかを判断し、判断した結果、上記デバッグ
対象プロセスと同一である場合に、上記ブレークポイン
ト記録部に記録されたデバッガ識別子によって識別され
るデバッガへデバッグ対象プロセスを実行させる制御を
移行させることを指示するブレークポイント例外処理部
と、上記ブレークポイント例外処理部からの指示によっ
て、実行中のデバッグ対象プロセスを中断し、上記デバ
ッガへデバッグ対象プロセスを実行させる制御を移行さ
せるプロセス制御部とを備えたことを特徴とする。
The debugging method further includes a breakpoint recording section for recording the breakpoint setting address, the debugger process identifier, and a debugger identifier for identifying a debugger that has notified the breakpoint setting instruction. When the debug target process reaches the break point indicated by the break point setting address, the debug target process being executed is the same as the debug target process identified by the debug target process identifier recorded in the break point recording unit. If the result of the determination is that the process is the same as the debug target process, the control to execute the debug target process is shifted to the debugger identified by the debugger identifier recorded in the breakpoint recording unit. And a process control unit for interrupting a running debug target process and transferring control to execute the debug target process to the debugger in accordance with an instruction from the break point exception processing unit. It is characterized by the following.

【0013】上記デバッグ方式は、さらに、プロセス切
り替えの可否を判定するシステム状態判定部を備え、上
記ブレークポイント例外処理部は、上記ブレークポイン
ト記録部に記録されたブレークポイント設定アドレスが
示すブレークポイントを第一のブレークポイントとし、
デバッガへデバッグ対象プロセスを実行させる制御を移
行させることを上記プロセス制御部へ指示する時に、上
記システム状態判定部へプロセス切り替えの可否を判定
させ、プロセス切り替えができないと判定された場合、
カーネルモードで実行される実行コード内で、次にプロ
セス切り替えが可能となる箇所を検索し、検索された次
にプロセス切り替えが可能となるアドレスへ第二のブレ
ークポイントを設定し、第二のブレークポイント到達時
に、デバッガへデバッグ対象プロセスを実行させる制御
を移行させることを上記プロセス制御部へ指示すること
を特徴とする。
The debugging system further includes a system state determining unit for determining whether or not the process can be switched. The breakpoint exception processing unit stores a breakpoint indicated by a breakpoint setting address recorded in the breakpoint recording unit. As the first breakpoint,
When instructing the process control unit to shift the control to execute the process to be debugged to the debugger, when the system state determination unit determines whether the process can be switched, and when it is determined that the process cannot be switched,
In the execution code executed in the kernel mode, search for a portion where the process can be switched next, set a second breakpoint to the searched address where the process can be switched next, and perform the second break. When the point is reached, the process control unit is instructed to shift the control for executing the debug target process to the debugger.

【0014】上記デバッグ方式は、さらに、カーネルモ
ードで実行中のデバッグ対象プロセスの状態をプロセス
状態として記録するプロセス状態記録部を備え、上記ブ
レークポイント例外処理部は、実行中のデバッグ対象プ
ロセスが上記第一のブレークポイントに到達した時に、
上記システム状態判定部によってプロセス切り替えがで
きないと判定された場合、ブレークポイントに到達した
時のプロセス状態を上記プロセス状態記録部へ記録し、
上記デバッガは、デバッグ対象プロセスを実行させる制
御が自己へ移された時に、上記プロセス状態記録部に記
録されたプロセス状態を取得することを特徴とする。
The above-mentioned debugging method further comprises a process status recording unit for recording the status of the process to be debugged being executed in the kernel mode as a process status. When you reach the first breakpoint,
If the system state determination unit determines that the process cannot be switched, the process state when the breakpoint is reached is recorded in the process state recording unit,
The debugger acquires the process status recorded in the process status recording unit when the control for executing the debugged process is transferred to itself.

【0015】上記デバッグ方式は、さらに、デバッガか
ら、あらかじめ監視するメモリ領域を通知され、通知さ
れたメモリ領域の範囲を記憶するメモリ変更監視部と、
上記メモリ変更監視部によって記憶されたメモリ領域の
内容が変更された場合に、上記メモリ領域の内容を変更
した命令を記録するメモリ変更記録部とを備え、上記ブ
レークポイント例外処理部は、実行中のデバッグ対象プ
ロセスが上記第一のブレークポイントに到達した時に、
上記システム状態判定部によってプロセス切り替えがで
きないと判定された場合、上記第一のブレークポイント
から上記第二のブレークポイントへ到達するまでにデバ
ッグ対象プロセスが実行した命令のうち、上記メモリ変
更監視部によって記録されたメモリ領域の内容を変更し
た命令を上記メモリ変更記録部に記録し、上記デバッガ
は、デバッグ対象プロセスを実行させる制御が自己へ移
された時に、上記メモリ変更記録部に記録されたメモリ
領域の内容を変更した命令を取得することを特徴とす
る。
In the above-mentioned debugging method, a memory change monitoring unit which is notified of a memory area to be monitored in advance from a debugger and stores a range of the notified memory area,
A memory change recording unit that records, when the content of the memory area stored by the memory change monitoring unit is changed, an instruction that changes the content of the memory area, wherein the breakpoint exception processing unit is executing When the debug target process reaches the first breakpoint,
If the system state determination unit determines that the process cannot be switched, the memory change monitoring unit executes instructions executed by the debug target process from the first breakpoint to the second breakpoint. The debugger records the instruction in which the content of the recorded memory area has been changed in the memory change recording unit. When the control to execute the debug target process is transferred to the debugger, the debugger records the memory recorded in the memory change recording unit. It is characterized by acquiring an instruction in which the contents of the area have been changed.

【0016】上記デバッグ方式は、さらに、デバッグ対
象プロセスの命令が実行された実行履歴を記録する実行
履歴記録部と、デバッグ対象プロセスを実行させる命令
を上記実行履歴記録部へ記録するトレース実行を制御す
るトレース実行制御部とを備え、上記ブレークポイント
例外処理部は、実行中のデバッグ対象プロセスが上記第
一のブレークポイントに到達した時に、上記システム状
態判定部によってプロセス切り替えができないと判定さ
れた場合、上記トレース実行制御部へトレース実行を制
御することを指示し、上記デバッガは、デバッグ対象プ
ロセスを実行させる制御が自己へ移された時に、上記実
行履歴記録部に記録された実行履歴を取得することを特
徴とする。
The debugging method further controls an execution history recording unit for recording an execution history of the execution of the instruction of the process to be debugged and a trace execution for recording an instruction for executing the process to be debugged in the execution history recording unit. A trace execution control unit to perform, the breakpoint exception processing unit, when the process to be debugged reaches the first breakpoint, when the system state determination unit determines that the process can not be switched And instructing the trace execution control unit to control the trace execution, and the debugger acquires the execution history recorded in the execution history recording unit when the control to execute the process to be debugged is transferred to itself. It is characterized by the following.

【0017】上記ブレークポイント設定部は、ブレーク
ポイントを設定するアドレスの命令を、ブレークポイン
トを発生させる例外処理命令へ書き換えることを特徴と
する。
The breakpoint setting section rewrites an instruction at an address for setting a breakpoint to an exception processing instruction for generating a breakpoint.

【0018】上記ブレークポイント設定部は、ブレーク
ポイントを設定するアドレスの命令を正常命令として上
記ブレークポイント記録部へ記録し、ブレークポイント
を設定するアドレスの命令を、ブレークポイントを発生
させる例外処理命令へ書き換え、上記ブレークポイント
例外処理部は、実行中のデバッグ対象プロセスが上記ブ
レークポイント記録部に記録されたデバッグ対象プロセ
ス識別子によって識別されるデバッグ対象プロセスと同
一でないと判断した場合に、書き換えられた例外処理命
令を上記ブレークポイント記録部に記録された正常命令
へ書き換えることを特徴とする。
The breakpoint setting section records the instruction at the address at which the breakpoint is set as a normal instruction in the breakpoint recording section, and converts the instruction at the address at which the breakpoint is set to an exception processing instruction for generating a breakpoint. Rewriting, if the breakpoint exception processing unit determines that the debug target process being executed is not the same as the debug target process identified by the debug target process identifier recorded in the breakpoint recording unit, the rewritten exception The processing instruction is rewritten to a normal instruction recorded in the breakpoint recording section.

【0019】この発明に係るデバッグ方法は、ユーザモ
ードとカーネルモードの2つの動作モードを有するオペ
レーティングシステムで命令が実行されるプロセスのデ
バッグ方法において、ユーザモードで実行される実行コ
ードと、カーネルモードで実行される実行モードとを有
するデバッグ対象プロセスに含まれるカーネルモードで
実行される実行コード内にブレークポイントを設定する
ブレークポイント設定工程と、上記デバッグ対象プロセ
スの実行を開始させ、上記ブレークポイント設定工程に
よって設定された実行コード内のブレークポイントへデ
バッグ対象プロセスが到達したときに、デバッグ対象プ
ロセスの実行を中断させ、上記デバッグ対象プロセスに
含まれる実行コードをカーネルモードで実行させてデバ
ッグするデバッグ工程とを備えたことを特徴とする。
A debugging method according to the present invention is a method for debugging a process in which an instruction is executed in an operating system having two operation modes of a user mode and a kernel mode. A breakpoint setting step of setting a breakpoint in an execution code executed in a kernel mode included in a debug target process having an execution mode to be executed; and a breakpoint setting step of starting execution of the debug target process. When the debuggee process reaches the breakpoint in the execution code set by the debugger, the execution of the debuggee process is interrupted, and the execution code included in the debuggee process is executed in the kernel mode for debugging. Characterized in that a degree.

【0020】上記ブレークポイント設定工程は、ブレー
クポイントを設定するアドレスの命令を、ブレークポイ
ントを発生させる例外処理命令へ書き換えることを特徴
とする。
The breakpoint setting step is characterized in that an instruction at an address for setting a breakpoint is rewritten to an exception processing instruction for generating a breakpoint.

【0021】[0021]

【発明の実施の形態】実施の形態1.図1は、本発明の
第1の実施の形態を示すブロック図である。図中の符号
において、10はデバッグ対象プロセス、20はデバッ
ガである。100は、オペレーティングシステムであ
り、50はハードウェアである。また、101はシステ
ムコールインタフェース、102はファイル管理サブシ
ステム、103はメモリ管理サブシステム、104はデ
バイスドライバである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiment 1 FIG. 1 is a block diagram showing a first embodiment of the present invention. In the figure, reference numeral 10 denotes a process to be debugged, and 20 denotes a debugger. 100 is an operating system, and 50 is hardware. Reference numeral 101 denotes a system call interface, 102 denotes a file management subsystem, 103 denotes a memory management subsystem, and 104 denotes a device driver.

【0022】106はプロセス制御部、110はブレー
クポイント設定部、111はブレークポイント記録部、
112はブレークポイント例外処理部である。図2は、
ブレークポイント記録部111の構造の一例を示す。
Reference numeral 106 denotes a process control unit, 110 denotes a breakpoint setting unit, 111 denotes a breakpoint recording unit,
Reference numeral 112 denotes a breakpoint exception processing unit. FIG.
4 shows an example of the structure of the breakpoint recording section 111.

【0023】デバッガ20は、システムコールインタフ
ェース101を介し、ブレークポイント設定部110に
対して、カーネルモード動作コード中のブレークポイン
ト設定アドレスとデバッグ対象プロセスの識別子の指定
を含むブレークポイント設定指示を出す。
The debugger 20 issues a breakpoint setting instruction including a breakpoint setting address in the kernel mode operation code and an identifier of a process to be debugged to the breakpoint setting unit 110 via the system call interface 101.

【0024】ブレークポイント設定部110は、デバッ
ガ20からブレークポイント設定指示を受けると動作を
開始する。以下、ブレークポイント設定部110の動作
を、図3を用いて説明する。
The breakpoint setting section 110 starts operating when a breakpoint setting instruction is received from the debugger 20. Hereinafter, the operation of the breakpoint setting unit 110 will be described with reference to FIG.

【0025】ブレークポイント設定部110は、S10
1で、ブレークポイント記録部111にブレークポイン
ト設定アドレスとデバッグ対象プロセスの識別子を記録
する。また、S102で、デバッガの識別子をブレーク
ポイント記録部111に記録する。
The break point setting unit 110 determines in S10
In step 1, the breakpoint setting address and the identifier of the process to be debugged are recorded in the breakpoint recording unit 111. In step S102, the debugger identifier is recorded in the breakpoint recording unit 111.

【0026】S103で、指定アドレスの実行によりブ
レークポイント例外を発生させるため、指定アドレスの
命令コードをブレークポイント記録部111に保存した
後、S104で、指定アドレスの命令コードをブレーク
ポイント例外発生命令に書き換える処理を行う。
In step S103, the instruction code at the specified address is stored in the breakpoint recording unit 111 in order to generate a breakpoint exception due to the execution of the specified address. Perform the rewriting process.

【0027】デバッガ20は、デバッグ対象プロセス1
0の動作を開始させる。ユーザモードでは、複数のプロ
セスが時分割により並行して動作しているため、任意の
プロセスがシステムコールを発行してカーネル内のコー
ドを実行し、設定されたブレークポイントに到達する可
能性がある。
The debugger 20 executes the process 1 to be debugged.
0 operation is started. In user mode, multiple processes are running in parallel in a time-sharing manner, so any process may issue a system call to execute code in the kernel and reach a set breakpoint .

【0028】以下、カーネルコード内のブレークポイン
ト例外発生命令が実行され、ブレークポイント例外が発
生した場合のブレークポイント例外処理部112の動作
を、図4を用いて説明する。
The operation of the breakpoint exception processing unit 112 when a breakpoint exception generating instruction in the kernel code is executed and a breakpoint exception occurs will be described below with reference to FIG.

【0029】ブレークポイント例外が発生すると、ブレ
ークポイント例外処理部112の処理が開始される。ブ
レークポイント例外処理部112は、S111で、例外
が発生したアドレスがブレークポイント記録部111に
記録されているか調べる。記録されていない場合(S1
12でN)、S116で不正命令実行としての処理を行
い処理を終了する。
When a breakpoint exception occurs, the processing of the breakpoint exception processing unit 112 starts. In step S111, the breakpoint exception processing unit 112 checks whether the address where the exception has occurred is recorded in the breakpoint recording unit 111. If not recorded (S1
In step S116, the process is executed as an illegal instruction, and the process ends.

【0030】例外が発生したアドレスが、ブレークポイ
ント記録部111に記録されている場合(S111で
Y)、S112で、現実行プロセス、すなわち例外を発
生させたプロセスの識別子が、ブレークポイント記録部
111に記録されているデバッグ対象プロセスの識別子
と一致するかを調べる(S112)。
If the address at which the exception has occurred is recorded in the breakpoint recording unit 111 (Y in S111), in S112, the identifier of the currently executed process, that is, the process that caused the exception, is stored in the breakpoint recording unit 111. It is checked whether it matches the identifier of the process to be debugged recorded in (S112).

【0031】現実行プロセスの識別子が記録されている
ものと一致しない場合(S112でN)、デバッグ対象
以外のプロセスの実行によりブレークポイントに到達し
たものであるため、S113で実行継続処理を行い、終
了する。S113における実行継続処理の動作を説明す
る。
If the identifier of the currently executed process does not match the recorded one (N in S112), since the breakpoint has been reached by the execution of a process other than the debug target, the execution continuation process is performed in S113. finish. The operation of the execution continuation process in S113 will be described.

【0032】まず、S113の実行継続処理は、ブレー
クポイント記録部111に保存されている、現在のブレ
ークポイント設定アドレスの元の命令コードを、現在の
ブレークポイント設定アドレスに書き込み、ブレークポ
イント設定アドレスの命令を復元する。続いて、復元し
た命令をシングルステップモードで実行し、シングルス
テップモードの実行が完了した時点で、ブレークポイン
ト設定アドレスにブレークポイント例外発生命令を再度
書き込む。
First, in the execution continuation processing of S113, the original instruction code of the current breakpoint setting address stored in the breakpoint recording unit 111 is written to the current breakpoint setting address, and Restore instructions. Subsequently, the restored instruction is executed in the single-step mode, and when the execution of the single-step mode is completed, the breakpoint exception generating instruction is written again at the breakpoint setting address.

【0033】この際に、ブレークポイント設定アドレス
の元の命令コードは、ブレークポイント記録部111に
既に保存されているため、再び保存を行う必要はない。
ブレークポイント例外発生命令の復元が完了すると、ブ
レークポイント設定アドレスの次に実行される命令アド
レスから通常の命令実行を再開し、デバッグ対象プロセ
ス10の実行が継続される。
At this time, since the original instruction code of the break point setting address has already been stored in the break point recording unit 111, it is not necessary to store it again.
When the restoration of the breakpoint exception generating instruction is completed, normal instruction execution is resumed from the instruction address executed next to the breakpoint setting address, and the execution of the debug target process 10 is continued.

【0034】現実行プロセスの識別子が記録されている
ものと一致する場合(S112でY)、デバッグ対象プ
ロセスの実行によりブレークポイントに到達したもので
あるため、S114でプロセス制御部106に対し、現
実行プロセスの実行を中断するよう指示する。S115
で、ブレークポイント記録部111に記録されているデ
バッガのプロセス識別子により、プロセス制御部106
に対してデバッガに制御を移すよう指示する。
If the identifier of the currently executed process matches the recorded one (Y in S112), it means that the breakpoint has been reached by the execution of the process to be debugged. Instructs the execution of the line process to be interrupted. S115
Then, the process control unit 106 is determined by the process identifier of the debugger recorded in the breakpoint recording unit 111.
Instructs the debugger to transfer control.

【0035】これにより、デバッグ対象プロセスは、カ
ーネルコード内のブレークポイント設定アドレスで実行
を中断した状態となり、デバッガからデバッグ対象プロ
セスの状態を調査することが可能となる。
As a result, the process to be debugged is suspended at the breakpoint setting address in the kernel code, and the debugger can check the status of the process to be debugged.

【0036】一方、デバッグ対象以外のプロセスについ
ては、ブレークポイント設定アドレスの実行後も処理が
継続されるため、システム全体の動作には影響を与えな
い。
On the other hand, processes other than those to be debugged continue even after the execution of the breakpoint setting address, so that the operation of the entire system is not affected.

【0037】この実施の形態1のデバッグ方式によれ
ば、カーネルモードで実行されるOS内のコードについ
て、デバッグ対象のプロセスによる実行のみを制御し、
他のプロセスの動作には影響を与えず、オンライン状態
でのデバッグを行うことができる。
According to the debugging method of the first embodiment, only the execution of the code in the OS executed in the kernel mode by the process to be debugged is controlled.
Debugging can be performed online without affecting the operation of other processes.

【0038】以上のように、この実施の形態のデバッグ
方式及びデバッグ方法は、ユーザモードとカーネルモー
ドの2つの動作モードを持つオペレーティングシステム
において、ユーザモードからカーネルモードへの遷移を
含むデバッグ対象プロセス10のカーネルモード動作の
デバッグを、デバッガ20から行うデバッグ方式及び方
法であって、カーネルモードでの実行コード内にブレー
クポイントを設定するブレークポイント設定部110
(ブレークポイント設定工程)と、設定されたブレーク
ポイントとデバッグ対象プロセスの識別子とデバッガの
識別子を記録するブレークポイント記録部111とを備
え、デバッガ20により設定された、カーネルモードで
の実行コード内のブレークポイントへの、デバッグ対象
プロセス10の到達時に、デバッグ対象プロセス10の
実行を中断し、デバッガ20に実行を移すことを特徴と
する。
As described above, the debugging method and the debugging method according to the present embodiment can be applied to a debug target process 10 including a transition from a user mode to a kernel mode in an operating system having two operation modes of a user mode and a kernel mode. A debugging method and method for debugging the kernel mode operation from the debugger 20, wherein the breakpoint setting unit 110 sets a breakpoint in the execution code in the kernel mode.
(Breakpoint setting step), and a breakpoint recording unit 111 that records the set breakpoint, the identifier of the process to be debugged, and the identifier of the debugger. When the debug target process 10 reaches a breakpoint, execution of the debug target process 10 is interrupted, and execution is transferred to the debugger 20.

【0039】実施の形態2.図5は、本発明の第2の実
施の形態を示すブロック図である。図中の符号におい
て、201はプロセスの切り替えの可否を判定するシス
テム状態判定部である。上記以外の符号の構成要素は、
実施の形態1と同様である。図6は、本実施の形態にお
けるブレークポイント記録部111の構成を示す。
Embodiment 2 FIG. 5 is a block diagram showing a second embodiment of the present invention. In the reference numerals in the figure, reference numeral 201 denotes a system state determination unit that determines whether the process can be switched. The components of the reference numerals other than the above are:
This is the same as in the first embodiment. FIG. 6 shows a configuration of the breakpoint recording unit 111 according to the present embodiment.

【0040】本発明の実施の形態2におけるブレークポ
イント設定部110の動作は、図3を用いて説明した実
施の形態1の場合と同様である。
The operation of the breakpoint setting section 110 according to the second embodiment of the present invention is the same as that of the first embodiment described with reference to FIG.

【0041】プロセスにより、カーネルコード内のブレ
ークポイント例外発生命令が実行され、ブレークポイン
ト例外が発生した場合のブレークポイント例外処理部1
12の動作を、図7を用いて説明する。
A breakpoint exception generating instruction in the kernel code is executed by the process, and a breakpoint exception processing unit 1 when a breakpoint exception occurs.
Operation 12 will be described with reference to FIG.

【0042】ブレークポイント例外処理部112は、S
211で、例外が発生したアドレスがブレークポイント
記録部111に記録されているか調べる。記録されてい
ない場合(S211でN)、S220で不正命令実行と
しての処理を行い処理を終了する。
The breakpoint exception handling unit 112
In step 211, it is checked whether the address where the exception has occurred is recorded in the breakpoint recording unit 111. If it is not recorded (N in S211), a process for executing an illegal command is performed in S220, and the process ends.

【0043】例外が発生したアドレスが、ブレークポイ
ント記録部111に記録されている場合(S211で
Y)、S212で、現実行プロセス、すなわち例外を発
生させたプロセスの識別子が、ブレークポイント記録部
111に記録されているデバッグ対象プロセスの識別子
と一致するかを調べる(S212)。
If the address at which the exception has occurred is recorded in the breakpoint recording unit 111 (Y in S211), in S212, the identifier of the currently executed process, that is, the process that caused the exception, is stored in the breakpoint recording unit 111. (S212).

【0044】現実行プロセスの識別子が記録されている
ものと一致しない場合(S212でN)、デバッグ対象
以外のプロセスの実行によりブレークポイントに到達し
たものであるため、S213で実行継続処理を行い、終
了する。実行継続処理は、S113で、説明したものと
同様である。
If the identifier of the currently executed process does not match the recorded one (N in S212), since the breakpoint has been reached by the execution of the process other than the debug target, the execution continuation process is performed in S213. finish. The execution continuation process is the same as that described in S113.

【0045】現実行プロセスの識別子が記録されている
ものと一致する場合(S212でY)、S214でシス
テム状態判定部201を参照し、システムがプロセス切
り替え可能な状態であるか判定する(S214)。
If the identifier of the currently executed process matches the recorded one (Y in S212), the system status determining unit 201 is referred to in S214 to determine whether the system is in a process switchable state (S214). .

【0046】プロセス切り替えが禁止された状態である
場合(S214でN)には、S215で代替ブレークポ
イント設定処理を行う。代替ブレークポイント設定処理
では、ブレークポイント記録部111内の未使用のエン
トリに対し、システム状態変更処理の終了アドレスをブ
レークポイント設定アドレスとして、現実行プロセスの
識別子をデバッグ対象プロセスの識別子として、それぞ
れ記録する。
If the process switching is prohibited (N in S214), an alternative breakpoint setting process is performed in S215. In the alternative breakpoint setting process, for the unused entries in the breakpoint recording unit 111, the end address of the system state change process is recorded as the breakpoint setting address, and the identifier of the currently executed process is recorded as the identifier of the process to be debugged. I do.

【0047】続いて、現在のブレークポイントが記録さ
れているブレークポイント記録部111内のエントリへ
のポインタをオリジナルブレークポイント情報として記
録し、現在のブレークポイントに対応するエントリに記
録されているデバッガ識別子を、代替ブレークポイント
に対応するエントリにコピーする。更に、システム状態
変更処理の終了アドレスの命令コードをブレークポイン
ト記録部111に保存した後、システム状態変更処理の
終了アドレスの命令コードをブレークポイント例外発生
命令に書き換える。
Subsequently, a pointer to the entry in the breakpoint recording unit 111 where the current breakpoint is recorded is recorded as original breakpoint information, and the debugger identifier recorded in the entry corresponding to the current breakpoint is recorded. To the entry corresponding to the alternate breakpoint. Further, after storing the instruction code of the end address of the system state change processing in the breakpoint recording unit 111, the instruction code of the end address of the system state change processing is rewritten to a breakpoint exception occurrence instruction.

【0048】ここで、システム状態変更処理は、OS内
で共通に使用されるプロセス切り替えの可否を設定する
処理であり、プロセス切り替え禁止状態からプロセス切
り替え可能状態へ移行する場合に必ず実行される処理で
ある。システム状態変更処理の終了アドレスは(第2
の)ブレークポイント設定アドレス、現実行プロセスの
識別子はデバッグ対象プロセス識別子に対応する。
Here, the system state change process is a process for setting whether or not process switching commonly used in the OS can be performed, and is always executed when shifting from the process switching disabled state to the process switchable state. It is. The end address of the system state change process is (second
The breakpoint setting address and the identifier of the currently executed process correspond to the debug target process identifier.

【0049】代替ブレークポイント設定処理後、S21
3で実行継続処理を行い、デバッグ対象プロセス10は
実行を継続する。
After the alternative break point setting processing, S21
In step 3, the execution continuation process is performed, and the debug target process 10 continues execution.

【0050】S214でプロセス切り替え可能な状態で
あると判定された場合(S214でY)には、続いて、
S216でブレークポイント記録部111を参照し、現
在のブレークポイントが代替ブレークポイントであるか
を判定する。代替ブレークポイントと判定された場合
(S216でY)には、S217で代替ブレークポイン
トの削除処理を行う。
If it is determined in S214 that the process can be switched (Y in S214), then
In step S216, it is determined whether the current breakpoint is an alternative breakpoint by referring to the breakpoint recording unit 111. If it is determined that the break point is an alternative break point (Y in S216), a process of deleting an alternative break point is performed in S217.

【0051】代替ブレークポイントの削除処理では、ブ
レークポイント記録部111内のブレークポイント設定
アドレスに記録されているアドレスに、命令保存領域に
記録されている命令を書き戻す。続いて、オリジナルブ
レークポイント情報の指すブレークポイント記録部11
1内のエントリを取得した後、代替ブレークポイントに
ついての記録を消去する。
In the process of deleting the substitute break point, the instruction recorded in the instruction storage area is written back to the address recorded at the break point setting address in the break point recording unit 111. Subsequently, the breakpoint recording unit 11 indicated by the original breakpoint information
After obtaining the entry in 1, delete the record for the alternate breakpoint.

【0052】S216で現在のブレークポイントが代替
ブレークポイントでないと判定された場合(S216で
N)、またはS217で代替ブレークポイント削除処理
の完了後、S218ではプロセス制御部106に対し、
現実行プロセスの実行を中断するよう指示する。続い
て、S219でブレークポイント記録部111に記録さ
れているデバッガのプロセス識別子により、プロセス制
御部106に対してデバッガ20に制御を移すよう指示
する。
If it is determined in S216 that the current breakpoint is not an alternative breakpoint (N in S216), or after completion of the alternative breakpoint deletion processing in S217, the process control unit 106 is instructed in S218.
Instructs execution of the current execution process to be interrupted. Then, in step S219, the process control unit 106 is instructed to transfer control to the debugger 20 using the debugger process identifier recorded in the breakpoint recording unit 111.

【0053】この実施の形態2のデバッグ方式によれ
ば、設定されたブレークポイントに到達した時点でシス
テムがプロセス切り替え禁止状態にある場合でも、プロ
セス切り替え可能状態となる場合に必ず実行されるシス
テム状態変更処理の終了アドレスに代替ブレークポイン
トを設定することにより、デバッグ対象プロセスの実行
を可能な限り速やかに中断してデバッグを行うことがで
き、デバッグ効率を向上させることができる。
According to the debugging method of the second embodiment, even when the system is in the process switching prohibited state at the time when the set breakpoint is reached, the system state always executed when the process switching is enabled. By setting an alternative breakpoint at the end address of the change process, the execution of the process to be debugged can be interrupted as soon as possible to perform debugging, and the debugging efficiency can be improved.

【0054】以上のように、この実施の形態のデバッグ
方式及びデバッグ方法は、更に、プロセス切り替えの可
否を判定するシステム状態判定部201を備え、カーネ
ルモードでの実行コード内の第1の命令ブレークポイン
ト到達時にプロセス切り替えが不可能な場合、カーネル
モードでの実行コード内のプロセス切り替えが可能とな
る箇所に第2のブレークポイントを設定し、第2のブレ
ークポイント到達時にデバッグ対象プロセス10の実行
を中断し、デバッガ20に実行を移すことを特徴とす
る。
As described above, the debugging method and the debugging method according to this embodiment further include the system state determination unit 201 for determining whether or not the process can be switched, and the first instruction break in the execution code in the kernel mode. If the process cannot be switched when the point is reached, a second breakpoint is set at a location in the executable code in the kernel mode where the process can be switched, and the execution of the debug target process 10 is performed when the second breakpoint is reached. It is characterized in that the execution is interrupted and the execution is transferred to the debugger 20.

【0055】実施の形態3.図8は、本発明の第3の実
施の形態を示すブロック図である。図中の符号におい
て、301はカーネルブレークポイント設定時点、すな
わちデバッグ例外発生時のプロセッサレジスタの内容な
どのプロセス情報を記録するプロセス状態記録部であ
る。上記以外の符号の構成要素は、実施の形態1及び実
施の形態2と同様である。
Embodiment 3 FIG. 8 is a block diagram showing a third embodiment of the present invention. In the figure, reference numeral 301 denotes a process state recording unit that records process information such as the contents of a processor register when a kernel breakpoint is set, that is, when a debug exception occurs. The components other than those described above are the same as those in the first and second embodiments.

【0056】本発明の実施の形態3におけるブレークポ
イント設定部110の動作は、図3を用いて説明した実
施の形態1の場合と同様である。
The operation of the breakpoint setting unit 110 according to the third embodiment of the present invention is the same as that of the first embodiment described with reference to FIG.

【0057】プロセスにより、カーネルコード内のブレ
ークポイント例外発生命令が実行され、ブレークポイン
ト例外が発生した場合のブレークポイント例外処理部1
12の動作を、図9を用いて説明する。
A breakpoint exception generating instruction in the kernel code is executed by the process, and a breakpoint exception processing unit 1 when a breakpoint exception occurs.
Operation 12 will be described with reference to FIG.

【0058】ブレークポイント例外処理部112は、S
311で、例外が発生したアドレスがブレークポイント
記録部111に記録されているか調べる。記録されてい
ない場合(S311でN)、S320で不正命令実行と
しての処理を行い処理を終了する。
The breakpoint exception handling unit 112
In 311, it is checked whether the address where the exception has occurred is recorded in the breakpoint recording unit 111. If it is not recorded (N in S311), a process for executing an illegal command is performed in S320, and the process ends.

【0059】例外が発生したアドレスが、ブレークポイ
ント記録部111に記録されている場合(S311で
Y)、S312で、現実行プロセス、すなわち例外を発
生させたプロセスの識別子が、ブレークポイント記録部
111に記録されているデバッグ対象プロセスの識別子
と一致するかを調べる(S312)。
If the address where the exception has occurred is recorded in the breakpoint recording unit 111 (Y in S311), in S312, the identifier of the currently executed process, that is, the process that caused the exception, is stored in the breakpoint recording unit 111. (S312).

【0060】現実行プロセスの識別子が記録されている
ものと一致しない場合(S312でN)、デバッグ対象
以外のプロセスの実行によりブレークポイントに到達し
たものであるため、S313で実行継続処理を行い、終
了する。
If the identifier of the currently executed process does not match the recorded one (N in S312), since the breakpoint has been reached by the execution of a process other than the debug target, execution continuation processing is performed in S313. finish.

【0061】現実行プロセスの識別子が記録されている
ものと一致する場合(S312でY)、S314でシス
テム状態判定部を参照し、システムがプロセス切り替え
可能な状態であるか判定する。
If the identifier of the currently executed process matches the recorded one (Y in S312), the system status determination unit is referred to in S314 to determine whether the system is in a process switchable state.

【0062】プロセス切り替えが禁止された状態である
場合(S314でN)には、S320において、カーネ
ルブレークポイント設定時点、すなわちデバッグ例外発
生時のプロセッサレジスタの内容などのプロセス情報
を、プロセス情報記録部301に記録する。続いて、S
315で代替ブレークポイント設定処理を行い、S31
3で実行継続処理を行い、デバッグ対象プロセス10は
実行を継続する。代替ブレークポイント設定処理は、実
施の形態2で説明した通りである。
If the process switching is prohibited (N in S314), in S320, the process information such as the contents of the processor register at the time of setting the kernel breakpoint, that is, when a debug exception occurs, is stored in the process information recording unit. Record in 301. Then, S
At 315, an alternative breakpoint setting process is performed, and at S31
In step 3, the execution continuation process is performed, and the debug target process 10 continues execution. The alternative breakpoint setting process is as described in the second embodiment.

【0063】S314でプロセス切り替え可能な状態で
あると判定された場合(S314でY)、S316から
S319までの処理は、実施の形態2におけるS216
からS219までの処理と同様である。
If it is determined in S314 that the process can be switched (Y in S314), the processes from S316 to S319 are performed in S216 in the second embodiment.
To S219.

【0064】デバッグ対象プロセス10が、プロセス切
り替え可能状態となり、代替ブレークポイントに到達す
ると、デバッガに制御が移る。デバッガ20は、システ
ムコールインタフェースを経由し、プロセス状態記録部
301から、本来のブレークポイント設定箇所でのプロ
セッサレジスタ内容などのプロセス状態を読み出す。
When the process 10 to be debugged enters a process switchable state and reaches an alternative breakpoint, control is transferred to the debugger. The debugger 20 reads the process state such as the contents of the processor register at the original breakpoint setting location from the process state recording unit 301 via the system call interface.

【0065】この実施の形態3のデバッグ方式によれ
ば、設定されたブレークポイントに到達した時点でシス
テムがプロセス切り替え禁止状態にある場合でも、その
時点でのプロセス情報を記録しておくことで、プロセス
切り替え可能状態となった後にデバッガから本来のブレ
ークポイント設定時点でのデバッグ対象プロセスの状態
を知ることができ、より効果的なデバッグを行うことが
できる。
According to the debugging method of the third embodiment, even if the system is in the process switching prohibition state at the time when the set breakpoint is reached, the process information at that time is recorded. After the process can be switched, the status of the process to be debugged at the time of setting the original breakpoint can be known from the debugger, and more effective debugging can be performed.

【0066】以上のように、この実施の形態のデバッグ
方式及びデバッグ方法は、更に、カーネルモードでのプ
ロセス状態を記録するプロセス状態記憶部301を備
え、カーネルモードでの実行コード内の第1のブレーク
ポイント到達時にプロセス切り替えが不可能な場合、第
1のブレークポイント到達時のデバッグ対象プロセスの
状態を記録し、カーネルモードでの実行コード内のプロ
セス切り替えが可能となる箇所に第2のブレークポイン
トを設定し、第2のブレークポイント到達時にデバッグ
対象プロセスの実行を中断し、デバッガに実行を移し、
デバッガは、前記プロセス状態を取得することを特徴と
する。
As described above, the debugging method and the debugging method according to the present embodiment further include the process state storage unit 301 for recording the process state in the kernel mode, and the first state in the execution code in the kernel mode. If it is not possible to switch the process when the breakpoint is reached, the state of the process to be debugged when the first breakpoint is reached is recorded, and the second breakpoint is set at a location in the executable code in the kernel mode where the process can be switched. Is set, the execution of the process to be debugged is interrupted when the second breakpoint is reached, execution is transferred to the debugger,
The debugger acquires the process state.

【0067】実施の形態4.図10は、本発明の第4の
実施の形態を示すブロック図である。図中の符号におい
て、401はメモリ変更記録部、402はメモリ変更監
視部である。上記以外の符号の構成要素は、実施の形態
2と同様である。
Embodiment 4 FIG. 10 is a block diagram showing a fourth embodiment of the present invention. In the reference numerals in the figure, 401 is a memory change recording unit, and 402 is a memory change monitoring unit. The components other than those described above are the same as those in the second embodiment.

【0068】本発明の実施の形態2におけるブレークポ
イント設定部110の動作は、実施の形態1の場合と同
様である。
The operation of break point setting section 110 according to the second embodiment of the present invention is the same as that of the first embodiment.

【0069】デバッガ20は、デバッグ対象プロセス1
0によるメモリ変更を監視すべきアドレスを、システム
コールインタフェースを介し、メモリ変更監視部402
に設定する。
The debugger 20 executes the process 1 to be debugged.
The memory change monitoring unit 402 designates an address to be monitored for a memory change due to 0 through the system call interface.
Set to.

【0070】デバッガ20により、カーネルコード内の
ブレークポイント例外発生命令が実行され、ブレークポ
イント例外が発生した場合のブレークポイント例外処理
部112の動作を、図11を用いて説明する。
The operation of the breakpoint exception processing unit 112 when the breakpoint exception generating instruction in the kernel code is executed by the debugger 20 and a breakpoint exception occurs will be described with reference to FIG.

【0071】ブレークポイント例外処理部112は、S
411で、例外が発生したアドレスがブレークポイント
記録部111に記録されているか調べる。記録されてい
ない場合(S411でN)、S421で不正命令実行と
しての処理を行い処理を終了する。
The breakpoint exception processing unit 112
At 411, it is checked whether the address where the exception has occurred is recorded in the breakpoint recording unit 111. If it is not recorded (N in S411), a process for executing an invalid instruction is performed in S421, and the process ends.

【0072】例外が発生したアドレスが、ブレークポイ
ント記録部111に記録されている場合(S411で
Y)、S412で、現実行プロセス、すなわち例外を発
生させたプロセスの識別子が、ブレークポイント記録部
111に記録されているデバッグ対象プロセスの識別子
と一致するかを調べる。
If the address at which the exception has occurred is recorded in the breakpoint recording unit 111 (Y in S411), in S412, the identifier of the currently executed process, that is, the process that caused the exception, is stored in the breakpoint recording unit 111. Check that it matches the identifier of the process to be debugged recorded in.

【0073】現実行プロセスの識別子が記録されている
ものと一致しない場合(S412でN)、デバッグ対象
以外のプロセスの実行によりブレークポイントに到達し
たものであるため、S413で実行継続処理を行い、終
了する。
If the identifier of the currently executed process does not match the recorded one (N in S412), since the breakpoint has been reached by the execution of a process other than the debug target, the execution continuation process is performed in S413. finish.

【0074】現実行プロセスの識別子が記録されている
ものと一致する場合(S412でY)、S414でシス
テム状態判定部201を参照し、システムがプロセス切
り替え可能な状態であるか判定する。
When the identifier of the currently executed process matches the recorded one (Y in S412), the system status determination unit 201 is referred to in S414 to determine whether the system is in a process switchable state.

【0075】プロセス切り替えが禁止された状態である
場合(S414でN)には、S415においてメモリ監
視設定を行うようメモリ変更監視部402に指示する。
メモリ変更監視部402は、あらかじめデバッガ20に
より設定されている監視対象のメモリアドレスを、プロ
セッサに備えられているウオッチポイント(データブレ
ークポイント)レジスタに書き込み、設定アドレスに対
する書き込みによりデバッグ例外を発生させるよう設定
する。
When the process switching is prohibited (N in S414), the memory change monitoring unit 402 is instructed to perform memory monitoring setting in S415.
The memory change monitoring unit 402 writes a monitoring target memory address set in advance by the debugger 20 into a watchpoint (data breakpoint) register provided in the processor, and generates a debug exception by writing to the set address. Set.

【0076】続いて、S416で代替ブレークポイント
設定処理を行い、S413で実行継続処理を行い、デバ
ッグ対象プロセスは実行を継続する。
Subsequently, an alternative breakpoint setting process is performed in S416, an execution continuation process is performed in S413, and the process to be debugged continues execution.

【0077】ここで、実行が継続されたデバッグ対象プ
ロセス10が、代替ブレークポイントに到達するまでの
間に、メモリ変更監視設定を行ったアドレスに対して書
き込みを行った場合、プロセッサのデバッグ例外が発生
する。デバッグ例外が発生すると、メモリ変更監視部4
02は、例外を発生させた命令と、監視対象のアドレス
に書き込まれたデータをメモリ変更記録部401に記録
し、デバッグ例外から復帰する。
Here, if the debugged process 10 whose execution has been continued writes to the address for which the memory change monitoring setting has been made until the alternative breakpoint is reached, a debug exception of the processor occurs. appear. When a debug exception occurs, the memory change monitoring unit 4
02 records the instruction that caused the exception and the data written at the monitoring target address in the memory change recording unit 401, and returns from the debug exception.

【0078】S414でプロセス切り替え可能な状態で
あると判定された場合(S414でY)、続いて、S4
17でブレークポイント記録部111を参照し、現在の
ブレークポイントが代替ブレークポイントであるかを判
定する。代替ブレークポイントと判定された場合には、
S418でメモリ監視の解除をメモリ変更監視部402
に対して指示し、続いて、S419で代替ブレークポイ
ントの削除処理を行う。
If it is determined in S414 that the process can be switched (Y in S414), the process proceeds to S4.
At 17, the breakpoint recording unit 111 is referenced to determine whether the current breakpoint is an alternative breakpoint. If an alternative breakpoint is determined,
In step S418, the release of the memory monitoring is notified by the memory change monitoring unit 402.
Then, in step S419, a process of deleting an alternative breakpoint is performed.

【0079】S417で現在のブレークポイントが代替
ブレークポイントでないと判定された場合(S417で
N)、またはS419で代替ブレークポイント削除処理
が完了した後、S420でプロセス制御部106に対
し、現実行プロセスの実行を中断するよう指示する。続
いて、S421でブレークポイント記録部111に記録
されているデバッガ20のプロセス識別子により、プロ
セス制御部106に対してデバッガ20に制御を移すよ
う指示する。
If it is determined in S 417 that the current break point is not an alternative break point (N in S 417), or after the alternative break point deletion processing is completed in S 419, the process control unit 106 is notified to the process control unit 106 in S 420. To stop the execution of. Next, in step S421, the process control unit 106 is instructed to transfer control to the debugger 20 based on the process identifier of the debugger 20 recorded in the breakpoint recording unit 111.

【0080】デバッグ対象プロセス10が、プロセス切
り替え可能状態となり、代替ブレークポイントに到達す
ると、デバッガ20に制御が移る。デバッガ20は、シ
ステムコールインタフェースを経由し、メモリ変更記録
部401から、指定されたメモリアドレスに対する変更
の記録を読み出す。
When the process 10 to be debugged enters a process switchable state and reaches an alternative breakpoint, the control is transferred to the debugger 20. The debugger 20 reads the record of the change for the specified memory address from the memory change recording unit 401 via the system call interface.

【0081】この実施の形態4のデバッグ方式によれ
ば、設定されたブレークポイントに到達した時点でシス
テムがプロセス切り替え禁止状態にある場合でも、プロ
セス切り替え可能状態となるまでの間の、指定されたメ
モリアドレスに対する変更を行った箇所が記録され、プ
ロセス切り替え可能状態となった後にデバッガ20から
メモリ変更の記録を読み出すことができるため、デバッ
グ効率を向上させることができる。
According to the debugging method of the fourth embodiment, even when the system is in the process switching prohibition state at the time when the set breakpoint is reached, the designated system is not changed until the process switching becomes possible. Since the location where the change is made to the memory address is recorded and the record of the memory change can be read from the debugger 20 after the process can be switched, the debugging efficiency can be improved.

【0082】以上のように、この実施の形態のデバッグ
方式及びデバッグ方法は、更に、デバッガから特定のメ
モリアドレスを指定するメモリ変更監視部402と、指
定されたメモリアドレスの内容の変更を検出する手段
(データブレークポイント)と、メモリ内容の変更を行
った命令を記録するメモリ変更記録部401とを備え、
カーネルモードでの実行コード内の第1のブレークポイ
ント到達時にプロセス切り替えが不可能な場合、カーネ
ルモードでの実行コード内のプロセス切り替えが可能と
なる箇所に第2のブレークポイントを設定し、第1のブ
レークポイントから第2のブレークポイント到達までの
間に指定されたメモリアドレスの内容が変更された場
合、メモリ内容の変更を行った命令を記録し、第2のブ
レークポイント到達時にデバッグ対象プロセス10の実
行を中断し、デバッガ20に実行を移し、デバッガ20
は、メモリ変更記録部401へ記録されたメモリ内容変
更命令を取得することを特徴とする。
As described above, the debugging method and the debugging method according to the present embodiment further detect the memory change monitoring unit 402 which specifies a specific memory address from the debugger and the change in the content of the specified memory address. Means (data breakpoints), and a memory change recording unit 401 for recording an instruction for changing the memory contents.
If the process cannot be switched when the first breakpoint in the execution code in the kernel mode is reached, a second breakpoint is set in a location where the process can be switched in the execution code in the kernel mode, and the first breakpoint is set. When the content of the specified memory address is changed between the break point of the first time and the arrival of the second break point, the instruction whose memory content has been changed is recorded, and when the second break point is reached, the debug target process 10 Is interrupted, execution is transferred to the debugger 20, and the debugger 20 is executed.
Is characterized in that a memory content change command recorded in the memory change recording unit 401 is acquired.

【0083】実施の形態5.図12は、本発明の第5の
実施の形態を示すブロック図である。図中の符号におい
て、501は命令実行により変化したレジスタを記録す
る実行履歴記録部、502はプロセス切り替えが禁止さ
れた状態である場合に、プロセスをトレースしながら実
行するトレース実行モードに設定するトレース実行制御
部である。上記以外の符号の構成要素は、実施の形態2
と同様である。
Embodiment 5 FIG. 12 is a block diagram showing a fifth embodiment of the present invention. In the reference numerals in the drawing, reference numeral 501 denotes an execution history recording unit that records a register changed by execution of an instruction, and reference numeral 502 denotes a trace that sets a trace execution mode in which a process is executed while tracing a process when process switching is prohibited. An execution control unit. Components other than those described above are the same as those in the second embodiment.
Is the same as

【0084】本発明の実施の形態2におけるブレークポ
イント設定部110の動作は、実施の形態1の場合と同
様である。
The operation of breakpoint setting section 110 according to the second embodiment of the present invention is the same as that of the first embodiment.

【0085】デバッガ20により、カーネルコード内の
ブレークポイント例外発生命令が実行され、ブレークポ
イント例外が発生した場合のブレークポイント例外処理
部112の動作を、図13を用いて説明する。
The operation of the breakpoint exception processing unit 112 when the breakpoint exception generation instruction in the kernel code is executed by the debugger 20 and a breakpoint exception occurs will be described with reference to FIG.

【0086】ブレークポイント例外処理部112は、S
511で、例外が発生したアドレスがブレークポイント
記録部111に記録されているか調べる。記録されてい
ない場合(S511でN)、S522で不正命令実行と
しての処理を行い処理を終了する。
The breakpoint exception processing unit 112
In 511, it is checked whether the address where the exception has occurred is recorded in the breakpoint recording unit 111. If it is not recorded (N in S511), a process for executing an illegal command is performed in S522, and the process ends.

【0087】例外が発生したアドレスが、ブレークポイ
ント記録部111に記録されている場合(S511で
Y)、S512で、現実行プロセス、すなわち例外を発
生させたプロセスの識別子が、ブレークポイント記録部
111に記録されているデバッグ対象プロセスの識別子
と一致するかを調べる。
If the address where the exception has occurred is recorded in the breakpoint recording unit 111 (Y in S511), in S512, the identifier of the currently executed process, that is, the process which caused the exception, is stored in the breakpoint recording unit 111. Check that it matches the identifier of the process to be debugged recorded in.

【0088】現実行プロセスの識別子が記録されている
ものと一致しない場合(S512でN)、デバッグ対象
以外のプロセスの実行によりブレークポイントに到達し
たものであるため、S513で実行継続処理を行い、終
了する。
If the identifier of the currently executed process does not match the recorded one (N in S512), since the breakpoint has been reached by the execution of a process other than the debug target, the execution continuation process is performed in S513. finish.

【0089】現実行プロセスの識別子が記録されている
ものと一致する場合(S512でY)、S514でシス
テム状態判定部201を参照し、システムがプロセス切
り替え可能な状態であるか判定する。
When the identifier of the currently executed process matches the recorded one (Y in S512), the system status determination unit 201 is referred to in S514 to determine whether the system is in a process switchable state.

【0090】プロセス切り替えが禁止された状態である
場合(S514でN)には、S515において、トレー
ス実行制御部502に対してトレース実行モードとする
ことを指示する。トレース実行制御部502は、プロセ
ッサのトレースモード制御フラグを設定する。続いて、
S516でブレークポイント設定箇所からの1命令を実
行し、S517で実行した命令のアドレス、命令コー
ド、命令実行により変化したレジスタを実行履歴記録部
501に記録する。トレース実行は、S518において
プロセス切り替え可能状態と判定されるまで繰り返され
る。S518においてプロセス切り替え可能状態と判定
されるとS519でトレースモードの設定は解除され
る。
If the process switching is prohibited (N in S514), in S515, the trace execution control unit 502 is instructed to enter the trace execution mode. The trace execution control unit 502 sets a trace mode control flag of the processor. continue,
In S516, one instruction from the breakpoint setting position is executed, and in S517, the address of the executed instruction, the instruction code, and the register changed by the instruction execution are recorded in the execution history recording unit 501. The trace execution is repeated until it is determined in step S518 that the process can be switched. If it is determined in step S518 that the process can be switched, the trace mode setting is canceled in step S519.

【0091】S514でプロセス切り替え可能状態と判
定された場合(S514でY)、あるいはトレース実行
の後にプロセス切り替えが可能となった後、S520で
現実行プロセスの実行を中断するよう指示する。続い
て、S521でブレークポイント記録部111に記録さ
れているデバッガ20のプロセス識別子により、プロセ
ス制御部106に対してデバッガ20に制御を移すよう
指示する。
When it is determined in S514 that the process can be switched (Y in S514), or after the process can be switched after the trace is executed, an instruction is given in S520 to interrupt the execution of the currently executed process. Subsequently, in step S521, the process control unit 106 is instructed to transfer control to the debugger 20 by using the process identifier of the debugger 20 recorded in the breakpoint recording unit 111.

【0092】デバッガ20は、システムコールインタフ
ェースを経由し、実行履歴記録部501から、ブレーク
ポイント設定時点から実行を中断する時点までに記録さ
れた実行履歴を読み出す。
The debugger 20 reads the execution history recorded from the time when the breakpoint is set to the time when the execution is interrupted from the execution history recording unit 501 via the system call interface.

【0093】この実施の形態5のデバッグ方式によれ
ば、設定されたブレークポイントに到達した時点でシス
テムがプロセス切り替え禁止状態にある場合でも、プロ
セス切り替え可能状態となるまでの間のすべての実行履
歴が保存され、プロセス切り替え可能となった後にデバ
ッガから実行履歴を読み出すことができ、デバッグ対象
プロセスの動作を知ることができるため、効率よくデバ
ッグを行うことができる。
According to the debugging method of the fifth embodiment, even if the system is in the process switching prohibition state at the time when the set breakpoint is reached, all the execution histories until the process switching state becomes possible. Is stored, and after the process can be switched, the execution history can be read from the debugger, and the operation of the process to be debugged can be known, so that efficient debugging can be performed.

【0094】以上のように、この実施の形態のデバッグ
方式及びデバッグ方法は、更に、プロセス切り替えの可
否を判定するシステム状態判定部201と、プロセスを
トレースして実行するトレース実行を制御するトレース
実行制御部502と、プロセスの実行履歴を記録する実
行履歴記録部501とを備え、カーネルモードでの実行
コード内のブレークポイント到達時にプロセス切り替え
が不可能な場合、カーネルモードでの実行コード内のプ
ロセス切り替えが可能となるまでのデバッグ対象プロレ
スの実行履歴を実行履歴記録部501へ記録し、プロセ
ス切り替えが可能となった時点でデバッグ対象プロセス
10の実行を中断し、デバッガに実行を移し、デバッガ
20から前記実行履歴を取得することを特徴とする。
As described above, the debugging method and the debugging method according to the present embodiment further include a system state determining unit 201 for determining whether or not the process can be switched, and a trace execution for controlling the trace execution for tracing and executing the process. A control unit 502 and an execution history recording unit 501 for recording an execution history of a process. When a process cannot be switched when a breakpoint in the execution code in the kernel mode is reached, the process in the execution code in the kernel mode is disabled. The execution history of the wrestling target wrestling until the switching becomes possible is recorded in the execution history recording unit 501, and when the process switching becomes possible, the execution of the debugging target process 10 is interrupted, and the execution is transferred to the debugger. The execution history is acquired from

【0095】[0095]

【発明の効果】このデバッグ方式のブレークポイント設
定部及びこのデバッグ方法のブレークポイント設定工程
によれば、カーネルモードで実行される実行モード、す
なわち、OS内のコードへブレークポイントを設定する
ことができる。
According to the breakpoint setting unit of the debugging method and the breakpoint setting step of the debugging method, a breakpoint can be set in the execution mode executed in the kernel mode, that is, the code in the OS. .

【0096】このデバッグ方式のブレークポイント設定
部及びこのデバッグ方法のブレークポイント設定工程に
よれば、デバッガからカーネルモードで実行される実行
モードへブレークポイントを設定することを指示するこ
とができる。
According to the break point setting unit of the debugging method and the break point setting step of the debugging method, it is possible to instruct the debugger to set a break point to the execution mode executed in the kernel mode.

【0097】このデバッグ方式のブレークポイント例外
処理部によれば、デバッグ対象プロセスのプロセスを実
行する時に、デバッガによって、デバッグ対象プロセス
の実行を制御することができ、デバッグ対象以外のプロ
セスは、正常処理を実行することができる。
According to the breakpoint exception handling unit of the debugging method, the execution of the process to be debugged can be controlled by the debugger when the process of the process to be debugged is executed. Can be performed.

【0098】このデバッグ方式のシステム状態判定部に
よれば、プロセス切り替えの可否を判定することが可能
になり、プロセスの切り替えができない場合は、ブレー
クポイント例外処理部によって、次のブレークポイント
を設定することができる。
According to the system state determination unit of the debugging method, it is possible to determine whether the process can be switched. If the process cannot be switched, the next breakpoint is set by the breakpoint exception processing unit. be able to.

【0099】このデバッグ方式のプロセス状態記録部に
よれば、プロセス切り替えができない場合に、プロセス
状態を記録することができる。
According to the process status recording unit of the debugging system, when the process cannot be switched, the process status can be recorded.

【0100】このデバッグ方式のメモリ変更記録部及び
メモリ変更監視部によれば、プロセス切り替えができな
い場合に、所定のメモリ領域の内容の変更させた命令を
記録することができる。
According to the memory change recording unit and the memory change monitoring unit of the debugging system, when the process cannot be switched, it is possible to record the instruction in which the contents of the predetermined memory area have been changed.

【0101】このデバッグ方式の実行履歴記録部によれ
ば、プロセス切り替えができない場合に、実行された命
令の履歴を記録することができる。
According to the execution history recording unit of this debugging method, when the process cannot be switched, the history of executed instructions can be recorded.

【0102】このデバッグ方式のブレークポイント設定
部及びこのデバッグ方法のブレークポイント設定工程に
よれば、ブレークポイントを設定する命令を書き換える
ことによって例外処理を発生させることができる。
According to the breakpoint setting unit of the debugging method and the breakpoint setting step of the debugging method, exception processing can be generated by rewriting the instruction for setting a breakpoint.

【0103】このデバッグ方式のブレークポイント設定
部及びこのデバッグ方法のブレークポイント設定工程に
よれば、ブレークポイントを設定する命令を書き換える
ことによって例外処理を発生させ、デバッグ対象プロセ
スではないプロセスを実行する場合には、正常処理を実
行することができる。
According to the breakpoint setting section of the debugging method and the breakpoint setting step of the debugging method, an exception process is generated by rewriting an instruction for setting a breakpoint, and a process which is not a process to be debugged is executed. , Normal processing can be executed.

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

【図1】 実施の形態1のデバッグ方式の構成の一例を
表わすブロック図。
FIG. 1 is a block diagram illustrating an example of a configuration of a debugging method according to a first embodiment.

【図2】 実施の形態1のデバッグ方式のブレークポイ
ント記録部の一例をを表わす図。
FIG. 2 is a diagram illustrating an example of a breakpoint recording unit of a debugging method according to the first embodiment;

【図3】 このデバッグ方式のブレークポイント設定部
がブレークポイントを設定する動作(ブレークポイント
設定工程)の一例を表わすフロー図。
FIG. 3 is a flowchart showing an example of an operation (breakpoint setting step) of setting a breakpoint by a breakpoint setting unit of the debugging method.

【図4】 実施の形態1のデバッグ方式のブレークポイ
ント例外処理部がデバッグする時の動作の一例を表わす
フロー図。
FIG. 4 is a flowchart showing an example of an operation when the breakpoint exception handling unit of the debugging method according to the first embodiment debugs;

【図5】 実施の形態2のデバッグ方式の構成の一例を
表わすブロック図。
FIG. 5 is a block diagram illustrating an example of a configuration of a debugging method according to a second embodiment.

【図6】 実施の形態2〜5のデバッグ方式のブレーク
ポイント記録部の一例をを表わす図。
FIG. 6 is a diagram illustrating an example of a breakpoint recording unit using a debugging method according to the second to fifth embodiments.

【図7】 実施の形態2のデバッグ方式のブレークポイ
ント例外処理部がデバッグする時の動作の一例を表わす
フロー図。
FIG. 7 is a flowchart illustrating an example of an operation when a debugger breakpoint exception handling unit according to the second embodiment debugs;

【図8】 実施の形態3のデバッグ方式の構成の一例を
表わすブロック図。
FIG. 8 is a block diagram illustrating an example of a configuration of a debugging method according to a third embodiment.

【図9】 実施の形態3のデバッグ方式のブレークポイ
ント例外処理部がデバッグする時の動作の一例を表わす
フロー図。
FIG. 9 is a flowchart illustrating an example of an operation when a debugger breakpoint exception processing unit according to the third embodiment debugs;

【図10】 実施の形態4のデバッグ方式の構成の一例
を表わすブロック図。
FIG. 10 is a block diagram illustrating an example of a configuration of a debugging method according to a fourth embodiment.

【図11】 実施の形態4のデバッグ方式のブレークポ
イント例外処理部がデバッグする時の動作の一例を表わ
すフロー図。
FIG. 11 is a flowchart illustrating an example of an operation when a debugger breakpoint exception handling unit according to the fourth embodiment performs debugging.

【図12】 実施の形態5のデバッグ方式の構成の一例
を表わすブロック図。
FIG. 12 is a block diagram illustrating an example of a configuration of a debugging method according to a fifth embodiment.

【図13】 実施の形態5のデバッグ方式のブレークポ
イント例外処理部がデバッグする時の動作の一例を表わ
すフロー図。
FIG. 13 is a flowchart showing an example of an operation when a debugger breakpoint exception processing unit according to the fifth embodiment performs debugging.

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

10 デバッグ対象プロセス、20 デバッガ、50
ハードウェア、100オペレーティングシステム、10
1 システムコールインタフェース、102ファイル管
理サブシステム、103 メモリ管理サブシステム、1
04 デバイスドライバ、106 プロセス制御部、1
10 ブレークポイント設定部、111 ブレークポイ
ント記録部、112 ブレークポイント例外処理部、2
01システム状態判定部、301 プロセス状態記憶
部、401 メモリ変更記録部、402 メモリ変更監
視部、501 実行履歴記録部、502 トレース実行
制御部。
10 process to be debugged, 20 debugger, 50
Hardware, 100 operating systems, 10
1 system call interface, 102 file management subsystem, 103 memory management subsystem, 1
04 device driver, 106 process control unit, 1
10 breakpoint setting section, 111 breakpoint recording section, 112 breakpoint exception processing section, 2
01 system status determination unit, 301 process status storage unit, 401 memory change recording unit, 402 memory change monitoring unit, 501 execution history recording unit, 502 trace execution control unit.

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 ユーザモードとカーネルモードの2つの
動作モードを有するオペレーティングシステムで命令が
実行されるプロセスのデバッグ方式において、 ユーザモードで実行される実行コードと、カーネルモー
ドで実行される実行モードとを有するデバッグ対象プロ
セスに含まれるカーネルモードで実行される実行コード
内にブレークポイントを設定するブレークポイント設定
部と、 上記デバッグ対象プロセスの実行を開始させ、上記ブレ
ークポイント設定部によって設定された実行コード内の
ブレークポイントへデバッグ対象プロセスが到達したと
きに、デバッグ対象プロセスの実行を中断させ、上記デ
バッグ対象プロセスに含まれる実行コードをカーネルモ
ードで実行させてデバッグするデバッガとを備えたこと
を特徴とするデバッグ方式。
1. A method for debugging a process in which an instruction is executed in an operating system having two operation modes, a user mode and a kernel mode, comprising: an execution code executed in a user mode; and an execution mode executed in a kernel mode. A breakpoint setting unit that sets a breakpoint in the execution code executed in the kernel mode included in the debug target process, and an execution code set by the breakpoint setting unit that starts execution of the debug target process A debugger that interrupts the execution of the debuggee process when the debuggee process reaches a breakpoint in the debugger and executes the execution code included in the debuggee process in a kernel mode to debug. Debug Method.
【請求項2】 上記ブレークポイント設定部は、上記デ
バッガから、ブレークポイントを設定する実行コードを
含むデバッグ対象プロセスを識別するデバッグ対象プロ
セス識別子と、ブレークポイントを設定する実行コード
のアドレスを示すブレークポイント設定アドレスとをブ
レークポイント設定指示として通知され、通知されたブ
レークポイント設定指示に基づいて、ブレークポイント
を設定することを特徴とする請求項1記載のデバッグ方
式。
2. The breakpoint setting section, comprising: a debugger process identifier for identifying a debug target process including an execution code for setting a breakpoint from the debugger; and a breakpoint indicating an address of an execution code for setting a breakpoint. 2. The debugging method according to claim 1, wherein the set address is notified as a breakpoint setting instruction, and a breakpoint is set based on the notified breakpoint setting instruction.
【請求項3】 上記デバッグ方式は、さらに、上記ブレ
ークポイント設定アドレスと、上記デバッグ対象プロセ
ス識別子と、上記ブレークポイント設定指示を通知した
デバッガを識別するデバッガ識別子とを記録するブレー
クポイント記録部と、 実行中のデバッグ対象プロセスが上記ブレークポイント
設定アドレスが示すブレークポイントに到達した時に、
実行中のデバッグ対象プロセスが上記ブレークポイント
記録部に記録されたデバッグ対象プロセス識別子によっ
て識別されるデバッグ対象プロセスと同一であるかを判
断し、判断した結果、上記デバッグ対象プロセスと同一
である場合に、上記ブレークポイント記録部に記録され
たデバッガ識別子によって識別されるデバッガへデバッ
グ対象プロセスを実行させる制御を移行させることを指
示するブレークポイント例外処理部と、 上記ブレークポイント例外処理部からの指示によって、
実行中のデバッグ対象プロセスを中断し、上記デバッガ
へデバッグ対象プロセスを実行させる制御を移行させる
プロセス制御部とを備えたことを特徴とする請求項2記
載のデバッグ方式。
3. The debug method further comprises: a breakpoint recording unit that records the breakpoint setting address, the debug target process identifier, and a debugger identifier that identifies a debugger that has notified the breakpoint setting instruction. When the running debug target process reaches the breakpoint indicated by the breakpoint setting address,
It is determined whether or not the debugged process being executed is the same as the debugged process identified by the debugged process identifier recorded in the breakpoint recording unit. A breakpoint exception processing unit that instructs to shift control of executing the debugged process to the debugger identified by the debugger identifier recorded in the breakpoint recording unit; and an instruction from the breakpoint exception processing unit.
3. The debugging method according to claim 2, further comprising: a process control unit that suspends a currently executing debug target process and transfers control to execute the debug target process to the debugger.
【請求項4】 上記デバッグ方式は、さらに、プロセス
切り替えの可否を判定するシステム状態判定部を備え、 上記ブレークポイント例外処理部は、上記ブレークポイ
ント記録部に記録されたブレークポイント設定アドレス
が示すブレークポイントを第一のブレークポイントと
し、デバッガへデバッグ対象プロセスを実行させる制御
を移行させることを上記プロセス制御部へ指示する時
に、上記システム状態判定部へプロセス切り替えの可否
を判定させ、プロセス切り替えができないと判定された
場合、カーネルモードで実行される実行コード内で、次
にプロセス切り替えが可能となる箇所を検索し、検索さ
れた次にプロセス切り替えが可能となるアドレスへ第二
のブレークポイントを設定し、第二のブレークポイント
到達時に、デバッガへデバッグ対象プロセスを実行させ
る制御を移行させることを上記プロセス制御部へ指示す
ることを特徴とする請求項3記載のデバッグ方式。
4. The debugging system according to claim 1, further comprising a system state determining unit for determining whether or not the process can be switched, wherein the breakpoint exception processing unit includes a breakpoint indicated by a breakpoint setting address recorded in the breakpoint recording unit. When the point is set as the first break point and the process control unit is instructed to shift the control to execute the process to be debugged to the debugger, the system state determination unit determines whether the process can be switched, and the process cannot be switched. If it is determined that, in the execution code executed in the kernel mode, search for the next process switchable location, set a second breakpoint to the searched next address where the process switchable To the debugger when the second breakpoint is reached Debugging method of claim 3, wherein the indicating that shifts the control to execute the bag target process to said process control unit.
【請求項5】 上記デバッグ方式は、さらに、カーネル
モードで実行中のデバッグ対象プロセスの状態をプロセ
ス状態として記録するプロセス状態記録部を備え、 上記ブレークポイント例外処理部は、実行中のデバッグ
対象プロセスが上記第一のブレークポイントに到達した
時に、上記システム状態判定部によってプロセス切り替
えができないと判定された場合、ブレークポイントに到
達した時のプロセス状態を上記プロセス状態記録部へ記
録し、 上記デバッガは、デバッグ対象プロセスを実行させる制
御が自己へ移された時に、上記プロセス状態記録部に記
録されたプロセス状態を取得することを特徴とする請求
項4記載のデバッグ方式。
5. The debugging method according to claim 1, further comprising a process state recording unit that records a state of the process to be debugged being executed in the kernel mode as a process state, wherein the breakpoint exception processing unit is configured to execute the process to be debugged. When the system state determination unit determines that the process cannot be switched when the first breakpoint is reached, the process state when the breakpoint is reached is recorded in the process state recording unit. 5. The debugging method according to claim 4, wherein when the control for executing the process to be debugged is transferred to itself, the process status recorded in the process status recording unit is acquired.
【請求項6】 上記デバッグ方式は、さらに、デバッガ
から、あらかじめ監視するメモリ領域を通知され、通知
されたメモリ領域の範囲を記憶するメモリ変更監視部
と、 上記メモリ変更監視部によって記憶されたメモリ領域の
内容が変更された場合に、上記メモリ領域の内容を変更
した命令を記録するメモリ変更記録部とを備え、 上記ブレークポイント例外処理部は、実行中のデバッグ
対象プロセスが上記第一のブレークポイントに到達した
時に、上記システム状態判定部によってプロセス切り替
えができないと判定された場合、上記第一のブレークポ
イントから上記第二のブレークポイントへ到達するまで
にデバッグ対象プロセスが実行した命令のうち、上記メ
モリ変更監視部によって記録されたメモリ領域の内容を
変更した命令を上記メモリ変更記録部に記録し、 上記デバッガは、デバッグ対象プロセスを実行させる制
御が自己へ移された時に、上記メモリ変更記録部に記録
されたメモリ領域の内容を変更した命令を取得すること
を特徴とする請求項4記載のデバッグ方式。
6. The debugging system according to claim 1, further comprising a memory change monitoring unit that is notified of a memory area to be monitored in advance from a debugger and stores a range of the notified memory area; and a memory stored by the memory change monitoring unit. A memory change recording unit that records, when the contents of the area are changed, an instruction that changes the contents of the memory area, wherein the breakpoint exception processing unit executes When reaching the point, if it is determined that the process can not be switched by the system state determination unit, among the instructions executed by the debug target process from the first breakpoint to the second breakpoint, An instruction that changes the contents of the memory area recorded by the memory Wherein the debugger acquires an instruction in which the content of the memory area recorded in the memory change recording unit is changed when the control for executing the process to be debugged is transferred to itself. The debugging method according to claim 4, wherein
【請求項7】 上記デバッグ方式は、さらに、デバッグ
対象プロセスの命令が実行された実行履歴を記録する実
行履歴記録部と、 デバッグ対象プロセスを実行させる命令を上記実行履歴
記録部へ記録するトレース実行を制御するトレース実行
制御部とを備え、 上記ブレークポイント例外処理部は、実行中のデバッグ
対象プロセスが上記第一のブレークポイントに到達した
時に、上記システム状態判定部によってプロセス切り替
えができないと判定された場合、上記トレース実行制御
部へトレース実行を制御することを指示し、 上記デバッガは、デバッグ対象プロセスを実行させる制
御が自己へ移された時に、上記実行履歴記録部に記録さ
れた実行履歴を取得することを特徴とする請求項4記載
のデバッグ方式。
7. The debugging system according to claim 1, further comprising: an execution history recording unit that records an execution history of execution of an instruction of the debug target process; and a trace execution unit that records an instruction to execute the debug target process in the execution history recording unit. And a trace execution control unit for controlling the execution of the program. The breakpoint exception processing unit determines that the system state determination unit cannot switch the process when the debug target process being executed reaches the first breakpoint. In this case, the trace execution control unit is instructed to control the trace execution, and when the control to execute the process to be debugged is transferred to itself, the debugger records the execution history recorded in the execution history recording unit. 5. The debugging method according to claim 4, wherein the information is acquired.
【請求項8】 上記ブレークポイント設定部は、ブレー
クポイントを設定するアドレスの命令を、ブレークポイ
ントを発生させる例外処理命令へ書き換えることを特徴
とする請求項1記載のデバッグ方式。
8. The debugging method according to claim 1, wherein the breakpoint setting unit rewrites an instruction at an address at which a breakpoint is set to an exception processing instruction that causes a breakpoint.
【請求項9】 上記ブレークポイント設定部は、ブレー
クポイントを設定するアドレスの命令を正常命令として
上記ブレークポイント記録部へ記録し、ブレークポイン
トを設定するアドレスの命令を、ブレークポイントを発
生させる例外処理命令へ書き換え、 上記ブレークポイント例外処理部は、実行中のデバッグ
対象プロセスが上記ブレークポイント記録部に記録され
たデバッグ対象プロセス識別子によって識別されるデバ
ッグ対象プロセスと同一でないと判断した場合に、書き
換えられた例外処理命令を上記ブレークポイント記録部
に記録された正常命令へ書き換えることを特徴とする請
求項3記載のデバッグ方式。
9. The exception processing for recording an instruction at an address at which a breakpoint is to be set as a normal instruction in the breakpoint recording unit, and an instruction at an address at which a breakpoint is to be set to generate a breakpoint. The breakpoint exception processing unit is rewritten when it determines that the debugged process being executed is not the same as the debugged process identified by the debugged process identifier recorded in the breakpoint recording unit. 4. The debugging method according to claim 3, wherein the exception processing instruction is rewritten to a normal instruction recorded in the breakpoint recording unit.
【請求項10】 ユーザモードとカーネルモードの2つ
の動作モードを有するオペレーティングシステムで命令
が実行されるプロセスのデバッグ方法において、 ユーザモードで実行される実行コードと、カーネルモー
ドで実行される実行モードとを有するデバッグ対象プロ
セスに含まれるカーネルモードで実行される実行コード
内にブレークポイントを設定するブレークポイント設定
工程と、 上記デバッグ対象プロセスの実行を開始させ、上記ブレ
ークポイント設定工程によって設定された実行コード内
のブレークポイントへデバッグ対象プロセスが到達した
ときに、デバッグ対象プロセスの実行を中断させ、上記
デバッグ対象プロセスに含まれる実行コードをカーネル
モードで実行させてデバッグするデバッグ工程とを備え
たことを特徴とするデバッグ方法。
10. A method for debugging a process in which an instruction is executed in an operating system having two operation modes, a user mode and a kernel mode, comprising: an execution code executed in a user mode; an execution mode executed in a kernel mode; A breakpoint setting step of setting a breakpoint in the execution code executed in the kernel mode included in the debug target process having: a start of the debug target process, and the execution code set by the breakpoint setting step A debug step of suspending execution of the debug target process when the debug target process reaches a breakpoint within the debugger, and executing and executing the execution code included in the debug target process in kernel mode. When Debug how.
【請求項11】 上記ブレークポイント設定工程は、ブ
レークポイントを設定するアドレスの命令を、ブレーク
ポイントを発生させる例外処理命令へ書き換えることを
特徴とする請求項10記載のデバッグ方法。
11. The debugging method according to claim 10, wherein in the step of setting a breakpoint, an instruction at an address for setting a breakpoint is rewritten to an exception processing instruction for generating a breakpoint.
JP2000144686A 2000-05-17 2000-05-17 Debugging system and its method Withdrawn JP2001325122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000144686A JP2001325122A (en) 2000-05-17 2000-05-17 Debugging system and its method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000144686A JP2001325122A (en) 2000-05-17 2000-05-17 Debugging system and its method

Publications (1)

Publication Number Publication Date
JP2001325122A true JP2001325122A (en) 2001-11-22

Family

ID=18651306

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000144686A Withdrawn JP2001325122A (en) 2000-05-17 2000-05-17 Debugging system and its method

Country Status (1)

Country Link
JP (1) JP2001325122A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006268298A (en) * 2005-03-23 2006-10-05 Nec Corp Debugging method and debugging device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006268298A (en) * 2005-03-23 2006-10-05 Nec Corp Debugging method and debugging device

Similar Documents

Publication Publication Date Title
JP4847734B2 (en) Semiconductor integrated circuit device, debugging system and debugging method thereof
EP0897151A1 (en) Device and method for debugging systems controlled by microprocessors
WO2007080931A1 (en) Debug supporting device, and program for causing computer to execute debug processing method
JP4676289B2 (en) Debug system and method
US20110126175A1 (en) Debugging method and debugging device using hardware breakpoints
JP2009129101A (en) Fault recovery system for information processor
EP0638864B1 (en) Development support system for microcomputer with internal cache
EP1367490A2 (en) Debugging apparatus and method
JPH09503084A (en) Tracer system for error analysis in running real-time system
JP2001325122A (en) Debugging system and its method
JP2006039763A (en) Guest os debug supporting method and virtual computer manager
US5813039A (en) Guest execution control system, method and computer process for a virtual machine system
JPH0668725B2 (en) Device for responding to interrupt condition in data processing system and method for responding to asynchronous interrupt condition
JP2653412B2 (en) How to set breakpoints
JP2001282572A (en) Device and method for debugging program
JP2000076095A (en) Device and method for tracing program and storage medium storing program therefor
JPH09330253A (en) Memory dump method and memory damp system applying the same
JP2658982B2 (en) Specific instruction execution detection method
JPH01147640A (en) Multi-programming debug device
JP3703549B2 (en) Software performance estimation and performance monitoring method
JP2001166966A (en) Method for managing execution environment of program to be tested in debugger
JPS638946A (en) Program debug supporting system
JP3863902B2 (en) Instruction change method, instruction change method, instruction change program, and recording medium recording instruction change program
JPH1049401A (en) Method for debugging program
JP5121134B2 (en) Simulation apparatus and simulation method

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: 20070807