JPH07191876A - Program testing device and using method for the same - Google Patents

Program testing device and using method for the same

Info

Publication number
JPH07191876A
JPH07191876A JP5329292A JP32929293A JPH07191876A JP H07191876 A JPH07191876 A JP H07191876A JP 5329292 A JP5329292 A JP 5329292A JP 32929293 A JP32929293 A JP 32929293A JP H07191876 A JPH07191876 A JP H07191876A
Authority
JP
Japan
Prior art keywords
procedure
breakpoint
program
execution
name
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
JP5329292A
Other languages
Japanese (ja)
Inventor
Hiroko Osumi
裕子 大隅
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 JP5329292A priority Critical patent/JPH07191876A/en
Publication of JPH07191876A publication Critical patent/JPH07191876A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To set a break point for stopping the execution of a program only when it is called from any specified procedure. CONSTITUTION:A command analyzing means 1 analyzes a command and stores a procedure name to set the break point and the procedure name of a calling source in a break point information table 4. A break point setting means 2 sets a trap instruction to a load module 5. A command executing means 3 is temporarily stopped when it meets the break point during the execution of the load module 5. It is decided whether the break point information table 4 is matched with the procedure name possessed from a stack frame or not and when they are matched, the execution of the load module 5 is stopped but when they are not matched, the execution is started again.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はプログラム試験装置及び
そのブレークポイント設定方法に関し、特にある手続き
がある特定の手続きの中から呼び出された時のみプログ
ラムの実行を停止させるようにするブレークポイントの
設定をコマンドより指定できるようにしたプログラム試
験装置及びそのブレークポイント設定方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program test apparatus and a breakpoint setting method therefor, and more particularly to setting a breakpoint for stopping execution of a program only when a procedure is called from within a specific procedure. The present invention relates to a program test device that allows the user to specify a command and a breakpoint setting method thereof.

【0002】[0002]

【従来の技術】従来のソースレベルでプログラムの動作
を試験するプログラム試験装置において、ブレークポイ
ントの設定は、プログラムの実行を停止させるために使
用される。ブレークポイントの設定は、ブレークポイン
ト設定コマンドを用いて、プログラムの行または手続き
に対して設定されていた。プログラム試験装置は、プロ
グラムの実行中、ブレークポイントに出会う度に、プロ
グラムの実行を停止していた。
2. Description of the Related Art In a conventional program test apparatus for testing the operation of a program at the source level, setting a breakpoint is used to stop the execution of the program. Breakpoints have been set for program lines or procedures using the breakpoint setting commands. The program test apparatus stopped the execution of the program each time a breakpoint was encountered during the execution of the program.

【0003】[0003]

【発明が解決しようとする課題】上述した従来技術で
は、ある手続きが多くの様々な手続きから呼び出される
プログラムの動作を試験する際、多くの様々な手続きか
ら呼び出されるある手続きにブレークポイントを設定し
た場合、試験中何度もこの手続きでプログラムの実行が
停止することになる。しかし、ユーザはこの手続きがあ
る特定の手続きから呼び出された状態について試験した
いと望んでいる場合には、プログラムがブレークポイン
トで停止するとその手続きがどの手続きから呼び出され
たものであるかをトレース情報から調べなければならな
い。そして、呼び出し元の手続きがある特定の手続きと
異なるならば、プログラムの実行を再開する。次に、プ
ログラムが停止すると同様に呼び出し元の手続きを調
べ、呼び出し元の手続きがある特定のプログラムでなけ
ればプログラムの実行を再開する。このブレークポイン
トを設定した手続きがある特定の手続きから呼び出され
るまでこの処理を繰り返さなけでばならないため、試験
したい手続きに到達するまでの操作性が悪く、また時間
もかかり試験効率が悪いという問題がある。
In the above-mentioned prior art, when testing the behavior of a program in which a procedure is called from many different procedures, a breakpoint is set on a procedure called from many different procedures. In this case, this procedure will cause the program execution to stop many times during the test. However, if the user wants to test the state in which this procedure was called by a particular procedure, then when the program stops at a breakpoint, trace information is displayed as to which procedure the procedure was called from. I have to find out from. Then, if the calling procedure is different from a specific procedure, execution of the program is restarted. Next, when the program stops, the calling procedure is checked in the same manner, and the execution of the program is resumed if the calling procedure is not a specific program. Since this process must be repeated until the procedure that set this breakpoint is called from a specific procedure, the operability to reach the procedure you want to test is poor, and it takes time and the test efficiency is poor. is there.

【0004】本発明は上記問題点の解決を図り、ある手
続きがある特定の手続きの中から呼び出された時のみプ
ログラムの実行を停止させるようにするブレークポイン
ト設定コマンドを設けることにより、試験したい手続き
に早く到達できるようにして試験効率を高めたプログラ
ム試験装置を提供する。
According to the present invention, the procedure to be tested is provided by solving the above-mentioned problems and by providing a breakpoint setting command for stopping the execution of the program only when a procedure is called from a certain procedure. PROBLEM TO BE SOLVED: To provide a program test device with which the test efficiency can be quickly reached and the test efficiency is improved.

【0005】[0005]

【課題を解決するための手段】上述した問題点を解決す
るため本願発明のプログラム試験装置では、プログラム
試験装置に入力されたコマンドを解析し、第1の手続き
が第2の手続きの中から呼び出された時のみ前記プログ
ラムの実行を停止させるブレークポイントの設定を行う
旨を前記コマンドが意味していた場合、ブレークポイン
トを設定する前記第1の手続きの手続き名と呼び出し元
の少なくとも1つの前記第2の手続きの手続き名をブレ
ークポイント情報テーブルに格納するコマンド解析手段
と、このコマンド解析手段により解析されたブレークポ
イントを設定する前記第1の手続きの手続き開始アドレ
スにトラップ命令を埋め込むブレークポイント設定手段
と、前記プログラムを実行し、前記ブレークポイント設
定手段により設定されたブレークポイントに達した時に
前記プログラムの実行を一旦停止し、そのブレークポイ
ントが前記第1の手続きに対するものならば前記第1の
手続きの手続き名が前記ブレークポイント情報テーブル
の中に存在するか否かを検索して、もし存在する場合は
前記ブレークポイント情報テーブルで指定された呼び出
し元の前記第2の手続き名と実際の呼び出し元の手続き
名とを比較して、一致していれば前記プログラムの実行
を停止し、一致していなければ前記プログラムの実行を
続行するコマンド実行手段とを有する。
In order to solve the above-mentioned problems, in the program test apparatus of the present invention, the command input to the program test apparatus is analyzed and the first procedure is called from the second procedure. When the command means to set a breakpoint that stops the execution of the program only when the breakpoint is set, the procedure name of the first procedure for setting the breakpoint and at least one of the calling source Command analysis means for storing the procedure name of the second procedure in the breakpoint information table, and breakpoint setting means for embedding a trap instruction at the procedure start address of the first procedure for setting the breakpoint analyzed by this command analysis means. And execute the program and set by the breakpoint setting means When the breakpoint is reached, the execution of the program is temporarily stopped, and if the breakpoint is for the first procedure, is the procedure name of the first procedure present in the breakpoint information table? If there is a match, the second procedure name of the caller specified in the breakpoint information table is compared with the actual caller's procedure name if there is a match. Command execution means for stopping the execution of the program and continuing the execution of the program if they do not match.

【0006】また、本願発明のプログラム試験装置にお
けるブレークポイント設定方法では、プログラム試験装
置に入力されたコマンドを解析し、第1の手続きが第2
の手続きの中から呼び出された時のみ前記プログラムの
実行を停止させるブレークポイントの設定を行う旨を前
記コマンドが意味していた場合、ブレークポイントを設
定する前記第1の手続きの手続き名と呼び出し元の少な
くとも1つの前記第2の手続きの手続き名をブレークポ
イント情報テーブルに格納するステップと、ブレークポ
イントを設定する前記第1の手続きの手続き開始アドレ
スにトラップ命令を埋め込むステップと、前記プログラ
ムを実行し、前記ブレークポイントに達した時に前記プ
ログラムの実行を一旦停止するステップと、前記ブレー
クポイントが前記第1の手続きに対するものならば前記
第1の手続きの手続き名が前記ブレークポイント情報テ
ーブルの中に存在するか否かを検索するステップと、も
し前記第1の手続きの手続き名が前記ブレークポイント
情報テーブルの中に存在する場合は前記ブレークポイン
ト情報テーブルで指定された呼び出し元の前記第2の手
続き名と実際の呼び出し元の手続き名とを比較するステ
ップと、前記ブレークポイント情報テーブルで指定され
た呼び出し元の前記第2の手続き名と実際の呼び出し元
の手続き名とが一致していれば前記プログラムの実行を
停止するステップとを有する。
Further, in the breakpoint setting method in the program testing apparatus of the present invention, the command inputted to the program testing apparatus is analyzed, and the first procedure is the second procedure.
If the command means to set a breakpoint that stops the execution of the program only when it is called from within the procedure, the procedure name and caller of the first procedure that sets the breakpoint Storing at least one procedure name of the second procedure in the breakpoint information table; embedding a trap instruction at the procedure start address of the first procedure for setting a breakpoint; and executing the program. , A step of temporarily stopping the execution of the program when the breakpoint is reached, and if the breakpoint is for the first procedure, the procedure name of the first procedure exists in the breakpoint information table. A step of searching whether or not to execute, and if the first procedure And the procedure name of the caller specified in the breakpoint information table is compared with the procedure name of the actual caller, If the second procedure name of the caller specified in the breakpoint information table and the procedure name of the actual caller match, stopping the execution of the program.

【0007】[0007]

【実施例】次に本発明のプログラム試験装置の一実施例
について図面を参照して詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the program testing device of the present invention will be described in detail with reference to the drawings.

【0008】図1を参照すると、本発明のプログラム試
験装置の一実施例の構成を示すブロック図であり、ロー
ドモジュール5と、プログラム試験装置6とを含んで構
成されている。なお、図1において、実線の矢線はデー
タの流れを示し、破線の矢線は制御の流れを示す。
Referring to FIG. 1, there is shown a block diagram showing the construction of an embodiment of a program test apparatus according to the present invention, which comprises a load module 5 and a program test apparatus 6. In addition, in FIG. 1, a solid arrow indicates a data flow, and a dashed arrow indicates a control flow.

【0009】ロードモジュール5は、機械語命令やその
他の制御情報を含むファイルであり、メモリ上に展開さ
れてコマンド実行手段3により実行される。
The load module 5 is a file containing machine language instructions and other control information, and is loaded on the memory and executed by the command executing means 3.

【0010】プログラム試験装置6は、コマンド解析手
段1と、ブレークポイント設定手段2と、コマンド実行
手段3と、ブレークポイント情報テーブル4と、トラッ
プ情報テーブル7とを含んで構成され、ユーザからのコ
マンドの受け取りや、プログラムのソースレベルのデバ
ッグを行う。
The program testing device 6 is configured to include a command analysis means 1, a breakpoint setting means 2, a command execution means 3, a breakpoint information table 4 and a trap information table 7, and a command from a user. Receive and debug the source level of the program.

【0011】コマンド解析手段1は、ユーザからの指示
によってブレークポイント情報テーブル4にブレークポ
イント、すなわちプログラム実行中に一旦停止すべき位
置、を設定する。
The command analysis means 1 sets a breakpoint in the breakpoint information table 4 according to an instruction from the user, that is, a position at which the program should be temporarily stopped during program execution.

【0012】ブレークポイント設定手段2は、プログラ
ム中におけるブレークポイントが設定された位置にトラ
ップ命令、すなわち割り込みを起こす命令、を埋め込
む。
The breakpoint setting means 2 embeds a trap instruction, that is, an instruction that causes an interrupt, at a position where a breakpoint is set in the program.

【0013】コマンド実行手段3は、ユーザからの指示
によりプログラムを実行し、ブレークポイントに到達し
た際にはプログラムの実行を継続するか否かを判断す
る。
The command executing means 3 executes the program according to an instruction from the user, and judges whether to continue the execution of the program when the breakpoint is reached.

【0014】ブレークポイント情報テーブル4は、ブレ
ークポイントを設定したい手続きに関する条件を格納す
る。すなわち、ある特定の手続きがこのブレークポイン
ト情報テーブル4で指定された手続きから呼び出された
場合にのみ停止するように、コマンド実行手段3によっ
て取り扱われる。
The break point information table 4 stores conditions relating to procedures for which break points are desired to be set. That is, the command execution means 3 handles the particular procedure so that it stops only when it is called from the procedure specified in the breakpoint information table 4.

【0015】トラップ情報テーブル7は、ブレークポイ
ントが設定されたことによって、トラップ命令が埋め込
まれた際の情報を格納する。すなわち、トラップ命令を
埋め込んだアドレスとトラップ命令を埋め込む前の状態
の退避領域とを含む。
The trap information table 7 stores information when the trap instruction is embedded due to the setting of the breakpoint. That is, it includes the address in which the trap instruction is embedded and the save area in the state before the trap instruction is embedded.

【0016】次に、本発明の上記一実施例のプログラム
試験装置の動作について説明する。
Next, the operation of the program test apparatus according to the above-described embodiment of the present invention will be described.

【0017】プログラム試験装置6は、ロードモジュー
ル5のデバッグを行うために起動される。プログラム試
験装置6が起動されると、プログラム試験装置6はコマ
ンド解析手段1を起動する。
The program test device 6 is activated to debug the load module 5. When the program test device 6 is activated, the program test device 6 activates the command analysis means 1.

【0018】図6を参照すると、起動されたコマンド解
析手段1の動作を表した図である。プログラム試験装置
6は、まずユーザからのコマンドを受け取る(ステップ
61)。そして、受け取ったコマンドを解析する(ステ
ップ62)。ここで、ある手続きがある特定の手続きか
ら呼び出された時のみプログラムの実行を停止させるブ
レークポイントの設定コマンドが指定された場合、ブレ
ークポイントを設定する手続き名とその手続きが呼び出
された呼び出し元の手続き名をブレークポイント情報テ
ーブル4に格納する(ステップ63)。
Referring to FIG. 6, it is a diagram showing the operation of the activated command analysis means 1. The program test apparatus 6 first receives a command from the user (step 61). Then, the received command is analyzed (step 62). Here, if a breakpoint setting command that stops program execution only when a procedure is called from a particular procedure is specified, the name of the procedure that sets the breakpoint and the caller from which the procedure was called The procedure name is stored in the breakpoint information table 4 (step 63).

【0019】図2を参照すると、本発明の対象となるプ
ログラムの一例であり、「手続きfunc(エ)が手続
きbから呼び出された時のみプログラムの実行を停止さ
せる」ブレークポイントの設定コマンドが指定された場
合、ブレークポイントを設定される手続き名がfun
c、呼び出し元の手続き名がbとなり、これらがブレー
クポイント情報テーブル4に格納される。なお、ある手
続きがある特定の手続きから呼び出された時のみプログ
ラムの実行を停止させるブレークポイントの設定コマン
ドには、呼び出し元の手続き名を複数指定できることと
し、このときはこれら複数の呼び出し元の手続き名をブ
レークポイント情報テーブル4に格納する。
Referring to FIG. 2, which is an example of a program to which the present invention is applied, a breakpoint setting command "stops program execution only when procedure func (d) is called from procedure b" is specified. Is set, the procedure name for which the breakpoint is set is fun
c, the procedure name of the caller is b, and these are stored in the breakpoint information table 4. Note that you can specify multiple caller procedure names in a breakpoint setting command that stops program execution only when a procedure is called by a specific procedure. The name is stored in the breakpoint information table 4.

【0020】図3を参照すると、図2のプログラム例に
対応するブレークポイント情報テーブル4の構成を表し
ている。例えば、「手続きfunc(エ)が手続きbお
よびcから呼び出された時のみプログラムの実行を停止
させる」ブレークポイントの設定が指定された場合、ブ
レークポイントを設定させる手続き名funcを項目4
2に、呼び出し元の手続き名bを項目43に、同じく呼
び出し元の手続き名cを項目44に設定して、有効フラ
グ41をセットする。
Referring to FIG. 3, there is shown a structure of the breakpoint information table 4 corresponding to the program example of FIG. For example, when the setting of the breakpoint "Stop the execution of the program only when the procedure func (d) is called from the procedures b and c" is specified, the procedure name func for setting the breakpoint is set to item 4
In step 2, the procedure name b of the caller is set in the item 43, the procedure name c of the caller is set in the item 44, and the valid flag 41 is set.

【0021】コマンド解析手段1が終了すると、次にブ
レークポイント設定手段2に制御が移る。
When the command analysis means 1 ends, control is next transferred to the breakpoint setting means 2.

【0022】図7を参照すると、ブレークポイント設定
手段2における処理を表した図である。
Referring to FIG. 7, it is a diagram showing the processing in the breakpoint setting means 2.

【0023】ブレークポイント設定手段2は、ブレーク
ポイントを設定する箇所にトラップ命令を埋め込む(ス
テップ72)のに先立ち、そのトラップ命令が埋め込ま
れる領域に格納されている情報を退避しておく(ステッ
プ71)。
The break point setting means 2 saves the information stored in the area in which the trap instruction is embedded (step 71) before embedding the trap instruction in the place where the breakpoint is set (step 72). ).

【0024】上記退避の方法を図4と図5を参照して説
明する。
The saving method will be described with reference to FIGS. 4 and 5.

【0025】図4を参照すると、ロードモジュール5を
各手続きごとにメモリ上に展開したイメージは、プログ
ラム領域51とデバッグ情報領域とに分けられる。プロ
グラム領域51は、デバッグ対象となるプログラムが格
納されている領域である。デバッグ情報領域52は、プ
ログラム試験装置6が必要とする情報を格納する領域で
あり、当該手続きの開始アドレスを含む手続き開始アド
レス部53と、当該手続きの終了アドレスを含む手続き
終了アドレス部54と、当該手続き内の各命令単位に付
される行番号とその格納アドレスを含む行番号情報55
とを含んでいる。
Referring to FIG. 4, the image of the load module 5 developed on the memory for each procedure is divided into a program area 51 and a debug information area. The program area 51 is an area in which a program to be debugged is stored. The debug information area 52 is an area for storing information required by the program test apparatus 6, and includes a procedure start address section 53 including a start address of the procedure, a procedure end address section 54 including an end address of the procedure, Line number information 55 including the line number assigned to each instruction unit in the procedure and its storage address
Includes and.

【0026】図5を参照すると、トラップ情報テーブル
7は、手続きに対してブレークポイントを設定した場合
のトラップ情報73と、命令に対してブレークポイント
を設定した場合のトラップ情報74とを有している。ト
ラップ情報73,74は、トラップ命令を埋め込んだア
ドレスを示すトラップ設定アドレス部78と、このトラ
ップ設定アドレス部78に格納されていた命令を退避す
るための領域である退避命令部79と、これらトラップ
設定アドレス部78と退避命令部79との対が有効であ
るかどうかを示す有効フラグ77とを1組にして、これ
ら有効フラグ77、トラップ設定アドレス部78および
退避命令部79からなる組を複数有する。
Referring to FIG. 5, the trap information table 7 has trap information 73 when a breakpoint is set for a procedure and trap information 74 when a breakpoint is set for an instruction. There is. The trap information 73 and 74 includes a trap setting address section 78 indicating an address in which a trap instruction is embedded, a save instruction section 79 which is an area for saving the instruction stored in the trap setting address section 78, and these traps. A set of a valid flag 77 indicating whether or not a pair of the set address section 78 and the save instruction section 79 is valid is set, and a plurality of sets including the valid flag 77, the trap set address section 78, and the save instruction section 79 are provided. Have.

【0027】上記のメモリイメージとトラップ情報テー
ブル7を前提として、まずステップ71では、ブレーク
ポイントを設定する手続きのプログラム領域51の先頭
命令に該当する位置の命令をトラップ情報73に退避す
る。すなわち、プログラム領域51の先頭命令に該当す
るアドレスをトラップアドレス78に格納し、このプロ
グラム領域51の先頭命令に該当する位置の命令を退避
命令部79に格納して、対応する有効フラグ77を「有
効」にする。
On the premise of the above memory image and trap information table 7, first in step 71, the instruction at the position corresponding to the first instruction of the program area 51 of the procedure for setting a breakpoint is saved in the trap information 73. That is, the address corresponding to the first instruction of the program area 51 is stored in the trap address 78, the instruction at the position corresponding to the first instruction of the program area 51 is stored in the save instruction section 79, and the corresponding valid flag 77 is set to " To enable.

【0028】次に、ステップ72では、ブレークポイン
トを設定する手続きのプログラム領域51の先頭命令に
該当する位置にトラップ命令を埋め込む。このようにし
ておくことにより、当該手続きが呼び出された際には、
トラップ命令が実行されて、プログラム試験装置に制御
が戻されることになる。
Next, at step 72, a trap instruction is embedded at a position corresponding to the head instruction of the program area 51 of the procedure for setting a breakpoint. By doing this, when the procedure is called,
The trap instruction will be executed and control will be returned to the program tester.

【0029】ブレークポイント設定手段2が終了する
と、次にコマンド実行手段3に制御が移る。
When the break point setting means 2 ends, control is next transferred to the command executing means 3.

【0030】図8を参照すると、コマンド実行手段3に
おける処理を表した図である。このコマンド実行手段3
は、以下に示すような処理を行う。
Referring to FIG. 8, it is a diagram showing the processing in the command executing means 3. This command execution means 3
Performs the following processing.

【0031】まず、ステップ81において、停止したブ
レークポイントが手続きに対するものであるか否かを判
定する。ここで、手続きに対するブレークポイントであ
ると判定した場合、その手続き名がブレークポイント情
報テーブル4に存在するか否かを検索する(ステップ8
2)。また、上記ステップ81において、手続きに対す
るブレークポイントでないと判断した場合、通常のブレ
ークポイントの設定であるためロードモジュール5の実
行を停止する(ステップ86)。
First, in step 81, it is determined whether the stopped breakpoint is for a procedure. If it is determined that the breakpoint is a procedure, it is searched whether the procedure name exists in the breakpoint information table 4 (step 8).
2). When it is determined in step 81 that the breakpoint is not the procedure breakpoint, the execution of the load module 5 is stopped because the breakpoint is set normally (step 86).

【0032】次に、上記ステップ82において、手続き
名がブレークポイント情報テーブル4のいずれかのエン
トリの項目42に存在する場合、呼び出し元の手続き名
を取得する(ステップ83)。この呼び出し元手続き名
の取得は、以下のようにして行う。すなわち、一般に手
続きを呼び出す際には、メモリ上のスタックフレームに
戻りアドレスが保存される。従って、呼び出された側の
手続きで呼び出し元手続きを調べるためには、このスタ
ックフレーム内の戻りアドレスを調べ、次にこの戻りア
ドレスがいずれの手続きに属するものかを調べる。いず
れの手続きに属するものかは、上記戻りアドレスが、図
4に示した各手続きに対応するデバッグ情報52中の手
続き開始アドレス部53及び手続き終了アドレス部54
の範囲に含まれているかどうかで判断することができ
る。
Next, in step 82, if the procedure name exists in the item 42 of any entry of the breakpoint information table 4, the procedure name of the caller is acquired (step 83). The acquisition of the caller procedure name is performed as follows. That is, generally, when calling a procedure, the return address is stored in the stack frame on the memory. Therefore, in order to check the calling procedure in the called procedure, the return address in this stack frame is checked, and then the procedure to which this return address belongs is checked. As to which procedure the procedure belongs to, the return address is the procedure start address section 53 and the procedure end address section 54 in the debug information 52 corresponding to each procedure shown in FIG.
It can be judged by whether it is included in the range of.

【0033】上記ステップ82において、手続き名がブ
レークポイント情報テーブル4に存在しないと判定した
場合、通常のブレークポイントの設定であると判断でき
るためロードモジュールの実行を停止する(ステップ8
6)。
When it is determined in step 82 that the procedure name does not exist in the breakpoint information table 4, it can be determined that the breakpoint is set normally, and execution of the load module is stopped (step 8).
6).

【0034】ステップ83により呼び出し元手続き名を
取得した後は、ブレークポイント情報テーブル4の項目
43以降に設定されている呼び出し元の手続き名、すな
わちブレークポイントが設定されている呼び出し元手続
き名、を取得する(ステップ84)。
After the caller procedure name is obtained in step 83, the caller procedure name set in item 43 and subsequent items of the breakpoint information table 4, that is, the caller procedure name in which the breakpoint is set, is set. It is acquired (step 84).

【0035】ステップ83とステップ84により取得し
た呼び出し元の手続き名が、一致しているか否かを判定
する(ステップ85)。一致している場合、ロードモジ
ュール5の実行を停止する(ステップ86)。一致して
いない場合、ブレークポイント情報テーブル4にコマン
ドで指定された呼び出し元の手続き名が他にもあるかな
いかを判定する(ステップ87)。呼び出し元の手続き
名が他には存在しない場合は、ロードモジュール5の実
行を継続する(ステップ88)。呼び出し元の手続き名
が他にも存在する場合は、ステップ84の処理を行う。
It is determined whether or not the procedure names of the caller acquired in steps 83 and 84 match (step 85). If they match, the execution of the load module 5 is stopped (step 86). If they do not match, it is judged whether or not there is another procedure name of the caller specified by the command in the breakpoint information table 4 (step 87). If there is no other procedure name of the calling source, the load module 5 continues execution (step 88). If another procedure name of the calling source exists, the process of step 84 is performed.

【0036】例えば、図2で示されたプログラム例で、
「手続きfunc(エ)が手続きbおよびcから呼び出
された時のみプログラムの実行を停止させる」ブレーク
ポイントの設定コマンドが指定された場合、ブレークポ
イント情報テーブル4には、ブレークポイントを設定す
る手続き名42にfunc、呼び出し元の手続き名4
3,44にbとcがそれぞれ格納されている。ロードモ
ジュール5は実行中にトラップ命令に出会うと実行を一
旦停止する。停止したブレークポイントが手続きfun
cに対するものなので、ブレークポイント情報テーブル
4のブレークポイントを設定する手続き名の中にfun
cが存在するかどうかを検索する。funcが存在する
ので、スタックフレームよりfuncの呼び出し元の手
続き名を調べ、funcの呼び出し元の手続き名はaと
なる。一方、ブレークポイント情報テーブル4の呼び出
し元の手続き名の中から呼び出し元の手続き名bを取得
する。ブレークポイント情報テーブル4より取得した呼
び出し元の手続き名bとスタックフレームより取得した
呼び出し元の手続き名aは一致しないので、さらにブレ
ークポイント情報テーブル4の呼び出し元の手続き名が
存在するか否かを判定する。呼び出し元の手続き名cが
存在するが、スタックフレームより取得した呼び出し元
の手続き名aと一致しないので、ブレークポイント情報
テーブル4の呼び出し元の手続き名が存在するか否かを
判定する。ブレークポイント情報テーブル4の呼び出し
元の手続き名は存在しないので、一旦停止したロードモ
ジュール5の実行を再開する。次に、ロードモジュール
5が実行中にトラップ命令に出会うと、実行を一旦停止
する。同様にスタックフレームより呼び出し元の手続き
名bを取得する。ブレークポイント情報テーブル4より
呼び出し元の手続き名bを取得し、呼び出し元の手続き
名が一致するため、ロードモジュール5の実行を停止す
る。
For example, in the program example shown in FIG.
When a breakpoint setting command is specified that "stops program execution only when procedure func (d) is called from procedures b and c", the procedure name for setting a breakpoint in the breakpoint information table 4 is specified. 42 to func, caller procedure name 4
3 and 44 store b and c, respectively. When the load module 5 encounters a trap instruction during execution, it temporarily stops execution. Stopped breakpoint is procedure fun
It is for c, so in the procedure name for setting a breakpoint in the breakpoint information table 4, "fun"
Search whether c exists. Since the func exists, the procedure name of the caller of the func is checked from the stack frame, and the procedure name of the caller of the func becomes a. On the other hand, the procedure name b of the caller is obtained from the procedure names of the caller in the breakpoint information table 4. Since the caller's procedure name b acquired from the breakpoint information table 4 and the caller's procedure name a acquired from the stack frame do not match, it is further determined whether the caller procedure name in the breakpoint information table 4 exists. judge. The caller procedure name c exists, but it does not match the caller procedure name a acquired from the stack frame. Therefore, it is determined whether or not the caller procedure name in the breakpoint information table 4 exists. Since the procedure name of the caller of the breakpoint information table 4 does not exist, the execution of the load module 5 which has been stopped is restarted. Next, when the load module 5 encounters a trap instruction during execution, it temporarily stops execution. Similarly, the procedure name b of the caller is acquired from the stack frame. The procedure name b of the caller is acquired from the break point information table 4, and since the procedure name of the caller matches, execution of the load module 5 is stopped.

【0037】また、ある手続きに対し通常のブレークポ
イントの設定コマンドを指定してブレークポイントが設
定された場合、指定された手続き名がブレークポイント
情報テーブル4に存在するならば、通常のブレークポイ
ントが設定されたことを示すように、プログラム試験装
置は有効フラグ41を「無効」にする。これにより、後
者のブレークポイントの設定が効果を有し、その手続き
が呼び出された際には呼び出し元にかかわらず実行が停
止するようになる。
When a breakpoint is set by specifying a normal break point setting command for a procedure, if the specified procedure name exists in the break point information table 4, a normal break point is set. The program test apparatus sets the valid flag 41 to "invalid" to indicate that it has been set. This has the effect of setting the latter breakpoint, which causes execution to stop when the procedure is called, regardless of the caller.

【0038】例えば、図2のプログラム例で、「手続き
func(エ)が手続きbから呼び出される時のみプロ
グラムの実行を停止させる」ブレークポイントの設定が
指定され、さらに手続きfunc(エ)に通常のブレー
クポイントの設定が指定されている場合は、手続きa、
bおよびcの手続きfuncの呼び出し全てに対しプロ
グラムの実行が停止する。
For example, in the program example of FIG. 2, the setting of the breakpoint "stop the execution of the program only when the procedure func (d) is called from the procedure b" is specified, and the procedure func (d) is normally set. If the breakpoint setting is specified, the procedure a,
Program execution stops for all calls to procedure func in b and c.

【0039】[0039]

【発明の効果】以上説明したように本発明のプログラム
試験装置では、ある手続きがある特定の手続きの中から
呼び出された時のみプログラムの実行を停止させるよう
にするブレークポイントの設定をコマンドより指定でき
るため、ブレークポイントが設定されている手続きが多
くの様々な手続きから呼び出されている場合であって
も、ブレークポイントに出会う度にプログラムの実行が
停止するわけではなく、無駄な停止を行わないようにで
きるため、プログラムの試験効率が良くなるという効果
がある。
As described above, in the program test apparatus of the present invention, a breakpoint is set by a command so that the execution of the program is stopped only when a certain procedure is called from a specific procedure. Therefore, even if the procedure in which the breakpoint is set is called from many different procedures, the execution of the program does not stop each time the breakpoint is encountered, and no unnecessary stop is performed. Therefore, there is an effect that the test efficiency of the program is improved.

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

【図1】本発明の一実施例のプログラム試験装置の一実
施例の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of an embodiment of a program test apparatus according to an embodiment of the present invention.

【図2】本発明の動作を説明するための対象プログラム
の一例である。
FIG. 2 is an example of a target program for explaining the operation of the present invention.

【図3】本発明の一実施例におけるブレークポイント情
報テーブルの一例である。
FIG. 3 is an example of a breakpoint information table according to an embodiment of the present invention.

【図4】本発明の一実施例におけるロードモジュールを
各手続きごとにメモリ上に展開したイメージの一例であ
る。
FIG. 4 is an example of an image in which a load module according to an embodiment of the present invention is expanded on a memory for each procedure.

【図5】本発明の一実施例におけるトラップ情報テーブ
ルの構成図である。
FIG. 5 is a configuration diagram of a trap information table according to an embodiment of the present invention.

【図6】本発明の一実施例におけるコマンド解析手段の
処理の動作を示す流れ図である。
FIG. 6 is a flow chart showing the operation of the processing of the command analysis means in the embodiment of the present invention.

【図7】本発明の一実施例におけるブレークポイント設
定手段の処理の動作を示す流れ図である。
FIG. 7 is a flow chart showing an operation of processing of a breakpoint setting means in an embodiment of the present invention.

【図8】本発明の一実施例におけるコマンド実行手段の
処理の動作を示す流れ図である。
FIG. 8 is a flow chart showing an operation of a process of a command executing means in the embodiment of the present invention.

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

1 コマンド解析手段 2 ブレークポイント設定手段 3 コマンド実行手段 4 ブレークポイント情報テーブル 5 ロードモジュール 6 プログラム試験装置 7 トラップ情報テーブル 1 Command Analyzing Means 2 Breakpoint Setting Means 3 Command Executing Means 4 Breakpoint Information Tables 5 Load Modules 6 Program Testing Equipment 7 Trap Information Tables

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 ソースレベルでプログラムの動作を試験
するプログラム試験装置であって、 このプログラム試験装置に入力されたコマンドを解析
し、第1の手続きが第2の手続きの中から呼び出された
時のみ前記プログラムの実行を停止させるブレークポイ
ントの設定を行う旨を前記コマンドが意味していた場
合、ブレークポイントを設定する前記第1の手続きの手
続き名と呼び出し元の少なくとも1つの前記第2の手続
きの手続き名をブレークポイント情報テーブルに格納す
るコマンド解析手段と、 このコマンド解析手段により解析されたブレークポイン
トを設定する前記第1の手続きの手続き開始アドレスに
トラップ命令を埋め込むブレークポイント設定手段と、 前記プログラムを実行し、前記ブレークポイント設定手
段により設定されたブレークポイントに達した時に前記
プログラムの実行を一旦停止し、そのブレークポイント
が前記第1の手続きに対するものならば前記第1の手続
きの手続き名が前記ブレークポイント情報テーブルの中
に存在するか否かを検索して、もし存在する場合は前記
ブレークポイント情報テーブルで指定された呼び出し元
の前記第2の手続き名と実際の呼び出し元の手続き名と
を比較して、一致していれば前記プログラムの実行を停
止し、一致していなければ前記プログラムの実行を続行
するコマンド実行手段とを含むことを特徴とするプログ
ラム試験装置。
1. A program test apparatus for testing the operation of a program at a source level, wherein a command input to this program test apparatus is analyzed, and a first procedure is called from a second procedure. If the command means to set a breakpoint that stops the execution of the program only, the procedure name of the first procedure that sets the breakpoint and at least one second procedure of the caller Command analysis means for storing the procedure name of the procedure in a breakpoint information table, breakpoint setting means for embedding a trap instruction at the procedure start address of the first procedure for setting the breakpoint analyzed by the command analysis means, Run the program and set by the breakpoint setting means When the breakpoint is reached, the execution of the program is temporarily stopped, and if the breakpoint is for the first procedure, whether the procedure name of the first procedure exists in the breakpoint information table. If it exists, the second procedure name of the caller specified in the breakpoint information table is compared with the procedure name of the actual caller, and if they match, the program And a command executing means for continuing the execution of the program if they do not coincide with each other.
【請求項2】 ソースレベルでプログラムの動作を試験
するプログラム試験装置におけるブレークポイント設定
方法であって、 前記プログラム試験装置に入力されたコマンドを解析
し、第1の手続きが第2の手続きの中から呼び出された
時のみ前記プログラムの実行を停止させるブレークポイ
ントの設定を行う旨を前記コマンドが意味していた場
合、ブレークポイントを設定する前記第1の手続きの手
続き名と呼び出し元の少なくとも1つの前記第2の手続
きの手続き名をブレークポイント情報テーブルに格納す
るステップと、 ブレークポイントを設定する前記第1の手続きの手続き
開始アドレスにトラップ命令を埋め込むステップと、 前記プログラムを実行し、前記ブレークポイントに達し
た時に前記プログラムの実行を一旦停止するステップ
と、 前記ブレークポイントが前記第1の手続きに対するもの
ならば前記第1の手続きの手続き名が前記ブレークポイ
ント情報テーブルの中に存在するか否かを検索するステ
ップと、 もし前記第1の手続きの手続き名が前記ブレークポイン
ト情報テーブルの中に存在する場合は前記ブレークポイ
ント情報テーブルで指定された呼び出し元の前記第2の
手続き名と実際の呼び出し元の手続き名とを比較するス
テップと、 前記ブレークポイント情報テーブルで指定された呼び出
し元の前記第2の手続き名と実際の呼び出し元の手続き
名とが一致していれば前記プログラムの実行を停止する
ステップとを含むことを特徴とするブレークポイント設
定方法。
2. A method for setting a breakpoint in a program test apparatus for testing the operation of a program at a source level, wherein a command input to the program test apparatus is analyzed, and a first procedure is a second procedure. If the command means to set a breakpoint that stops the execution of the program only when it is called from, at least one of the procedure name and the caller of the first procedure that sets the breakpoint Storing the procedure name of the second procedure in a breakpoint information table; embedding a trap instruction in the procedure start address of the first procedure for setting a breakpoint; executing the program; When the program reaches the And if the breakpoint is for the first procedure, searching for a procedure name of the first procedure in the breakpoint information table; Comparing the procedure name of the caller specified in the breakpoint information table with the procedure name of the actual caller if the procedure name of the procedure exists in the breakpoint information table; And a step of stopping the execution of the program if the second procedure name of the caller specified in the breakpoint information table and the procedure name of the actual caller match. How to set points.
JP5329292A 1993-12-27 1993-12-27 Program testing device and using method for the same Pending JPH07191876A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5329292A JPH07191876A (en) 1993-12-27 1993-12-27 Program testing device and using method for the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5329292A JPH07191876A (en) 1993-12-27 1993-12-27 Program testing device and using method for the same

Publications (1)

Publication Number Publication Date
JPH07191876A true JPH07191876A (en) 1995-07-28

Family

ID=18219834

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5329292A Pending JPH07191876A (en) 1993-12-27 1993-12-27 Program testing device and using method for the same

Country Status (1)

Country Link
JP (1) JPH07191876A (en)

Cited By (3)

* 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
JP2014146358A (en) * 2008-04-07 2014-08-14 International Business Maschines Corporation Debugger data processing system, debugging method and computer program
JP2016528650A (en) * 2013-08-22 2016-09-15 オラクル・インターナショナル・コーポレイション Cloud-based target debugging

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55134448A (en) * 1979-04-04 1980-10-20 Nec Corp Microprogram execution stopping unit
JPH04344938A (en) * 1991-05-23 1992-12-01 Nec Ibaraki Ltd Interruption generation circuit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55134448A (en) * 1979-04-04 1980-10-20 Nec Corp Microprogram execution stopping unit
JPH04344938A (en) * 1991-05-23 1992-12-01 Nec Ibaraki Ltd Interruption generation circuit

Cited By (3)

* 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
JP2014146358A (en) * 2008-04-07 2014-08-14 International Business Maschines Corporation Debugger data processing system, debugging method and computer program
JP2016528650A (en) * 2013-08-22 2016-09-15 オラクル・インターナショナル・コーポレイション Cloud-based target debugging

Similar Documents

Publication Publication Date Title
US6931631B2 (en) Low impact breakpoint for multi-user debugging
US7178135B2 (en) Scope-based breakpoint selection and operation
US20070028240A1 (en) Information processing method and information processing apparatus for processing a plurality of threads
US20030115576A1 (en) Breakpoint safety net
JPH07191876A (en) Program testing device and using method for the same
US7636869B2 (en) Program dynamically burnt system and method
JP2006202102A (en) Simulation apparatus
JPH04153742A (en) Measurement system for program performance
JPH06242989A (en) Memory allocation tracing device
JP2800577B2 (en) Debug device
JPH0253148A (en) Debugging method for test program for input/output device
JPH03282739A (en) Debugging control system
JPH07319730A (en) Test debugging method
JP2001051864A (en) Test conducting system for data processor
CN115292076A (en) Linux system kernel debugging device and method
JPH0816431A (en) Debugging process system for user program
JPH07168743A (en) Information display system in abnormal completion of user program
JPH05204708A (en) Debugger processing system
JPH05233317A (en) Software simulator
JPH05342052A (en) Debugging system
JPH04217034A (en) Display system for program trace
JPS6274130A (en) Data generating system for program structure
JPH0683670A (en) Program test device
JPS61153742A (en) Start controlling system of test program
JP2001067245A (en) Simulation method and simulation device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19971014