JPH1091479A - Program debugging system, program debugging method and storage medium storing debugging program - Google Patents

Program debugging system, program debugging method and storage medium storing debugging program

Info

Publication number
JPH1091479A
JPH1091479A JP8241969A JP24196996A JPH1091479A JP H1091479 A JPH1091479 A JP H1091479A JP 8241969 A JP8241969 A JP 8241969A JP 24196996 A JP24196996 A JP 24196996A JP H1091479 A JPH1091479 A JP H1091479A
Authority
JP
Japan
Prior art keywords
program
data
output
file
result
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
JP8241969A
Other languages
Japanese (ja)
Inventor
Noboru Higuchi
登 樋口
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 JP8241969A priority Critical patent/JPH1091479A/en
Publication of JPH1091479A publication Critical patent/JPH1091479A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To shorten time until a part where the execution result of a program becomes unjust is detected if a file outputted when the program is precisely executed previously exists. SOLUTION: A file acquirement means 1 acquires a result file name when the program precisely operates and a file name outputted by the execution of the program. A file output monitor means 4 recognizes output against the file. An output result comparison means 5 compares data-to be outputted with precise data. When unjust data is outputted as a result, a debugger 7 outputs a message and inputs a debugging command from a user. Since the debugger 7 sets an internal brake point in an output part against the file so as to monitor it, debugging can be executed when unjust data is to be outputted even if the unjust part of the program is not detected.

Description

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

【発明の属する技術分野】本発明はプログラム・デバッ
グ・システム、プログラム・デバッグ方法およびデバッ
グ用プログラムを記憶した記憶媒体に関する。
The present invention relates to a program debug system, a program debug method, and a storage medium storing a debug program.

【0001】[0001]

【従来の技術】一般に、プログラムデバッグは、プログ
ラムの実行結果が、そのプログラムを実行するマシンに
より異なった場合や、ソースプログラムをコンパイルす
るときに指定するオプションにより異なった場合に、そ
のプログラムの動作不正の原因究明のために行われてい
る。
2. Description of the Related Art In general, program debugging is performed when the execution result of a program differs depending on the machine that executes the program or when an option specified when compiling a source program differs. Is being conducted to determine the cause.

【0002】従来のプログラムデバッグ方法の一例が特
開平7−271631号公報に記載されている。この公
報に記載されたプログラムデバッグ方法は、ソースプロ
グラムに所定パターンを埋め込んでコンパイルし、実行
マシンやオプションが異なる2つの実行プログラムを並
行してデバッグし、実行結果の異なる部分を検出するも
のである。ユーザ入出力管理部、2つのデバッグ制御
部、コマンド解析部および中間データ比較部から構成さ
れている。
An example of a conventional program debugging method is described in Japanese Patent Application Laid-Open No. 7-271631. The program debugging method described in this publication embeds a predetermined pattern in a source program, compiles it, debugs two execution programs having different execution machines and options in parallel, and detects different portions of the execution results. . It comprises a user input / output management unit, two debug control units, a command analysis unit, and an intermediate data comparison unit.

【0003】2つのデバッグ制御部のそれぞれは、1つ
の対話型デバッガを制御する。対話型デバッガはデバッ
グ対象である実行プログラムをデバッグする。中間デー
タ比較部は、2つのデバッグ対象である実行プログラム
の実行途中結果を比較し、一致するか否かを判別する。
実行途中結果が一致しない場合は、一致しないデータを
表示する。表示されたデータを参照して実行プログラム
のデバッグが行われる。
[0003] Each of the two debug controllers controls one interactive debugger. The interactive debugger debugs an execution program to be debugged. The intermediate data comparison unit compares the in-execution results of the two execution programs to be debugged and determines whether they match.
If the results do not match during execution, the data that does not match is displayed. The execution program is debugged with reference to the displayed data.

【0004】[0004]

【発明が解決しようとする課題】従来の方法では、不正
箇所に至るまでの途中でのプログラムの停止やそのとき
のデータの表示をユーザデバッグコマンドを入力するこ
とによって行っているため、プログラムの実行結果が不
正になる箇所がわかっていない場合、不正箇所の特定に
時間がかかるという欠点がある。アプリケーションプロ
グラムの中には、同一処理を繰り返し実行するものが多
いが、繰り返し処理の中で結果が不正になっている場合
には、繰り返しごとにデータを比較する必要があり、不
正な結果を生じるまでに数多くのコマンドを実行しなけ
ればならない。
In the conventional method, the program is stopped halfway up to the illegal portion and the data displayed at that time is input by inputting a user debug command. If the location where the result is incorrect is not known, there is a disadvantage that it takes time to specify the incorrect location. Many application programs repeatedly execute the same process, but if the result is incorrect during the repetition process, it is necessary to compare the data at each iteration, resulting in an incorrect result Have to execute many commands by then.

【0005】さらに、従来の方法では、2つの対話型デ
バッガを用いて2つのプログラムを同時にデバッグして
いるため、デバッグに多くの資源を要するという欠点も
ある。すなわち、異なるマシンでの結果を比較する場
合、比較しようとしている2つのマシン資源が同時に利
用できなければならない。また、その2つのマシンがネ
ットワーク資源等で接続されていなければならない。
Further, in the conventional method, since two programs are simultaneously debugged using two interactive debuggers, there is a disadvantage that a large amount of resources are required for debugging. That is, when comparing results on different machines, the two machine resources being compared must be available simultaneously. Also, the two machines must be connected by a network resource or the like.

【0006】また、同じマシン上でコンパイル時に指定
されたオプションが異なる2つのプログラムをデバッグ
する場合には、2つのプログラムと2つの対話型デバッ
ガが動作できるだけの記憶領域が存在しなければならな
い。
When debugging two programs with different options specified at the time of compilation on the same machine, there must be a storage area that can operate the two programs and the two interactive debuggers.

【0007】さらに、従来の方法では、異なるマシンで
プログラムを実行したり、プログラムをコンパイルする
ときに指定するオプションの違い等によって、プログラ
ムの実行結果、特に浮動小数点演算の結果には誤差が発
生する場合があるが、この演算誤差を考慮できないとい
う欠点もある。
Further, in the conventional method, an error occurs in the execution result of the program, especially in the result of the floating-point operation, due to a difference in an option specified when executing the program on a different machine or compiling the program. In some cases, however, there is a disadvantage that this calculation error cannot be considered.

【0008】これは、2つのデバッガで実行されたコマ
ンドの結果を比較する場合、両者の結果が一致するかど
うかで正しく実行できたかを判断しているためである。
This is because when comparing the results of the commands executed by the two debuggers, it is determined whether or not the execution has been performed correctly by checking whether the results of the two match.

【0009】本発明の目的は、正しい結果がわかってい
るプログラムの開発および保守時に正しい結果と異なる
出力結果が生じた時点でデバッグモード(ユーザからの
デバッグコマンド入力待ちの状態)に移行できるデバッ
グ・システムを提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a debug / debug mode capable of shifting to a debug mode (waiting for input of a debug command from a user) when an output result different from the correct result occurs during development and maintenance of a program whose correct result is known. It is to provide a system.

【0010】本発明の他の目的は、正しい結果とデバッ
グ中のプログラムの結果が異なる場合、マシンアーキテ
クチャやコンパイラの機能差を考慮し、演算の誤差を加
味して結果の比較を行うことができるデバッグ・システ
ムを提供することにある。
Another object of the present invention is to compare a result in consideration of a difference in a machine architecture or a function of a compiler and a calculation error in a case where a correct result is different from a result of a program being debugged. To provide a debugging system.

【0011】[0011]

【課題を解決するための手段】本発明の第1のプログラ
ム・デバッグ方法は、プログラムの出力が正しい結果と
異なった時点で、デバッグモードに移行し、プログラム
のデバッグができる。より具体的には、正しい結果が格
納されたファイル名とプログラムの出力ファイル名を取
得するファイル名取得手段(図1の1)と、プログラム
がファイルに出力を行う場合に、出力先のファイルが結
果の比較対象になっているかどうかを確認するファイル
出力監視手段(図1の4)と、正しい結果とプログラム
が出力しようとしているデータを比較する出力結果比較
手段(図1の5)と、正しい結果との比較が指定された
とき、ファイル名取得手段を呼び出し、さらにプログラ
ム内のファイルへの出力部分にブレークポイントを設定
し、その設定されたブレークポイントでプログラムの実
行が停止した場合にファイル出力監視手段を呼び出し、
不正なデータの出力が検出された場合には、その旨を示
すメッセージを出力し、ユーザからのデバッグコマンド
を入力するデバッガとを有する。
According to the first program debugging method of the present invention, when the output of the program is different from the correct result, the program shifts to the debug mode and the program can be debugged. More specifically, a file name acquisition unit (1 in FIG. 1) for acquiring a file name in which a correct result is stored and an output file name of a program, and an output destination file when the program outputs to a file. A file output monitoring unit (4 in FIG. 1) for confirming whether or not the result is to be compared, an output result comparison unit (5 in FIG. 1) for comparing the correct result with the data to be output by the program, When the comparison with the result is specified, the file name acquisition unit is called, a breakpoint is set in the output part to the file in the program, and the file is output when the program execution stops at the set breakpoint. Call monitoring means,
When an output of incorrect data is detected, a debugger that outputs a message to that effect and inputs a debug command from a user is provided.

【0012】また、本発明の第2のプログラム・デバッ
グ方法は、演算の誤差を考慮してプログラムの出力デー
タが正しいかどうかを判定する。具体的には許される誤
差の範囲を取得する誤差範囲取得手段(図7の3)と、
正しい結果に対してプログラムが出力しようとしている
データが指定された誤差範囲に入っているかどうかを判
定する出力結果判定手段(図7の6)とを有する。
Further, in the second program debugging method of the present invention, it is determined whether or not the output data of the program is correct in consideration of a calculation error. More specifically, an error range obtaining unit (3 in FIG. 7) for obtaining an allowable error range,
Output result determining means (6 in FIG. 7) for determining whether or not the data to be output by the program with respect to a correct result falls within a specified error range.

【0013】さらに、本発明の第3のプログラム・デバ
ッグ方法は、出力ファイルごとに許される誤差の範囲が
設定できる。具体的には、正しい結果が格納されている
ファイル名、プログラムが出力するファイル名、および
出力するファイルごとの許される誤差の範囲を取得する
ファイル情報取得手段(図13の2)を有する。
Further, in the third program debugging method of the present invention, an allowable error range can be set for each output file. Specifically, it has file information acquisition means (2 in FIG. 13) for acquiring a file name in which correct results are stored, a file name output by the program, and an allowable error range for each output file.

【0014】本発明の第1のプログラム・デバッグ・シ
ステムは、正しいデータを予め格納した第1の格納手段
と、第2の格納手段と、前記第2の格納手段へのデータ
の出力を指示するデータ出力指示部分にブレークポイン
トが設定されたデバッグ対象プログラムを実行し、該プ
ログラムの実行が前記ブレークポイントで停止した場合
に、前記データ出力指示部分の指示により前記第2の格
納手段に出力されるデータと該データに対応する前記第
1の格納手段内の正しいデータとを比較し、前記プログ
ラムの検査を行うデバッグ手段とを備える。
A first program debugging system of the present invention instructs a first storage unit in which correct data is stored in advance, a second storage unit, and an output of data to the second storage unit. A debug target program having a breakpoint set in a data output instruction portion is executed, and when the execution of the program stops at the breakpoint, the program is output to the second storage means according to the instruction of the data output instruction portion. And debugging means for comparing the data with correct data in the first storage means corresponding to the data, and checking the program.

【0015】本発明の第2のプログラム・デバッグ・シ
ステムは、正しいデータを予め格納した第1の格納手段
と、第2の格納手段と、誤差許容範囲を示す許容値を格
納した第3の格納手段と、前記第2の格納手段へのデー
タの出力を指示するデータ出力指示部分にブレークポイ
ントが設定されたデバッグ対象プログラムを実行し、該
プログラムの実行が前記ブレークポイントで停止した場
合に、前記データ出力指示部分の指示により前記第2の
格納手段に出力されるデータと該データに対応する前記
第1の格納手段内の正しいデータとの差を求め、該差が
前記第3の格納手段に格納された前記許容値の示す許容
範囲内であるか否かを調べ、前記プログラムの検査を行
うデバッグ手段とを備える。
A second program debug system according to the present invention comprises a first storage means for storing correct data in advance, a second storage means, and a third storage means for storing an allowable value indicating an allowable error range. Means for executing a debug target program having a breakpoint set in a data output instruction portion for instructing output of data to the second storage means, and when the execution of the program is stopped at the breakpoint, The difference between the data output to the second storage means in accordance with the instruction of the data output instruction part and the correct data in the first storage means corresponding to the data is obtained, and the difference is stored in the third storage means. Debugging means for examining whether or not the value is within an allowable range indicated by the stored allowable value and inspecting the program.

【0016】[0016]

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

【0017】図1を参照すると、本発明の第1の実施の
形態は、キーボード等の入力装置16と、ディスプレイ
装置等の出力装置15と、プログラムの実行を制御する
制御部17と、プログラムの実行に必要な情報を記憶す
るメモリ18と、プログラムの出力結果等を記憶する外
部記憶装置19とを備えている。
Referring to FIG. 1, in a first embodiment of the present invention, an input device 16 such as a keyboard, an output device 15 such as a display device, a control unit 17 for controlling execution of a program, and a program A memory 18 for storing information required for execution and an external storage device 19 for storing output results of the program and the like are provided.

【0018】制御部17は、デバッガ7と、デバッグ対
象であるプログラム8とを含む。
The control section 17 includes a debugger 7 and a program 8 to be debugged.

【0019】デバッガ7は、ファイル名取得手段1と、
ファイル出力監視手段4と、出力結果比較手段5とを備
えている。デバッガ7は外部記憶装置19内の出力ファ
イル13と結果ファイル14とを比較することが入力装
置16から指定されている場合、ファイル名取得手段1
を起動し、プログラム8内にある、ファイルへの出力部
分にブレークポイントを設定し、プログラムを実行す
る。設定したブレークポイントによりプログラム8の実
行が停止した場合には、ファイル出力監視手段4が起動
される。もし、出力ファイル13に出力しようとしてい
る出力バッファ12内のデータと結果ファイル14内の
対応するデータとが一致しないと判断された場合には、
その旨が出力装置15に出力され、デバッグモードに移
行して、入力装置16からデバッグコマンドが受け付け
られる。出力バッファ12内のデータと結果ファイル1
4内の対応するデータとが一致しているか、または、比
較する対象のファイルへの出力ではない場合には、次の
ブレークポイントまでプログラム8の実行を継続する。
The debugger 7 comprises: a file name obtaining means 1;
A file output monitoring unit 4 and an output result comparison unit 5 are provided. When it is specified from the input device 16 that the output file 13 in the external storage device 19 and the result file 14 are to be compared, the debugger 7 acquires the file name
Is started, a breakpoint is set in the output portion to the file in the program 8, and the program is executed. When the execution of the program 8 is stopped by the set break point, the file output monitoring means 4 is activated. If it is determined that the data in the output buffer 12 to be output to the output file 13 does not match the corresponding data in the result file 14,
This is output to the output device 15, the mode is shifted to the debug mode, and the debug command is received from the input device 16. Data in output buffer 12 and result file 1
If the corresponding data in 4 does not match or is not output to a file to be compared, the execution of the program 8 is continued until the next breakpoint.

【0020】ファイル名取得手段1は、入力装置16か
ら入力された結果ファイル14の名前(結果ファイル
名)および出力ファイル13の名前(出力ファイル名)
を取得して、メモリ18上にファイル対応表9の領域を
確保し、ファイル対応表9に、取得した結果ファイル名
と出力ファイル名とを格納する。
The file name obtaining means 1 includes a name of the result file 14 (result file name) input from the input device 16 and a name of the output file 13 (output file name).
Is obtained, an area of the file correspondence table 9 is secured in the memory 18, and the obtained result file name and output file name are stored in the file correspondence table 9.

【0021】ファイル出力監視手段4は、プログラム8
が出力バッファ12の内容を出力しようとしているファ
イルの名前がファイル対応表9内の出力ファイル名のい
ずれかと一致する場合に、出力結果比較手段5を起動す
る。
The file output monitoring means 4 includes a program 8
Starts the output result comparison means 5 when the name of the file whose contents are to be output from the output buffer 12 matches one of the output file names in the file correspondence table 9.

【0022】出力結果比較手段5は、出力バッファ12
内のデータとそれに対応する結果ファイル14内のデー
タとを比較し、それらが一致するかどうかを判断する。
The output result comparing means 5 includes an output buffer 12
Is compared with the corresponding data in the result file 14 to determine whether they match.

【0023】プログラム8はデバッガ7がデバッグ対象
とするプログラムである。
The program 8 is a program to be debugged by the debugger 7.

【0024】メモリ18は、ファイル対応表9と、出力
バッファ12とを備えている。
The memory 18 has a file correspondence table 9 and the output buffer 12.

【0025】ファイル対応表9は、プログラム8が出力
する出力ファイル13の名前すなわち出力ファイル名
と、プログラム8が正しく動作した場合に出力されるデ
ータを格納すべき結果ファイル14の名前すなわち結果
ファイル名とを対にして格納している。プログラム8が
実行中に出力するファイルが複数あり、それぞれに対応
する正しいデータが格納されたファイルが比較対象とし
て指定されている場合は、対応表9には複数のファイル
名の対が格納される。
The file correspondence table 9 contains the name of the output file 13 output by the program 8, ie, the output file name, and the name of the result file 14, in which data output when the program 8 operates correctly, ie, the result file name, is stored. And are stored in pairs. When there are a plurality of files output by the program 8 during execution, and a file in which correct data corresponding to each is specified as a comparison target, a plurality of file name pairs are stored in the correspondence table 9. .

【0026】出力バッファ12は、プログラム8がファ
イルに出力するデータを一時的に格納する領域、あるい
は、プログラム8がファイルに出力しようとするデータ
が一時的に格納されている領域である。
The output buffer 12 is an area for temporarily storing data to be output to a file by the program 8, or an area for temporarily storing data to be output to a file by the program 8.

【0027】外部記憶装置19は、出力ファイル13と
結果ファイル14とを備えている。
The external storage device 19 has an output file 13 and a result file 14.

【0028】出力ファイル13は、プログラム8がデー
タを出力するファイルである。
The output file 13 is a file to which the program 8 outputs data.

【0029】結果ファイル14は、プログラム8が正し
く動作した場合に出力ファイル13に出力されるはずで
あるデータが格納されているファイルである。
The result file 14 is a file that stores data that should be output to the output file 13 when the program 8 operates correctly.

【0030】次に、図1から図5を参照して、本発明の
第1の実施の形態の動作について説明する。
Next, the operation of the first embodiment of the present invention will be described with reference to FIGS.

【0031】プログラム8のソースプログラムを他のマ
シンでコンパイルおよび実行させたり、あるいは、同じ
マシン上で他のオプションによってコンパイルし、実行
させた等により、既にプログラム8の正しい出力結果が
得られている場合、そのファイル名とプログラム8の実
行によって出力されるファイル名を対にした情報を入力
装置16から、ユーザが予め入力する。
A correct output result of the program 8 has already been obtained by compiling and executing the source program of the program 8 on another machine, or compiling and executing the same program with other options on the same machine. In this case, the user inputs in advance information from the input device 16 in which the file name and the file name output by the execution of the program 8 are paired.

【0032】デバッガ7は、この比較対象のファイルの
対が入力されているかどうかを判断し(図2のステップ
701)、入力されている(比較ファイルが指定されて
いる)場合には、ファイル名取得手段1を起動する(図
2のステップ702)。
The debugger 7 determines whether or not the pair of files to be compared has been input (step 701 in FIG. 2). If the pair has been input (the comparison file has been specified), the file name is determined. The acquisition unit 1 is started (Step 702 in FIG. 2).

【0033】ファイル名取得手段1は、指定されている
比較ファイルの対の数およびファイル名の長さ等を考慮
し、メモリ上に正しい結果が格納されているファイル
(結果ファイル14)の名前(結果ファイル名)とプロ
グラム8の実行によって出力されるファイル(出力ファ
イル13)の名前(出力ファイル名)が格納できるだけ
の領域(ファイル対応表9)を確保し(図3のステップ
101)、結果ファイル名および出力ファイル名をファ
イル対応表9に格納する(図3のステップ102)。比
較ファイルの対が複数ある場合には、それら全てをファ
イル対応表9に格納する。
The file name obtaining means 1 takes into account the number of designated comparison file pairs, the length of the file name, etc., and the name of the file (result file 14) in which the correct result is stored in the memory. The result file name) and the area (file correspondence table 9) enough to store the name (output file name) of the file (output file 13) output by the execution of the program 8 are secured (step 101 in FIG. 3). The name and output file name are stored in the file correspondence table 9 (step 102 in FIG. 3). When there are a plurality of pairs of comparison files, all of them are stored in the file correspondence table 9.

【0034】ファイル名取得手段1の処理が終了した
後、デバッガ7はプログラム8内の、ファイルに対する
出力部分にブレークポイントを設定する(図2のステッ
プ705)。
After the processing of the file name obtaining means 1 is completed, the debugger 7 sets a breakpoint at an output portion for the file in the program 8 (step 705 in FIG. 2).

【0035】ブレークポイントの設定後、あるいは比較
対象ファイルの対が指定されていない場合には、入力装
置16からユーザがデバッグコマンドを入力するのを待
つ(図2のステップ706)。
After setting a breakpoint, or when a pair of files to be compared is not specified, the process waits for a user to input a debug command from the input device 16 (step 706 in FIG. 2).

【0036】ユーザがデバッグコマンドを入力した場
合、それが終了コマンドであれば、デバッガ7はその動
作を終了する(図2のステップ707)。
When the user inputs a debug command and the command is an end command, the debugger 7 ends its operation (step 707 in FIG. 2).

【0037】入力されたデバッグコマンドが終了コマン
ドでなければ、指定されたデバッグコマンドの処理を行
う(図2のステップ708)。
If the input debug command is not the end command, the designated debug command is processed (step 708 in FIG. 2).

【0038】指定されたデバッグコマンドがプログラム
8の実行であり、かつ、プログラム8の実行がブレーク
ポイントで停止した場合、停止したブレークポイントが
ステップ705で設定したブレークポイントかどうかを
判断し(ステップ709)、ステップ705で設定した
ブレークポイントでの停止の場合には、ファイル出力監
視手段4を起動する(ステップ710)。
If the designated debug command is the execution of the program 8 and the execution of the program 8 is stopped at a breakpoint, it is determined whether the stopped breakpoint is the breakpoint set in step 705 (step 709). If the operation is stopped at the break point set in step 705, the file output monitoring means 4 is activated (step 710).

【0039】ファイル出力監視手段4はプログラム8が
出力しようとしているファイルの名前がファイル対応表
9内の出力ファイル名と一致するかどうかを判断する
(図4のステップ401)。もし、ファイル対応表9内
に複数の出力ファイル名がある場合には、その中のいず
れかと一致するかどうかを判断する。そして、ファイル
対応表9内の出力ファイル名に一致するものがあった場
合のみ、出力結果比較手段5を起動する(図4のステッ
プ402)。
The file output monitoring means 4 determines whether the name of the file to be output by the program 8 matches the output file name in the file correspondence table 9 (step 401 in FIG. 4). If there are a plurality of output file names in the file correspondence table 9, it is determined whether or not the output file names match any of them. Then, only when there is an output file name in the file correspondence table 9 that matches the output file name, the output result comparison means 5 is started (step 402 in FIG. 4).

【0040】出力結果比較手段5は、対応する結果ファ
イル14がオープンされているかどうかを判断し(図5
のステップ501)、オープンされていない場合には結
果ファイルをオープンする(図5のステップ502)。
続いて、出力バッファ12にデータが格納されているか
どうかを判断し(図5のステップ503)、データが格
納されていない場合には、ファイル出力監視手段4に不
一致データがなかったことを示す戻り値を返す(図5の
ステップ509)。出力バッファ12にデータがある場
合には、結果ファイルからデータを入力し(図5のステ
ップ504)、出力バッファ12からもデータを1つ入
力し(図5のステップ505)、両者を比較する(図5
のステップ507)。両者が一致していない場合には、
不正なデータの出力であることを示す戻り値をファイル
出力監視手段4に返す(図5のステップ508)。2つ
のデータが一致している場合には、さらに出力バッファ
12内の次のデータについて同様の処理(図5のステッ
プ503からステップ507)を繰り返す。
The output result comparison means 5 determines whether the corresponding result file 14 is open (FIG. 5).
In step 501), if the file is not opened, the result file is opened (step 502 in FIG. 5).
Subsequently, it is determined whether or not data is stored in the output buffer 12 (step 503 in FIG. 5). If no data is stored, the file output monitoring means 4 returns to indicate that there is no inconsistent data. The value is returned (step 509 in FIG. 5). If there is data in the output buffer 12, data is input from the result file (step 504 in FIG. 5), one data is also input from the output buffer 12 (step 505 in FIG. 5), and both are compared ( FIG.
Step 507). If they do not match,
A return value indicating that invalid data is output is returned to the file output monitoring means 4 (step 508 in FIG. 5). If the two data match, the same processing (steps 503 to 507 in FIG. 5) is repeated for the next data in the output buffer 12.

【0041】ファイル出力監視手段4は出力結果比較手
段5の戻り値をそのままデバッガ7に戻す。
The file output monitoring means 4 returns the return value of the output result comparing means 5 to the debugger 7 as it is.

【0042】デバッガ7はファイル出力監視手段4から
の戻り値によって不正なデータの出力かどうかを判断し
(図2のステップ711)、不正なデータの出力の場合
には出力しようとしているデータが正しい結果と一致し
ない旨のメッセージを出力装置15に出力し(図2のス
テップ713)、次のデバッグコマンドの入力を待つ
(図2のステップ706)。不正なデータの出力ではな
い場合には、次のブレークポイントまでプログラム8を
実行する(図2のステップ714)。
The debugger 7 determines whether or not the output is incorrect data based on the return value from the file output monitoring means 4 (step 711 in FIG. 2). If the output is incorrect, the data to be output is correct. A message to the effect that the result does not match is output to the output device 15 (step 713 in FIG. 2), and input of the next debug command is waited for (step 706 in FIG. 2). If the output is not invalid data, the program 8 is executed until the next breakpoint (step 714 in FIG. 2).

【0043】上述した本発明の第1の実施の形態は、フ
ァイルに出力されるデータが不正な場合には、不正が発
生する部分がどこであるか、あるいは、どのデータが不
正になるか、といった情報がなくてもデバッグでき、こ
のため、デバッガの操作性が向上し、デバッグ作業の効
率も向上するという効果を奏する。
According to the first embodiment of the present invention, when data output to a file is invalid, it is necessary to determine where the invalidity occurs or what data becomes invalid. Debugging can be performed without any information, so that the operability of the debugger is improved and the efficiency of the debugging work is also improved.

【0044】次に、本発明の第1の実施の形態の一実施
例の動作を詳細に説明する。
Next, the operation of one example of the first embodiment of the present invention will be described in detail.

【0045】図6を参照すると、ユーザは比較対象ファ
イルの対として、RESULT1とOUTPUT1とを
環境変数CMPFILE1に指定したとする。また、デ
バッグ対象のプログラム8の名前がa.out、デバッ
ガ7を起動するコマンドをdebugとする。
Referring to FIG. 6, it is assumed that the user has designated RESULT1 and OUTPUT1 as an environment variable CMPFILE1 as a pair of files to be compared. The name of the program 8 to be debugged is a. out, and the command for starting the debugger 7 is debug.

【0046】“debug a.out”によってデバ
ッガ7が起動されると、比較対象ファイルが指定されて
いるので、ファイル名取得手段1が起動され(図2のス
テップ702)、ファイル対応表9を作成する(図3の
ステップ101)。すなわち、ファイル対応表9の中に
は、結果ファイル名としてのRESULT1と、プログ
ラム8(a.out)の出力ファイル名としてのOUT
PUT1とが格納される(図3のステップ102)。
When the debugger 7 is started by “debug a.out”, the file to be compared is specified, so the file name obtaining means 1 is started (step 702 in FIG. 2), and the file correspondence table 9 is created. (Step 101 in FIG. 3). That is, RESULT1 as a result file name and OUT as an output file name of the program 8 (a.out) are included in the file correspondence table 9.
PUT1 is stored (step 102 in FIG. 3).

【0047】また、デバッガ7によって、プログラム8
(a.out)の、ファイルへの出力部分に対してブレ
ークポイントが設定される(図2のステップ705)。
The debugger 7 causes the program 8
A breakpoint is set for the output portion of (a.out) to the file (step 705 in FIG. 2).

【0048】プログラム8(a.out)の実行を指示
するデバッグコマンドrunが入力されると、プログラ
ム8(a.out)が実行される(図2のステップ70
8)。途中、出力ファイル(OUTPUT1)への出力
のたびに、図2のステップ705で設定したブレークポ
イントでプログラム8(a.out)の実行が停止し、
ファイル出力監視手段4が起動され(図2のステップ7
10)、さらに出力結果比較手段5が起動される(図4
のステップ402)。
When a debug command run instructing execution of the program 8 (a.out) is input, the program 8 (a.out) is executed (step 70 in FIG. 2).
8). On the way, every time the output to the output file (OUTPUT1) is performed, the execution of the program 8 (a.out) stops at the breakpoint set in step 705 in FIG.
The file output monitoring means 4 is started (step 7 in FIG. 2).
10), and the output result comparing means 5 is activated (FIG. 4).
Step 402).

【0049】出力結果比較手段5では、最初のうちは、
図6の例では、出力ファイル(RESULT1)内のデ
ータと一致したデータが出力ファイル(OUTPUT
1)に出力されているので、戻り値として0を返す(図
5のステップ509)。そのため、不正なデータの出力
がなかったと判断され(図2のステップ711)、次の
ブレークポイントまでプログラム8(a.out)の実
行が継続される(図2のステップ714)。しかし、図
6に示されるように、出力バッファ12に“31”が格
納されたとき、対応する結果ファイル(RESULT
1)内のデータの値は“1362”であり、両者は一致
しない。そのため、出力結果比較手段5から不正なデー
タ出力を示す戻り値1が返却される(図5のステップ5
08)。
In the output result comparing means 5, at first,
In the example of FIG. 6, the data that matches the data in the output file (RESULT1) is stored in the output file (OUTPUT).
Since it is output to 1), 0 is returned as a return value (step 509 in FIG. 5). Therefore, it is determined that there is no output of incorrect data (step 711 in FIG. 2), and the execution of the program 8 (a.out) is continued until the next breakpoint (step 714 in FIG. 2). However, as shown in FIG. 6, when "31" is stored in the output buffer 12, the corresponding result file (RESULT) is stored.
The value of the data in 1) is “1362”, and they do not match. Therefore, the output result comparison means 5 returns a return value 1 indicating an invalid data output (step 5 in FIG. 5).
08).

【0050】これにより、デバッガ7は不正なデータが
出力されたと判断し(図2のステップ711)、不正な
データが出力されたことを示すメッセージを出力装置1
5に表示し(図2のステップ713)、ユーザからのデ
バッグコマンド入力待ち状態になる(図2のステップ7
06)。
As a result, the debugger 7 determines that incorrect data has been output (step 711 in FIG. 2), and outputs a message indicating that the incorrect data has been output to the output device 1.
5 (step 713 in FIG. 2), and waits for a debug command input from the user (step 7 in FIG. 2).
06).

【0051】次に、本発明の第2の実施の形態について
図面を参照して詳細に説明する。
Next, a second embodiment of the present invention will be described in detail with reference to the drawings.

【0052】図7を参照すると、本発明の第2の実施の
形態は、図1に示された第1の実施の形態における構成
に加え、誤差範囲取得手段3と、誤差許容範囲格納手段
10とを有し、出力結果比較手段5の代わりに出力結果
判定手段6を有する点で異なる。
Referring to FIG. 7, in the second embodiment of the present invention, in addition to the configuration of the first embodiment shown in FIG. 1, error range obtaining means 3 and error allowable range storage means 10 are provided. And an output result determination unit 6 instead of the output result comparison unit 5.

【0053】誤差範囲取得手段3は、入力装置16から
出力ファイル1(13a)、出力ファイル2(13b)
および出力ファイル3(13c)に対して許される誤差
の範囲が入力されている場合に、その値を誤差許容範囲
格納手段10に格納する。
The error range obtaining means 3 receives the output file 1 (13a) and the output file 2 (13b) from the input device 16.
If an allowable error range is input to the output file 3 (13c), the value is stored in the allowable error storage unit 10.

【0054】出力結果判定手段6は、プログラム8が出
力ファイル1(13a)、出力ファイル2(13b)お
よび出力ファイル3(13c)に対して出力しようとす
るデータと、それぞれの出力ファイルに対応して正しい
結果が格納されている結果ファイル1(14a)、結果
ファイル2(14b)および結果ファイル3(14c)
内の対応するデータとの誤差が、誤差許容範囲格納手段
10に格納されている誤差の範囲内にあるかどうかを判
定する。
The output result judging means 6 corresponds to the data which the program 8 intends to output to the output file 1 (13a), the output file 2 (13b) and the output file 3 (13c), and the respective output files. File 1 (14a), result file 2 (14b) and result file 3 (14c) in which correct results are stored
It is determined whether or not the error with the corresponding data in the range is within the range of the error stored in the error allowable range storage means 10.

【0055】誤差許容範囲格納手段10には、各結果フ
ァイル1,2および3(14a,14bおよび14c)
と各出力ファイル1,2および3(13a,13bおよ
び13c)とのそれぞれ対応するデータ間で許される誤
差の値が誤差範囲取得手段3により格納されている。
Each of the result files 1, 2, and 3 (14a, 14b, and 14c) is stored in the error allowable range storage means 10.
The error range obtaining means 3 stores the value of the error allowed between the data corresponding to the output files 1, 2 and 3 (13a, 13b and 13c).

【0056】次に、本発明の第2の実施の形態の動作を
図7から図11を参照して詳細に説明する。
Next, the operation of the second embodiment of the present invention will be described in detail with reference to FIGS.

【0057】デバッガ7がファイル名取得手段1を起動
し(図8のステップ702)、ファイル名取得手段1の
処理が終了するまでは、第1の実施の形態の動作と同一
であるため説明は省略する。その後、デバッガ7は誤差
範囲取得手段3を起動する(図8のステップ703)。
The operation until the debugger 7 activates the file name obtaining means 1 (step 702 in FIG. 8) and the processing of the file name obtaining means 1 is completed is the same as the operation of the first embodiment. Omitted. Thereafter, the debugger 7 activates the error range obtaining means 3 (Step 703 in FIG. 8).

【0058】誤差範囲取得手段3は、誤差範囲が指定さ
れているかどうかを判断し(図9のステップ301)、
指定されている場合には、指定された値を取得し(図9
のステップ302)、その値を誤差許容範囲格納手段1
0に格納する(図9のステップ303)。誤差範囲が指
定されていない場合には、誤差許容範囲格納手段10に
値0を格納する(図9のステップ304)。
The error range obtaining means 3 determines whether an error range has been designated (step 301 in FIG. 9).
If specified, the specified value is obtained (FIG. 9).
Step 302), and stores the value in the error tolerance storage unit 1.
0 (step 303 in FIG. 9). If the error range is not specified, the value 0 is stored in the error allowable range storage means 10 (Step 304 in FIG. 9).

【0059】誤差範囲取得手段3を起動した後に、デバ
ッガ7がプログラム8内の、ファイルに対する出力部分
にブレークポイントを設定する処理(図8のステップ7
05)から、ファイル出力監視手段4がプログラム8が
出力しようとしているファイル名がファイル対応表9内
の出力ファイル名のいずれかと一致するかどうかを判断
する処理(図10のステップ401)までは、第1の実
施の形態の動作と同一であるので、説明は省略する。
After the error range obtaining means 3 is activated, the debugger 7 sets a breakpoint at an output portion for a file in the program 8 (step 7 in FIG. 8).
05) to the processing (step 401 in FIG. 10) in which the file output monitoring means 4 determines whether the file name that the program 8 is trying to output matches any of the output file names in the file correspondence table 9. Since the operation is the same as that of the first embodiment, the description is omitted.

【0060】プログラム8が出力しようとしているファ
イルがファイル対応表9内の出力ファイル名のいずれか
と一致した場合には、ファイル出力監視手段4は、出力
結果判定手段6を起動する(図10のステップ40
3)。
If the file to be output by the program 8 matches one of the output file names in the file correspondence table 9, the file output monitoring means 4 activates the output result judging means 6 (step in FIG. 10). 40
3).

【0061】出力結果判定手段6は、プログラム8が出
力しようとしているファイル(出力ファイル)に対応す
る正しい結果が格納されているファイル(結果ファイ
ル)が既にオープンされているかどうかを判断し(図1
1のステップ601)、オープンされていなければオー
プンする(図11のステップ602)。次に、出力バッ
ファ12にデータが格納されているかどうかを判断し
(図11のステップ603)、データが格納されていな
ければファイル出力監視手段4に不正なデータがなかっ
たことを示す値を返す(図11のステップ609)。出
力バッファ12にデータが格納されている場合、結果フ
ァイルからデータを1つ入力し(図11のステップ60
4)、出力ファイル12からもデータを1つ入力し(図
11のステップ605)、両者の相対誤差を計算する
(図11のステップ606)。計算した相対誤差と誤差
許容範囲格納手段10に格納されている値とを比較する
(図11のステップ607)。計算した相対誤差の方が
大きければ不正なデータの出力を示す戻り値をファイル
出力監視手段4に返す(図11のステップ608)。一
方、計算した相対誤差が、誤差許容範囲格納手段10に
格納されている値以下の場合には、出力バッファ12内
の次のデータについて同様の処理(図11のステップ6
03からステップ607)を繰り返す。
The output result judging means 6 judges whether a file (result file) storing a correct result corresponding to a file (output file) to be output by the program 8 has already been opened (FIG. 1).
(Step 601 in FIG. 11), and open if not opened (Step 602 in FIG. 11). Next, it is determined whether data is stored in the output buffer 12 (step 603 in FIG. 11), and if no data is stored, a value indicating that there is no invalid data is returned to the file output monitoring means 4. (Step 609 in FIG. 11). When data is stored in the output buffer 12, one data is input from the result file (step 60 in FIG. 11).
4) One data is also input from the output file 12 (step 605 in FIG. 11), and the relative error between them is calculated (step 606 in FIG. 11). The calculated relative error is compared with the value stored in the error allowable range storage means 10 (Step 607 in FIG. 11). If the calculated relative error is larger, a return value indicating the output of incorrect data is returned to the file output monitoring means 4 (step 608 in FIG. 11). On the other hand, if the calculated relative error is equal to or less than the value stored in the error allowable range storage means 10, the same processing is performed for the next data in the output buffer 12 (step 6 in FIG. 11).
From step 03, step 607) is repeated.

【0062】ファイル出力監視手段4は、出力結果判定
手段6の戻り値をそのままデバッガ7に戻す。
The file output monitoring means 4 returns the return value of the output result judgment means 6 to the debugger 7 as it is.

【0063】ファイル出力監視手段4の処理が終了した
後のデバッガ7の処理は、第1の実施の形態の動作と同
一であるので説明は省略する。
The processing of the debugger 7 after the processing of the file output monitoring means 4 has been completed is the same as the operation of the first embodiment, and will not be described.

【0064】上述した本発明の第2の実施の形態は、プ
ログラム8が出力するデータと正しい結果のデータとの
比較において、マシンアーキテクチャやプログラムをコ
ンパイルするときのオプションの差等によって生じる演
算誤差を考慮することができ、演算誤差のために正しい
結果と僅かの違いが生じたために不正なデータの出力で
あることを示すメッセージが表示されるのを抑止するこ
とができる。このため、表示されたメッセージが演算誤
差によるものかどうかをユーザが確認する必要がなくな
り、デバッグ作業の効率が向上するという効果を奏す
る。
According to the second embodiment of the present invention, in comparing the data output by the program 8 with the data of the correct result, the calculation error caused by the difference in the machine architecture or the option at the time of compiling the program is eliminated. This can be taken into account, and the display of a message indicating incorrect data output due to a slight difference from a correct result due to an arithmetic error can be suppressed. This eliminates the need for the user to check whether the displayed message is due to a calculation error, and has the effect of improving the efficiency of the debugging operation.

【0065】次に、本発明の第2の実施の形態の一実施
例の動作を詳細に説明する。
Next, the operation of one example of the second embodiment of the present invention will be described in detail.

【0066】図12を参照すると、ユーザは比較対象フ
ァイルの対として、RESULT1とOUTPUT1と
を環境変数CMPFILE1に、RESULT2とOU
TPUT2とを環境変数CMPFILE2に、RESU
LT3とOUTPUT3とを環境変数CMPFILE3
に、それぞれ指定したとする。また、許される誤差の範
囲として環境変数CMPERRORに値0.0001が
指定されたとする。さらに、デバッグ対象のプログラム
8の名前がa.out、デバッガ7を起動するコマンド
をdebugとする。
Referring to FIG. 12, the user sets RESULT1 and OUTPUT1 as environment variables CMPFILE1 and RESULT2 and OU
TPUT2 and the environment variable CMPFILE2, and RESU
LT3 and OUTPUT3 are converted into environment variables CMPFILE3.
It is assumed that each is specified. Further, it is assumed that a value of 0.0001 is specified in the environment variable CMPERROR as a permissible error range. Further, the name of the program 8 to be debugged is a. out, and the command for starting the debugger 7 is debug.

【0067】“debug a.out”によってデバ
ッガが起動されると、比較対象ファイルが指定されてい
るので、ファイル名取得手段1が起動され(図8のステ
ップ702)、ファイル対応表9を作成する(図3のス
テップ101)。ファイル対応表9の中には、結果ファ
イル名としてのRESULT1、RESULT2および
RESULT3と、プログラム8(a.out)の出力
ファイル名としてのOUTPUT1、OUTPUT2お
よびOUTPUT3とがそれぞれ対になって格納される
(図3のステップ102)。
When the debugger is started by "debug a.out", the file to be compared is specified, so the file name obtaining means 1 is started (step 702 in FIG. 8), and the file correspondence table 9 is created. (Step 101 in FIG. 3). In the file correspondence table 9, RESULT1, RESULT2, and RESULT3 as the result file names and OUTPUT1, OUTPUT2, and OUTPUT3 as the output file names of the program 8 (a.out) are stored as a pair, respectively ( Step 102 in FIG. 3).

【0068】また、デバッガによって、プログラム8
(a.out)の、ファイルへの出力部分に対してブレ
ークポイントが設定される(図8のステップ705)。
Also, the program 8
A breakpoint is set for the output portion of (a.out) to the file (step 705 in FIG. 8).

【0069】プログラム8(a.out)の実行を指示
するデバッグコマンドrunが入力されると、プログラ
ム8(a.out)が実行される(図8のステップ70
8)。途中、ファイル名がOUTPUT1またはOUT
PUT2またはOUTPUT3のファイルへの出力が生
じると、そのたびに図8のステップ705で設定したブ
レークポイントでプログラム8(a.out)の実行が
停止し、ファイル出力監視手段4が起動され(図2のス
テップ710)、さらに出力結果判定手段6が起動され
る(図10のステップ403)。
When a debug command run instructing execution of program 8 (a.out) is input, program 8 (a.out) is executed (step 70 in FIG. 8).
8). On the way, the file name is OUTPUT1 or OUT
Whenever output to the file of PUT2 or OUTPUT3 occurs, execution of the program 8 (a.out) stops at the breakpoint set in step 705 of FIG. 8 and the file output monitoring means 4 is activated (FIG. 2). Step 710), and the output result determination means 6 is activated (step 403 in FIG. 10).

【0070】出力結果判定手段6では、出力ファイル
(OUTPUT1)に出力するデータに対しては結果フ
ァイル(RESULT1)、出力ファイル(OUTPU
T2)に出力するデータに対しては結果ファイル(RE
SULT2)、出力ファイル(OUTPUT3)に出力
するデータに対しては結果ファイル(RESULT3)
内のそれぞれ対応するデータとの相対誤差を計算する
(図11のステップ606)。プログラム8(a.ou
t)が出力するデータを出力データ、対応する正しい結
果のデータを結果データとすると、相対誤差は{(結果
データ−出力データ)/結果データ}の値であるが、出
力結果判定手段6で誤差許容範囲かどうかを判断する場
合(図11のステップ606)では、この相対誤差の絶
対値と誤差許容範囲格納手段10の値を比較する(図1
1のステップ607)。
The output result judging means 6 determines a result file (RESULT1) and an output file (OUTPU) for the data to be output to the output file (OUTPUT1).
For the data to be output to T2), a result file (RE
SULT2) and a result file (RESULT3) for the data output to the output file (OUTPUT3).
Then, the relative error with the corresponding data is calculated (step 606 in FIG. 11). Program 8 (a.ou
Assuming that the data output by t) is output data and the corresponding correct result data is result data, the relative error is {(result data−output data) / result data}. When it is determined whether or not the relative error is within the allowable range (step 606 in FIG. 11), the absolute value of the relative error is compared with the value of the error allowable range storage unit 10 (FIG. 1).
1 step 607).

【0071】図12の例では、最初のうちは、出力ファ
イル(OUTPUT1,2および3)のどのファイルに
対しても相対誤差が誤差許容範囲であるため、出力結果
判定手段6からは、0が返され(図11のステップ60
9)、不正データの出力を示すメッセージは表示されな
い。しかし、出力ファイル(OUTPUT2)に対する
出力で、出力バッファ12にデータ“2862.43
2”が格納されたとき、そのデータに対する結果ファイ
ル(RESULT2)内のデータは“8692.93
5”であり、このときの相対誤差は“0.6707”と
なり誤差許容範囲格納手段10に格納されている値
“0.0001”を越えてしまう。したがって、出力結
果判定手段6は戻り値として1を返す(図11のステッ
プ608)。
In the example of FIG. 12, since the relative error is within the allowable range for any of the output files (OUTPUT1, OUTPUT2 and OUTPUT3) at first, 0 is output from the output result determination means 6. Is returned (step 60 in FIG. 11).
9), a message indicating the output of illegal data is not displayed. However, in the output to the output file (OUTPUT2), the data “2862.43” is stored in the output buffer 12.
When "2" is stored, the data in the result file (RESULT2) for that data is "8692.93".
5 ", and the relative error at this time is" 0.6707 ", which exceeds the value" 0.0001 "stored in the error allowable range storage means 10. Therefore, the output result determination means 6 returns 1 is returned (step 608 in FIG. 11).

【0072】ファイル出力監視手段4も1を返すため、
デバッガ7は、不正なデータの出力であることを示すメ
ッセージを出力し(図8のステップ713)、ユーザか
らのデバッグコマンド入力待ち状態になる(図8のステ
ップ706)。
Since the file output monitoring means 4 also returns 1,
The debugger 7 outputs a message indicating that the output is incorrect data (step 713 in FIG. 8), and waits for a debug command input from the user (step 706 in FIG. 8).

【0073】次に、本発明の第3の実施の形態について
図面を参照して詳細に説明する。
Next, a third embodiment of the present invention will be described in detail with reference to the drawings.

【0074】図13を参照すると、本発明の第3の実施
の形態は、図7に示された第2の実施の形態における構
成に対して、ファイル名取得手段1と誤差範囲取得手段
3に代えてファイル情報取得手段2を有し、ファイル対
応表9と誤差許容範囲格納手段10に代えてファイル情
報領域11を有する点で異なる。
Referring to FIG. 13, the third embodiment of the present invention differs from the configuration of the second embodiment shown in FIG. The difference is that a file information obtaining unit 2 is provided instead, and a file information area 11 is provided instead of the file correspondence table 9 and the error tolerance storage unit 10.

【0075】ファイル情報取得手段2は、入力装置16
から結果ファイル名および出力ファイル名が入力されて
いる場合に、結果ファイル名、出力ファイル名およびそ
の出力ファイルに対する誤差許容範囲を格納する領域す
なわちファイル情報領域11をメモリ上に確保し、結果
ファイル名および出力ファイル名をファイル情報領域1
1に格納し、さらにその出力ファイルに対して許される
誤差の範囲が指定されている場合には、その値をファイ
ル情報領域11に格納する。結果ファイル名、出力ファ
イル名および誤差許容範囲が複数入力されている場合に
は、それら全てをファイル情報領域11に格納する。
The file information obtaining means 2 is provided with the input device 16
When the result file name and the output file name are input from the memory, an area for storing the result file name, the output file name and the allowable error range for the output file, that is, the file information area 11 is secured in the memory, and the result file name is obtained. And output file name to file information area 1
1 and if an allowable error range for the output file is specified, the value is stored in the file information area 11. When a plurality of result file names, output file names, and error tolerances are input, all of them are stored in the file information area 11.

【0076】ファイル情報領域11には、ファイル情報
取得手段2によって、結果ファイル名、出力ファイル
名、誤差許容範囲の組が格納される。結果ファイル名、
出力ファイル名が複数指定されている場合には、それら
の組が全て格納される。
In the file information area 11, a set of a result file name, an output file name, and an allowable error range is stored by the file information acquisition means 2. Result file name,
When a plurality of output file names are specified, all the sets are stored.

【0077】次に、本発明の第3の実施の形態の動作を
図13から図15を参照して詳細に説明する。
Next, the operation of the third embodiment of the present invention will be described in detail with reference to FIGS.

【0078】ユーザは、プログラム8を別のマシンでの
実行あるいは別のオプションを指定してコンパイルし、
実行した場合などにより、既に正しい結果のファイルが
存在する場合、そのファイル(結果ファイル)の名前
と、プログラム8の実行によって出力されるファイル
(出力ファイル)の名前と、2つのファイル内のデータ
間で許される誤差の範囲を入力装置16から入力する。
The user compiles the program 8 by executing it on another machine or specifying another option.
If a file with a correct result already exists due to execution or the like, the name of the file (result file), the name of a file (output file) output by executing the program 8, and the data between the two files Is input from the input device 16.

【0079】デバッガ7は、結果ファイルおよび出力フ
ァイルの情報が入力されているかどうかを判断し(図1
4のステップ701)、入力されている場合にはファイ
ル情報取得手段2を起動する(図14のステップ70
4)。
The debugger 7 determines whether or not information on the result file and the output file has been input (FIG. 1).
4) (Step 701 of FIG. 14).
4).

【0080】ファイル情報取得手段2は、入力された情
報の数やファイル名の長さ等を考慮し、ファイル情報1
1の領域をメモリ上に確保し(図15のステップ20
1)入力された結果ファイル名、出力ファイル名をファ
イル情報領域11に格納し(図15のステップ20
2)、その出力ファイルに対して許される誤差の範囲が
指定されていればその値を取得し(図15のステップ2
04)、ファイル情報領域11に格納する(図15のス
テップ206)。一方、許される誤差の範囲の指定がな
ければ、値0をファイル情報領域11に格納する(図1
5のステップ205)。ユーザが入力した結果ファイル
および出力ファイル全てに対して、上記処理(図15の
ステップ202からステップ206)を繰り返した後、
デバッガ7に制御を戻す(図15のステップ208)。
The file information obtaining means 2 considers the number of input information, the length of a file name, etc.
1 is secured in the memory (step 20 in FIG. 15).
1) Store the input result file name and output file name in the file information area 11 (step 20 in FIG. 15).
2) If an allowable error range is specified for the output file, the value is obtained (step 2 in FIG. 15).
04), and store it in the file information area 11 (step 206 in FIG. 15). On the other hand, if no allowable error range is specified, the value 0 is stored in the file information area 11 (FIG. 1).
5 step 205). After repeating the above processing (steps 202 to 206 in FIG. 15) for all the result files and output files input by the user,
Control is returned to the debugger 7 (step 208 in FIG. 15).

【0081】デバッガ7は、ファイル情報取得手段2を
起動した後で、プログラム8内の、ファイルに対する出
力部分にブレークポイントを設定し(図14のステップ
705)、ユーザからのデバッグコマンドの入力を待つ
(図14のステップ706)。
After activating the file information acquisition means 2, the debugger 7 sets a breakpoint in the output portion for the file in the program 8 (step 705 in FIG. 14) and waits for a debug command input from the user. (Step 706 in FIG. 14).

【0082】結果ファイルおよび出力ファイルに関する
情報が入力されていない場合にも、ユーザからのデバッ
グコマンドの入力を待つ(図14のステップ706)。
Even when the information regarding the result file and the output file has not been input, it waits for the input of the debug command from the user (step 706 in FIG. 14).

【0083】これ(図14のステップ706)以降の処
理については、第2の実施の形態の動作が、各比較対象
ファイル全てに対して同じ誤差許容範囲格納手段10に
格納された値に基づいて不正なデータかどうかの判定を
行っているのに対し、本実施の形態では、各ファイルご
とにファイル情報領域11に格納された値を用いること
を除いて、第2の実施の形態の動作と同一である。
For the processing after this (step 706 in FIG. 14), the operation of the second embodiment is based on the values stored in the same error allowable range storage means 10 for all the files to be compared. In contrast to the determination of whether or not the data is invalid, in the present embodiment, the operation of the second embodiment is the same as that of the second embodiment except that the value stored in the file information area 11 is used for each file. Are identical.

【0084】上述した第3の実施の形態は、プログラム
8が出力するファイルごとに、出力するデータに許され
る誤差の範囲を指定できるため、より細かな誤差の考慮
ができる。すなわち、プログラム8が出力するファイル
によってデータの演算誤差が異なる場合や、特に高精度
な結果の出力が要求されるファイルがある場合など、他
のファイルと同一の誤差で処理できない場合に有効であ
る。たとえば、許される誤差の値として最も大きな値に
よって全てのファイルを処理してしまうと、不正なデー
タの出力やデータの精度の低下などを見逃してしまう恐
れがあり、逆に、最も小さな値によって全てのファイル
を処理してしまうと、許される誤差に対しても不正なデ
ータの出力を示すメッセージが表示されてしまう場合が
ある。本発明の第3の実施の形態では、このような不都
合を抑止することができる。このため、デバッグ作業の
効率がさらに向上する。
In the above-described third embodiment, the range of an error allowed for output data can be specified for each file output by the program 8, so that a more detailed error can be considered. In other words, this method is effective when the data cannot be processed with the same error as other files, such as when the calculation error of the data differs depending on the file output by the program 8 or when there is a file that is required to output a highly accurate result. . For example, if all files are processed with the largest allowable error value, incorrect data output or a decrease in data accuracy may be missed. If the file is processed, a message indicating incorrect data output may be displayed even for an allowable error. According to the third embodiment of the present invention, such inconvenience can be suppressed. Therefore, the efficiency of the debugging work is further improved.

【0085】[0085]

【発明の効果】第1の効果は、ファイルに出力されるデ
ータが不正な場合に、不正が発生する部分がどこである
か、あるいは、どのデータが不正になるか、といった情
報がなくてもデバッグできることにある。この結果、デ
バッガの操作性が向上し、デバッグ作業の効率(生産性
および保守性)も向上する。
The first effect is that when data output to a file is invalid, debugging can be performed even if there is no information such as where the invalidity occurs or what data becomes invalid. What you can do. As a result, the operability of the debugger is improved, and the efficiency (productivity and maintainability) of the debugging work is also improved.

【0086】これは、ファイルへの出力部分にブレーク
ポイントを設定し、そのブレークポイントでプログラム
の実行が停止した場合に、出力するデータと正しいデー
タを比較するためである。
This is because a breakpoint is set at the output portion to the file, and when the execution of the program is stopped at the breakpoint, the output data is compared with the correct data.

【0087】第2の効果は、プログラムを実行するマシ
ンのアーキテクチャや、プログラムをコンパイルすると
きに指定するオプションの差による演算誤差を無視でき
ることにある。この結果、出力されるメッセージに対す
る余分な確認作業が不要になり、デバッグ作業の効率が
向上する。
The second effect is that an operation error caused by a difference between an architecture of a machine for executing a program and an option specified when compiling the program can be ignored. As a result, an extra check operation for the output message is not required, and the efficiency of the debug operation is improved.

【0088】これは、ファイルに出力するデータと正し
いデータを比較する場合に、両者の差が許される誤差の
範囲内であれば、正しいデータの出力と判定するためで
ある。
This is because when comparing the data to be output to the file with the correct data, if the difference between the two is within an allowable error range, it is determined that the correct data is output.

【0089】第3の効果は、出力するファイルごとに許
される誤差の範囲を変えることができることにある。こ
の結果、不必要なメッセージの出力をさらに抑止するこ
とができ、デバッグ作業の効率がより向上する。
The third effect is that the allowable error range can be changed for each output file. As a result, output of unnecessary messages can be further suppressed, and the efficiency of debugging work is further improved.

【0090】これは、プログラムが実行中に出力するフ
ァイルごとに許される誤差の範囲を設定できるためであ
る。
This is because the allowable error range can be set for each file output during execution of the program.

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

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

【図2】本発明の第1の実施の形態におけるデバッガの
動作を示す流れ図である。
FIG. 2 is a flowchart showing an operation of the debugger according to the first embodiment of the present invention.

【図3】本発明の第1の実施の形態におけるファイル名
取得手段の動作を示す流れ図である。
FIG. 3 is a flowchart showing an operation of a file name obtaining unit according to the first embodiment of the present invention.

【図4】本発明の第1の実施の形態におけるファイル出
力監視手段の動作を示す流れ図である。
FIG. 4 is a flowchart showing the operation of the file output monitoring means according to the first embodiment of the present invention.

【図5】本発明の第1の実施の形態における出力結果比
較手段の動作を示す流れ図である。
FIG. 5 is a flowchart showing the operation of the output result comparison means according to the first embodiment of the present invention.

【図6】本発明の第1の実施の形態の一実施例を示す説
明図である。
FIG. 6 is an explanatory diagram showing an example of the first embodiment of the present invention.

【図7】本発明の第2の実施の形態を示すブロック図で
ある。
FIG. 7 is a block diagram showing a second embodiment of the present invention.

【図8】本発明の第2の実施の形態におけるデバッガの
動作を示す流れ図である。
FIG. 8 is a flowchart showing an operation of the debugger according to the second embodiment of the present invention.

【図9】本発明の第2の実施の形態における誤差範囲取
得手段の動作を示す流れ図である。
FIG. 9 is a flowchart illustrating an operation of an error range obtaining unit according to the second embodiment of the present invention.

【図10】本発明の第2の実施の形態におけるファイル
出力監視手段の動作を示す流れ図である。
FIG. 10 is a flowchart showing the operation of the file output monitoring means according to the second embodiment of the present invention.

【図11】本発明の第2の実施の形態における出力結果
判定手段の動作を示す流れ図である。
FIG. 11 is a flowchart illustrating an operation of an output result determination unit according to the second embodiment of the present invention.

【図12】本発明の第2の実施の形態における一実施例
を示す説明図である。
FIG. 12 is an explanatory diagram showing one example of the second embodiment of the present invention.

【図13】本発明の第3の実施の形態を示すブロック図
である。
FIG. 13 is a block diagram showing a third embodiment of the present invention.

【図14】本発明の第3の実施の形態におけるデバッガ
の動作を示す流れ図である。
FIG. 14 is a flowchart showing an operation of the debugger according to the third embodiment of the present invention.

【図15】本発明の第3の実施の形態におけるファイル
情報取得手段の動作を示す流れ図である。
FIG. 15 is a flowchart showing an operation of a file information acquisition unit according to the third embodiment of the present invention.

【図16】本発明の第3の実施の形態の一実施例を示す
説明図である。
FIG. 16 is an explanatory diagram showing an example of the third embodiment of the present invention.

【符号の説明】 1 ファイル名取得手段 2 ファイル情報取得手段 3 誤差範囲取得手段 4 ファイル出力監視手段 5 出力結果比較手段 6 出力結果判定手段 7 デバッガ 8 プログラム 9 ファイル対応表 10 誤差許容範囲格納手段 11 ファイル情報 12 出力バッファ 13 出力ファイル 14 結果ファイル 15 出力装置 16 入力装置 17 制御部 18 メモリ 19 外部記憶装置[Description of Signs] 1 File name acquisition unit 2 File information acquisition unit 3 Error range acquisition unit 4 File output monitoring unit 5 Output result comparison unit 6 Output result determination unit 7 Debugger 8 Program 9 File correspondence table 10 Error allowable range storage unit 11 File information 12 Output buffer 13 Output file 14 Result file 15 Output device 16 Input device 17 Control unit 18 Memory 19 External storage device

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 正しいデータを予め格納した第1の格納
手段と、 第2の格納手段と、 前記第2の格納手段へのデータの出力を指示するデータ
出力指示部分にブレークポイントが設定されたデバッグ
対象プログラムを実行し、該プログラムの実行が前記ブ
レークポイントで停止した場合に、前記データ出力指示
部分の指示により前記第2の格納手段に出力されるデー
タと該データに対応する前記第1の格納手段内の正しい
データとを比較し、前記プログラムの検査を行うデバッ
グ手段とを備えたことを特徴とするプログラム・デバッ
グ・システム。
1. A breakpoint is set in a first storage unit in which correct data is stored in advance, a second storage unit, and a data output instruction portion instructing output of data to the second storage unit. When the program to be debugged is executed, and when the execution of the program is stopped at the breakpoint, the data output to the second storage means according to the instruction of the data output instruction portion and the first data corresponding to the data. A program debugging system comprising: debugging means for comparing the data with correct data in a storage means and checking the program.
【請求項2】 正しいデータを予め格納した第1の格納
手段と、 第2の格納手段と、 誤差許容範囲を示す許容値を格納した第3の格納手段
と、 前記第2の格納手段へのデータの出力を指示するデータ
出力指示部分にブレークポイントが設定されたデバッグ
対象プログラムを実行し、該プログラムの実行が前記ブ
レークポイントで停止した場合に、前記データ出力指示
部分の指示により前記第2の格納手段に出力されるデー
タと該データに対応する前記第1の格納手段内の正しい
データとの差を求め、該差が前記第3の格納手段に格納
された前記許容値の示す許容範囲内であるか否かを調
べ、前記プログラムの検査を行うデバッグ手段とを備え
たことを特徴とするプログラム・デバッグ・システム。
2. A first storage unit in which correct data is stored in advance, a second storage unit, a third storage unit in which an allowable value indicating an error allowable range is stored, and a storage unit in the second storage unit. Executing a debug target program in which a breakpoint is set in a data output instruction portion for instructing data output, and when the execution of the program is stopped at the breakpoint, the second data output instruction portion indicates the second The difference between the data output to the storage means and the correct data in the first storage means corresponding to the data is determined, and the difference is within an allowable range indicated by the allowable value stored in the third storage means. And a debugging means for checking whether or not the program is valid and for inspecting the program.
【請求項3】 ユーザから指定されるデータ特定情報に
基づき、前記プログラム中の該当する前記データ出力指
示部分にブレークポイントを設定する設定手段を含むこ
とを特徴とする請求項1または2記載のプログラム・デ
バッグ・システム。
3. The program according to claim 1, further comprising a setting unit configured to set a breakpoint at a corresponding data output instruction portion in the program based on data specifying information specified by a user. -Debug system.
【請求項4】 デバッグ対象プログラムの実行において
正しい結果のファイルとの比較が指定された場合に、前
記プログラム内のファイルに対する出力部分にブレーク
ポイントを設定する第1のステップと、該ブレークポイ
ントでプログラムの実行が停止した場合に、比較対象の
ファイルに対する出力であるならば、正しい結果のファ
イルの該当するデータと前記プログラムが出力しようと
しているデータとを比較する第2のステップと、該第2
のステップで両データが一致しない場合にはメッセージ
を出力し、デバッグコマンドの入力を可能にする第3の
ステップとを含むことを特徴とするプログラム・デバッ
グ方法。
4. A first step of setting a breakpoint at an output portion of a file in the program when a comparison with a file having a correct result is specified in execution of the program to be debugged; If the execution is stopped and the output is for a file to be compared, a second step of comparing the corresponding data of the file with the correct result with the data that the program is about to output,
And a third step of outputting a message when the two data do not match in the step (b) and enabling the input of a debug command.
【請求項5】 正しいデータと前記プログラムが出力し
ようとするデータとの間の差が許される誤差の範囲内で
あれば、正しいデータの出力と判定する第4のステップ
を含むことを特徴とする請求項4記載のプログラム・デ
バッグ方法。
5. The method according to claim 4, further comprising a fourth step of determining that the correct data is output if the difference between the correct data and the data to be output by the program is within an allowable error range. The method according to claim 4.
【請求項6】 前記許される誤差の範囲を前記プログラ
ムが出力するファイルごとに設定する第5のステップを
含むことを特徴とする請求項5記載のプログラム・デバ
ッグ方法。
6. The program debugging method according to claim 5, further comprising a fifth step of setting the allowable error range for each file output by the program.
【請求項7】 第1の格納手段へのデータの出力を指示
するデータ出力指示部分にブレークポイントが設定され
たデバッグ対象プログラムの実行を制御する第1の処理
と、 前記プログラムの実行が前記ブレークポイントで停止し
た場合に、前記データ出力指示部分の指示により前記第
1の格納手段に出力されるデータと該データに対応する
第1の格納手段内の正しいデータとを比較し、前記プロ
グラムの検査を行う第2の処理とをコンピュータに実行
させることを特徴とするプログラム・デバッグ用プログ
ラムを記憶した記憶媒体。
7. A first process for controlling execution of a debug target program in which a breakpoint is set in a data output instruction portion for instructing output of data to a first storage means; When stopping at a point, the data output to the first storage means according to the instruction of the data output instruction part is compared with the correct data in the first storage means corresponding to the data, and the program is checked. A storage medium storing a program / debugging program, which causes a computer to execute a second process of performing the following.
【請求項8】 第1の格納手段へのデータの出力を指示
するデータ出力指示部分にブレークポイントが設定され
たデバッグ対象プログラムの実行を制御する第1の処理
と、 前記プログラムの実行が前記ブレークポイントで停止し
た場合に、前記データ出力指示部分の指示により前記第
1の格納手段に出力されるデータと該データに対応する
第2の格納手段内の正しいデータとの差を求め、誤差が
第3の格納手段に格納された許容値の示す許容範囲内で
あるか否かを調べ、前記プログラムの検査を行う第2の
処理とをコンピュータに実行させることを特徴とするプ
ログラム・デバッグ用プログラムを記憶した記憶媒体。
8. A first process for controlling execution of a debug target program in which a breakpoint is set in a data output instruction portion for instructing output of data to a first storage means, and wherein the execution of the program is the break. When stopping at the point, the difference between the data output to the first storage means according to the instruction of the data output instruction part and the correct data in the second storage means corresponding to the data is obtained, and A program / debugging program which checks whether or not it is within an allowable range indicated by an allowable value stored in the storage means of the third program, and causes the computer to execute a second process of checking the program. A storage medium that stores.
【請求項9】 ユーザから指定されるデータ特定情報に
基づき、前記プログラム中の該当する前記データ出力指
示部分にブレークポイントを設定する第3の処理とをコ
ンピュータに実行させることを特徴とする請求項7また
は8記載のプログラム・デバッグ用プログラムを記憶し
た記憶媒体。
9. The method according to claim 8, wherein the third step of setting a breakpoint at a corresponding data output instruction portion in the program is executed by a computer based on data specifying information specified by a user. A storage medium storing the program / debug program according to 7 or 8.
JP8241969A 1996-09-12 1996-09-12 Program debugging system, program debugging method and storage medium storing debugging program Pending JPH1091479A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8241969A JPH1091479A (en) 1996-09-12 1996-09-12 Program debugging system, program debugging method and storage medium storing debugging program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8241969A JPH1091479A (en) 1996-09-12 1996-09-12 Program debugging system, program debugging method and storage medium storing debugging program

Publications (1)

Publication Number Publication Date
JPH1091479A true JPH1091479A (en) 1998-04-10

Family

ID=17082284

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8241969A Pending JPH1091479A (en) 1996-09-12 1996-09-12 Program debugging system, program debugging method and storage medium storing debugging program

Country Status (1)

Country Link
JP (1) JPH1091479A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018018121A (en) * 2016-07-25 2018-02-01 富士通株式会社 Database control program, database control method, and database control apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018018121A (en) * 2016-07-25 2018-02-01 富士通株式会社 Database control program, database control method, and database control apparatus

Similar Documents

Publication Publication Date Title
US7016807B2 (en) Device and method for monitoring a program execution
US5361352A (en) Method for debugging in a parallel computer system and system for the same
US20030204641A1 (en) Programming model for concurrent programs
US7721250B2 (en) System and method for interactive and integrated software development process and phases
CN114564394B (en) Test case determination method, system and related components
JP2019091144A (en) Simulation device, simulation system, simulation method, and simulation program
Gotovos et al. Test-driven development of concurrent programs using concuerror
JP2765549B2 (en) Operation evaluation system in computer system
EP0801348A1 (en) Method of monitoring the operation of a computer
JPH11224211A (en) Software inspection support device
JP2006155047A (en) Verification system and verification method
JPH01177165A (en) Definition-quotation relation checking system for array
JP2743889B2 (en) Method and apparatus for program evaluation
WO2022249421A1 (en) Code implementation omission detection device, code implementation omission detection method, and program
JPH06274370A (en) Debugger
US7627859B2 (en) Method for configuring non-script language library files to be run as scripts
JP2746180B2 (en) Program test support management device and program test support management method
JP2002116926A (en) Program processor and program processing method
JPS63174130A (en) System for detecting value unsettled variable name
JPH08137714A (en) Debugging method and debugging system for multitask program
JPH11191072A (en) Debug break processing method and debug processor
JPH09265385A (en) Software integrity management method
WO2022249420A1 (en) Test generation device, test generation method, and program
JPH01205348A (en) Program debugging system
JPH0695910A (en) Interactive debugging control system for abnormality processing

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19991102