JPH0764819A - Debugger - Google Patents

Debugger

Info

Publication number
JPH0764819A
JPH0764819A JP5238770A JP23877093A JPH0764819A JP H0764819 A JPH0764819 A JP H0764819A JP 5238770 A JP5238770 A JP 5238770A JP 23877093 A JP23877093 A JP 23877093A JP H0764819 A JPH0764819 A JP H0764819A
Authority
JP
Japan
Prior art keywords
break
function
program
argument
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP5238770A
Other languages
Japanese (ja)
Inventor
Hideyuki Kishiba
秀行 岸塲
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP5238770A priority Critical patent/JPH0764819A/en
Publication of JPH0764819A publication Critical patent/JPH0764819A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To provide a debugger which gives a break for a desired condition (function and argument) to temporarily stop a program. CONSTITUTION:A start instruction of debugging processing, a break condition, etc., are inputted through an input part 1. The break condition is set as a pair of a function name and the value of an abnormal argument given to the function and is stored in a storage part 3. A program execution part 2 performs the normal debugging processing in accordance with the start instruction and sends a function to a break discriminating part 4 at the time of finding the function in instructions of the program. The discriminating part 4 compares the argument in the break point set position detected by the program execution part 2 and the break condition stored in the storage part 3 with each other to discriminate whether the break processing should be executed or not, and, when the condition is satisfied, the break processing is executed, and the source code of the function to which the break point is set, is displayed on a display part 5.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、デバッグ装置に関する
もので、より具体的にはブレーク処理機構の改良に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debugging device, and more particularly to improvement of a break processing mechanism.

【0002】[0002]

【従来の技術】公知のように、プログラム開発時には、
ソースレベルやアセンブラレベルのプログラム中に存在
するバグを検出し、修正してプログラムを完成されるた
めに、開発途中のプログラムをデバッガ,デバッギング
システム等と称されるデバッグ処理装置に入力し、その
プログラムの最初から実行するようになっている。
As is well known, during program development,
In order to detect a bug existing in a source level or assembler level program and correct it to complete the program, the program under development is input to a debug processing device called a debugger, debugging system, etc. It's supposed to run from the beginning.

【0003】そして、デバッグ処理を行うに際し、ブレ
ークポイントを設定することがある。すなわち、プログ
ラム実行を停止したい関数名を予め入力しておき、デバ
ッグ処理対象のプログラム中のある関数が呼ばれたらそ
のプログラムの実行を中止し、それ以後の処理をインタ
ラクティプに行えるようにする。
A breakpoint may be set when performing the debug process. That is, the name of a function whose program execution is desired to be stopped is input in advance, and when a certain function in the program to be debugged is called, the execution of the program is stopped so that the subsequent processing can be performed interactively.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記し
た従来のデバッグ装置では、以下に示す問題を有する。
すなわち、ある関数に異常な引数(例えば0やNULL
ポインタ等)が与えられるというバグを直す場合、従来
の関数名に基づくブレーク処理では、その関数に正常な
引数が与えられるような場合であっても、プログラムの
実行が一時停止してしまう。したがって、その後は異常
な引数が与えられるまでデバッグ処理者がプログラムの
実行をインタラクティブに進めなければならず、その作
業が煩雑であった。特に、プログラムによっては、ブレ
ーク設定関数が数十回〜数百回と呼ばれるような場合に
は、事実上、上記のようなデバッグ処理が困難となる。
However, the above-mentioned conventional debug device has the following problems.
That is, an abnormal argument to a function (for example, 0 or NULL
When fixing the bug that the pointer is given), the conventional break processing based on the function name causes the execution of the program to be suspended even if the function is given a normal argument. Therefore, after that, the debug processor has to interactively proceed with the execution of the program until an abnormal argument is given, and the work is complicated. In particular, depending on the program, when the break setting function is called several tens to several hundreds of times, the above-described debug processing is practically difficult.

【0005】本発明は、上記した背景に鑑みてなされた
もので、その目的とするところは、所望の条件(関数と
引数)の時にブレークしてプログラムを一時停止するこ
とのできるデバッグ装置を提供することにある。
The present invention has been made in view of the above background, and an object of the present invention is to provide a debugging device capable of breaking and temporarily stopping a program under a desired condition (function and argument). To do.

【0006】[0006]

【課題を解決するための手段】上記した目的を達成する
ために、本発明に係るデバッグ装置では、与えられたプ
ログラムに対してデバッグ処理をする処理手段と、前記
デバッグ処理中に前記プログラムを一時停止するブレー
ク条件を記憶する記憶手段と、実行中の前記プログラム
に前記記憶手段に格納された前記ブレーク条件を満たす
箇所の有無を判定するブレーク判定手段とを備え、か
つ、前記ブレーク条件が、関数名とその関数に与えられ
る所定の引数の値との対で格納されるようにした。
In order to achieve the above-mentioned object, in a debugging device according to the present invention, a processing means for performing a debug process on a given program, and the program temporarily during the debug process. The program includes a storage unit that stores a break condition to be stopped, and a break determination unit that determines whether or not a portion of the program being executed that satisfies the break condition stored in the storage unit is included, and the break condition is a function. The name and the value of a given argument given to the function are stored as a pair.

【0007】[0007]

【作用】与えられたブログラムに対して、処理手段を実
行して通常のデバッグ処理を行う。また、このデバッグ
処理開始に先立ち、ブレークポイントを設定し、そのブ
レーク条件を記憶手段に格納する。そして、デバッグ処
理中は、ブレーク判定手段により実行中のプログラムの
命令中等に記憶手段に格納された関数名があるか否かを
検出し、その関数名があった場合には、その時その関数
に与えられる引数の値を参照し、それが記憶手段に格納
された所定の値か否かを判断する。そして、記憶手段に
格納された関数名と引数の値が一致した場合にブレーク
処理をする。換言すれば、たとえ関数名が同じであって
も引数の値が違う場合にはブレークすることなくプログ
ラムの実行(デバッグ処理)が継続される。
With the given program, the processing means is executed to carry out the usual debug processing. Further, prior to the start of this debug processing, a break point is set and the break condition is stored in the storage means. Then, during the debug processing, the break determination means detects whether or not there is a function name stored in the storage means in the instruction of the program being executed, and if there is that function name, the function is The value of the given argument is referred to and it is determined whether or not it is the predetermined value stored in the storage means. Then, when the function name stored in the storage means and the argument value match, break processing is performed. In other words, even if the function names are the same, if the argument values are different, the program execution (debug processing) continues without breaking.

【0008】[0008]

【実施例】以下、本発明に係るデバッグ装置の好適な実
施例を添付図面を参照にして詳述する。図1は本発明に
係るデバッグ装置の一実施例を示している。同図(A)
中符合1はキーボードやマウスなどの入力部であり、デ
バッグ処理の起動命令や、ブレークポイント設定箇所並
びに条件などを入力するようになっている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT A preferred embodiment of a debug device according to the present invention will be described in detail below with reference to the accompanying drawings. FIG. 1 shows an embodiment of a debug device according to the present invention. Same figure (A)
A middle numeral 1 is an input unit such as a keyboard and a mouse, and is adapted to input a start instruction of debug processing, a breakpoint setting location and conditions.

【0009】この入力部1の出力が、プログラム実行部
2及び記憶部3に接続されている。そして、プログラム
実行部2は、入力部1から与えられる上記起動命令に基
づいて処理対象のプログラム並びに所定の各種デバッグ
コマンド等を実行するもので、いわゆるデバッガの本体
部分である。そして、このプログラム実行部2では、関
数が引かれる都度、次段のブレーク判定部4にその関数
名を送るようになっている。
The output of the input unit 1 is connected to the program execution unit 2 and the storage unit 3. The program execution unit 2 executes a program to be processed, various predetermined debug commands, and the like based on the activation instruction given from the input unit 1, and is a so-called debugger main body. The program execution unit 2 sends the function name to the break determination unit 4 at the next stage each time the function is drawn.

【0010】また、記憶部3は、ブレーク条件を格納し
ておくもので、本例では図1(B)に示すように、プロ
グラムを一時停止させるための関数名及びその関数に与
えられる引数の値(異常な引数)を対にしたテーブルを
作成している。
The storage unit 3 stores break conditions. In this example, as shown in FIG. 1B, a function name for temporarily stopping the program and arguments given to the function are stored. Creating a table that pairs values (abnormal arguments).

【0011】そして、ブレーク判定部4では、プログラ
ム実行部2で検出されたブレークポイント設定箇所での
引数と、記憶部3に格納されたブレーク条件とを比較
し、ブレーク処理を行うか否かの判断を行い、その判定
結果をプログラム実行部2に送り返すと共に、ブレーク
する場合にはそのブレークポイントが設定された関数の
ソースコードを表示部5に送り、そこにおいて係るソー
スコードを表示するようになっている。
Then, the break determination unit 4 compares the argument at the breakpoint setting location detected by the program execution unit 2 with the break condition stored in the storage unit 3 to determine whether or not to perform break processing. A judgment is made and the judgment result is sent back to the program execution unit 2, and when a break occurs, the source code of the function in which the breakpoint is set is sent to the display unit 5 and the source code concerned is displayed there. ing.

【0012】次に、上記した実施例の作用を図2に示す
フローチャート図を用いて説明する。すなわち、まず入
力部1を介してデバッグ処理起動命令がプログラム実行
部2に入力され、また、ブレークポイントが設定(ブレ
ークする関数及び異常な引数を対にして記憶部3に格
納)される(S101,102)。本例では、図1
(B)に示すように、ブレーク条件としてある関数f
(x)が呼ばれた時に、その関数に与えられる引数xの
値が「0」の場合にブレークするようにした。
Next, the operation of the above embodiment will be described with reference to the flow chart shown in FIG. That is, first, a debug process activation instruction is input to the program execution unit 2 via the input unit 1, and a breakpoint is set (a function to be broken and an abnormal argument are paired and stored in the storage unit 3) (S101). , 102). In this example, FIG.
As shown in (B), a certain function f is used as a break condition.
When (x) is called, breaks when the value of the argument x given to the function is "0".

【0013】すると、プログラム実行部2では、予めセ
ットされたプログラム中の各命令及びコマンドを順次実
行していく(S103)。そして、プログラム中に関数
があるとそれがブレーク判定部4に送られ、その関数が
ブレーク条件の1つであるf(x)であるか否かが判断
される(S104)。そして、f(x)でなければ、続
行命令がプログラム実行部2に送られプログラム実行部
2では、命令並びにコマンドの実行を継続する。
Then, the program execution section 2 sequentially executes each instruction and command in the preset program (S103). Then, if there is a function in the program, it is sent to the break determination unit 4, and it is determined whether or not the function is f (x) which is one of the break conditions (S104). If it is not f (x), a continuation instruction is sent to the program execution unit 2, and the program execution unit 2 continues execution of the instruction and the command.

【0014】一方、関数がf(x)とすると、その関数
が呼ばれた時に与えられる引数の値を参照し、その値が
記憶部3に格納された異常な値(0)であるか否かを判
断し(S106)、0でなければステップ103に戻り
プログラムの実行を継続する。また、0の時には、ブレ
ーク処理を行い、プログラムを一時停止すると共に、そ
の時の関数のソースコードを表示部5に表示する(S1
07,108)。
On the other hand, if the function is f (x), the value of the argument given when the function is called is referred to, and whether the value is an abnormal value (0) stored in the storage unit 3 or not. If it is not 0, the process returns to step 103 to continue the execution of the program. When it is 0, break processing is performed, the program is temporarily stopped, and the source code of the function at that time is displayed on the display unit 5 (S1
07, 108).

【0015】すなわち、本例によれば、たとえブレーク
条件の一つである関数f(x)がプログラム中に呼ばれ
たとしても、そこに入力される引数の値が正常なもの
(本例では0以外)の場合にはブレーク処理されずにプ
ログラムが実行継続され、係る引数が異常な値の時に初
めてブレークされるため、一度のブレーク処理で問題発
生時の関数が特定される。
That is, according to this example, even if the function f (x), which is one of the break conditions, is called in the program, the value of the argument input thereto is normal (in this example, In the case of (other than 0), the program continues to be executed without break processing, and the break occurs only when the argument has an abnormal value. Therefore, the function at the time of occurrence of the problem can be identified by one break processing.

【0016】なお、上記した実施例では、説明の便宜上
ブレーク条件の関数と引数の値が1つの例について説明
したが、本例はこれに限ることなく、複数設定して良い
のはもちろんである。
In the above embodiment, the function of the break condition and the value of the argument are one for the sake of convenience of explanation, but the present embodiment is not limited to this, and a plurality of values may be set. .

【0017】[0017]

【発明の効果】以上のように、本発明に係るデバッグ装
置では、ブレークポイントの設定として、関数及びその
関数に呼ばれる引数の値を対にして設定し、両者の条件
が一致した時にブレーク処理をするようにしたため、た
とえ記憶手段に格納されたブレークポイントとなる関数
名と同じ関数が呼ばれたとしても、その関数に与えられ
る引数の値が正常なもの(記憶手段に格納したものと異
なる)であれば、ブレークされることなくプログラムの
実行が継続される。したがって、一度のブレーク処理で
問題発生時等の関数が特定することができ、デバッグ効
率が向上する。
As described above, in the debug device according to the present invention, as a breakpoint setting, the value of the function and the argument called to the function are set as a pair, and the break processing is performed when the both conditions are matched. Therefore, even if the same function as the function name of the breakpoint stored in the storage means is called, the value of the argument given to that function is normal (different from the one stored in the storage means). If so, program execution continues without breaking. Therefore, the function at the time of occurrence of a problem can be specified by one break processing, and the debugging efficiency is improved.

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

【図1】(A)は、本発明に係るでバッグ装置の一実施
例を示すブロック図である。(B)は、記憶部に格納さ
れるデータ構造の一例を示す図である。
FIG. 1A is a block diagram showing an embodiment of a bag device according to the present invention. (B) is a diagram showing an example of a data structure stored in the storage unit.

【図2】作用を説明するフローチャートである。FIG. 2 is a flowchart illustrating an operation.

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

1 入力部 2 プログラム実行部(処理手段) 3 記憶部 4 ブレーク判定部 5 表示部 1 input section 2 program execution section (processing means) 3 storage section 4 break determination section 5 display section

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 与えられたプログラムに対してデバッグ
処理をする処理手段と、 前記デバッグ処理中に前記プログラムを一時停止するブ
レーク条件を記憶する記憶手段と、 実行中の前記プログラムに前記記憶手段に格納された前
記ブレーク条件を満たす箇所の有無を判定するブレーク
判定手段とを備え、 かつ、前記ブレーク条件が、関数名とその関数に与えら
れる所定の引数の値との対で格納されるデバッグ装置。
1. A processing unit for performing a debug process on a given program, a storage unit for storing a break condition for temporarily stopping the program during the debug process, and a storage unit for the program being executed. And a break determining means for determining whether or not there is a stored portion that satisfies the break condition, and the break condition is stored as a pair of a function name and a value of a predetermined argument given to the function. .
JP5238770A 1993-08-31 1993-08-31 Debugger Withdrawn JPH0764819A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5238770A JPH0764819A (en) 1993-08-31 1993-08-31 Debugger

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5238770A JPH0764819A (en) 1993-08-31 1993-08-31 Debugger

Publications (1)

Publication Number Publication Date
JPH0764819A true JPH0764819A (en) 1995-03-10

Family

ID=17035017

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5238770A Withdrawn JPH0764819A (en) 1993-08-31 1993-08-31 Debugger

Country Status (1)

Country Link
JP (1) JPH0764819A (en)

Similar Documents

Publication Publication Date Title
JPH0764819A (en) Debugger
JPH05298204A (en) Test circut for input/output processor
JPH03113648A (en) Program debug system
JP2800577B2 (en) Debug device
JPH06250889A (en) Fault processing system in data processing system
JPS63236142A (en) Software monitoring device
JPH04310139A (en) Debug support tool for compiler language
JPH07319730A (en) Test debugging method
JPH03242736A (en) Abnormality processing system
JP2000284989A (en) Debug device
JPH02151938A (en) Program debugging system
JPH01277942A (en) Source row display system for execution abnormal instruction
JPS61235955A (en) Program debugging system
JPH07134665A (en) Information processor
JPS6365541A (en) Automatic display system for program in fault
JPS60254251A (en) Debug system
JPS6111855A (en) Function diagnosing method of data processor
JPH103402A (en) System diagnosis device/method
JPS6116338A (en) Interrupt processing system of virtual computer system
JPH03209534A (en) Back-up device for development of program
JPH04283835A (en) Inference system
JPS60110045A (en) Automatic trace damping method
JPH0236488A (en) Execution detection system for data flow computer
JPH0695915A (en) Method for debugging processing
JPH0659931A (en) Debugging device

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20001031