JPH0822401A - Method for interrupting program execution and debugging device - Google Patents

Method for interrupting program execution and debugging device

Info

Publication number
JPH0822401A
JPH0822401A JP6155792A JP15579294A JPH0822401A JP H0822401 A JPH0822401 A JP H0822401A JP 6155792 A JP6155792 A JP 6155792A JP 15579294 A JP15579294 A JP 15579294A JP H0822401 A JPH0822401 A JP H0822401A
Authority
JP
Japan
Prior art keywords
function
class
procedure
call
program
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
JP6155792A
Other languages
Japanese (ja)
Inventor
Noriyasu Mori
教安 森
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP6155792A priority Critical patent/JPH0822401A/en
Publication of JPH0822401A publication Critical patent/JPH0822401A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To set a function break point where a call function is limited and interrupted. CONSTITUTION:In the break point setting process 12 of a debugging process 1, at least one of the entrance point and exit point of a function is set as the function break point in a break point table 3 on the basis of a break point setting command 21 inputted by a user and a function which calls the function is registered as a call condition function in the break point table. In the instruction executing process 13 of the debugging process 1, it is decided whether or not the function which actually calls the function matches the call condition function when a program is executed and reaches the break point, and the program is interrupted only when the function matches the call condition function, but continued without being interrupted when not.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、プログラム実行中断方
法およびデバッギング装置に関し、さらに詳しくは、呼
び出した手続き又は関数(以下、単に関数という場合も
ある)を判定条件として、呼び出された関数に設定され
た中断点でプログラムの実行を中断するか又は継続実行
するプログラム実行中断方法およびデバッギング装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program execution interrupting method and a debugging device, and more specifically, it sets a called function or function (hereinafter, may be simply referred to as a function) as a judgment condition in a called function. The present invention relates to a program execution interruption method and a debugging device for interrupting or continuously executing a program at a specified interruption point.

【0002】[0002]

【従来の技術】第1の従来例として、プログラムのデバ
ッグのために、関数名と,入口点または出口点または両
方の区別をユーザが指定することで、指定した関数の入
口点または出口点または両方に中断点を設定し、その中
断点でプログラムの実行を中断するプログラム実行中断
方法が知られている。また、第2の従来例として、ユー
ザがクラス名を指定すると、そのクラスに所属する関数
およびそのクラスを継承するクラスに所属する関数のす
べてに中断点を設定し、その中断点でプログラムの実行
を中断するプログラム実行中断方法が知られている。ま
た、第3の従来例として、関数が呼び出された時に当該
関数を呼び出した関数の情報をプッシュし,前記呼び出
された関数から復帰する時に前記プッシュしていた情報
をポップする関数呼出しスタックを具備し、この関数呼
出しスタックを利用して、現在の呼出しレベル(呼出し
関係の深さ=呼出しスタックの深さ)から、指定した深
さ(オペランドdepthで指定)分だけ復帰した時点
でプログラムの実行を中断するプログラム実行中断方法
が知られている。
2. Description of the Related Art As a first conventional example, in order to debug a program, a user specifies a function name and an entry point or an exit point, or both, so that the entry point or the exit point of the designated function or A program execution interruption method is known in which an interruption point is set in both of them and the execution of the program is interrupted at the interruption point. As a second conventional example, when a user specifies a class name, a breakpoint is set for all functions belonging to the class and functions inheriting the class, and the program is executed at the breakpoint. There is known a method of interrupting program execution for interrupting. Further, as a third conventional example, a function call stack for pushing information of a function that called the function when the function is called and popping the pushed information when returning from the called function is provided. However, using this function call stack, the program is executed when the specified depth (specified by the operand depth) is restored from the current call level (depth of the call relationship = depth of the call stack). A method of interrupting program execution for interrupting is known.

【0003】上記従来の技術は、例えば「HP−UX
Symbolic Debugger User's Guide HP9000 C
omputers(発行所 HEWLETT PACKARD,199
1)」に記載されている。
The above-mentioned conventional technique is, for example, "HP-UX".
Symbolic Debugger User's Guide HP9000 C
omputers (Publisher HEWLETT PACKARD, 199
1) ”.

【0004】[0004]

【発明が解決しようとする課題】既開発プログラムに機
能拡張等による新規関数の追加を行った場合、新規関数
が既存関数を利用する上での誤りを検査するには、既存
関数に中断点を設定し、新規関数が既存関数を呼び出し
た時にプログラムの実行を中断し、新規関数が既存関数
を正しく呼び出しているか否か確認すればよい。しか
し、従来の技術では、既存関数に中断点を設定すると、
検査の必要のない別の既存の関数が前記既存関数を呼び
出してもプログラムの実行が中断されてしまうため、デ
バッグの効率が悪い問題点がある。
When a new function is added to the already-developed program by expanding the function, etc., in order to check the error in using the existing function, the interruption point is added to the existing function. It may be set, and the execution of the program may be interrupted when the new function calls the existing function, and it may be confirmed whether the new function correctly calls the existing function. However, in the conventional technology, if you set a break point in an existing function,
Even if another existing function that does not need to be checked calls the existing function, the execution of the program is interrupted, which causes a problem of inefficient debugging.

【0005】また、オブジェクト指向言語のプログラム
において、クラスの開発者がクラス自身のデバッグを行
う場合、クラス外からの呼出しの影響は少ないため、ク
ラスに所属するメンバ関数(メソッド)がクラス内から
呼ばれた時だけプログラムの実行を中断すればよい。逆
に、そのクラスを利用するだけで良いユーザのプログラ
ムのデバッグを行う場合は、クラス内での呼出し関係は
注目する必要はなく、前記メンバ関数がクラス外から呼
ばれた時だけプログラムの実行を中断すればよい。しか
し、従来の技術では、メンバ関数に中断点を設定する
と、クラス内からの呼出しとクラス外からの呼出しとを
区別せずにプログラムの実行が中断されてしまうため、
デバッグの効率が悪い問題点がある。
In addition, in a program of an object-oriented language, when a class developer debugs the class itself, there is little effect of calls from outside the class, so member functions (methods) belonging to the class are called from within the class. The program execution may be interrupted only when it is interrupted. On the other hand, when debugging a user's program that only needs to use the class, it is not necessary to pay attention to the calling relationship within the class, and the program execution can be executed only when the member function is called from outside the class. Just stop. However, in the conventional technique, if a breakpoint is set in the member function, the execution of the program is suspended without distinguishing the call from inside the class and the call from outside the class.
There is a problem that debugging efficiency is poor.

【0006】そこで、本発明の目的は、上記のような状
況においてデバッグを効率よく行えるようにするため、
呼び出した関数を判定条件として、呼び出された関数に
設定された中断点でプログラムの実行を中断するか又は
継続実行するプログラム実行中断方法およびデバッギン
グ装置を提供することにある。
Therefore, an object of the present invention is to enable efficient debugging in the above situation.
It is an object of the present invention to provide a program execution interruption method and a debugging device for interrupting or continuously executing the execution of a program at an interruption point set in the called function with the called function as a judgment condition.

【0007】[0007]

【課題を解決するための手段】第1の観点では、本発明
は、手続き又は関数の制御構造を有するプログラムのデ
バッグのためのプログラム実行中断方法であって、手続
き又は関数の入口点または出口点の少なくとも一方を関
数中断点としてユーザが指定すると共に、当該手続き又
は関数を呼び出す一つ又は複数の手続き又は関数を呼出
し条件関数としてユーザが指定するのに対して、前記指
定された関数中断点に中断点を設定し、且つ、その中断
点に対応させて前記呼出し条件関数を登録し、前記プロ
グラムを実行中に前記中断点に至った時、当該手続き又
は関数を実際に呼び出した手続き又は関数が前記呼出し
条件関数に合致するか否かを判定し、その判定結果に応
じて前記プログラムの実行を中断するか又は中断せずに
継続実行することを特徴とするプログラム実行中断方法
を提供する。
SUMMARY OF THE INVENTION In a first aspect, the present invention is a program execution interruption method for debugging a program having a procedure or function control structure, the procedure or function entry point or exit point. While at least one of the above is specified by the user as a function break point and one or more procedures or functions that call the procedure or function are specified by the user as a call condition function, the specified function break point is When a breakpoint is set and the call condition function is registered in association with the breakpoint, and when the breakpoint is reached during execution of the program, the procedure or function that actually called the procedure or function is Judgment whether or not the calling condition function is met, and depending on the judgment result, execution of the program is interrupted or continued without interruption. Providing program execution is suspended and wherein.

【0008】第2の観点では、本発明は、手続き又は関
数の制御構造を有するプログラムのためのデバッギング
装置であって、ユーザが入力した中断点設定コマンドに
基づいて、手続き又は関数の入口点または出口点の少な
くとも一方を関数中断点として設定すると共に、当該手
続き又は関数を呼び出す一つ又は複数の手続き又は関数
を呼出し条件関数として登録する中断点設定処理手段
と、前記プログラムを実行し、前記中断点に至った時、
当該手続き又は関数を実際に呼び出した手続き又は関数
が前記呼出し条件関数に合致するか否かを判定し、その
判定結果に応じて前記プログラムの実行を中断するか又
は中断せずに継続実行する命令実行処理手段とを具備し
たことを特徴とするデバッギング装置を提供する。
In a second aspect, the present invention is a debugging device for a program having a procedure or function control structure, wherein the procedure or function entry point or At least one of the exit points is set as a function break point, and one or more procedures or functions that call the procedure or function are registered as call condition functions, and a break point setting processing means that executes the program When you reach the point,
An instruction that determines whether or not the procedure or function that actually called the procedure or function matches the calling condition function, and suspends execution of the program according to the determination result, or continues execution without interruption There is provided a debugging device comprising: an execution processing unit.

【0009】第3の観点では、本発明は、上記構成のデ
バッギング装置において、手続き又は関数が呼び出され
た時に当該手続き又は関数を呼び出した手続き又は関数
の情報をプッシュし,前記呼び出された手続き又は関数
から復帰する時に前記プッシュしていた情報をポップす
る関数呼出しスタックを具備し、前記命令実行処理手段
は、当該手続き又は関数を実際に呼び出した手続き又は
関数を前記関数呼出しスタックから取得することを特徴
とするデバッギング装置を提供する。
According to a third aspect of the present invention, in the debugging device having the above structure, when a procedure or function is called, information on the procedure or function that called the procedure or function is pushed, and the called procedure or function is pushed. A function call stack for popping the pushed information when returning from a function is provided, and the instruction execution processing means acquires the procedure or function that actually called the procedure or function from the function call stack. A characteristic debugging device is provided.

【0010】第4の観点では、本発明は、上記構成のデ
バッギング装置において、設定する中断点の種類を指定
するコマンド部と,中断点を設定する一つ又は複数の手
続き又は関数を指定する関数指定部と,当該手続き又は
関数を呼び出す一つ又は複数の手続き又は関数を指定す
る呼出し条件関数指定部と,当該手続き又は関数を実際
に呼び出した手続き又は関数が前記呼出し条件関数に合
致すると判定したときにプログラムの実行を中断するか
継続するかを指定する条件動作指定部とを含む中断点設
定コマンドを、前記中断点設定処理手段が受け付けるこ
とを特徴とするデバッギング装置を提供する。
According to a fourth aspect of the present invention, in the debugging device having the above-mentioned structure, a command section for designating a kind of an interruption point to be set and a function for designating one or more procedures or functions for setting the interruption point. It is determined that the specification part, the call condition function specification part that specifies one or more procedures or functions that call the procedure or function, and the procedure or function that actually called the procedure or function match the call condition function. There is provided a debugging device characterized in that the interruption point setting processing means receives an interruption point setting command including a conditional operation specifying section for specifying whether to interrupt or continue the execution of the program.

【0011】第5の観点では、本発明は、上記構成のデ
バッギング装置において、前記コマンド部が前記条件動
作指定部の機能を有し、独立した条件動作指定部を含ま
ない中断点設定コマンドを、前記中断点設定処理手段が
受け付けることを特徴とするデバッギング装置を提供す
る。
According to a fifth aspect of the present invention, in the debugging device having the above structure, the command point has a function of the conditional operation designating section, and an interruption point setting command not including an independent conditional operation designating section is provided. A debugging device is provided, which is accepted by the break point setting processing means.

【0012】第6の観点では、本発明は、上記構成のデ
バッギング装置において、前記中断点設定処理手段は、
前記関数指定部または前記呼出し条件関数指定部にクラ
スが指定されているとき、当該クラスに所属する手続き
又は関数の全てが指定されたものとして処理することを
特徴とするデバッギング装置を提供する。
According to a sixth aspect of the present invention, in the debugging device having the above structure, the interruption point setting processing means is
There is provided a debugging device characterized in that, when a class is designated in the function designation unit or the call condition function designation unit, all the procedures or functions belonging to the class are processed as designated.

【0013】第7の観点では、本発明は、上記構成のデ
バッギング装置において、前記中断点設定処理手段は、
前記関数指定部または前記呼出し条件関数指定部にクラ
スが指定されているとき、当該クラスに所属する手続き
又は関数および当該クラスを継承するクラスに所属する
手続き又は関数の全てが指定されたものとして処理する
ことを特徴とするデバッギング装置を提供する。
According to a seventh aspect of the present invention, in the debugging device having the above structure, the interruption point setting processing means is
When a class is specified in the function specification part or the call condition function specification part, it is processed as if all the procedures or functions belonging to the class and the procedures or functions belonging to the class inheriting the class are specified. Provided is a debugging device.

【0014】第8の観点では、本発明は、上記構成のデ
バッギング装置において、前記中断点設定処理手段は、
前記コマンド部の内容に応じて、請求項6または請求項
7のいずれかの処理を選択することを特徴とするデバッ
ギング装置を提供する。
According to an eighth aspect of the present invention, in the debugging device having the above structure, the interruption point setting processing means is
There is provided a debugging device, wherein the processing according to claim 6 or 7 is selected according to the contents of the command section.

【0015】[0015]

【作用】上記第1の観点によるプログラム実行中断方法
および上記第2の観点によるデバッギング装置では、ユ
ーザに指定された関数中断点に中断点を設定するのと同
時にその中断点に対応させてユーザに指定された呼出し
条件関数を登録しておく。、そして、デバッグ対象のプ
ログラムを実行中に前記中断点に至った時、当該手続き
又は関数を実際に呼び出した手続き又は関数が前記呼出
し条件関数に合致するか否かを判定し、その判定結果に
応じて前記プログラムの実行を中断するか又は中断せず
に継続実行する。これにより、呼び出した関数を判定条
件として、呼び出された関数に設定された中断点でプロ
グラムの実行を中断するか又は継続実行するように出来
る。そこで、例えば、新規関数が既存関数を呼び出した
時のみプログラムの実行を中断し、検査の必要のない別
の既存の関数が前記既存関数を呼び出してもプログラム
の実行を中断しないように出来て、デバッグを効率よく
行える。また、クラス内またはクラス外の一方からの呼
出し時のみプログラムの実行を中断し、他方からの呼出
し時にはプログラムの実行を中断しないように出来て、
デバッグを効率よく行える。
In the program execution interruption method according to the first aspect and the debugging device according to the second aspect, the interruption point is set to the function interruption point designated by the user, and at the same time, the user is made to correspond to the interruption point. Register the specified call condition function. Then, when the breakpoint is reached during execution of the program to be debugged, it is determined whether or not the procedure or function that actually calls the procedure or function matches the calling condition function, and the determination result is Accordingly, the execution of the program is interrupted or is continuously executed without interruption. This makes it possible to suspend the execution of the program or continue the execution of the program at the interruption point set in the called function, using the called function as the determination condition. Therefore, for example, it is possible to interrupt the execution of the program only when the new function calls the existing function, and to prevent the execution of the program from being interrupted even if another existing function that does not require inspection calls the existing function, You can debug efficiently. Also, it is possible to suspend the execution of the program only when calling from within one of the classes or outside the class, and not to suspend the execution of the program when calling from the other,
You can debug efficiently.

【0016】上記第3の観点によるデバッギング装置で
は、上記構成のデバッギング装置において、中断点が設
定されている手続き又は関数を呼び出した手続き又は関
数の情報を呼出し時にプッシュし,復帰時にポップする
関数呼出しスタックを利用して、前記手続き又は関数を
実際に呼び出した手続き又は関数を取得する。これによ
り、実際に呼び出した手続き又は関数を容易に取得でき
る。
In the debugging device according to the third aspect, in the debugging device having the above-described configuration, a function call that pushes information of a procedure or function that called a procedure or function for which an interruption point is set at the time of calling and pops at the time of return The stack is used to acquire the procedure or function that actually called the procedure or function. As a result, the procedure or function actually called can be easily obtained.

【0017】上記第4の観点によるデバッギング装置で
は、上記構成のデバッギング装置において、中断点の種
類を指定するコマンド部と,中断点を設定する手続き又
は関数を指定する関数指定部と,当該手続き又は関数を
呼び出す手続き又は関数を指定する呼出し条件関数指定
部と,実際に呼び出した手続き又は関数が前記呼出し条
件関数に合致すると判定したときにプログラムの実行を
中断するか継続するかを指定する条件動作指定部とを含
む中断点設定コマンドを、中断点設定処理手段が受け付
ける。これにより、ユーザは、前記中断点設定コマンド
を用いて、的確に中断条件を指示できる。また、前記コ
マンド部に前記条件動作指定部の機能を含ませれば、冗
長性が高くなり、使い勝手が良くなる。
In the debugging device according to the fourth aspect, in the debugging device having the above-mentioned configuration, a command section for designating a kind of the interruption point, a function designating section for designating a procedure or a function for setting the interruption point, and the procedure or A call condition function specification part that specifies a procedure or function that calls a function, and a conditional action that specifies whether the execution of the program is interrupted or continued when it is determined that the actually called procedure or function matches the call condition function. A break point setting processing unit receives a break point setting command including a designation section. As a result, the user can accurately instruct the interruption condition by using the interruption point setting command. Further, if the command section includes the function of the conditional operation designating section, the redundancy becomes high and the usability becomes good.

【0018】上記第5の観点によるデバッギング装置で
は、上記構成のデバッギング装置において、前記コマン
ド部に前記条件動作指定部の機能を含ませ、独立した条
件動作指定部を省略可能としている。これにより、ユー
ザは、短縮型の中断点設定コマンドを用いて、的確に中
断条件を指示できる。
In the debugging device according to the fifth aspect, in the debugging device having the above configuration, the command part includes the function of the conditional operation designating part, and an independent conditional operation designating part can be omitted. As a result, the user can accurately instruct the interruption condition by using the shortened interruption point setting command.

【0019】上記第6の観点によるデバッギング装置で
は、上記構成のデバッギング装置において、前記中断点
設定処理手段は、関数指定部または呼出し条件関数指定
部にクラスが指定されているとき、当該クラスに所属す
る手続き又は関数の全てが指定されたものとして処理す
る。これにより、ユーザは、1つの中断点設定コマンド
を用いて、複数の手続き又は関数を指定できるようにな
り、使い勝手が良くなる。
In the debugging device according to the sixth aspect, in the debugging device having the above-mentioned configuration, the break point setting processing means belongs to a class when the class is specified in the function specifying section or the call condition function specifying section. All the procedures or functions to be processed are specified. As a result, the user can specify a plurality of procedures or functions using one breakpoint setting command, which improves usability.

【0020】上記第7の観点によるデバッギング装置で
は、上記構成のデバッギング装置において、前記中断点
設定処理手段は、関数指定部または呼出し条件関数指定
部にクラスが指定されているとき、当該クラスに所属す
る手続き又は関数および当該クラスを継承するクラスに
所属する手続き又は関数の全てが指定されたものとして
処理する。これにより、ユーザは、1つの中断点設定コ
マンドを用いて、複数の手続き又は関数を指定できるよ
うになり、使い勝手が良くなる。
In the debugging device according to the seventh aspect, in the debugging device having the above configuration, the break point setting processing means belongs to a class when a class is specified in the function specifying unit or the call condition function specifying unit. All the procedures or functions to be performed and the procedures or functions belonging to the class that inherits the class are processed as specified. As a result, the user can specify a plurality of procedures or functions using one breakpoint setting command, which improves usability.

【0021】上記第8の観点によるデバッギング装置で
は、上記構成のデバッギング装置において、前記中断点
設定処理手段は、関数指定部または呼出し条件関数指定
部にクラスが指定されているとき、コマンド部の内容に
応じて、当該クラスに所属する手続き又は関数の全てが
指定されたものとして処理するか,あるいは,当該クラ
スに所属する手続き又は関数および当該クラスを継承す
るクラスに所属する手続き又は関数の全てが指定された
ものとして処理する。これにより、ユーザは、クラス名
を用いた複数の手続き又は関数の2種類の指定方法を使
い分けできるようになり、使い勝手が良くなる。
In the debugging device according to the eighth aspect, in the debugging device having the above-mentioned configuration, the interruption point setting processing means, when a class is specified in the function specifying unit or the call condition function specifying unit, the contents of the command unit. Depending on, all the procedures or functions belonging to the class are processed as specified, or all the procedures or functions belonging to the class and the procedures or functions belonging to the class that inherits the class are Treat as specified. As a result, the user can selectively use two kinds of designation methods of a plurality of procedures or functions using the class name, which improves usability.

【0022】[0022]

【実施例】以下、図に示す実施例により本発明をさらに
詳細に説明する。なお、これにより本発明が限定される
ものではない。図1は、本発明の一実施例のデバッギン
グ装置の構成図である。このデバッギング装置1000
は、メモリ1001と、表示装置1002と、CPU1
003と、入力装置1004と、外部記憶装置1005
とを具備している。メモリ1001には、本発明のプロ
グラム実行中断方法を実施することが可能なデバッグ処
理1と入力処理2とコンパイル処理5のプログラムが少
なくとも記憶されている。外部記憶装置1005には、
デバッグ対象のソースプログラム4が格納されている。
EXAMPLES The present invention will be described in more detail with reference to the examples shown in the drawings. The present invention is not limited to this. FIG. 1 is a configuration diagram of a debugging device according to an embodiment of the present invention. This debugging device 1000
Is a memory 1001, a display device 1002, and a CPU 1.
003, an input device 1004, and an external storage device 1005
Is provided. The memory 1001 stores at least the programs of the debug process 1, the input process 2, and the compile process 5 capable of implementing the program execution interruption method of the present invention. In the external storage device 1005,
The source program 4 to be debugged is stored.

【0023】図2は、本発明のプログラム実行中断方法
にかかる処理の関係を示す概念図である。コンパイル処
理5は、ソースプログラム4を解析し、オブジェクトコ
ード6およびソース情報ファイル7を生成する。ソース
情報ファイル7には、行アドレス対応表71と、関数情
報表72と、クラス階層情報73とが含まれている。行
アドレス対応表71は、ソースプログラム4の行番号
と,その行番号の行のコンパイル結果が格納されている
オブジェクトコード6上のアドレスの対応を示す表であ
る。行アドレス対応表71の詳細は、図4を参照して後
述する。関数情報表72は、関数名や関数中断点などの
情報を保持している。関数情報表72の詳細は、図5を
参照して後述する。クラス階層情報73は、ソースファ
イル4のプログラム言語がC++等のオブジェクト指向
言語である場合に作成され、プログラム言語で規定され
ているクラスと呼ばれる処理単位の情報やそのクラス間
の継承情報を保持している。クラス階層情報73の詳細
は、図13および図14を参照して後述する。なお、ソ
ース情報ファイル7の情報をオブジェクトコード6に含
ませれば、ソース情報ファイル7を独立したファイルと
しなくてもよい。
FIG. 2 is a conceptual diagram showing the relationship of the processes according to the program execution interruption method of the present invention. The compiling process 5 analyzes the source program 4 and generates an object code 6 and a source information file 7. The source information file 7 includes a row address correspondence table 71, a function information table 72, and class hierarchy information 73. The line address correspondence table 71 is a table showing the correspondence between the line number of the source program 4 and the address on the object code 6 in which the compilation result of the line of that line number is stored. Details of the row address correspondence table 71 will be described later with reference to FIG. The function information table 72 holds information such as function names and function break points. Details of the function information table 72 will be described later with reference to FIG. The class hierarchy information 73 is created when the programming language of the source file 4 is an object-oriented language such as C ++, and holds information on processing units called classes defined in the programming language and inheritance information between the classes. ing. Details of the class hierarchy information 73 will be described later with reference to FIGS. 13 and 14. If the information of the source information file 7 is included in the object code 6, the source information file 7 does not have to be an independent file.

【0024】入力処理2は、入力装置1004からユー
ザが入力した中断点設定コマンド21をデバッグ処理1
に渡す。デバッグ処理1は、コマンド解析処理11と、
中断点設定処理12と、命令実行処理13と、中断処理
14と,関数呼出しスタック15とが含んでいる。コマ
ンド解析処理11は、中断点設定コマンド21を解析す
る。中断点設定処理12は、コマンド解析処理11で解
析された中断点設定コマンド21に従い、ソースプログ
ラム4,オブジェクトコード6およびソース情報ファイ
ル7を用いて、中断点が設定されるべきソース位置およ
び中断条件を中断点表3に設定する。中断点表3の詳細
は、図7を参照して後述する。また、中断点設定処理1
2は、行アドレス対応表71を参照して、前記ソース位
置に対応するオブジェクトのアドレスを求め、そのアド
レスのオブジェクトコード上の命令を退避すると共に割
込み命令で置換する(以下、この置換により挿入された
割込み命令を中断点割込み命令という場合がある)。な
お、上記ソース位置とは、ソースプログラム4上での特
定のプログラム要素(例えば、関数呼出し点)の位置で
あり、ファイル番号(特定名のファイルと1対1に対応
する)と行番号と列(カラム)番号とを組み合わせて表
現することが出来る。
In the input processing 2, the interruption point setting command 21 input by the user from the input device 1004 is debugged 1
Pass to. Debug processing 1 includes command analysis processing 11 and
It includes a break point setting process 12, an instruction execution process 13, a break process 14, and a function call stack 15. The command analysis processing 11 analyzes the breakpoint setting command 21. The break point setting process 12 uses the source program 4, the object code 6 and the source information file 7 according to the break point setting command 21 analyzed in the command analysis process 11 to set the source position and the break condition at which the break point should be set. Is set in the interruption point table 3. Details of the break point table 3 will be described later with reference to FIG. 7. Also, break point setting process 1
2 refers to the row address correspondence table 71, obtains the address of the object corresponding to the source position, saves the instruction in the object code of that address, and replaces it with an interrupt instruction (hereinafter, this instruction is inserted by this replacement). Sometimes an interrupt instruction is called a breakpoint interrupt instruction). The source position is a position of a specific program element (for example, a function call point) on the source program 4, and includes a file number (corresponding to a file having a specific name on a one-to-one basis), a line number, and a column. (Column) number can be combined and expressed.

【0025】命令実行処理13は、実行プログラムの命
令アドレスを更新しながら命令を実行する。命令実行中
に前記中断点割込み命令による割込みが発生すると、割
込み処理を行い、次に中断条件を満たしているか否かを
判定する。満たしている場合には、中断処理14に制御
を渡す。そして、中断処理14から制御を戻されると、
前記中断点割込み命令で置換した命令以下の実行を再開
する。一方、中断条件を満たしていない場合は、中断す
ることなく、前記中断点割込み命令で置換した命令以下
の実行を続行する。中断処理14は、命令実行を中断し
て、ユーザからの入力を待つ。また、現中断点付近のソ
ースファイル4の内容を表示装置1002に表示し、カ
ーソル等により現中断点をユーザに示す。ユーザが継続
実行を指示すると、命令実行処理13に制御を戻す。
The instruction execution processing 13 executes the instruction while updating the instruction address of the execution program. When an interrupt due to the interrupt point interrupt instruction occurs during instruction execution, interrupt processing is performed, and then it is determined whether or not the interrupt condition is satisfied. If it is satisfied, the control is passed to the interruption processing 14. Then, when the control is returned from the interruption processing 14,
Resume execution of the instructions below the instruction replaced by the interruption interrupt instruction. On the other hand, if the interruption condition is not satisfied, the execution of the instruction replaced by the interruption point interrupt instruction and the following steps are continued without interruption. The suspending process 14 suspends command execution and waits for an input from the user. Further, the contents of the source file 4 near the current break point are displayed on the display device 1002, and the current break point is shown to the user by a cursor or the like. When the user gives an instruction for continuous execution, control is returned to the instruction execution processing 13.

【0026】以下、本発明の3つの適用例を説明する。
なお、説明の簡略化のため、ソース位置は行番号のみで
表現する(1行に関数呼出しは1つしかないものとす
る)。また、関数名は必ず「関数名()」の形式で扱わ
れるものとする。さらに、関数中断点(関数の入口点お
よび/または出口点に設定される中断点)は入口点のみ
に設定することとする。
Three application examples of the present invention will be described below.
For simplification of description, the source position is expressed only by the line number (it is assumed that there is only one function call per line). Moreover, the function name is always handled in the form of "function name ()". Further, the function break point (the break point set at the entry point and / or the exit point of the function) is set only at the entry point.

【0027】−適用例1− 適用例1は、C言語のような手続き型言語を用いたソー
スプログラム4に対して本発明を適用したものである。
図3は、ソースプログラム4の例1である。プログラム
言語はC言語である。第1行から第7行までが関数ab
s()の定義であり、第15行,第16行,第26行に
その関数abs()の呼出しがある。また、第11行か
ら第18行までが関数absmax()の定義であり、
第27行にその関数absmax()の呼出しがある。
-Application Example 1-Application Example 1 is an application of the present invention to a source program 4 using a procedural language such as C language.
FIG. 3 is an example 1 of the source program 4. The programming language is C language. Lines 1 to 7 are functions ab
This is the definition of s (), and the function abs () is called at the 15th, 16th and 26th lines. Lines 11 to 18 are the definition of the function absmax (),
On line 27 there is a call to the function absmax ().

【0028】図4は、行アドレス対応表71の例であ
る。行アドレス対応表71の各エントリは、ソースプロ
グラム4の実行文ごとに作成され、ソース位置欄711
にソースプログラム4上の実行文の行番号を有し、オブ
ジェクト位置欄712に前記実行文のコンパイル結果が
格納されているオブジェクトコード6上のアドレスを有
している。例えば、エントリ7111は、図3のソース
プログラム4上の行番号24の実行文のコンパイル結果
がオブジェクトコード6上のアドレス0228に格納さ
れていることを表している。
FIG. 4 is an example of the row address correspondence table 71. Each entry of the row address correspondence table 71 is created for each execution statement of the source program 4 and is stored in the source position column 711.
Has the line number of the execution statement on the source program 4, and the object position column 712 has the address on the object code 6 where the compilation result of the execution statement is stored. For example, entry 7111 indicates that the compilation result of the executable statement at line number 24 on the source program 4 in FIG. 3 is stored at address 0228 on the object code 6.

【0029】図5は、関数情報表72の例である。関数
情報表72の各エントリは、コンパイル処理5の意味解
析時に関数が認識される度に作成され、関数番号欄72
1に個々の関数に一意に付与された関数番号を有し、関
数名欄722に関数名を有し、関数中断点欄723に当
該関数の入口点および出口点のソース位置を有し(ここ
では入口点のみ)、所属クラス番号欄724に当該関数
の所属クラスのクラス番号を有している(ここでは関数
の所属クラスがないため“0”になっている)。
FIG. 5 is an example of the function information table 72. Each entry of the function information table 72 is created each time the function is recognized during the semantic analysis of the compilation process 5, and the function number column 72
1 has the function number uniquely assigned to each function, the function name column 722 has the function name, and the function break point column 723 has the source position of the entry point and the exit point of the function (here (Only the entry point), the belonging class number column 724 has the class number of the belonging class of the function (here, it is "0" because there is no belonging class of the function).

【0030】クラス階層情報73は、ソースプログラム
4の具体例1では、関数の所属クラスがないため、作成
されない。
In the specific example 1 of the source program 4, the class hierarchy information 73 is not created because there is no class to which the function belongs.

【0031】図6は、デバッグ処理1が起動された時
に、ユーザが図4のソースプログラム4に対し指定する
関数中断点設定コマンドの例である。コマンド101の
「FBREAK abs()」は、従来と同じ関数中断
点設定コマンドである。「FBREAK」は関数が呼ば
れた時に必ず中断する種類の中断点設定コマンドであ
る。オペランド「abs()」は、中断点を設定する関
数名である。デバッグ処理1の中断点設定処理12は、
先ず、オペランドの関数名“abs()”から関数情報
表72(図5)を用いて関数名欄722が一致するエン
トリを求める。そのエントリの関数中断点欄723の内
容から関数中断点のソース位置(これをSFBとする)
として“4”を得る。次に、行アドレス対応表71(図
4)を検索し、ソース位置欄711が、関数中断点のソ
ース位置SFBの“4”と一致するエントリを求める。
そのエントリのオブジェクト位置欄712の内容からオ
ブジェクト位置(これをOFBとする)として“002
8”を得る。次に、ソース位置SFBの“4”を中断点
表3に登録する。また、オブジェクト位置OFBの“0
028”(アドレス)にある命令を退避し、割込み命令
で置換する。
FIG. 6 shows an example of a function breakpoint setting command specified by the user for the source program 4 of FIG. 4 when the debug process 1 is started. "FBREAK abs ()" of the command 101 is the same function break point setting command as in the related art. "FBREAK" is a type of break point setting command that always breaks when a function is called. The operand "abs ()" is the name of the function that sets the break point. The break point setting process 12 of the debug process 1 is
First, using the function information table 72 (FIG. 5), the entry in which the function name column 722 matches is found from the function name “abs ()” of the operand. From the contents of the function break point column 723 of the entry, the source position of the function break point (this is SFB)
And get "4". Next, the row address correspondence table 71 (FIG. 4) is searched, and the entry in which the source position column 711 matches “4” of the source position SFB of the function interruption point is obtained.
From the contents of the object position column 712 of the entry, the object position (this is referred to as OFB) is set to “002
8 "is obtained. Next," 4 "of the source position SFB is registered in the interruption point table 3. Also," 0 "of the object position OFB is registered.
The instruction at 028 "(address) is saved and replaced with an interrupt instruction.

【0032】コマンド102の「CFBREAK ab
s() main() B」は、本発明にかかる呼出し
条件関数付き中断点設定コマンドである。「CFBRE
AK」は、指定された呼出し条件関数と実際の呼出し関
数とが合致しているときに原則として中断し、合致して
いないときに原則として中断しない種類の呼出し条件関
数付き中断点設定コマンドを指定するコマンド部であ
る。第1オペランドの「abs()」は、中断点を設定
する関数名を指定する関数指定部である。第2オペラン
ドの「main()」は、第1オペランドの関数を呼び
出す関数名を指定する呼出し条件関数指定部である。第
3オペランドの「B」は、第1オペランドの関数「ab
s()」が第2オペランドの関数「main()」に呼
び出されたなら中断し,第2オペランドの関数でない関
数に呼び出されたなら中断しないことを指定する条件動
作指定部である。従って、図3のソースプログラム4の
26行目で関数main()が関数abs()を呼び出
すと中断するが、15行目および16行目で関数abs
max()が関数abs()を呼び出しても中断しな
い。なお、第3オペランドが「C」なら、第1オペラン
ドの関数が第2オペランドの関数に呼び出されたなら中
断せず、第2オペランドの関数でない関数に呼び出され
たなら中断する。
The command 102 "CFBREAK ab
s () main () B "is a breakpoint setting command with a call conditional function according to the present invention. "CFBRE
"AK" designates a break point setting command with a call condition function of a type that, in principle, interrupts when the specified call condition function and the actual call function match, and does not break when they do not match. It is the command section to do. “Abs ()” of the first operand is a function designating unit that designates a function name for setting an interruption point. The "main ()" of the second operand is a calling condition function designating unit that designates a function name that calls the function of the first operand. The third operand "B" is the function "ab" of the first operand.
This is a conditional action designating unit that designates that if "s ()" is called by the function "main ()" of the second operand, it is interrupted, and if it is called by a function that is not the function of the second operand, it is not interrupted. Therefore, when the function main () calls the function abs () at the 26th line of the source program 4 in FIG. 3, the process is interrupted, but at the 15th and 16th lines, the function abs
Even if max () calls the function abs (), there is no interruption. If the third operand is “C”, the function of the first operand is not interrupted if it is called by the function of the second operand, and is interrupted if it is called by a function that is not the function of the second operand.

【0033】コマンド103の「CFNBREAK a
bsmax() main() C」は、前記コマンド
102と実質的に同じである。但し、「CFNBREA
K」は、指定された呼出し条件関数と実際の呼出し関数
とが合致しているときに原則として中断せず、合致して
いないときに原則として中断する種類の呼出し条件関数
付き中断点設定コマンドを指定するコマンド部である。
すなわち、前記コマンド102では第3オペランドを
“B”にして使うのが原則であるのに対し、コマンド1
03では第3オペランドを“C”にして使うのが原則で
ある。
The command 103 "CFNBREAK a
bsmax () main () C ”is substantially the same as the command 102. However, "CFNBREA
"K" is a break point setting command with a call condition function of a type that does not interrupt in principle when the specified call condition function and the actual call function match, and interrupts when they do not match. This is the command section to specify.
That is, in principle, the command 102 uses the third operand with "B", while the command 1
In principle, 03 uses the third operand as "C".

【0034】図7は、図6の中断点設定コマンド列に対
してデバッグ処理1の中断点設定処理12が作成した中
断点表3の例である。中断点表3の中断点表番号欄31
には、第1オペランドの関数に対応する中断点のソース
位置が格納される。中断条件欄32は、呼出し関数番号
欄321と,条件動作指定欄322とからなる。呼出し
関数番号欄321には、第2オペランドの関数の関数番
号が格納される。第2オペランドがない場合は、“0”
が格納される。条件動作指定欄322には、第3オペラ
ンドの値が格納される。第3オペランドがない場合は、
“N”が格納される。
FIG. 7 shows an example of the break point table 3 created by the break point setting process 12 of the debug process 1 for the break point setting command sequence shown in FIG. Breakpoint table number column 31 of the breakpoint table 3
In, the source position of the break point corresponding to the function of the first operand is stored. The interruption condition column 32 includes a calling function number column 321 and a conditional operation designation column 322. The call function number column 321 stores the function number of the function of the second operand. "0" if there is no second operand
Is stored. The value of the third operand is stored in the conditional operation designation column 322. If there is no third operand,
“N” is stored.

【0035】図8は、デバッグ処理1の中断点設定処理
12による関数中断点設定手順を説明するフローチャー
ト図である。ステップ801では、関数中断点設定コマ
ンドの関数名FNと中断条件(第2オペランドおよび第
3オペランド)を読み込む。ステップ802では、関数
情報表72を検索し、関数名FNに合致する関数名欄7
22をもつエントリを探し、そのエントリの関数中断点
欄723から関数中断点ソース位置BPNを取得する。
ステップ804では、中断条件の有無(第2オペランド
および第3オペランドの有無)を判定し、中断条件があ
るときはステップ808に進み、中断条件がないときは
ステップ805に進む。ステップ805では、呼出し関
数番号CFI=0とする。ステップ806では、条件動
作指定F=Nとする。そして、ステップ812に進む。
FIG. 8 is a flow chart for explaining a function break point setting procedure by the break point setting process 12 of the debug process 1. In step 801, the function name FN and the interruption condition (second operand and third operand) of the function interruption point setting command are read. In step 802, the function information table 72 is searched and the function name column 7 matching the function name FN is searched.
The entry having 22 is searched for, and the function break point source position BPN is acquired from the function break point column 723 of the entry.
In step 804, the presence / absence of the interruption condition (presence / absence of the second operand and the third operand) is determined. If the interruption condition exists, the process proceeds to step 808, and if the interruption condition does not exist, the process proceeds to step 805. In step 805, the calling function number CFI = 0. In step 806, the conditional action designation F = N. Then, the process proceeds to step 812.

【0036】ステップ808では、関数情報表72を用
いて、第2オペランドの関数名の関数の関数番号を取得
し、それを呼出し関数番号CFIとする。ステップ80
9では、第3オペランドの値を判定し、“B”ならステ
ップ810に進み、“C”ならステップ811に進む。
ステップ810では、条件動作指定F=Bとする。そし
て、ステップ812に進む。ステップ811では、条件
動作指定F=Cとする。そして、ステップ812に進
む。ステップ812では、(関数中断点ソース位置BP
N,呼出し関数番号CFI,条件動作指定F)を、中断
点表3の(中断点行番号31,呼出し関数番号321,
条件動作指定322)に登録する。
In step 808, the function information table 72 is used to acquire the function number of the function having the function name of the second operand, and set it as the calling function number CFI. Step 80
At 9, the value of the third operand is determined. If "B", the process proceeds to step 810, and if "C", the process proceeds to step 811.
In step 810, conditional operation designation F = B. Then, the process proceeds to step 812. In step 811, the conditional operation designation F = C. Then, the process proceeds to step 812. In step 812, (function break point source position BP
N, the calling function number CFI, the conditional operation designation F) is defined as (break point line number 31, calling function number 321,
It is registered in the conditional operation designation 322).

【0037】図9は、デバッグ処理1の命令実行処理1
3の動作を説明するフローチャート図である。ステップ
900では、実行するべき命令のアドレスに未実行の命
令があるか否か判定する。未実行の命令があればステッ
プ901に進み、未実行の命令がなければ処理を終了す
る。ステップ901では、オブジェクトコード6から1
命令を取り出す。なお、取り出した命令が関数main
()の最初の命令であれば、関数呼出しスタック15に
関数main()の関数番号をプッシュする。ステップ
902では、取り出した命令が中断点の割込み命令か否
か判定する。中断点の割込み命令ならステップ903に
進み、中断点の割込み命令でないならステップ907に
進む。ステップ903では、中断点表3を参照し、条件
付き関数中断点であるか否かを判定する。条件付き関数
中断点ならステップ904に進み、条件付き関数中断点
でないならステップ912に進む。ステップ904で
は、中断点表3を参照し、条件動作指定が“B”か否か
を判定する。条件動作指定が“B”ならステップ905
に進み、“B”でないならステップ906に進む。ステ
ップ905では、中断点表3に登録された呼出し関数番
号と実際に呼び出した関数が対応するか否かを判定す
る。実際の呼出し関数は、関数呼出しスタック15によ
り知ることが出来る(トップから2番目にプッシュされ
ている関数が実際の呼出し関数である)。中断点表3に
登録された呼出し関数番号の関数から呼び出されたのな
ら、ステップ912に進む。中断点表3に登録された呼
出し関数番号の関数から呼び出されたのでないなら、ス
テップ907に進む。ステップ906では、中断点表3
に登録された呼出し関数番号の関数から呼び出されたの
か否かを判定する。中断点表3に登録された呼出し関数
番号の関数から呼び出されたのなら、ステップ907に
進む。中断点表3に登録された呼出し関数番号の関数か
ら呼び出されたのでないなら、ステップ912に進む。
FIG. 9 shows the instruction execution process 1 of the debug process 1.
It is a flowchart figure explaining operation | movement of 3. In step 900, it is determined whether or not there is an unexecuted instruction at the address of the instruction to be executed. If there is an unexecuted instruction, the process proceeds to step 901, and if there is no unexecuted instruction, the process ends. In step 901, the object code 6 to 1
Take out the instruction. The fetched instruction is the function main
If it is the first instruction in (), the function number of the function main () is pushed onto the function call stack 15. In step 902, it is determined whether the fetched instruction is an interrupt instruction at a break point. If it is the interrupt instruction at the interruption point, the process proceeds to step 903. If it is not the interrupt instruction at the interruption point, the process proceeds to step 907. In step 903, it is determined whether the breakpoint is a conditional function breakpoint with reference to the breakpoint table 3. If it is a conditional function break point, the process proceeds to step 904, and if it is not a conditional function break point, the process proceeds to step 912. In step 904, the interruption point table 3 is referred to, and it is determined whether the conditional operation designation is “B”. If the conditional operation designation is "B", step 905
Go to step 906 if not "B". In step 905, it is determined whether or not the call function number registered in the break point table 3 corresponds to the function actually called. The actual calling function can be known from the function call stack 15 (the function pushed second from the top is the actual calling function). If it is called from the function having the calling function number registered in the interruption point table 3, the process proceeds to step 912. If it is not called from the function having the calling function number registered in the interruption point table 3, the process proceeds to step 907. In step 906, the break point table 3
It is determined whether the function is called from the function having the calling function number registered in. If the function having the call function number registered in the break point table 3 is called, the process proceeds to step 907. If it is not called from the function having the calling function number registered in the interruption point table 3, the process proceeds to step 912.

【0038】ステップ907では、取り出した命令が関
数呼出命令か否かを判定する。関数呼出命令ならステッ
プ908に進み、関数呼出命令でないならステップ90
9に進む。ステップ908では、関数呼出命令を実行
し、その後、関数呼出しスタック15に呼出し先の関数
番号をプッシュし、前記ステップ900に戻る。
In step 907, it is determined whether the fetched instruction is a function call instruction. If it is a function call command, the process proceeds to step 908. If it is not a function call command, step 90
Proceed to 9. In step 908, the function call instruction is executed, and then the called function number is pushed onto the function call stack 15, and the process returns to step 900.

【0039】ステップ909では、取り出した命令が関
数復帰命令か否かを判定する。関数復帰命令ならステッ
プ910に進み、関数復帰命令でないならステップ91
1に進む。ステップ910では、関数呼出しスタック1
5のトップから関数番号をポップし、その後、復帰命令
を実行し、前記ステップ900に戻る。
In step 909, it is determined whether the fetched instruction is a function return instruction. If it is a function return instruction, the process proceeds to step 910. If it is not a function return instruction, step 91
Go to 1. In step 910, the function call stack 1
The function number is popped from the top of 5, and then a return instruction is executed, and the process returns to step 900.

【0040】ステップ911では、取り出した命令が中
断点割り込み命令でない場合は、取り出した命令を実行
する。一方、取り出した命令が中断点割り込み命令であ
る場合は、その中断点割り込み命令で置換していた命令
(退避していた命令)を実行する。また、中断処理14
から制御が戻されたときも、中断点割り込み命令で置換
していた命令(退避していた命令)を実行する。そし
て、前記ステップ900に戻る。ステップ912では、
中断処理14に制御を渡す。中断処理14でユーザが継
続実行を指示すれば、中断処理14から制御が戻され、
前記ステップ911に戻る。一方、中断処理14でユー
ザが処理停止を指示すれば、処理を終了する。
In step 911, if the fetched instruction is not a break point interrupt instruction, the fetched instruction is executed. On the other hand, when the fetched instruction is the interruption point interrupt instruction, the instruction replaced with the interruption point interruption instruction (the instruction that has been saved) is executed. Also, the interruption process 14
Even when the control is returned from, the instruction replaced by the interruption interrupt instruction (the instruction saved) is executed. Then, the process returns to step 900. In step 912,
Control is passed to the interruption processing 14. If the user instructs continuous execution in the interruption processing 14, control is returned from the interruption processing 14,
Returning to step 911. On the other hand, if the user gives an instruction to stop the processing in the interruption processing 14, the processing ends.

【0041】図10は、関数呼出しスタック15のプッ
シュとポップの動作を説明する図である。スタック状態
151は、関数番号“3”のみがプッシュされている状
態で、図3のソースプログラム4の24行目の状態であ
る。スタック状態153は、上記ステップ908による
プッシュ動作152で、関数番号“3”の上に関数番号
“1”がプッシュされた状態であり、図3のソースプロ
グラム4の26行目の状態である。スタック状態155
は、上記ステップ909によるポップ動作154で、ト
ップの関数番号“1”がポップされて、関数番号“3”
がトップにきた状態であり、図3のソースプログラム4
の6行目の状態である。
FIG. 10 is a diagram for explaining the push and pop operations of the function call stack 15. The stack state 151 is a state in which only the function number “3” is pushed, and is the state of the 24th line of the source program 4 in FIG. The stack state 153 is a state in which the function number “1” is pushed on the function number “3” in the push operation 152 in step 908, and is the state of the 26th line of the source program 4 in FIG. Stuck state 155
Is popped at the top function number "1" by the pop operation 154 at step 909, and the function number "3"
Is at the top, and the source program 4 in Figure 3
This is the state of the sixth line.

【0042】以上のように、図6の呼出し条件付き中断
点設定コマンド(102,103)およびそれに対応し
た動作により、ユーザは、単に関数中断点を指定するだ
けでなく、その呼出し関数を限定した形での条件付き関
数中断点を設定できるようになる。このため、デバッグ
作業を効率的に行なうことが出来る。
As described above, the user does not only specify the function break point but also limits the call function by the call condition conditional break point setting commands (102, 103) in FIG. 6 and the operation corresponding thereto. Allows you to set conditional function breakpoints in the form. Therefore, the debugging work can be efficiently performed.

【0043】−適用例2− 適用例2は、C++言語のようなオブジェクト指向言語
を用いたソースプログラム4に対して本発明を適用した
ものである。オブジェクト指向言語におけるクラスとそ
のメンバ関数のような関係により関数がグループ化され
ている場合には、前記適用例1よりも効果的な呼出し条
件関数付きの中断点の設定が可能となる。図11および
図12は、ソースプログラム4の例2,例3である。プ
ログラム言語は、C++言語である。C++言語では、
関数は、クラス内に存在するメンバ関数とクラスの外に
存在する非メンバ関数がある。図11のソースプログラ
ム4の例2での関数は、すべてメンバ関数である。一
方、図12のソースプログラム4の例3での関数mai
n()および関数f()は、非メンバ関数であり、特定
のクラスに所属していない関数である。
-Application Example 2-Application Example 2 is one in which the present invention is applied to the source program 4 using an object-oriented language such as the C ++ language. When the functions are grouped by the relationship such as the class and its member function in the object-oriented language, it is possible to set the break point with the call condition function more effectively than the application example 1. 11 and 12 are examples 2 and 3 of the source program 4. The programming language is the C ++ language. In C ++ language,
Functions include member functions that exist inside the class and non-member functions that exist outside the class. The functions in Example 2 of the source program 4 in FIG. 11 are all member functions. On the other hand, the function mai in the example 3 of the source program 4 in FIG.
The n () and the function f () are non-member functions and do not belong to a specific class.

【0044】メンバ関数はクラス内に存在するので、関
数の特定のために、クラス名を修飾する必要がある。そ
こで、 「クラス名::メンバ関数名(引数型リスト)」 の形式でメンバ関数を表現することとする。引数型リス
トを付与するのは、多義化関数(同一名で引数の型が異
なる関数が定義できる)の存在を考慮しているためであ
るが、説明の簡単化のため、単に「()」を付けるのみ
とする。
Since the member function exists in the class, it is necessary to qualify the class name to identify the function. Therefore, the member function is expressed in the format of "class name :: member function name (argument type list)". The argument type list is added because it takes into account the existence of polysemy functions (functions with the same name but different argument types can be defined), but for simplicity of explanation, simply use "()". Only attach.

【0045】図11のソースプログラム4の例2は、い
わゆるクラス宣言であり、各種のプログラムが共通に使
うことを目的としてクラス階層を定義しており、通常ヘ
ッダファイルとして用いるものである。クラスLには、 103行目に、L::add() 104行目に、L::print() 105行目に、L::append() がそれぞれ定義されている。また、108行目のクラス
iLは、「:L」の指定により、クラスLの全メンバ
(関数も含む)を継承している。クラスiLに特有の関
数として、 109行目に、iL::addi() 110行目に、iL::printi() が定義されている。これにより、クラスiLでは継承元
であるクラスLの3つのメンバ関数add(),pri
nt(),append()の他に、addi()およ
びprinti()も使用する(呼び出す)ことが出来
る。同様に、113行目のクラスsLも、クラスLを継
承しており、上記3つのメンバ関数に加えて、関数ad
ds()を使用することが出来る。また、117行目の
クラスpLは、クラスiLを継承している。また、クラ
スpLに特有の関数として、 118行目に、pL::addp() が定義されている。また、各関数の定義において、 109行目に、iL::addi()からL::add
()の呼出し 114行目に、sL::adds()からL::add
()の呼出し の呼出し関係がある。
Example 2 of the source program 4 in FIG. 11 is a so-called class declaration, which defines a class hierarchy for the purpose of being commonly used by various programs, and is usually used as a header file. In the class L, L :: add () is defined in the 104th line, L :: print () is defined in the 105th line, and L :: append () is defined in the class L, respectively. Further, the class iL on the 108th line inherits all members (including functions) of the class L by the specification of ": L". As a function peculiar to the class iL, iL :: addi () is defined on the 109th line, and iL :: printi () is defined on the 110th line. As a result, in the class iL, the three member functions add (), pri of the class L that is the inheritance source are added.
In addition to nt () and append (), addi () and printi () can also be used (called). Similarly, the class sL on the 113th line also inherits the class L, and in addition to the above three member functions, the function ad
ds () can be used. The class pL on the 117th line inherits the class iL. In addition, pL :: addp () is defined in the 118th line as a function peculiar to the class pL. In addition, in the definition of each function, on line 109, from iL :: addi () to L :: add
() Call on line 114, from sL :: adds () to L :: add
There is a call relationship of () call.

【0046】図12は、図11のソースプログラム4で
定義されているクラス階層をクラスライブラリとして利
用しているソースプログラム4の例3である。各クラス
のオブジェクトとして、 203行目に、クラスLのオブジェクトa 204行目に、クラスiLのオブジェクトai 205行目に、クラスsLのオブジェクトas がそれぞれ定義されている。また、関数の呼出し関係と
して、 208行目に、関数f()からL::add()の呼出
し 212行目に、関数main()からL::add()
の呼出し 213行目に、関数main()からiL::addi
()の呼出し 214行目に、関数main()からsL::adds
()の呼出し が存在する。
FIG. 12 is an example 3 of the source program 4 using the class hierarchy defined in the source program 4 of FIG. 11 as a class library. As an object of each class, an object a of class sL is defined on the 203rd line, an object a of the class L is on the 204th line, and an object ai of the class iL is on the 205th line. As a function call relationship, a function f () calls L :: add () on line 208, and a function main () calls L :: add () on line 212.
Call 213 from the function main () to iL :: addi
() Call on line 214 from function main () to sL :: adds
There is a call to ().

【0047】図13は、図11のソースプログラム4の
例2に対するクラス情報表731の構成例である。クラ
ス情報表731の各エントリは、コンパイル処理5の意
味解析時にクラスが認識される度に作成され、クラス番
号欄7311に個々のクラスに一意に付与されたクラス
番号を有し、クラス名欄7312にクラス名を有してい
る。
FIG. 13 is a structural example of the class information table 731 for Example 2 of the source program 4 of FIG. Each entry of the class information table 731 is created each time a class is recognized during the semantic analysis of the compilation process 5, has a class number uniquely assigned to each class in the class number column 7311, and has a class name column 7312. Has a class name.

【0048】図14は、図11のソースプログラム4の
例2に対する継承情報表732の構成例である。図11
及び図12のプログラム例に対するクラス情報表731
と継承関係情報表732の構成例である。各エントリ
は、継承元クラス番号欄7321と,継承先クラス番号
欄7322とからなる。例えば、エントリ7323は、
クラス番号2(クラスiL)が、クラス番号1(クラス
L)を継承していることを表わしている。
FIG. 14 is a structural example of the inheritance information table 732 for the example 2 of the source program 4 of FIG. Figure 11
And class information table 731 for the example program of FIG.
3 is a configuration example of the inheritance relationship information table 732. Each entry includes an inheritance source class number column 7321 and an inheritance destination class number column 7322. For example, entry 7323 is
It indicates that the class number 2 (class iL) inherits the class number 1 (class L).

【0049】図15は、図11のソースプログラム4の
例2および図12のソースプログラム4の例3に対する
関数情報表72の構成例である。関数番号4から関数番
号6までの関数は、クラスLに所属するメンバ関数であ
るため、その所属クラス番号欄724の内容は“1”
(クラスL)となっている。なお、どのクラスにも所属
しない関数の場合には、所属クラス番号欄724の内容
は“0”となっている。
FIG. 15 shows a configuration example of the function information table 72 for the example 2 of the source program 4 of FIG. 11 and the example 3 of the source program 4 of FIG. Since the functions from function number 4 to function number 6 are member functions belonging to class L, the content of the belonging class number column 724 is "1".
(Class L). If the function does not belong to any class, the content of the belonging class number column 724 is “0”.

【0050】図16は、デバッグ処理1が起動された時
に、ユーザが図11のソースプログラム4および図12
のソースプログラム4に対して指定するクラス指定型中
断条件付き関数中断点設定コマンドの例である。コマン
ド201の「CCFBREAK L::add() iL」
は、本発明にかかるクラス指定型呼出し条件関数付き中
断点設定コマンドである。「CCFBREAK」は、関
数指定部または呼出し条件関数指定部にクラスが指定さ
れているとき、当該クラスに所属する関数の全てが指定
されたものとし、指定された呼出し条件関数と実際の呼
出し関数とが合致しているときに原則として中断し、合
致していないときに原則として中断しない種類の呼出し
条件関数付き中断点設定コマンドを指定するコマンド部
である。第1オペランドの「L::add()」は、関数
指定部である。第2オペランドの「iL」は、呼出し条
件関数指定部である。第1オペランドおよび第2オペラ
ンドは共に、関数名またはクラス名の指定が可能であ
り、クラス名が指定された場合には、そのクラスに所属
するすべてのメンバ関数を指すことになる。第3オペラ
ンドはないが、条件動作指定“B”が仮定されている。
コマンド201の場合、第1オペランドの関数「L::a
dd()」が第2オペランドのクラス「iL」に属する
関数に呼び出されたなら中断し,第2オペランドのクラ
ス「iL」に属する関数でない関数に呼び出されたなら
中断しない。例えば、図11のソースプログラム4の1
09行目で関数add()が呼び出されたなら中断する
が、114行目で関数add()が呼び出されても中断
しない。同様に、コマンド202の「CCFBREAK
L iL::addi()」の場合、クラス「L」のす
べてのメンバ関数(ここでは、L::add(),
L::append(),L::print()の3関
数)に関数中断点を設定し、これらのメンバ関数が関数
iL::addi()に呼び出されたなら中断し,関数
iL::addi()でない関数に呼び出されたなら中
断しない。なお、第1オペランドおよび第2オペランド
が共に関数である場合は、図6のコマンド102「CF
BREAK」またはコマンド103「CFNBREA
K」で第3オペランドを“B”にしたときと同等とな
る。
In FIG. 16, when the debug process 1 is started, the user can select the source program 4 of FIG.
10 is an example of a class specification type interrupt condition-specified function interruption point setting command specified for the source program 4 of FIG. Command 201 “CCFBREAK L :: add () iL”
Is a break point setting command with a class-specified type call condition function according to the present invention. "CCFBREAK" means that when a class is specified in the function specification part or the call condition function specification part, all the functions belonging to the class are specified, and the specified call condition function and the actual call function are specified. Is a command section for specifying a break point setting command with a call condition function that, in principle, suspends when the two match and does not interrupt when the two do not match. "L :: add ()" of the first operand is a function designation part. The second operand “iL” is a call condition function designating part. Both the first operand and the second operand can specify a function name or a class name, and when the class name is specified, it means all the member functions that belong to the class. Although there is no third operand, the conditional action designation "B" is assumed.
In the case of command 201, the function “L :: a” of the first operand
If dd () ”is called by a function belonging to the second operand class“ iL ”, it is interrupted, and if it is called by a function that is not a function belonging to the second operand class“ iL ”, it is not interrupted. For example, 1 of the source program 4 in FIG.
If the function add () is called at the 09th line, it is interrupted, but it is not interrupted even if the function add () is called at the 114th line. Similarly, the command 202 “CCFBREAK
In the case of “L iL :: addi ()”, all member functions of the class “L” (here, L :: add (),
L :: append (), L :: print () three functions) are set as function break points, and if these member functions are called by the function iL :: addi (), the function break is made, and the function iL :: addi is stopped. Do not interrupt if called by a function that is not (). If both the first operand and the second operand are functions, the command 102 "CF
BREAK ”or command 103“ CFNBREA
This is the same as when the third operand is set to "B" in "K".

【0051】図17は、図16のクラス指定型の呼出し
条件関数付き中断点設定コマンドに対して、デバッグ処
理1の中断点設定処理12が作成した中断点表3の例で
ある。エントリ334は、コマンド201によって設定
された中断点である。このコマンド201のように、第
2オペランドをクラスで指定すると、複数の呼出し関数
番号を一括して指定可能となる。エントリ335は、コ
マンド202によって設定された中断点である。このコ
マンド202のように、第1オペランドをクラスで指定
すると、中断点を設定する複数の関数番号を一括して指
定可能となる。
FIG. 17 shows an example of the break point table 3 created by the break point setting process 12 of the debug process 1 for the break point setting command with call condition function of the class designation type shown in FIG. The entry 334 is a break point set by the command 201. When the second operand is designated by the class like this command 201, a plurality of calling function numbers can be designated collectively. Entry 335 is the break point set by command 202. When the first operand is designated by the class like this command 202, it becomes possible to collectively designate a plurality of function numbers for setting break points.

【0052】図18は、デバッグ処理1の中断点設定処
理12によるクラス指定型条件付き関数中断点設定手順
を説明するフローチャート図である。ステップ1801
では、クラス指定型呼出し条件関数付き中断点設定コマ
ンドの第1オペランドboprと第2オペランドcop
rを読み込む。ステップ1802では、第1オペランド
boprがクラス名か関数名かを例えば「()」の有無
で判定する。クラス名であるときは、ステップ1803
に進む。関数名であるときは、ステップ1805に進
む。ステップ1803では、クラス情報表731(図1
3)を用いて、第1オペランドboprのクラス名のク
ラス番号BCIを取得する。ステップ1804では、関
数情報表72(図15)を検索し、所属クラス欄724
の内容が前記クラス番号BCIと一致する関数の関数番
号を全て取得し、これらを関数番号集合BIGの要素と
する。そして、ステップ1806に進む。
FIG. 18 is a flow chart for explaining the procedure for setting a class-specified conditional function breakpoint at the breakpoint setting processing 12 of the debug processing 1. Step 1801
Then, the first operand bopr and the second operand cop of the breakpoint setting command with a class-specified type call condition function
Read r. In step 1802, it is determined whether the first operand bopr is a class name or a function name based on the presence or absence of “()”, for example. If it is a class name, step 1803
Proceed to. If it is a function name, the process proceeds to step 1805. In step 1803, the class information table 731 (see FIG.
3) is used to obtain the class number BCI of the class name of the first operand bopr. In step 1804, the function information table 72 (FIG. 15) is searched, and the belonging class column 724 is searched.
All the function numbers of the functions whose contents match the class number BCI are acquired, and these are set as the elements of the function number set BIG. Then, the process proceeds to step 1806.

【0053】ステップ1805では、関数情報表72
(図15)を用いて、第1オペランドboprの関数名
の関数番号BFIを取得し、これを関数番号集合BIG
の唯一の要素とする。ステップ1806では、関数情報
表72(図15)を検索し、関数番号集合BIGの要素
である各関数Fiの関数中断点欄723の内容から中断
点行番号Pi(iは、BPGの要素のインデックス)を
求める。ステップ1807では、第2オペランドcop
rがクラス名か関数名かを例えば「()」の有無で判定
する。クラス名であるときは、ステップ1809に進
む。関数名であるときは、ステップ1811に進む。ス
テップ1809では、クラス情報表731(図13)を
用いて、第2オペランドcoprのクラス名のクラス番
号CCIを取得する。ステップ1810では、関数情報
表72(図15)を検索し、所属クラス欄724の内容
が前記クラス番号CCIと一致する関数の関数番号CF
Iを全て取得する。そして、ステップ1812に進む。
In step 1805, the function information table 72
(FIG. 15) is used to obtain the function number BFI of the function name of the first operand bopr, and this is acquired as the function number set BIG.
The only element of. In step 1806, the function information table 72 (FIG. 15) is searched, and from the contents of the function break point column 723 of each function Fi which is an element of the function number set BIG, the break point line number Pi (i is the index of the element of BPG). ). In step 1807, the second operand cop
Whether r is a class name or a function name is determined by the presence or absence of "()", for example. If it is a class name, the process proceeds to step 1809. If it is a function name, the process proceeds to step 1811. In step 1809, the class number CCI of the class name of the second operand copr is acquired using the class information table 731 (FIG. 13). In step 1810, the function information table 72 (FIG. 15) is searched, and the function number CF of the function whose contents in the belonging class column 724 matches the class number CCI.
Get all I. Then, the process proceeds to step 1812.

【0054】ステップ1811では、関数情報表72
(図15)を用いて、第2オペランドcoprの関数名
の関数番号CFIを取得する。ステップ1812では、
前記ステップ1806で得た中断点行番号Piと,前記
ステップ1810または1811で得た関数番号CFI
の組(Pi,CFI)をすべて中断点表3(図17)に
登録する。また、中断点表3(図17)の条件動作指定
欄322には、“B”を格納する。
In step 1811, the function information table 72
Using FIG. 15, the function number CFI of the function name of the second operand copr is acquired. In step 1812,
The break point line number Pi obtained in step 1806 and the function number CFI obtained in step 1810 or 1811
All the pairs (Pi, CFI) are registered in the interruption point table 3 (FIG. 17). Further, “B” is stored in the conditional operation designation column 322 of the interruption point table 3 (FIG. 17).

【0055】図17の中断点表3に対するデバッグ処理
1の命令実行処理13の動作は、図9に示したフローチ
ャート図と基本的に同じである。但し、ステップ905
およびステップ906における「中断点表3に登録され
た呼出し関数番号と実際に呼び出した関数が対応するか
否か」の判定は、図17の呼出し関数条件欄321に登
録されている関数の数だけ繰り返し、いずれかと一致す
れば「Yes」と判定し、いずれとも一致しなかったと
きのみ「NO」と判定する。
The operation of the instruction execution process 13 of the debug process 1 for the interruption point table 3 of FIG. 17 is basically the same as that of the flow chart shown in FIG. However, step 905
And the determination of "whether or not the calling function number registered in the interruption point table 3 corresponds to the actually called function" in step 906 is performed by the number of functions registered in the calling function condition column 321 of FIG. Repeatedly, if any of them matches, it is determined to be “Yes”, and only when they do not match, it is determined to be “NO”.

【0056】以上のように、図16のクラス指定型呼出
し条件関数付き中断点設定コマンドおよびそれに対応し
た動作により、ユーザは、中断点を設定すべき関数や呼
出し条件とする関数をクラス名で指定できる。オブジェ
クト指向言語では、クラス単位での扱いが主となるた
め、ユーザの意図に適する効率的な条件付き関数中断点
の設定が可能となり、デバッグ作業の効率化に寄与す
る。
As described above, by the break point setting command with a class-specified type call condition function of FIG. 16 and the operation corresponding thereto, the user specifies the function for which a break point is to be set or the function to be called condition by the class name. it can. Since the object-oriented language mainly deals with class units, it is possible to efficiently set conditional function break points suitable for the user's intention, which contributes to the efficiency of debugging work.

【0057】−適用例3− 適用例3は、上記適用例2と同様に、C++言語のよう
なオブジェクト指向言語を用いたソースプログラム4に
対して本発明を適用したものであるが、関数の代りにク
ラスが指定されているとき、当該クラスに所属する関数
および当該クラスを継承するクラスに所属する関数の全
てが指定されたものとして処理する例である。これによ
り、上記適用例2よりもデバッグ作業が効率的になる。
適用例3でも、図11および図12のソースプログラム
4の例2,例3を使用する。図19は、デバッグ処理1
が起動された時に、ユーザが図11のソースプログラム
4および図12のソースプログラム4に対して指定する
クラス階層指定型呼出し条件関数付き中断点設定コマン
ドの例である。コマンド301の「CLFNBREAK
L::add() L」は、本発明にかかるクラス階層指
定型呼出し条件関数付き中断点設定コマンドである。
「CLFNBREAK」は、関数指定部または呼出し条
件関数指定部にクラスが指定されているとき、当該クラ
スに所属する関数および当該クラスを継承するクラスに
所属する関数の全てが指定されたものとし、指定された
呼出し条件関数と実際の呼出し関数とが合致していると
きに原則として継続し、合致していないときに原則とし
て中断する種類の呼出し条件関数付き中断点設定コマン
ドを指定するコマンド部である。第1オペランドの
「L::add()」は、関数指定部である。第2オペラ
ンドの「L」は、呼出し条件関数指定部である。第1オ
ペランドおよび第2オペランドは共に、関数名またはク
ラス名の指定が可能であり、クラス名が指定された場合
には、そのクラスに所属するすべてのメンバ関数および
そのクラスを(間接的な継承も含めた)継承元とするす
べてのクラスの関数を指すことになる。あるクラスおよ
びそのクラスを(間接的な継承も含めた)継承元とする
すべてのクラスをクラス階層と呼ぶ。従って、第1オペ
ランドまたは第2オペランドで指定するクラス名は、ク
ラス階層の指定を意味する。第3オペランドはないが、
条件動作指定“C”が仮定されている。コマンド301
の場合、第1オペランドの関数「L::add()」が第
2オペランドのクラス「L」に属する関数またはクラス
「L」を直接継承するクラス「iL」「sL」に属する
関数またはクラス「L」を間接継承するクラス「pL」
に属する関数に呼び出されたなら継続し,そうでない関
数に呼び出されたならば中断する。
-Application Example 3-In Application Example 3, the present invention is applied to a source program 4 using an object-oriented language such as C ++, as in Application Example 2 above. When a class is designated instead, all the functions belonging to the class and the functions belonging to the class inheriting the class are processed as designated. As a result, the debugging work becomes more efficient than in the application example 2.
Also in the application example 3, the examples 2 and 3 of the source program 4 of FIGS. 11 and 12 are used. FIG. 19 shows the debug process 1
12 is an example of a break point setting command with a class hierarchy designation type call condition function that the user designates for the source program 4 of FIG. 11 and the source program 4 of FIG. 12 when is activated. Command 301 “CLFNBREAK
"L :: add () L" is a break point setting command with a class hierarchy designation type call condition function according to the present invention.
"CLFNBREAK" is specified when all the functions belonging to the class and the functions inheriting from the class are specified when the class is specified in the function specification part or the call condition function specification part. It is a command part that specifies a breakpoint setting command with a call condition function of the type that continues as a general rule when the specified call condition function and the actual call function match, and interrupts as a rule when they do not match. . "L :: add ()" of the first operand is a function designation part. The second operand “L” is a call condition function designating part. Both the first operand and the second operand can specify a function name or a class name. When the class name is specified, all member functions belonging to the class and the class (indirect inheritance) are specified. It also means the function of all the inheritance source classes (including the one). A class and all classes that inherit it (including indirect inheritance) are called the class hierarchy. Therefore, the class name designated by the first operand or the second operand means designation of the class hierarchy. There is no third operand,
Conditional action designation "C" is assumed. Command 301
In the case of, the function “L :: add ()” of the first operand belongs to the class “L” of the second operand or the function or class “L” of the class “L” that directly inherits the class “L”. "PL" class that indirectly inherits "L"
Continue if called by a function that belongs to, and interrupt if called by a function that does not.

【0058】同様に、コマンド302の「CLFNBR
EAK iL::addi() iL」の場合、第1オペラ
ンドの関数「iL::addi()」が第2オペランドの
クラス「iL」に属する関数またはクラス「iL」を継
承するクラス「pL」に属する関数に呼び出されたなら
継続し,そうでない関数に呼び出されたならば中断す
る。なお、第1オペランドおよび第2オペランドが共に
関数である場合は、図6のコマンド102「CFBRE
AK」またはコマンド103「CFNBREAK」で第
3オペランドを“C”にしたときと同等となる。
Similarly, the command 302 "CLFNBR
In the case of EAK iL :: addi () iL ”, the function“ iL :: addi () ”of the first operand becomes a function belonging to the class“ iL ”of the second operand or a class“ pL ”that inherits the class“ iL ”. Continue if called by the function to which it belongs, interrupt if called by a function that does not. If both the first operand and the second operand are functions, the command 102 "CFBRE" in FIG.
This is the same as when the third operand is set to "C" by "AK" or the command 103 "CFNBREAK".

【0059】図20は、図19のクラス階層指定型呼出
し条件関数付き中断点設定コマンドに対して、デバッグ
処理1の中断点設定処理12が作成した中断点表3の例
である。エントリ336は、コマンド301によって設
定された中断点である。このコマンド301のように、
第2オペランドをクラス階層で指定すると、複数の呼出
し関数番号を一括して指定可能となる。エントリ337
は、コマンド302によって設定された中断点である。
FIG. 20 is an example of the break point table 3 created by the break point setting process 12 of the debug process 1 for the break point setting command with the class hierarchy designation type call condition function of FIG. The entry 336 is a break point set by the command 301. Like this command 301,
When the second operand is specified in the class hierarchy, a plurality of calling function numbers can be specified collectively. Entry 337
Is the break point set by the command 302.

【0060】図21は、デバッグ処理1の中断点設定処
理12によるクラス階層指定型条件付き関数中断点設定
手順を説明するフローチャート図である。なお、説明の
簡単のため、第1オペランドでは関数名を指定し、第2
オペランドではクラス名を指定するものとする。ステッ
プ2101では、クラス階層指定型呼出し条件関数付き
中断点設定コマンドの第1オペランドboprと第2オ
ペランドcoprを読み込む。ステップ2102では、
図15の関数情報表72を検索し、第1オペランドの関
数名boprに合致する関数名欄722をもつエントリ
を探し、そのエントリの関数中断点欄723から関数中
断点ソース位置FBIを取得する。ステップ2103で
は、クラス情報表731(図13)を用いて、第2オペ
ランドcoprのクラス名のクラス番号CCIを取得す
る。ステップ2104では、クラス番号CCIをクラス
番号集合CIGの唯一の要素とする。ステップ2105
では、条件関数番号集合CFGIを空で初期化する。
FIG. 21 is a flow chart for explaining a procedure for setting a class hierarchy designation type conditional function break point by the break point setting process 12 of the debug process 1. For simplicity of explanation, the function name is specified in the first operand and the second
The class name is specified in the operand. In step 2101, the first operand bopr and the second operand copr of the breakpoint setting command with class hierarchy designation type call condition function are read. In step 2102,
The function information table 72 of FIG. 15 is searched to find an entry having a function name column 722 that matches the function name bopr of the first operand, and the function breakpoint point source position FBI is acquired from the function breakpoint point column 723 of that entry. In step 2103, the class number CCI of the class name of the second operand copr is acquired using the class information table 731 (FIG. 13). In step 2104, the class number CCI is the only element of the class number set CIG. Step 2105
Then, the conditional function number set CFGI is initialized to be empty.

【0061】ステップ2106では、クラス番号集合C
IGの要素が空であるか判定する。空でないならステッ
プ2107に進み、空ならステップ2112に進む。ス
テップ2107では、クラス番号集合CIGから要素を
一つ取り出す。それをクラス番号CIとする。取り出し
た後、クラス番号CIをクラス番号集合CIGから取り
除く。ステップ2108では、図15の関数情報表72
を検索し、所属クラス番号欄724の内容がクラス番号
CIと一致する関数(すなわち、クラス番号CIのクラ
スのメンバ関数)の関数番号欄721から関数番号を集
め、関数番号集合CIFIGを作成する。ステップ21
09では、関数番号集合CIFIGを、条件関数番号集
合CFIGに加える。ステップ2110では、図14の
継承情報表732の継承元クラス番号欄7321がクラ
ス番号CIと一致するエントリの継承先クラス番号欄7
322の内容をすべて取得し、クラス番号CIのクラス
の直接の継承先のクラス番号の集合DCIを求める。ス
テップ2111では、継承先のクラス番号の集合DCI
をクラス番号集合CIGに加える。そして、前記ステッ
プ2106に戻る。以上のステップ2106〜ステップ
2111をクラス番号集合CIGが空となるまで反復実
行することで、クラス番号CIのクラスの関数およびそ
の直接および間接の継承先のクラス番号の集合としての
条件関数集合CFIGを求めることができる。
In step 2106, the class number set C
Determine if the element of IG is empty. If it is not empty, the procedure proceeds to step 2107, and if it is empty, the procedure proceeds to step 2112. In step 2107, one element is extracted from the class number set CIG. Let it be the class number CI. After taking out, the class number CI is removed from the class number set CIG. In step 2108, the function information table 72 of FIG.
Is searched, the function numbers are collected from the function number column 721 of the function whose contents of the belonging class number column 724 match the class number CI (that is, the member function of the class of the class number CI), and the function number set CIFIG is created. Step 21
At 09, the function number set CIFIG is added to the conditional function number set CFIG. In step 2110, the inheritance destination class number column 7 of the entry in which the inheritance source class number column 7321 of the inheritance information table 732 of FIG. 14 matches the class number CI.
All the contents of 322 are acquired, and the set DCI of the class numbers of the direct inheritance destination of the class of the class number CI is obtained. In step 2111, a set DCI of class numbers of inheritance destinations
To the class number set CIG. Then, the process returns to step 2106. By repeating the above steps 2106 to 2111 until the class number set CIG becomes empty, the conditional function set CFIG as a set of the function of the class of the class number CI and the class numbers of its direct and indirect inheritance destinations is obtained. You can ask.

【0062】ステップ2112では、前記ステップ21
02で得られた関数中断点ソース位置FBIと,前記ス
テップ2109で得た条件関数集合CFIGの要素であ
る関数番号の組(FBI,CFIGの要素)をすべて中
断点表3(図20)に登録する。また、中断点表3(図
20)の条件動作指定欄322には、“C”を格納す
る。
In step 2112, the above-mentioned step 21
All of the function break point source position FBI obtained in step 02 and the set of function numbers (FBI and CFIG elements) which are elements of the conditional function set CFIG obtained in step 2109 are registered in the break point table 3 (FIG. 20). To do. Further, "C" is stored in the conditional operation designation column 322 of the interruption point table 3 (FIG. 20).

【0063】図20の中断点表3に対するデバッグ処理
1の命令実行処理13の動作は、図9に示したフローチ
ャート図と基本的に同じである。但し、ステップ905
およびステップ906における「中断点表3に登録され
た呼出し関数番号と実際に呼び出した関数が対応するか
否か」の判定は、図20の呼出し関数条件欄321に登
録されている関数の数だけ繰り返し、いずれかと一致す
れば「Yes」と判定し、いずれとも一致しなかったと
きのみ「NO」と判定する。
The operation of the instruction execution process 13 of the debug process 1 for the interruption point table 3 of FIG. 20 is basically the same as that of the flow chart shown in FIG. However, step 905
And the determination of “whether or not the calling function number registered in the interruption point table 3 corresponds to the actually called function” in step 906 is performed by the number of functions registered in the calling function condition column 321 of FIG. Repeatedly, if any of them matches, it is determined to be “Yes”, and only when they do not match, it is determined to be “NO”.

【0064】以上のように、図20のクラス階層指定型
呼出し条件関数付き中断点設定コマンドおよびそれに対
応した動作により、ユーザは、中断点を設定すべき関数
や呼出し条件とする関数をクラス階層で指定できる。す
なわち、クラス名を指定するだけで、そのクラスを頂点
とするクラス階層に含まれる全ての関数を呼出し関数条
件として設定することが出来る。例えば、クラスライブ
ラリの頂点のクラスを指定するだけで、クラスライブラ
リ全体を中断点として設定できる。クラスライブラリを
利用したプログラム開発ではライブラリ開発者と利用者
とが分かれている場合が多いため、このクラス階層によ
る中断点設定を利用することで、ユーザの意図に適する
効率的な条件付き関数中断点の設定が可能となり、デバ
ッグ作業の効率化に寄与する。
As described above, by the break point setting command with the class hierarchy designation type call condition function of FIG. 20 and the operation corresponding thereto, the user can select a function to set a break point or a function to be a call condition in the class hierarchy. Can be specified. That is, by simply specifying the class name, all the functions included in the class hierarchy having the class as the vertex can be set as the calling function condition. For example, the entire class library can be set as an interruption point simply by specifying the class at the top of the class library. Since the library developer and the user are often separated in the program development using the class library, by using the breakpoint setting by this class hierarchy, an efficient conditional function breakpoint that suits the user's intention can be obtained. Can be set, which contributes to the efficiency of debugging work.

【0065】[0065]

【発明の効果】本発明のプログラム実行中断方法および
デバッギング装置によれば、ユーザは、単に関数中断点
を指定するだけでなく、呼出し関数の指定が可能とな
り、呼出し関数を限定した条件付き関数中断点を設定で
きるようになる。従って、プログラムのデバッグを効率
的に行うことが出来るようになる。
According to the program execution interruption method and the debugging apparatus of the present invention, the user can specify not only the function interruption point but also the calling function, and the conditional function interruption limiting the calling function. You will be able to set points. Therefore, the program can be debugged efficiently.

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

【図1】本発明の一実施例のデバッギング装置の構成図
である。
FIG. 1 is a configuration diagram of a debugging device according to an embodiment of the present invention.

【図2】本発明のプログラム実行中断方法にかかる処理
の関係を示す概念図である。
FIG. 2 is a conceptual diagram showing a relationship of processes according to a program execution interruption method of the present invention.

【図3】適用例1におけるソースプログラムの例示図で
ある。
FIG. 3 is a view showing an example of a source program in application example 1.

【図4】適用例1における行アドレス対応表の構成図で
ある。
FIG. 4 is a configuration diagram of a row address correspondence table in application example 1.

【図5】適用例1における関数情報表の構成図である。5 is a configuration diagram of a function information table in application example 1. FIG.

【図6】適用例1における関数中断点設定コマンドの例
示図である。
FIG. 6 is a view showing an example of a function breakpoint setting command in Application Example 1;

【図7】適用例1における中断点表の構成図である。FIG. 7 is a configuration diagram of an interruption point table in application example 1;

【図8】適用例1における関数中断点設定手順のフロー
チャート図である。
FIG. 8 is a flowchart of a function break point setting procedure in application example 1;

【図9】命令実行処理の動作を説明するフローチャート
図である。
FIG. 9 is a flowchart illustrating the operation of an instruction execution process.

【図10】適用例1における呼出し関数スタックの動作
の説明図である。
FIG. 10 is an explanatory diagram of an operation of a call function stack in application example 1.

【図11】適用例2におけるソースプログラムの第1の
例示図である。
FIG. 11 is a first exemplary diagram of a source program in application example 2;

【図12】適用例2におけるソースプログラムの第2の
例示図である。
FIG. 12 is a second exemplary diagram of a source program in application example 2;

【図13】適用例2におけるクラス情報表の構成図であ
る。
FIG. 13 is a configuration diagram of a class information table in application example 2.

【図14】適用例2における継承情報表の構成図であ
る。
FIG. 14 is a configuration diagram of a succession information table in Application Example 2;

【図15】適用例2における関数情報表の構成図であ
る。
FIG. 15 is a configuration diagram of a function information table in application example 2.

【図16】適用例2におけるクラス指定型呼出し条件関
数付き中断点設定コマンドの例示図である。
FIG. 16 is a view showing an example of a breakpoint setting command with a class-specified type call condition function in application example 2;

【図17】適用例2における中断点表の構成図である。FIG. 17 is a configuration diagram of an interruption point table in application example 2;

【図18】適用例2におけるクラス指定型条件付き関数
中断点設定手順のフローチャート図である。
FIG. 18 is a flowchart of a class-specific conditional interrupt function setting procedure in application example 2;

【図19】適用例3におけるクラス階層指定型呼出し条
件関数付き中断点設定コマンドの例示図である。
FIG. 19 is an exemplary diagram of a break point setting command with a class hierarchy designation type call condition function in Application Example 3;

【図20】適用例3における中断点表の構成図である。20 is a configuration diagram of an interruption point table in application example 3. FIG.

【図21】適用例3におけるクラス階層指定型条件付き
関数中断点設定手順のフローチャート図である。
FIG. 21 is a flowchart of a class hierarchy designation type conditional function breakpoint setting procedure in Application Example 3;

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

1・・・デバッグ処理、3・・・中断点表、5・・・コ
ンパイル処理、7・・・ソース情報ファイル、12・・
・中断点設定処理、13・・・命令実行処理、14・・
・中断処理、15・・・関数呼出しスタック、32・・
・中断条件欄、71・・・行アドレス対応表、72・・
・関数情報表、73・・・クラス階層情報、321・・
・呼出し関数番号欄、322・・・条件動作指定欄
1 ... Debug processing, 3 ... Break point table, 5 ... Compile processing, 7 ... Source information file, 12 ...
・ Interruption point setting processing, 13 ... Instruction execution processing, 14 ...
・ Interruption processing, 15 ... Function call stack, 32 ...
・ Interruption condition column, 71 ... Row address correspondence table, 72 ...
・ Function information table, 73 ... Class hierarchy information, 321 ...
・ Call function number column, 322 ... Conditional action specification column

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 手続き又は関数の制御構造を有するプロ
グラムのデバッグのためのプログラム実行中断方法であ
って、 手続き又は関数の入口点または出口点の少なくとも一方
を関数中断点としてユーザが指定すると共に、当該手続
き又は関数を呼び出す一つ又は複数の手続き又は関数を
呼出し条件関数としてユーザが指定するのに対して、前
記指定された関数中断点に中断点を設定し、且つ、その
中断点に対応させて前記呼出し条件関数を登録し、前記
プログラムを実行中に前記中断点に至った時、当該手続
き又は関数を実際に呼び出した手続き又は関数が前記呼
出し条件関数に合致するか否かを判定し、その判定結果
に応じて前記プログラムの実行を中断するか又は中断せ
ずに継続実行することを特徴とするプログラム実行中断
方法。
1. A program execution interruption method for debugging a program having a procedure or function control structure, wherein a user specifies at least one of an entry point and an exit point of the procedure or function as a function interruption point, and While the user specifies one or more procedures or functions that call the procedure or function as a call condition function, a break point is set at the specified function break point, and the break point is made to correspond to the break point. Register the call condition function, when the program reaches the breakpoint during execution, determine whether the procedure or function that actually called the procedure or function matches the call condition function, A program execution interruption method characterized in that the execution of the program is interrupted or continued without interruption depending on the result of the determination.
【請求項2】 手続き又は関数の制御構造を有するプロ
グラムのためのデバッギング装置であって、 ユーザが入力した中断点設定コマンドに基づいて、手続
き又は関数の入口点または出口点の少なくとも一方を関
数中断点として設定すると共に、当該手続き又は関数を
呼び出す一つ又は複数の手続き又は関数を呼出し条件関
数として登録する中断点設定処理手段と、 前記プログラムを実行し、前記中断点に至った時、当該
手続き又は関数を実際に呼び出した手続き又は関数が前
記呼出し条件関数に合致するか否かを判定し、その判定
結果に応じて前記プログラムの実行を中断するか又は中
断せずに継続実行する命令実行処理手段とを具備したこ
とを特徴とするデバッギング装置。
2. A debugging device for a program having a control structure of a procedure or a function, wherein at least one of an entry point and an exit point of the procedure or the function is interrupted based on a breakpoint setting command input by a user. A breakpoint setting processing means for setting a point and registering one or more procedures or functions that call the procedure or function as a calling condition function, and executing the program, and when the breakpoint is reached, the procedure Alternatively, an instruction execution process for determining whether or not a procedure or function that actually calls a function matches the calling condition function, and suspends execution of the program according to the determination result or continuously executes without interruption. And a debugging device.
【請求項3】 請求項2に記載のデバッギング装置にお
いて、手続き又は関数が呼び出された時に当該手続き又
は関数を呼び出した手続き又は関数の情報をプッシュ
し,前記呼び出された手続き又は関数から復帰する時に
前記プッシュしていた情報をポップする関数呼出しスタ
ックを具備し、前記命令実行処理手段は、当該手続き又
は関数を実際に呼び出した手続き又は関数を前記関数呼
出しスタックから取得することを特徴とするデバッギン
グ装置。
3. The debugging device according to claim 2, wherein when a procedure or function is called, information of the procedure or function that called the procedure or function is pushed, and when returning from the called procedure or function. A debugging device comprising a function call stack for popping the pushed information, wherein the instruction execution processing means obtains from the function call stack the procedure or function that actually called the procedure or function. .
【請求項4】 請求項2または請求項3に記載のデバッ
ギング装置において、設定する中断点の種類を指定する
コマンド部と,中断点を設定する一つ又は複数の手続き
又は関数を指定する関数指定部と,当該手続き又は関数
を呼び出す一つ又は複数の関数を指定する呼出し条件関
数指定部と,当該手続き又は関数を実際に呼び出した手
続き又は関数が前記呼出し条件関数に合致すると判定し
たときにプログラムの実行を中断するか継続するかを指
定する条件動作指定部とを含む中断点設定コマンドを、
前記中断点設定処理手段が受け付けることを特徴とする
デバッギング装置。
4. The debugging device according to claim 2 or 3, wherein a command section that specifies the type of the break point to be set and a function specification that specifies one or more procedures or functions to set the break point. Part, a call condition function specification part that specifies one or more functions that call the procedure or function, and a program when it is determined that the procedure or function that actually called the procedure or function matches the call condition function The breakpoint setting command including the conditional action specification part that specifies whether to suspend or continue the execution of
A debugging device, wherein the breakpoint setting processing means receives the information.
【請求項5】 請求項4に記載のデバッギング装置にお
いて、前記コマンド部が前記条件動作指定部の機能を有
し、独立した条件動作指定部を含まない中断点設定コマ
ンドを、前記中断点設定処理手段が受け付けることを特
徴とするデバッギング装置。
5. The debugging device according to claim 4, wherein the command section has a function of the conditional operation designating section, and the interrupt point setting command is not included in the independent conditional operation designating section. A debugging device characterized by being accepted by a means.
【請求項6】 請求項4または請求項5に記載のデバッ
ギング装置において、前記中断点設定処理手段は、前記
関数指定部または前記呼出し条件関数指定部にクラスが
指定されているとき、当該クラスに所属する手続き又は
関数の全てが指定されたものとして処理することを特徴
とするデバッギング装置。
6. The debugging device according to claim 4 or 5, wherein the break point setting processing unit assigns a class to a class when the function designation unit or the call condition function designation unit specifies a class. A debugging device characterized by processing all procedures or functions to which it belongs as specified.
【請求項7】 請求項4または請求項5に記載のデバッ
ギング装置において、前記中断点設定処理手段は、前記
関数指定部または前記呼出し条件関数指定部にクラスが
指定されているとき、当該クラスに所属する手続き又は
関数および当該クラスを継承するクラスに所属する手続
き又は関数の全てが指定されたものとして処理すること
を特徴とするデバッギング装置。
7. The debugging apparatus according to claim 4 or 5, wherein the break point setting processing unit is assigned to a class when the function designation unit or the call condition function designation unit specifies a class. A debugging device characterized by processing all belonging procedures or functions and procedures or functions belonging to a class that inherits the class as specified.
【請求項8】 請求項4または請求項5に記載のデバッ
ギング装置において、前記中断点設定処理手段は、前記
コマンド部の内容に応じて、請求項6または請求項7の
いずれかの処理を選択することを特徴とするデバッギン
グ装置。
8. The debugging device according to claim 4 or 5, wherein the break point setting processing means selects one of the processing according to claim 6 or 7 according to the content of the command section. A debugging device characterized by:
JP6155792A 1994-07-07 1994-07-07 Method for interrupting program execution and debugging device Pending JPH0822401A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6155792A JPH0822401A (en) 1994-07-07 1994-07-07 Method for interrupting program execution and debugging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6155792A JPH0822401A (en) 1994-07-07 1994-07-07 Method for interrupting program execution and debugging device

Publications (1)

Publication Number Publication Date
JPH0822401A true JPH0822401A (en) 1996-01-23

Family

ID=15613539

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6155792A Pending JPH0822401A (en) 1994-07-07 1994-07-07 Method for interrupting program execution and debugging device

Country Status (1)

Country Link
JP (1) JPH0822401A (en)

Cited By (2)

* 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
JP2004326789A (en) * 2003-04-21 2004-11-18 Microsoft Corp Just-my-code debugging method

Cited By (2)

* 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
JP2004326789A (en) * 2003-04-21 2004-11-18 Microsoft Corp Just-my-code debugging method

Similar Documents

Publication Publication Date Title
JP4901075B2 (en) Computer-readable medium, method and computing device
US6077312A (en) Apparatus, program product and method of debugging utilizing a context sensitive breakpoint
US5854932A (en) Compiler and method for avoiding unnecessary recompilation
US6249907B1 (en) Method system and article of manufacture for debugging a computer program by encoding user specified breakpoint types at multiple locations in the computer program
US10007551B2 (en) Techniques for switching threads within routines
US8527961B2 (en) Expression-level debugging without format changes
EP1164478A2 (en) Method and apparatus for resolving data references in generated code
US6543049B1 (en) Ranked break points and method for debugging a computer program
JPS6017539A (en) Emulation system
US20030093771A1 (en) Debugging aid device, a compiling device, a debugging aid program, a compiling program, and a computer readable record medium therefor
JP2012063868A (en) Method to generate combined parser by combining language processing parsers, and its computer and computer program
US20090019273A1 (en) Exception-based error handling in an array-based language
US20050066312A1 (en) Inter-job breakpoint apparatus and method
US7877629B2 (en) Facilitating handling of exceptions in a program implementing a M-on-N threading model
JPH0822401A (en) Method for interrupting program execution and debugging device
US5150474A (en) Method for transferring arguments between object programs by switching address modes according to mode identifying flag
US20060174248A1 (en) Software tool for automatically protecting shared resources within software source code
Hanson Event associations in SNOBOL4 for program debugging
JP2022542488A (en) Method and apparatus for processing and executing heterogeneous embedded tabularized motion processes
JPH11110256A (en) Device and method for debugging program, and computer readable recording medium recorded with the method for the same
JP2002288004A (en) Program source processing device and method, and program source processing program
JPH06290077A (en) Method for setting up interruption point of program execution
JP2827724B2 (en) Program debug processing method
US7627859B2 (en) Method for configuring non-script language library files to be run as scripts
JP3130421B2 (en) Program analysis method and apparatus

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080716

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees