JP2000330823A - Device and method for debugging program - Google Patents

Device and method for debugging program

Info

Publication number
JP2000330823A
JP2000330823A JP11144092A JP14409299A JP2000330823A JP 2000330823 A JP2000330823 A JP 2000330823A JP 11144092 A JP11144092 A JP 11144092A JP 14409299 A JP14409299 A JP 14409299A JP 2000330823 A JP2000330823 A JP 2000330823A
Authority
JP
Japan
Prior art keywords
execution
program
breakpoint
command
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11144092A
Other languages
Japanese (ja)
Inventor
Hiroyuki Tomimori
博幸 富森
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP11144092A priority Critical patent/JP2000330823A/en
Publication of JP2000330823A publication Critical patent/JP2000330823A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To set a brake point in each object. SOLUTION: A setting device 221 converts an object specified as a command argument of a brake point setting command inputted from an input device 1 and information concerned with a stop position into a pointer to an object storage area in its corresponding program and an execution address and stores these converted values in a brake information storage device 32 as brake point information. An execution code changing device 41 pads a brake code in an intra-program text area corresponding to the stored execution address. When an execution command is inputted from the input device 1, an execution control device 231 starts the execution of the program. When the execution of the program is stopped by the brake code during the execution of the program, a stop judging device 232 judges whether the execution of the program is to be restarted or not on the basis of the brake point information stored in the storage device 32.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、オブジェクト指向
言語を対象としたプログラムのデバックに関する。
[0001] 1. Field of the Invention [0002] The present invention relates to program debugging for an object-oriented language.

【0002】[0002]

【従来の技術】従来、オブジェクト指向言語を対象とし
たデバッグ装置においては、メソッドへのブレークポイ
ント設定は、着目するメソッドに対応するプログラム内
の実行アドレスをデバッグ情報等から取得し、そのアド
レスにブレークコードを埋め込む方法により実現してい
る。
2. Description of the Related Art Conventionally, in a debugging apparatus for an object-oriented language, setting a breakpoint on a method involves acquiring an execution address in a program corresponding to a method of interest from debug information or the like, and setting a break at that address. This is achieved by embedding the code.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、メソッ
ドの実行アドレスは、一般的に、そのメソッドを定義す
るクラスから生成される全てのオブジェクトにおいて共
通であるため、上述した従来の方法では、どのオブジェ
クトに属するメソッドかを区別してブレークポイントを
設定することができない。したがって、デバッグ時に着
目したいメソッドを持つクラスオブジェクトが複数存在
する場合には、どのオブジェクトのメソッドが実行され
た場合にも、そのメソッドに設定されたブレークポイン
トによって、プログラムの実行が停止させられてしまう
という現象が発生する。よって、ある特定のオブジェク
トが実行するメソッドをデバッグしたい場合に、その箇
所にたどり着くまでに非常に多くの時間と手間を必要と
することになるという問題点がある。
However, since the execution address of a method is generally common to all objects generated from the class defining the method, in the above-described conventional method, which object It is not possible to set a breakpoint by distinguishing which method belongs. Therefore, when there are a plurality of class objects having the method of interest during debugging, no matter which method of the object is executed, the execution of the program will be stopped by the breakpoint set for that method. This phenomenon occurs. Therefore, there is a problem that when debugging a method executed by a specific object, it takes a very long time and effort to reach the location.

【0004】オブジェクト指向言語を対象するデバッグ
装置には、オブジェクトの状態表示や、オブジェクト単
位の実行制御等、常にオブジェクトを意識したデバッグ
機能が要求されるが、上記のオブジェクトを区別してブ
レークポイントを設定できないという問題は、デバッグ
時の大きな妨げとなり、デバッグ効率を低下させる要因
となる。
A debugging device for an object-oriented language is required to always have a debugging function that is conscious of an object, such as displaying the state of an object and controlling execution of each object. The problem of not being able to do so is a great hindrance to debugging, and is a factor in reducing debugging efficiency.

【0005】本発明の目的は、この問題点を解決し、オ
ブジェクト単位でのブレークポイント設定を可能にする
プログラムデバッグシステムを提供することにある。
An object of the present invention is to provide a program debugging system which solves this problem and enables a breakpoint to be set for each object.

【0006】[0006]

【課題を解決するための手段】第1の本発明のプログラ
ムのデバック装置は、オブジェクト指向言語を対象とし
たプログラムのデバッグ装置において、プログラムのテ
キスト領域にブレークポイントを設定する際に、オブジ
ェクトを指定したブレークポイントを設定することによ
り、そのテキストを共有するクラスオブジェクトが複数
存在する場合にも、指定されたオブジェクトの実行のみ
を停止させることが可能なブレーク機能を有することを
特徴とする。
According to a first aspect of the present invention, there is provided a program debugging apparatus for designating an object when setting a breakpoint in a text area of a program in a program debugging apparatus for an object-oriented language. By setting such a breakpoint, even if there are a plurality of class objects sharing the text, a break function is provided that can stop only the execution of the specified object.

【0007】第2の本発明のプログラムのデバック装置
は、オブジェクト指向言語を対象としたプログラムのデ
バッグ装置において、入力装置から入力されたブレーク
ポイント設定コマンドのコマンド引き数に指定されたオ
ブジェクトおよび停止位置に関する情報を、それに対応
するプログラム中のオブジェクト記憶領域へのポインタ
と実行アドレスに変換し、その値をブレークポイント情
報としてブレーク情報記憶装置に記憶する設定装置と、
該記憶した実行アドレスに対応するプログラム内テキス
ト領域にブレークコードを埋め込む実行コード変更装置
と、前記入力装置から実行コマンドが入力されると、プ
ログラムの実行を開始する実行制御装置と、該プログラ
ム実行中に前記ブレークコードによりプログラムの実行
が停止すると、該プログラムの実行を再開するか否かを
判定する停止判定装置とを備え、該停止判定装置は、先
ず現在の停止アドレスを取得し、次に前記ブレーク情報
記憶装置の中に、現在の停止アドレスと一致する実行ア
ドレスを含むブレークポイント情報があるかどうかを検
索し、見つかった場合は、さらに現在停止中のメソッド
に渡されている自身のオブジェクトへのポインタを取得
し、それが前記見つかったブレークポイント情報に含ま
れるオブジェクトへのポインタと一致するかどうかを比
較し、両者が一致しない場合は、ブレークポイント設定
対象外のオブジェクトが実行されているものとして、再
び前記プログラムの実行を開始するが、その他の場合に
は、実行を停止させた状態のまま、現在の停止位置を出
力装置に出力して次のコマンド入力を待つことを特徴と
する。
According to a second aspect of the present invention, there is provided a program debugging device for a program debugging device for an object-oriented language, wherein an object and a stop position specified in a command argument of a breakpoint setting command input from an input device are provided. A setting device that converts the information about the object into a pointer and an execution address to an object storage area in the corresponding program, and stores the value in the break information storage device as breakpoint information;
An execution code changing device for embedding a break code in a text area in a program corresponding to the stored execution address; an execution control device for starting execution of the program when an execution command is input from the input device; A stop judging device for judging whether or not to resume the execution of the program when the execution of the program is stopped by the break code, the stop judging device first obtains a current stop address, and then Searches the break information storage device for breakpoint information that includes an execution address that matches the current stop address, and if found, returns to the own object passed to the currently stopped method. The pointer contained in the found breakpoint information If the two pointers do not match, it is assumed that the object not targeted for the breakpoint execution has been executed, and the execution of the program is started again. In this state, the current stop position is output to the output device and the next command input is waited.

【0008】本発明のプログラムデバック方法は、オブ
ジェクト指向言語を対象としたプログラムのデバッグ方
法において、入力装置から入力されたブレークポイント
設定コマンドのコマンド引き数に指定されたオブジェク
トおよび停止位置に関する情報を、それに対応するプロ
グラム中のオブジェクト記憶領域へのポインタと実行ア
ドレスに変換し、その値をブレークポイント情報として
ブレーク情報記憶装置に記憶する手順と、該記憶した実
行アドレスに対応するプログラム内テキスト領域にブレ
ークコードを埋め込む手順と、前記入力装置から実行コ
マンドが入力されると、プログラムの実行を開始する手
順と、該プログラム実行中に前記ブレークコードにより
プログラムの実行が停止すると、該プログラムの実行を
再開するか否かを判定する手順とを有し、該判定する手
順は、先ず現在の停止アドレスを取得し、次に前記ブレ
ーク情報記憶装置の中に、現在の停止アドレスと一致す
る実行アドレスを含むブレークポイント情報があるかど
うかを検索する手順と、検索の結果、ブレークポイント
情報が見つかった場合は、さらに現在停止中のメソッド
に渡されている自身のオブジェクトへのポインタを取得
する手順と、該取得されたポインタが前記見つかったブ
レークポイント情報に含まれるオブジェクトへのポイン
タと一致するかどうかを比較する手順と、該比較の結
果、両者が一致しない場合は、ブレークポイント設定対
象外のオブジェクトが実行されているものとして、再び
前記プログラムの実行を開始するが、その他の場合に
は、実行を停止させた状態のまま、現在の停止位置を出
力装置に出力して次のコマンド入力を待つ手順とから成
ることを特徴とする。
According to a program debugging method of the present invention, in a method of debugging a program for an object-oriented language, information on an object and a stop position specified in a command argument of a breakpoint setting command input from an input device is stored. A procedure for converting the pointer into an object storage area in the program corresponding to the execution address and an execution address, and storing the value as breakpoint information in the break information storage device, and a break in the program text area corresponding to the stored execution address. A step of embedding a code, a step of starting execution of a program when an execution command is input from the input device, and a step of restarting execution of the program when execution of the program is stopped by the break code during execution of the program. Whether or not The determining step includes first obtaining a current stop address, and then, in the break information storage device, there is breakpoint information including an execution address that matches the current stop address. Whether breakpoint information is found as a result of the search, and further, a step of obtaining a pointer to the own object passed to the currently stopped method, and a step of obtaining the pointer. A step of comparing whether or not the pointer matches the pointer to the object included in the found breakpoint information; and, as a result of the comparison, when the two do not match, it is assumed that the object not targeted for the breakpoint setting is being executed. The execution of the program is started again, but otherwise, the execution is stopped and the current And outputs to the output device a stop position, characterized in that it consists of a procedure to wait for the next command input.

【0009】[0009]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して説明する。
Next, embodiments of the present invention will be described with reference to the drawings.

【0010】本発明の一実施の形態形態を示す図1を参
照すると、本デバック装置は、デバッグコマンドを入力
するための入力装置1と、入力されたデバックコマンド
を処理するコマンド処理装置2と、情報を記憶する記憶
装置3と、デバッグ対象プログラムを直接制御するプロ
グラム制御装置4と、コマンドの処理の結果を出力する
出力装置5とを含む。
Referring to FIG. 1 showing an embodiment of the present invention, the present debug apparatus comprises an input device 1 for inputting a debug command, a command processing device 2 for processing the input debug command, It includes a storage device 3 for storing information, a program control device 4 for directly controlling a program to be debugged, and an output device 5 for outputting a result of command processing.

【0011】入力装置1には、オブジェクト指定情報お
よび停止位置指定情報を引数とするブレークポイント設
定コマンドと、ブレークポイント設定後に出力されるブ
レークポイントIDを引き数にとるブレークポイント解除
コマンドと、プログラム実行コマンドが入力されるもの
とする。なお、ブレークポイント設定コマンドにおい
て、オブジェクト指定情報の指定は省略可能とし、その
場合は、オブジェクトの区別なしに、指定されたメソッ
ドでプログラムを停止させるものとする。
The input device 1 includes a breakpoint setting command using the object specification information and the stop position specification information as arguments, a breakpoint release command using the breakpoint ID output after setting the breakpoint as an argument, a program execution Assume that a command is entered. In the breakpoint setting command, the specification of the object specification information can be omitted. In this case, the program is stopped by the specified method without distinguishing the objects.

【0012】記憶装置3は、デバッグ情報記憶装置31と
ブレーク情報記憶装置32とを備えている。デバッグ情報
記憶装置31は、変数名やメソッド名に対応するプログラ
ム内のアドレス等の情報をあらかじめ記憶している。ま
た、ブレーク情報記憶装置32は、ブレークポイント対象
となるオブジェクトおよび停止位置をプログラム内にお
けるオブジェクト記憶領域へのポインタと実行アドレス
に変換した値と、ブレークポイント管理用IDとを1組の
ブレークポイント情報として記憶する。
The storage device 3 has a debug information storage device 31 and a break information storage device 32. The debug information storage device 31 stores in advance information such as addresses in a program corresponding to variable names and method names. Further, the break information storage device 32 stores a breakpoint target object and a value obtained by converting a stop position into a pointer to an object storage area and an execution address in the program, and a breakpoint management ID as one set of breakpoint information. To be stored.

【0013】プログラム制御装置4は、プログラムへの
ブレークコードの埋め込みや復元を行う実行コード変更
装置41と、変数の値や現在の停止アドレス等を取得する
データ取得装置42と、プログラムを実行するプログラム
実行装置43とを備える。
The program control device 4 includes an execution code changing device 41 for embedding and restoring a break code in a program, a data acquisition device 42 for acquiring a value of a variable and a current stop address, and a program for executing a program. An execution device 43 is provided.

【0014】コマンド処理装置2は、入力装置1から入力
されたデバッグコマンドを解析するコマンド解析装置21
と、ブレークポイント設定/解除コマンドが入力された
場合にそれを処理するブレークコマンド処理装置22と、
実行コマンドが入力された場合にそれを処理する実行コ
マンド処理装置23から構成される。
The command processing device 2 includes a command analysis device 21 for analyzing a debug command input from the input device 1.
And a break command processing device 22 for processing when a breakpoint setting / cancellation command is input,
When an execution command is input, the execution command processing unit 23 processes the command.

【0015】ブレークコマンド処理装置22は、ブレーク
ポイントの設定を行う設定装置221と、設定済みのブレ
ークポイントの解除をおこなう解除装置222を備える。
設定装置221は、コマンド引き数に指定されたオブジェ
クト指定情報と停止位置指定情報をデバッグ情報記憶装
置31およびデータ取得装置42を使用して、プログラム中
のオブジェクト記憶領域へのポインタと実行アドレスに
変換し。ブレークポイントIDと共にブレーク情報記憶装
置32に記憶する。その後、実行コード変更装置41によ
り、メソッドの実行先頭アドレスにブレークコードを埋
め込む。解除装置222は、コマンド引き数に指定された
ブレークポイントIDをもつブレークポイント情報をブレ
ークポイント記憶装置32から削除する。また、同じ実行
アドレスをもつ他のブレークポイント情報が存在しない
場合は、実行コード変更装置41により、その実行アドレ
スに埋め込まれたブレークコードを解除する。
The break command processing device 22 includes a setting device 221 for setting a breakpoint and a release device 222 for releasing a set breakpoint.
The setting device 221 converts the object specification information and the stop position specification information specified in the command argument into a pointer to an object storage area in the program and an execution address using the debug information storage device 31 and the data acquisition device 42. And The information is stored in the break information storage device 32 together with the breakpoint ID. Then, the break code is embedded in the execution start address of the method by the execution code changing device 41. The release device 222 deletes the breakpoint information having the breakpoint ID specified in the command argument from the breakpoint storage device 32. If there is no other breakpoint information having the same execution address, the breakcode embedded in the execution address is released by the execution code changing device 41.

【0016】実行コマンド処理装置23は、実行制御装置
231と停止判定装置232からなる。実行制御装置231は、
まず、プログラム実行装置43によりプログラムの実行を
開始し、ブレークコードにより実行が停止した場合に、
停止判定装置232に実行を継続するかどうかを問い合わ
せる。停止判定装置232は、現在の停止アドレスをデー
タ取得装置42から取得し、ブレーク情報記憶装置32に記
憶されたブレークポイント情報の中に、同じ実行アドレ
スをもつ情報があるか否かを調べる。見つかった場合
は、さらに、デバッグ情報記憶装置31に記憶されたデバ
ッグ情報およびデータ取得装置42により、現在実行中の
メソッドに渡されている自身のオブジェクトへのポイン
タを取得し、ブレークポイント情報に記憶されたオブジ
ェクトへのポインタと一致するかどうかを調べる。一致
しない場合は、再び実行制御装置231により実行を再開
する。その他の場合には、実行をそのまま停止し、出力
装置5に停止メッセージを出力する。
The execution command processing device 23 is an execution control device.
231 and a stop determination device 232. The execution control device 231
First, when the execution of the program is started by the program execution device 43 and the execution is stopped by the break code,
An inquiry is made to the stop determination device 232 as to whether or not to continue the execution. The stop determination device 232 acquires the current stop address from the data acquisition device 42, and checks whether or not there is information having the same execution address in the break point information stored in the break information storage device 32. If found, a pointer to the object passed to the currently executing method is acquired by the debug information and data acquisition device 42 stored in the debug information storage device 31 and stored in the breakpoint information. To see if it matches the pointer to the assigned object. If they do not match, the execution is resumed by the execution control device 231 again. In other cases, the execution is stopped as it is, and a stop message is output to the output device 5.

【0017】次に、本実施の形態の動作について、ま
ず、図1および図2を使用して動作の全体概要を説明し、
その後、各コマンド処理の詳細について、図1,図3,図
4および図5を参照して説明する。
Next, the operation of this embodiment will be described first with reference to FIG. 1 and FIG.
Then, for details of each command processing, refer to Figs.
This will be described with reference to FIG. 4 and FIG.

【0018】入力装置1にコマンドの入力があると(図2
のステップA1)、その内容がコマンド解析装置21に供給
される。コマンド解析装置21は、与えられたコマンドを
解析し(ステップA2)、それがブレークポイント設定コマ
ンドの場合は設定装置221に、ブレークポイント解除コ
マンドの場合は解除装置222に、実行コマンドの場合は
実行制御装置231にコマンドの内容を与え、それぞれの
装置において各コマンドの処理を実施する(ステップA
3)。これらのコマンドの処理を実施する各装置は、コマ
ンド処理の結果を出力装置5に表示し(ステップA4)、再
び入力装置1からのコマンド入力を受け付ける(ステップ
A1)。
When a command is input to the input device 1 (FIG. 2)
In step A1), the contents are supplied to the command analyzer 21. The command analysis device 21 analyzes the given command (step A2), and if it is a breakpoint setting command, executes the command to the setting device 221; if it is a breakpoint release command, it executes the release device 222; The contents of the command are given to the control device 231 and the processing of each command is performed in each device (step A).
3). Each device that executes the processing of these commands displays the result of the command processing on the output device 5 (step A4), and accepts a command input from the input device 1 again (step A4).
A1).

【0019】次に、図1および図3を参照して、ブレーク
ポイント設定処理の詳細について説明する。設定装置22
1は、コマンド引き数にオブジェクト指定情報が含まれ
るか否かを調べる(図3のステップB1)。その結果、オブ
ジェクト指定情報が含まれている場合は、そのオブジェ
クト指定情報に対応するプログラム中のオブジェクト記
憶領域へのポインタが存在するアドレスをデバッグ情報
記憶装置31から取得し(ステップB2)、次に、そのアドレ
スに格納されるオブジェクトへのポインタをデータ取得
装置42によって取得する(ステップB3)。一方、コマンド
引き数にオブジェクト指定情報が含まれていない場合に
は、ポインタの値は0x0とする(ステップB4)。その
後、設定装置22は、コマンド引き数に指定された停止位
置情報に対応するプログラム内の実行アドレスをデバッ
グ情報記憶装置31から取得し(ステップB5)、実行コード
変更装置41により、そのアドレスに対してブレークコー
ドを埋め込む(ステップB6)。
Next, the details of the breakpoint setting process will be described with reference to FIGS. Setting device 22
In step 1, it is checked whether or not the command argument includes object designation information (step B1 in FIG. 3). As a result, if the object specification information is included, the address at which the pointer to the object storage area in the program corresponding to the object specification information exists is obtained from the debug information storage device 31 (step B2). Then, the pointer to the object stored at the address is obtained by the data obtaining device 42 (step B3). On the other hand, if the command argument does not include the object designation information, the value of the pointer is set to 0x0 (step B4). Thereafter, the setting device 22 acquires an execution address in the program corresponding to the stop position information specified in the command argument from the debug information storage device 31 (step B5), and the execution code changing device 41 To embed a break code (step B6).

【0020】これらの処理が全て成功した場合は、この
ブレークポイントに対して管理用のIDを付与し(ステッ
プB7)、このIDと前述のオブジェクトへのポインタおよ
び実行アドレスを1組みのブレークポイント情報とし
て、ブレーク情報記憶装置32に記憶する(ステップB8)。
その後、出力装置5に上記で付与したブレークポイントI
Dを出力する(ステップB9)。しかし、これらの処理のい
づれかが失敗した場合には、出力装置5にエラーを出力
する(ステップB10)。
If all of these processes succeed, an ID for management is assigned to the breakpoint (step B7), and the ID, the pointer to the object and the execution address are set as a set of breakpoint information. Is stored in the break information storage device 32 (step B8).
Then, the breakpoint I assigned above to the output device 5
D is output (step B9). However, if any of these processes fails, an error is output to the output device 5 (step B10).

【0021】次に、図1および図4を参照して、ブレーク
ポイント解除処理の詳細について説明する。解除装置22
2は、コマンドで指定されたブレークポイントIDをもつ
ブレークポイント情報をブレーク情報記憶装置32から検
索する(図4のステップC1)。その結果、ブレークポイン
ト情報が見つかった場合は、その情報をブレーク情報記
憶装置32から削除する(ステップC2)。次に、削除したブ
レークポイント情報が持っていた実行アドレスと一致す
る他のブレークポイント情報があるかどうかをブレーク
情報記憶装置32から検索し(ステップC3)、他のブレーク
ポイント情報が見つからなかった場合には、実行コード
変更装置41によりプログラム内の実行アドレスに埋め込
まれたブレークコードを解除する(ステップC4)。一方、
他のブレークポイント情報が見つかった場合には、ブレ
ークコードの解除(ステップC4)は行わない。処理が全
て成功した場合は出力装置5に削除したブレークポイン
トIDを表示し(ステップC5)、 失敗した場合にはエラー
を出力する(ステップC6)。
Next, the details of the breakpoint release processing will be described with reference to FIGS. Release device 22
Step 2 searches the break information storage device 32 for breakpoint information having the breakpoint ID specified by the command (step C1 in FIG. 4). As a result, when the breakpoint information is found, the information is deleted from the break information storage device 32 (Step C2). Next, a search is made from the break information storage device 32 for other breakpoint information that matches the execution address held by the deleted breakpoint information (step C3), and when no other breakpoint information is found Next, the break code embedded at the execution address in the program is released by the execution code changing device 41 (step C4). on the other hand,
If other breakpoint information is found, the break code is not released (step C4). If all the processing is successful, the deleted breakpoint ID is displayed on the output device 5 (step C5), and if it fails, an error is output (step C6).

【0022】最後に、図1および図5を参照して、実行コ
マンドの処理について説明する。実行制御装置231は、
プログラム実行装置43によりプログラムの実行を開始す
る(図3のステップD1)。その際、プログラムがブレーク
コードにより停止した場合には、停止判定装置232によ
り実行を継続するかどうかを判定する。停止判定装置23
2は、現在の停止位置をデータ取得装置42から取得し(ス
テップD2)、そのアドレスに一致する実行アドレスを含
むブレークポイント情報があるか否かをブレーク情報記
憶装置32から検索する(ステップD3)。その結果、ブレー
クポイント情報がみつかった場合には、ブレークポイン
ト情報に記録されたオブジェクトへのポインタが0x0か
どうかを調べ(ステップD4)、もし0x0ならばブレークポ
イント設定時にオブジェクトの指定は行われていないた
め、そのまま実行を停止し、出力装置5に現在の停止位
置を出力する(ステップD8)。
Finally, the processing of the execution command will be described with reference to FIGS. The execution control device 231
The execution of the program is started by the program execution device 43 (step D1 in FIG. 3). At this time, when the program is stopped by the break code, the stop determination device 232 determines whether or not to continue the execution. Stop determination device 23
2 acquires the current stop position from the data acquisition device 42 (step D2) and searches the break information storage device 32 for breakpoint information including an execution address that matches the address (step D3). . As a result, if breakpoint information is found, it is checked whether the pointer to the object recorded in the breakpoint information is 0x0 (step D4) .If the pointer is 0x0, the object was specified at the time of setting the breakpoint. Therefore, the execution is stopped, and the current stop position is output to the output device 5 (step D8).

【0023】一方、記録されたオブジェクトへのポイン
タが0x0でない場合は、データ取得装置42により、現在
停止中のメソッドに引き数として渡されている自身のオ
ブジェクトへのポインタを取得し(ステップD5)、それが
記録されたオブジェクトへのポインタと一致するか否か
を調べる(ステップD6)。その結果、一致する場合は出力
装置5に現在の停止位置を出力し(ステップD8)、一致し
ない場合はブレークポイント対象ではない他のオブジェ
クトのメソッドが実行されているものとして、実行制御
装置231により再び実行を継続する(ステップD7)。
On the other hand, if the pointer to the recorded object is not 0x0, the data acquisition device 42 acquires a pointer to its own object passed as an argument to the currently stopped method (step D5). It is checked whether it matches the pointer to the recorded object (step D6). As a result, if they match, the current stop position is output to the output device 5 (step D8) .If they do not match, the execution control device 231 determines that a method of another object that is not a breakpoint target is being executed. The execution is continued again (step D7).

【0024】次に、本発明の他の実施の形態について説
明する。図6を参照すると、本実施の形態は例は、プロ
グラム制御装置6が、図1に示された実施の形態における
プログラム制御装置4の構成に加えて、オブジェクト管
理装置44を有する点で異なる。
Next, another embodiment of the present invention will be described. Referring to FIG. 6, the present embodiment is different from the example in that program control device 6 has an object management device 44 in addition to the configuration of program control device 4 in the embodiment shown in FIG.

【0025】この、オブジェクト管理装置44は、プログ
ラム実行中に、ブレーク情報記憶装置32に記憶されたオ
ブジェクトの解放を検出すると、プログラムの実行を一
時的に停止し、解放されたオブジェクトに対するブレー
クポイントIDを解除装置222に通知し、指定されたIDに
対応するブレークポイントを削除する。その後、実行制
御装置231により実行を再開する。
When the object management device 44 detects the release of the object stored in the break information storage device 32 during the execution of the program, it temporarily stops the execution of the program and sets the breakpoint ID for the released object. To the release device 222, and deletes the breakpoint corresponding to the specified ID. Thereafter, the execution is resumed by the execution control device 231.

【0026】本実施の形態の動作を図面を参照して詳細
に説明する。ブレークポイント設定コマンドおよび解除
コマンドの処理は、図3および図4を参照して説明した前
述の動作と同様である。したがって、実行コマンドの処
理について、図6および図7を参照して説明する。
The operation of the present embodiment will be described in detail with reference to the drawings. The processing of the breakpoint setting command and the release command is the same as the above-described operation described with reference to FIGS. Therefore, the processing of the execution command will be described with reference to FIG. 6 and FIG.

【0027】入力装置1から実行コマンドが入力される
と、実行制御装置231は、プログラム実行装置43により
プログラムの実行を開始する(図7のステップD1)。プロ
グラム実行中に、オブジェクト管理装置44が、ブレーク
情報記憶装置32が記憶するオブジェクトに対する解放処
理を検出(ステップE1)した場合は、実行を停止し(ステ
ップE2)、そのオブジェクトに対応するブレークポイン
トIDを解除装置222に通知する。解除装置222は、入力装
置1からブレークポイント解除コマンドが入力された場
合と同様に、指定されたIDに対応するブレークポイント
を削除する(ステップE3)。その後、実行制御装置231に
より実行を再開する(ステップE4)。オブジェクトの解放
の検出(ステップE1)が行われずに、プログラムがブレ
ークコードにより停止した場合は、図5におけるステッ
プD2からD8と同様の処理を実施する。
When an execution command is input from the input device 1, the execution control device 231 starts executing the program by the program execution device 43 (step D1 in FIG. 7). If the object management device 44 detects release processing for an object stored in the break information storage device 32 during execution of the program (step E1), the execution is stopped (step E2), and the breakpoint ID corresponding to the object is stopped. Is notified to the release device 222. The release device 222 deletes the breakpoint corresponding to the specified ID, similarly to the case where the breakpoint release command is input from the input device 1 (step E3). Thereafter, the execution is restarted by the execution control device 231 (step E4). When the program is stopped by the break code without detecting the release of the object (step E1), the same processing as steps D2 to D8 in FIG. 5 is performed.

【0028】オブジェクトを指定してブレークポイント
を設定した場合、そのブレークポイントは、指定された
オブジェクトが解放されずに記憶領域場に存在する間で
のみ有効である。本実施の形態は、オブジェクトの解放
を検出することにより、有効でなくなったブレークポイ
ントを自動的に削除し、不正なブレークポイントによる
プログラム停止動作を回避する機能を有するものであ
る。
When a breakpoint is set by specifying an object, the breakpoint is valid only while the specified object exists in the storage area without being released. The present embodiment has a function of automatically deleting a breakpoint that is no longer valid by detecting the release of an object and avoiding a program stop operation due to an illegal breakpoint.

【0029】[0029]

【発明の効果】本発明の効果は、オブジェクト指向言語
で記述されたプログラムのデバック効率を高めることに
ある。その理由は、プログラムのテキスト領域に対する
ブレークポイントをオブジェクトを区別して設定できる
ようにすることにより、オブジェクトに着目したデバッ
クを容易にするためである。
An effect of the present invention is to increase the debugging efficiency of a program described in an object-oriented language. The reason is that a breakpoint for a text area of a program can be set for each object so that debugging focusing on the object is facilitated.

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

【図1】 本発明の一実施の形態のブロック図である。FIG. 1 is a block diagram of one embodiment of the present invention.

【図2】 図1に示した実施の形態の全般の動作を示す
フローチャートである。
FIG. 2 is a flowchart showing an overall operation of the embodiment shown in FIG.

【図3】 図1に示した実施の形態におけるブレークポ
イント設定処理を示すフローチャートである。
FIG. 3 is a flowchart showing a breakpoint setting process in the embodiment shown in FIG. 1;

【図4】 図1に示した実施の形態におけるブレークポ
イント解除処理を示すフローチャートである。
FIG. 4 is a flowchart showing a breakpoint release process in the embodiment shown in FIG. 1;

【図5】 図1に示した実施の形態における実行コマン
ドの処理を示すフローチャートである。
FIG. 5 is a flowchart showing processing of an execution command in the embodiment shown in FIG. 1;

【図6】 本発明の他の実施の形態のブロック図であ
る。
FIG. 6 is a block diagram of another embodiment of the present invention.

【図7】 図6に示した実施の形態における実行コマン
ドの処理を示すフローチャートである。
FIG. 7 is a flowchart showing processing of an execution command in the embodiment shown in FIG. 6;

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

1 入力装置 2 コマンド処理装置 3 記憶装置 4 プログラム制御装置 5 出力装置 6 プログラム制御装置 21 コマンド解析装置 22 ブレークコマンド処理装置 23 実行コマンド処理装置 31 デバッグ情報記憶装置 32 ブレーク情報記憶装置 41 実行コード変更装置 42 データ取得装置 43 プログラム実行装置 44 オブジェクト管理装置 221 設定装置 222 解除装置 231 実行制御装置 232 停止判定装置 Reference Signs List 1 input device 2 command processing device 3 storage device 4 program control device 5 output device 6 program control device 21 command analysis device 22 break command processing device 23 execution command processing device 31 debug information storage device 32 break information storage device 41 execution code change device Reference Signs List 42 data acquisition device 43 program execution device 44 object management device 221 setting device 222 release device 231 execution control device 232 stop determination device

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 オブジェクト指向言語を対象としたプロ
グラムのデバッグ装置において、 プログラムのテキスト領域にブレークポイントを設定す
る際に、オブジェクトを指定したブレークポイントを設
定することにより、そのテキストを共有するクラスオブ
ジェクトが複数存在する場合にも、指定されたオブジェ
クトの実行のみを停止させることが可能なブレーク機能
を有することを特徴とするプログラムのデバッグ装置。
In a program debugging apparatus for an object-oriented language, when a breakpoint is set in a text area of a program, a class object sharing the text by setting a breakpoint specifying the object. A program debugging device having a break function capable of stopping only execution of a specified object even when a plurality of programs exist.
【請求項2】 オブジェクト指向言語を対象としたプロ
グラムのデバッグ装置において、 入力装置から入力されたブレークポイント設定コマンド
のコマンド引き数に指定されたオブジェクトおよび停止
位置に関する情報を、それに対応するプログラム中のオ
ブジェクト記憶領域へのポインタと実行アドレスに変換
し、その値をブレークポイント情報としてブレーク情報
記憶装置に記憶する設定装置と、 該記憶した実行アドレスに対応するプログラム内テキス
ト領域にブレークコードを埋め込む実行コード変更装置
と、 前記入力装置から実行コマンドが入力されると、プログ
ラムの実行を開始する実行制御装置と、 該プログラム実行中に前記ブレークコードによりプログ
ラムの実行が停止すると、該プログラムの実行を再開す
るか否かを判定する停止判定装置と を備え、該停止判定装置は、先ず現在の停止アドレスを
取得し、次に前記ブレーク情報記憶装置の中に、現在の
停止アドレスと一致する実行アドレスを含むブレークポ
イント情報があるかどうかを検索し、見つかった場合
は、さらに現在停止中のメソッドに渡されている自身の
オブジェクトへのポインタを取得し、それが前記見つか
ったブレークポイント情報に含まれるオブジェクトへの
ポインタと一致するかどうかを比較し、両者が一致しな
い場合は、ブレークポイント設定対象外のオブジェクト
が実行されているものとして、再び前記プログラムの実
行を開始するが、その他の場合には、実行を停止させた
状態のまま、現在の停止位置を出力装置に出力して次の
コマンド入力を待つことを特徴とするプログラムのデバ
ッグ装置。
2. A debugger for a program for an object-oriented language, comprising: information relating to an object and a stop position specified in a command argument of a breakpoint setting command input from an input device; A setting device that converts a pointer to an object storage area and an execution address and stores the value as breakpoint information in a break information storage device; and an execution code for embedding a break code in a text area in a program corresponding to the stored execution address A change device, an execution control device that starts execution of a program when an execution command is input from the input device, and restarts execution of the program when execution of the program is stopped by the break code during execution of the program. Determine whether or not The stop determination device first obtains a current stop address, and then has breakpoint information including an execution address that matches the current stop address in the break information storage device. Search for, and if found, further obtain a pointer to its own object passed to the currently stopped method, which matches the pointer to the object included in the found breakpoint information If the two do not match, execution of the program is started again assuming that an object not targeted for breakpoint setting has been executed, but otherwise, execution has been stopped. Output the current stop position to an output device and wait for the next command input. Grayed apparatus.
【請求項3】 前記プログラム実行中に、前記ブレーク
情報記憶装置が記憶するオブジェクトに対する解放処理
を検出した場合は、該プログラムの実行を停止し、その
オブジェクトに対応するブレークポイントの解除を通知
するオブジェクト管理装置を付加したことを特徴とする
請求項2記載のプログラムのデバッグ装置。
3. An object that, when executing the program, detects release processing of an object stored in the break information storage device, stops execution of the program, and notifies release of a breakpoint corresponding to the object. 3. The program debugging device according to claim 2, further comprising a management device.
【請求項4】 オブジェクト指向言語を対象としたプロ
グラムのデバッグ方法において、 入力装置から入力されたブレークポイント設定コマンド
のコマンド引き数に指定されたオブジェクトおよび停止
位置に関する情報を、それに対応するプログラム中のオ
ブジェクト記憶領域へのポインタと実行アドレスに変換
し、その値をブレークポイント情報としてブレーク情報
記憶装置に記憶する手順と、 該記憶した実行アドレスに対応するプログラム内テキス
ト領域にブレークコードを埋め込む手順と、 前記入力装置から実行コマンドが入力されると、プログ
ラムの実行を開始する手順と、 該プログラム実行中に前記ブレークコードによりプログ
ラムの実行が停止すると、該プログラムの実行を再開す
るか否かを判定する手順とを有し、 該判定する手順は、 先ず現在の停止アドレスを取得し、次に前記ブレーク情
報記憶装置の中に、現在の停止アドレスと一致する実行
アドレスを含むブレークポイント情報があるかどうかを
検索する手順と、 検索の結果、ブレークポイント情報が見つかった場合
は、さらに現在停止中のメソッドに渡されている自身の
オブジェクトへのポインタを取得する手順と、 該取得されたポインタが前記見つかったブレークポイン
ト情報に含まれるオブジェクトへのポインタと一致する
かどうかを比較する手順と、 該比較の結果、両者が一致しない場合は、ブレークポイ
ント設定対象外のオブジェクトが実行されているものと
して、再び前記プログラムの実行を開始するが、その他
の場合には、実行を停止させた状態のまま、現在の停止
位置を出力装置に出力して次のコマンド入力を待つ手順
とから成ることを特徴とするプログラムのデバッグ方
法。
4. A method for debugging a program for an object-oriented language, comprising: information relating to an object and a stop position specified in a command argument of a breakpoint setting command input from an input device; Converting a pointer to an object storage area and an execution address and storing the value as breakpoint information in a break information storage device; embedding a break code in a program text area corresponding to the stored execution address; A step of starting execution of a program when an execution command is input from the input device; and determining whether or not to resume execution of the program when execution of the program is stopped by the break code during execution of the program. And determining The procedure includes: first obtaining a current stop address; then, searching the break information storage device for breakpoint information including an execution address that matches the current stop address. If the breakpoint information is found, further obtaining a pointer to the own object passed to the currently stopped method, and setting the obtained pointer to the object included in the found breakpoint information. And a procedure for comparing whether or not the pointers match, and if the two do not match as a result, the execution of the program is started again assuming that an object not targeted for the breakpoint setting is being executed. In other cases, the current stop position is output to the output device while execution is stopped. Debug a program characterized by comprising a procedure to wait for the next command input.
JP11144092A 1999-05-24 1999-05-24 Device and method for debugging program Pending JP2000330823A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11144092A JP2000330823A (en) 1999-05-24 1999-05-24 Device and method for debugging program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11144092A JP2000330823A (en) 1999-05-24 1999-05-24 Device and method for debugging program

Publications (1)

Publication Number Publication Date
JP2000330823A true JP2000330823A (en) 2000-11-30

Family

ID=15354038

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11144092A Pending JP2000330823A (en) 1999-05-24 1999-05-24 Device and method for debugging program

Country Status (1)

Country Link
JP (1) JP2000330823A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003271415A (en) * 2002-03-13 2003-09-26 Denso Corp Execution history recording device, brake instruction setting device and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003271415A (en) * 2002-03-13 2003-09-26 Denso Corp Execution history recording device, brake instruction setting device and program

Similar Documents

Publication Publication Date Title
JP4901075B2 (en) Computer-readable medium, method and computing device
US20040168157A1 (en) System and method for creating a process invocation tree
US8762953B2 (en) Exception-based error handling in an array-based language
JP2000330823A (en) Device and method for debugging program
JPH0934698A (en) Software generating method and software developing and supporting method
JP2002073348A (en) Scenario analysis type control system device
JP2007004516A (en) Program debugging method of built-in system
CN108197000B (en) Application program starting log saving method, storage medium, electronic device and system
JP2658982B2 (en) Specific instruction execution detection method
JPH07191876A (en) Program testing device and using method for the same
JP2000099364A (en) Method for debugging device driver
JP3114686B2 (en) Program debugging method
JP2001166966A (en) Method for managing execution environment of program to be tested in debugger
JP2006350676A (en) Program debugging method of built-in system
JP2001142743A (en) Parallel debugger, system and method for debugging of parallel process, and recording medium
JPH04273342A (en) Fault area output system for software fault
JP2000112771A (en) Interruption controller, interruption processing method, operating system, microcomputer system, information processor and storage medium recording program
JPH0816431A (en) Debugging process system for user program
JPH0997182A (en) Program converter and debugger
JPH0358144A (en) System for gathering program run history information
JPH04333146A (en) Program execution control system for debugging
JPH02226344A (en) Computer system
JPH03278241A (en) Program debugging system
JPH0772874B2 (en) Interrupt receiving device
JPH0434627A (en) Log-out information acquisition control system

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20020226