JP2001290674A - Device and method for setting program breakpoint - Google Patents

Device and method for setting program breakpoint

Info

Publication number
JP2001290674A
JP2001290674A JP2000104656A JP2000104656A JP2001290674A JP 2001290674 A JP2001290674 A JP 2001290674A JP 2000104656 A JP2000104656 A JP 2000104656A JP 2000104656 A JP2000104656 A JP 2000104656A JP 2001290674 A JP2001290674 A JP 2001290674A
Authority
JP
Japan
Prior art keywords
function
position information
name
point
class
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
JP2000104656A
Other languages
Japanese (ja)
Inventor
Shinobu Asao
忍 浅尾
Hirohisa Tanaka
裕久 田中
Jiyunko Sayama
旬子 佐山
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2000104656A priority Critical patent/JP2001290674A/en
Publication of JP2001290674A publication Critical patent/JP2001290674A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To solve the problem where a range to set a breakpoint cannot be designated and breakpoint setting conditions are limited to a function unit concerning a conventional breakpoint setting method for setting the breakpoint to a function callout point. SOLUTION: A compiler 202 analyzes a source file 201, position information composed of class name, object name, function name, argument list, file scope, class scope, function scope, row number and address is extracted by a position information extracting part 404 and a position information table 1000 is prepared. A debugger 600 collates the position information table 1000 with each of items in the position information, which is inputted by a user as breakpoint setting conditions, in a breakpoint setting condition collating part 602, and the breakpoint is simultaneously set to one or plural relevant addresses.

Description

【発明の詳細な説明】<用語の説明>発明の詳細に入る
前に、説明に使用する単語について解説する。・ アドレスラベル 実際にプログラムをコンピューター上で実行する場合に
アクセスするアドレスは、リンク時に決定される。よっ
てコンパイラが出力するアセンブリファイルではアドレ
スをラベルで表現しておき、リンク時にラベルをアドレ
スに置換えて実行形式ファイルが生成される。このラベ
ルをアドレスラベルと呼ぶ。・ 引数リスト 関数が持つ引数を並べたものである。関数が多重定義可
能であるような言語(C++言語等)では、関数名が等し
い場合、引数の相違によって関数を区別する。本発明で
は多重定義関数を限定するためにこの引数リストを使用
する。・ スコープ 一般的に、宣言した関数、オブジェクトの名前を使用で
きる有効範囲のことをいう。ファイルスコープとはファ
イル単位(翻訳単位)での有効範囲、関数スコープとは
関数単位での有効範囲、クラススコープとはクラス単位
での有効範囲である。・ 位置情報 中断点を設定する位置(アドレス)の候補となる情報の
集合である。集合の要素としては、オブジェクトのクラ
ス名、オブジェクト名、呼び出す関数名、関数を限定す
るための引数の並びである引数リスト、所属するファイ
ルスコープ、クラススコープ、関数スコープ、ソースフ
ァイル上での行番号、実行形式ファイル上でのアドレス
がある。・ 字句解析 プログラムの文字の列を、言語として意味を持つ最小単
位(トークンと呼ばれる)に分ける解析処理のことを言
う。・ 構文解析 字句解析によってトークンの列とされたプログラムを、
その言語の組み方である構文に従って解析し、プログラ
ムのどの部分がどの構文に対応するか、また構文として
の誤りがないかどうかを検査する処理のことを言う。・ 意味解析 構文解析によって処理されたプログラムに対して、変数
や演算子の同定を行なったり、意味的誤りがないか検査
して、言語の意味を解析する処理のことを言う。主な処
理内容としては、変数の使用と宣言との対応づけ、型情
報検査、演算子の型やオペランドの同定などがある。・ 中間コード ソースファイルのプログラムと等価で中間的な水準のプ
ログラムで、抽象構文木やポーランドコードなどがあ
る。目的コードの最適化や、複数の目的機械に対するコ
ード生成をしやすくするために作成される。・ 暗黙的なメンバ関数呼び出し C++で、ドット演算子(.)やポインタ演算子(->)を用いて
明示的に呼び出すのではなく、暗黙的に呼び出されるメ
ンバ関数の呼び出しをいう。コンストラクタやデストラ
クタ、代入演算子などのメンバ関数呼び出しが該当す
る。
DETAILED DESCRIPTION OF THE INVENTION <Explanation of Terms> Before entering into details of the invention, words used in the description will be explained. -Address label The address to be accessed when the program is actually executed on the computer is determined at the time of linking. Therefore, in the assembly file output by the compiler, the address is represented by a label, and the label is replaced with the address at the time of linking to generate an executable file. This label is called an address label. -Argument list Argument list is a list of arguments of the function. In a language in which functions can be overloaded (such as C ++ language), if the function names are the same, the functions are distinguished by differences in arguments. The present invention uses this argument list to limit overloaded functions. -Scope Generally, the scope in which the names of declared functions and objects can be used. The file scope is the effective range in file units (translation units), the function scope is the effective range in function units, and the class scope is the effective range in class units. -Position information A set of information that is candidates for the position (address) at which to set a break point. The elements of the set include the class name of the object, the object name, the name of the function to be called, the argument list that lists the arguments for limiting the function, the file scope to which it belongs, the class scope, the function scope, and the line number in the source file , There is an address on the executable file.・ Lexical analysis This is an analysis process that divides a character string of a program into minimum units (called tokens) that have meaning as a language.・ Parsing Parsing tokenized programs by lexical analysis
It refers to the process of analyzing according to the syntax that is the composition of the language, and checking which part of the program corresponds to which syntax, and whether there is a syntax error.・ Semantic analysis The process of identifying variables and operators in a program processed by syntax analysis, checking for semantic errors, and analyzing the meaning of the language. The main processing contents include associating the use of variables with declarations, checking type information, identifying operator types and operands, and the like. -Intermediate code This is an intermediate level program equivalent to the program in the source file, such as an abstract syntax tree or Polish code. It is created to facilitate optimization of the target code and code generation for multiple target machines. -Implicit member function call In C ++, this is a call to a member function that is called implicitly instead of explicitly using the dot operator (.) Or pointer operator (->). Calls to member functions such as constructors, destructors, and assignment operators.

【0001】[0001]

【発明の属する技術分野】本発明は、デバッグ時にプロ
グラムの実行を中断させる点(ブレークポイント)を設
定する中断点設定方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for setting a break point at which execution of a program is interrupted during debugging.

【0002】[0002]

【従来の技術】プログラムをデバッグする場合、実行中
のある状態での変数の型や値などを調べるために、プロ
グラム実行中断点(ブレークポイント)を設定すること
をよく行なう。図11は従来の中断点の設定例である。
従来のデバッガが備えているブレークポイントの設定手
段として、ソースプログラムの行番号を用いた設定11
01、1102や、オブジェクトプログラムでの絶対ア
ドレスを用いた設定方法1103、1104などが挙げ
られる。
2. Description of the Related Art When debugging a program, a break point of program execution is often set to check the type and value of a variable in a certain state during execution. FIG. 11 shows a conventional example of setting an interruption point.
As a means for setting a breakpoint provided in a conventional debugger, setting using a line number of a source program 11
01, 1102, and setting methods 1103, 1104 using absolute addresses in an object program.

【0003】また、関数名を指定して中断点を設定する
方法1105、1106が挙げられる。この場合、中断
点は指定した関数の開始点もしくは終了点に設定される
のが一般的である。手続き型言語の処理の基本単位が関
数であることを考えると、関数名で中断点を設定するこ
とは効果的であると考えられる。しかし言語によって
は、関数の開始点で処理を中断させるよりも、関数の呼
出し点で処理を中断させる方が有効な場合がある。例と
して、C++言語の仮想関数が挙げられる。図12はC++言
語での仮想関数の呼び出し例である。この関数は、動的
に呼び出されるという特徴を持っており、仮想関数とし
て定義されている複数の関数の中からコンパイル時では
なく実行時のオブジェクトの型に対応する関数を呼び出
す。図12の例では、仮想関数呼び出し1201では実
行時の型であるクラスBの仮想関数を呼び出し、仮想関
数呼び出し1202では実行時の型であるクラスCの仮
想関数を呼び出すこととなる。このように、実行時にど
のオブジェクトによって呼び出されたかが重要となるた
め、呼び出し側に制御が移った関数の開始点で中断点を
設定するよりも制御が移る前、すなわち関数の呼出し点
で処理を中断させる必要がある。特に具体的な動的束縛
の対象となる関数群の確認や、動的束縛が行なわれてい
る呼出し点の確認はユーザーに任されており、誤った使
い方をする可能性が高い関数である。このため関数呼出
し点で中断点を設定する必要がある。また、暗黙的なメ
ンバ関数呼び出しの機能を有している場合、暗黙的な呼
び出しのため予期しない部分からメンバ関数が呼び出さ
れていることがある。この呼び出し点の確認はユーザー
任せであり、このことからも関数の呼出し点で中断点を
設定する必要がある。
There are also methods 1105 and 1106 for setting a break point by designating a function name. In this case, the interruption point is generally set to the start point or the end point of the designated function. Considering that the basic unit of processing in a procedural language is a function, it is considered effective to set a break point by a function name. However, depending on the language, it may be more effective to suspend processing at a function call point than to suspend processing at a function start point. An example is a virtual function in the C ++ language. FIG. 12 shows an example of calling a virtual function in the C ++ language. This function has a feature of being dynamically called, and calls a function corresponding to an object type at the time of execution, not at the time of compilation, from among a plurality of functions defined as virtual functions. In the example of FIG. 12, a virtual function call 1201 calls a virtual function of class B, which is a runtime type, and a virtual function call 1202 calls a virtual function of class C, which is a runtime type. In this way, it is important which object is called at execution time. Therefore, rather than setting a break point at the start point of the function whose control has been transferred to the caller, the process is interrupted before control is transferred, that is, at the function call point Need to be done. In particular, it is up to the user to check the functions to be subjected to specific dynamic binding and to confirm the call point where the dynamic binding is performed. This function is highly likely to be used incorrectly. Therefore, it is necessary to set a break point at the function call point. Also, when the function of implicit member function call is provided, the member function may be called from an unexpected part due to the implicit call. Confirmation of this call point is left to the user, and therefore, it is necessary to set a break point at the function call point.

【0004】[0004]

【発明が解決しようとする課題】関数を指定することに
より、該当するすべての呼出し点に中断点を設定する方
法は、特開平6-290077ですでに提案されてい
る。しかし、提案されている手法には、いくつかの問題
点がある。
A method of setting a break point at all relevant call points by specifying a function has already been proposed in Japanese Patent Laid-Open No. 6-290077. However, the proposed approach has several problems.

【0005】まず、中断点設定の範囲を指定する機構が
存在しないことが挙げられる。範囲の指定ができないた
め、該当するすべての関数呼出し点に対して中断点を設
定することになる。これは、デバッグを行おうとする範
囲外の不要な箇所にも中断点を設定してしまうことにな
り、効率的なデバッグを阻害する。
First, there is no mechanism for designating a range for setting an interruption point. Since a range cannot be specified, an interruption point is set for all corresponding function call points. This means that an interruption point is set at an unnecessary portion outside the range to be debugged, which hinders efficient debugging.

【0006】さらに、中断点の設定単位が関数単位に限
定されていることが挙げられる。手続き型言語の場合で
は、処理の基本単位が関数単位であったため問題がな
い。しかしオブジェクト指向型言語の場合、オブジェク
ト単位における処理が基本となるため、関数単位だけで
なく、オブジェクト単位、またオブジェクトの種類をあ
らわすクラス単位でも中断点を設定する機構が必要であ
る。しかし、上記の提案手法は、関数単位での処理にし
か対応しておらず、オブジェクト指向型言語デバッガの
中断点設定方法としては不十分である。
Further, the setting unit of the interruption point is limited to the function unit. In the case of a procedural language, there is no problem because the basic unit of processing is a function unit. However, in the case of an object-oriented language, since processing is performed in units of objects, a mechanism for setting a break point is required not only in units of functions but also in units of objects or classes that represent the types of objects. However, the above proposed method only supports processing on a function-by-function basis, and is insufficient as a method for setting a break point in an object-oriented language debugger.

【0007】そこで、本発明の目的は、オブジェクト指
向型言語の特徴を考慮に入れ、クラス単位、オブジェク
ト単位、関数単位の情報を指定し、また中断点の設定を
実行する範囲を与えることによって、一つもしくは複数
の中断点を必要な範囲だけに一度に設定する効率的なプ
ログラム実行中断点設定方法を提供することにある。
Therefore, an object of the present invention is to take into account the characteristics of an object-oriented language, specify information on a class basis, an object basis, and a function basis, and provide a range for executing the setting of a break point. An object of the present invention is to provide an efficient program execution interruption point setting method for setting one or a plurality of interruption points only in a necessary range at a time.

【0008】[0008]

【課題を解決するための手段】この目的を達成するため
に、本発明のプログラム中断点設定装置は、特定の処理
単位に対する位置情報を抽出する位置情報抽出手段を備
える。この手段を備えることにより、ソースファイルの
プログラムで特定の処理が実行されるとその処理に対す
る位置に関する情報を抽出し、デバッガで効率的に中断
点を設定することを可能とする情報として記録すること
ができる。また、前記位置情報抽出手段により抽出され
た位置情報とユーザーが入力した中断点設定条件とを照
合する中断点設定条件照合手段を備える。この手段を備
えることにより、前記位置情報抽出手段により抽出され
た位置情報とユーザーが入力した中断点設定条件を照合
し、前記位置情報のうち前記中断点設定条件のすべてを
満たすものを中断点の設定する位置として確定すること
ができる。また、前記中断点設定条件照合手段により照
合した結果に基づいて中断点設定条件に該当する一つま
たは複数の位置に中断点を設定する中断点設定手段を備
える。この手段を備えることにより、一つもしくは複数
の中断点を必要な範囲だけに一度に設定する効率的なプ
ログラム実行中断点設定方法を提供することができる。
図1は本発明の実施構成である。
In order to achieve this object, a program interruption point setting device according to the present invention comprises position information extracting means for extracting position information for a specific processing unit. By providing this means, when a specific process is executed in the program of the source file, information on a position corresponding to the process is extracted and recorded as information that enables a debugger to efficiently set a break point. Can be. The apparatus further includes a break point setting condition matching unit that checks the position information extracted by the position information extracting unit with a break point setting condition input by a user. By providing this means, the position information extracted by the position information extracting means is compared with the break point setting condition input by the user, and the position information that satisfies all of the break point setting conditions is determined as the break point. The position to be set can be determined. The apparatus further includes an interruption point setting unit configured to set an interruption point at one or a plurality of positions corresponding to the interruption point setting condition based on a result of the comparison by the interruption point setting condition comparison unit. By providing this means, it is possible to provide an efficient program execution interruption point setting method for setting one or a plurality of interruption points only in a necessary range at a time.
FIG. 1 shows an embodiment of the present invention.

【0009】[0009]

【発明の実施の形態】図2は、ソースファイル201か
らアセンブリファイル203、再配置可能ファイル20
5、および実行形式ファイル207を作成するまでのフ
ローチャートである。まずコンパイラ202によってソ
ースファイル201はアセンブリファイル203に変換
される。その後、アセンブラ204によってアセンブリ
ファイル203は機械語変換が施され、再配置可能ファ
イル205が生成される。この段階では、各機械語命令
の実行アドレスはラベルで表現されている。その後、リ
ンカ206でアドレス解決処理によって各ラベルに対し
メモリのアドレスが割り当てられ、実行形式ファイル2
07が生成される。アセンブラ204、およびリンカ2
06は本発明の主眼ではないので、詳細な説明は省略す
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 2 shows a source file 201 to an assembly file 203 and a relocatable file 20.
5 and a flowchart until the execution format file 207 is created. First, the source file 201 is converted into an assembly file 203 by the compiler 202. Thereafter, the assembly file 203 is subjected to machine language conversion by the assembler 204, and a relocatable file 205 is generated. At this stage, the execution address of each machine language instruction is represented by a label. Thereafter, the address of the memory is assigned to each label by the address resolution processing in the linker 206, and the executable file 2
07 is generated. Assembler 204 and linker 2
06 is not the focus of the present invention, and a detailed description thereof will be omitted.

【0010】<コンパイラ装置の構成>図3(a)は、
コンパイラ装置202の構成図である。コンパイラはデ
ータ解析部301、中間コード生成部302、最適化部
303、資源割付部304、コード生成部305で構成
される。
<Structure of Compiler Apparatus> FIG.
FIG. 3 is a configuration diagram of a compiler device 202. The compiler includes a data analysis unit 301, an intermediate code generation unit 302, an optimization unit 303, a resource allocation unit 304, and a code generation unit 305.

【0011】データ解析部301は、記憶装置に記憶さ
れているソースファイル201に対して字句解析、構文
解析、意味解析の処理を行なう。また本発明に係る情報
である位置情報を抽出し、位置情報テーブル1000を
生成するのもこの部分である。データ解析部301の詳
細については後述する。
The data analyzer 301 performs lexical analysis, syntax analysis, and semantic analysis on the source file 201 stored in the storage device. It is also this part that extracts the position information, which is the information according to the present invention, and generates the position information table 1000. Details of the data analysis unit 301 will be described later.

【0012】中間コード生成部302は、データ解析部
から渡された情報のうち、以降の解析に不必要なものを
削除し、より簡単に解析ができるように中間的なコード
を生成する。
The intermediate code generation unit 302 deletes information unnecessary for subsequent analysis from information passed from the data analysis unit, and generates an intermediate code so that analysis can be performed more easily.

【0013】最適化部303は、生成する目的プログラ
ムのサイズ縮小、および実行効率の向上を実現するため
に中間コードの最適化を行なう。
The optimizing unit 303 optimizes the intermediate code to reduce the size of the target program to be generated and to improve the execution efficiency.

【0014】資源割付部304は、中間プログラム内の
変数をマイクロプロセッサ上の記憶資源であるレジスタ
やメモリに割付ける。
The resource allocating unit 304 allocates variables in the intermediate program to registers and memories that are storage resources on the microprocessor.

【0015】コード生成部305は、中間プログラムか
ら機械語命令のプログラムに変換する。
The code generator 305 converts the intermediate program into a machine language instruction program.

【0016】中間コード生成部302、最適化部30
3、資源割付部304、コード生成部305は本発明の
主眼ではないので、詳細な説明は省略する。
Intermediate code generator 302, optimizer 30
3. Since the resource allocation unit 304 and the code generation unit 305 are not the main subject of the present invention, detailed description will be omitted.

【0017】ここに示したコンパイラの構成では、デー
タ解析部が本発明に係る構成要素であり、これを除いた
コンパイラの構成は従来のものと変わらない。
In the configuration of the compiler shown here, the data analysis unit is a component according to the present invention, and the configuration of the compiler excluding this is the same as that of the conventional compiler.

【0018】図3(b)がコンパイラ装置202におけ
るフローチャートである。入力されたソースファイル2
01に対して、ステップ306でデータ解析処理を実行
する。次にステップ307で中間コード生成処理を実行
する。次にステップ308で最適化処理を実行する。次
にステップ309で資源割付処理を実行する。次にステ
ップ310でコード生成処理を実行し、アセンブリファ
イル203を生成する。なおデータ解析処理はデータ解
析部301、中間コード生成処理は中間コード生成部3
02、最適化処理は最適化部303、資源割付処理は資
源割付部304、コード生成処理はコード生成部305
で行なわれる。なお図3(b)の処理は、ソースファイ
ル201の内容すべてを読みこんでから実行しても、ソ
ースファイル201の一部を逐次読みこんで実行を繰り
返してもかまわない。
FIG. 3B is a flowchart in the compiler 202. Input source file 2
For 01, data analysis processing is executed in step 306. Next, in step 307, an intermediate code generation process is executed. Next, in step 308, an optimization process is performed. Next, in step 309, resource allocation processing is executed. Next, in step 310, a code generation process is executed to generate an assembly file 203. The data analysis processing is performed by the data analysis unit 301, and the intermediate code generation processing is performed by the intermediate code generation unit 3.
02, the optimizing unit 303 for the optimizing process, the resource allocating unit 304 for the resource allocating process, and the code generating unit 305 for the code generating process.
It is done in. Note that the processing in FIG. 3B may be executed after reading all the contents of the source file 201, or may be executed by sequentially reading a part of the source file 201.

【0019】次にデータ解析部301の詳細について説
明する。図4(a)は、データ解析部301の構成図で
ある。データ解析部301は、字句解析部401、構文
解析部402、意味解析部403、そして本発明に係る
構成要素である位置情報抽出部404によって構成され
ている。
Next, the details of the data analyzer 301 will be described. FIG. 4A is a configuration diagram of the data analysis unit 301. The data analysis unit 301 includes a lexical analysis unit 401, a syntax analysis unit 402, a semantic analysis unit 403, and a position information extraction unit 404, which is a component according to the present invention.

【0020】字句解析部401は、ソースプログラムの
文字の列を、言語として意味を持つ最小単位に分割する
字句解析の処理を行なう。
The lexical analysis unit 401 performs lexical analysis processing for dividing a character string of a source program into minimum units having a meaning as a language.

【0021】構文解析部402は、字句解析が行なわれ
たソースファイルのどの部分がどの構文に対応するかを
解析し、またソースファイルに構文としての誤りがない
かどうかを検査する構文解析の処理を行なう。
The syntax analysis unit 402 analyzes which part of the lexically analyzed source file corresponds to which syntax, and checks whether the source file has a syntax error. Perform

【0022】意味解析部403は、構文解析が行なわれ
たソースファイルに対して、変数や演算子の同定を行な
ったり、意味的誤りがないか検査して、言語の意味を解
析する意味解析の処理を行なう。
The semantic analysis unit 403 identifies the variables and operators of the parsed source file, checks for semantic errors, and analyzes the meaning of the language. Perform processing.

【0023】位置情報テーブル抽出部404は、本発明
に係る構成であり、意味解析処理の結果から特定の処理
単位に対して位置情報を抽出し、デバッガで効率的に中
断点を設定するための情報である位置情報テーブル10
00を生成する処理を行なう。
The position information table extractor 404 has a configuration according to the present invention. The position information table extractor 404 extracts position information for a specific processing unit from the result of the semantic analysis processing, and allows a debugger to efficiently set a break point. Position information table 10 which is information
00 is generated.

【0024】図4(b)はデータ解析部301における
フローチャートである。まずステップ405で字句解析
処理が実行され、ステップ406に進み構文解析処理が
実行される。その次にステップ407で意味解析処理が
実行され、ステップ408で位置情報抽出処理が実行さ
れる。なお、字句解析処理は字句解析部401、構文解
析処理は構文解析部402、意味解析処理は意味解析部
403、位置情報抽出処理は位置情報抽出部404で行
われる。また、各処理はソースファイル201の内容す
べてを読みこんでから実行しても、ソースファイル20
1の一部を逐次読みこんで実行を繰り返してもかまわな
い。
FIG. 4B is a flowchart in the data analyzer 301. First, a lexical analysis process is performed in step 405, and the process proceeds to step 406 where a syntax analysis process is performed. Next, semantic analysis processing is executed in step 407, and position information extraction processing is executed in step 408. The lexical analysis processing is performed by the lexical analysis unit 401, the syntactic analysis processing is performed by the syntactic analysis unit 402, the semantic analysis processing is performed by the semantic analysis unit 403, and the position information extraction processing is performed by the position information extraction unit 404. Even if each process is executed after reading all the contents of the source file 201, the source file 20
1 may be sequentially read and the execution may be repeated.

【0025】次に、本発明に係る処理である位置情報テ
ーブル抽出部404の処理の詳細を説明する。図5は位
置情報抽出部におけるフローチャートである。
Next, the processing of the position information table extraction unit 404, which is processing according to the present invention, will be described in detail. FIG. 5 is a flowchart in the position information extracting unit.

【0026】前記意味解析部403における意味解析処
理が終了した部分に対して位置情報抽出処理を行なう。
まず、ステップ501でメンバ関数呼び出しかどうかの
判定を行なう。ソースファイル中の解析対象部分がメン
バ関数の呼び出し(暗黙的なメンバ関数呼び出しを含
む)である場合、ステップ502で位置情報であるメン
バ関数のクラス名、オブジェクト名、関数名、引数リス
ト、ファイルスコープ名、クラススコープ名、関数スコ
ープ名、ソースファイル上の行番号、解析対象命令に割
り当てられたアドレスラベルを位置情報テーブル100
0に記録(位置情報テーブル1000がまだなければ位
置情報テーブル1000を生成して記録)する処理を行
なう。解析対象がメンバ関数の呼び出しであった場合、
ステップ503に移行し呼び出している関数が基底クラ
スの仮想関数であるかどうかの判定を行なう。オブジェ
クトのクラスが基底クラスである場合、ステップ504
に移行しクラス名項目を派生クラス(複数ある場合はす
べてについて)に変更して位置情報テーブル1000に
記録する処理を行なう。これは仮想関数に対応するため
の処理である。図12の1201,1202で具体例を
挙げたとおり、コンパイラ解析時では基底クラスへのポ
インタが指すオブジェクトによって仮想関数が起動され
ていたとしても、実行時には派生クラス型のオブジェク
トによって仮想関数が起動されることが有り得るためで
ある。よって、考えられるすべての起動に対して情報を
記録しなければならないため、すべての派生クラスに変
更した位置情報を位置情報テーブル1000に記録する
必要がある。
The location information extracting process is performed on the portion where the semantic analyzing process is completed in the semantic analyzing unit 403.
First, in step 501, it is determined whether or not a member function call is made. If the analysis target part in the source file is a call of a member function (including an implicit member function call), in step 502, the class name, object name, function name, argument list, and file scope of the member function, which is positional information, Name, class scope name, function scope name, line number in the source file, and address label assigned to the instruction to be analyzed
0 (the position information table 1000 is generated and recorded if the position information table 1000 does not exist). If the analysis target is a call to a member function,
The process proceeds to step 503 to determine whether the calling function is a virtual function of the base class. If the class of the object is a base class, step 504
Then, a process of changing the class name item to a derived class (when there are a plurality of classes, changing all of them) and recording it in the position information table 1000 is performed. This is a process for dealing with a virtual function. As described in the specific examples 1201 and 1202 in FIG. 12, even when the virtual function is activated by the object pointed to by the pointer to the base class at the time of compiler analysis, the virtual function is activated by the derived class type object at the time of execution. This is because it is possible that Therefore, since information must be recorded for every conceivable activation, it is necessary to record the position information changed to all the derived classes in the position information table 1000.

【0027】以上の処理を意味解析処理407からデー
タが送られる毎に行ない、ソースファイル201のすべ
てのデータ解析処理306が終了するまで続けることに
よって位置情報テーブル1000が生成される。
The above processing is performed every time data is sent from the semantic analysis processing 407, and is continued until all the data analysis processing 306 of the source file 201 is completed, thereby generating the position information table 1000.

【0028】<デバッガ装置の構成>図6は、デバッガ
装置600の構成図である。デバッガ装置600は、入
力コマンド処理部601、中断点設定条件照合部60
2、中断点設定部603、中断点表示部604、プログ
ラム実行処理部605、そして情報表示部606で構成
されている。
<Structure of Debugger Device> FIG. 6 is a diagram showing the structure of the debugger device 600. The debugger device 600 includes an input command processing unit 601, an interruption point setting condition matching unit 60
2, a break point setting unit 603, a break point display unit 604, a program execution processing unit 605, and an information display unit 606.

【0029】入力コマンド処理部601は入力されたコ
マンドを解析する。コマンドが中断点設定コマンドなら
ば、コンパイラ装置202の位置情報抽出部404で抽
出した位置情報の集合である位置情報テーブル1000
と、ユーザーが入力した中断点設定条件とを中断点設定
条件照合部602に受け渡す。コマンドがプログラム実
行コマンドならば、プログラム実行処理部605に処理
を移す。コマンドが情報表示コマンドならば、情報表示
部606に処理を移す。
The input command processing unit 601 analyzes an input command. If the command is a breakpoint setting command, the position information table 1000 which is a set of position information extracted by the position information extraction unit 404 of the compiler device 202.
And the interruption point setting condition input by the user are transferred to the interruption point setting condition collating unit 602. If the command is a program execution command, the processing is shifted to the program execution processing unit 605. If the command is an information display command, the process proceeds to the information display unit 606.

【0030】中断点設定条件照合部602は、コンパイ
ラ装置202が生成した位置情報テーブル1000と、
ユーザーが入力した中断点設定条件に関する情報を照合
し、条件に一致する関数呼び出し点を抽出する。本発明
に係る構成である中断点設定情報照合部602の詳細に
ついては、後述する。
The interruption point setting condition collating unit 602 includes: a position information table 1000 generated by the compiler 202;
The information on the breakpoint setting condition input by the user is collated, and a function call point that matches the condition is extracted. Details of the interruption point setting information collation unit 602 having the configuration according to the present invention will be described later.

【0031】中断点設定部603は、上記照合部での抽
出結果を受け取り、該当する箇所に中断点を設定する処
理を行なう。
The break point setting unit 603 receives the result of the extraction by the collating unit, and performs a process of setting a break point at a corresponding point.

【0032】中断点表示部604は、上記設定部で設定
した中断点の箇所を表示する処理を行なう。
The interruption point display section 604 performs a process of displaying the location of the interruption point set by the setting section.

【0033】プログラム実行処理部605は、プログラ
ム実行コマンドが入力された時に起動し、プログラムの
実行を行なう。プログラムの実行が設定された中断点に
達した場合、プログラムの実行を中断する。
The program execution processing unit 605 is activated when a program execution command is input, and executes a program. When the execution of the program reaches the set interruption point, the execution of the program is interrupted.

【0034】情報表示部606は、情報表示コマンドが
入力されると起動され、入力されたオブジェクトに対す
る情報を出力する。
The information display unit 606 is activated when an information display command is input, and outputs information on the input object.

【0035】本発明に係るデバッグ装置の構成は、中断
点設定情報照合部602であり、これを除く入力コマン
ド処理部601、中断点設定部603、中断点表示部6
04、プログラム実行処理部605ならびに情報表示部
606については、従来のデバッグ装置に備えられてい
るものと変わらない。
The configuration of the debugging device according to the present invention is an interruption point setting information collating section 602, except for the input command processing section 601, the interruption point setting section 603, and the interruption point display section 6.
04, the program execution processing unit 605 and the information display unit 606 are the same as those provided in the conventional debugging device.

【0036】では、まず中断点設定条件照合部602の
処理の詳細について説明し、次にデバッグ処理全体につ
いて説明する。図7は中断点設定条件照合部602にお
けるフローチャートである。なお、デバッグ処理開始時
にデバッグ対象ファイルに対応する位置情報テーブル1
000を読みこんでいるものとする。また中断点設定条
件照合部602は、入力コマンド処理部601からユー
ザーが入力した中断点設定条件が渡されている。まずス
テップ701でユーザにより入力された中断点設定条件
と位置情報抽出処理408によって記録された位置情報
テーブル1000との照合を行なう。照合結果、位置情
報テーブル1000に含まれている位置情報のうち、ユ
ーザにより入力された中断点設定条件のすべてを含む位
置情報の保持しているアドレスを、中断点を設定するア
ドレスとして確定する。次にステップ702に渡され、
前記確定したアドレスをもつ位置情報を中断点設定部に
渡す。
First, details of the processing of the break point setting condition collating unit 602 will be described, and then the entire debugging processing will be described. FIG. 7 is a flowchart in the interruption point setting condition matching unit 602. At the start of the debugging process, the position information table 1 corresponding to the file to be debugged
000 is read. The interruption point setting condition collation unit 602 receives the interruption point setting condition input by the user from the input command processing unit 601. First, in step 701, the break point setting condition input by the user is compared with the position information table 1000 recorded by the position information extraction processing 408. As a result of the comparison, of the position information included in the position information table 1000, the address holding the position information including all of the breakpoint setting conditions input by the user is determined as the address at which the breakpoint is set. Next, it is passed to step 702,
The position information having the determined address is passed to the break point setting unit.

【0037】次にデバッグ処理の全体について説明す
る。図8はデバッグ装置のフローチャートである。まず
ステップ801でコマンド入力待ち状態であるデバッガ
は、ステップ802に移りユーザーからコマンドが入力
されたかどうかの判定を行なう。コマンドが入力された
場合、ステップ803に移りデバッガはユーザーから受
け取った入力コマンドを解析し判定を行なう。判定結
果、中断点の設定コマンドであった場合は、前述した中
断点設定条件照合部502に処理が移る。中断点設定条
件照合部502でのステップ701で条件を位置情報テ
ーブル1000と照合する。照合結果、位置情報テーブ
ル1000に含まれている位置情報のうち、ユーザによ
り入力された中断点設定条件のすべてを含む位置情報の
保持しているアドレスを、中断点を設定するアドレスと
して確定する。次にステップ702に渡され、前記確定
したアドレスをもつ位置情報を中断点設定部に渡す。次
にステップ804に移り前記アドレスに対して中断点を
設定する処理を行なう。そしてステップ805に移り設
定した中断点に関する位置情報を表示する処理を行な
い、コマンド入力待ち状態に移行する。ステップ803
でコマンドの解析結果がプログラム実行コマンドであっ
た場合は、ステップ806に移りコマンドに従いプログ
ラムを実行する。実行中はステップ807に移り随時中
断点に到達したかどうかの判定を行ない、中断点に到達
すればステップ808に移りプログラムの中断処理を実
行する。中断点に到達していない場合は、ステップ80
9に移りプログラムが終了したかどうかの判定を行な
う。終了していれば、ステップ801に移りコマンド入
力待ち状態に移行、終了していなければステップ806
に移りプログラムの実行を続ける。ステップ803でコ
マンドの解析結果が情報表示コマンドの場合、ステップ
810に移り指定したコマンドに対応した情報を表示す
る処理を行なった後、ステップ801に移りコマンド入
力待ち状態に移行する。
Next, the entire debugging process will be described. FIG. 8 is a flowchart of the debugging device. First, in step 801, the debugger in a command input waiting state proceeds to step 802 and determines whether a command has been input from the user. If a command has been input, the process proceeds to step 803 where the debugger analyzes the input command received from the user and makes a determination. If the result of the determination is that the command is a break point setting command, the process proceeds to the break point setting condition matching unit 502 described above. In step 701 of the break point setting condition matching unit 502, the condition is compared with the position information table 1000. As a result of the comparison, of the position information included in the position information table 1000, the address holding the position information including all of the breakpoint setting conditions input by the user is determined as the address at which the breakpoint is set. Next, the process is passed to step 702, and the position information having the determined address is passed to the interruption point setting unit. Next, the process proceeds to step 804 to perform a process of setting a break point for the address. Then, the process proceeds to step 805 to display the position information on the set interruption point, and shifts to a command input waiting state. Step 803
If the result of the analysis of the command is a program execution command, the process proceeds to step 806 to execute the program according to the command. During execution, the process proceeds to step 807 to determine whether or not the interruption point has been reached at any time. If the interruption point has been reached, the process proceeds to step 808 to execute the interruption process of the program. If the interruption point has not been reached, step 80
Then, it is determined whether or not the program is completed. If the processing has been completed, the processing shifts to step 801 to shift to a command input waiting state. If not completed, the processing proceeds to step 806.
Go to and continue executing the program. If the analysis result of the command is an information display command in step 803, the process proceeds to step 810 to display information corresponding to the specified command, and then proceeds to step 801 to shift to a command input waiting state.

【0038】なお、上記ステップ801、802、80
3は入力コマンド処理部601、ステップ701,70
2は中断点設定条件照合部602、ステップ804は中
断点設定部603、ステップ805は中断点表示部60
4、ステップ806、807、808、809はプログ
ラム実行処理部605、ステップ810は情報表示部6
06で実行される。
The above steps 801, 802, 80
3 is an input command processing unit 601, steps 701 and 70
2 is an interruption point setting condition matching unit 602, step 804 is an interruption point setting unit 603, and step 805 is an interruption point display unit 60.
4. Steps 806, 807, 808, and 809 are for the program execution processing unit 605, and step 810 is for the information display unit 6.
06.

【0039】以下、具体例により本発明を詳細に説明す
る。図9はソースプログラムの例である。プログラム言
語はC++言語である。
Hereinafter, the present invention will be described in detail with reference to specific examples. FIG. 9 is an example of a source program. The programming language is C ++.

【0040】ヘッダファイル"header.h"では、各クラス
の定義およびメンバ関数の定義を行なっている。1行目
から6行目まではクラスAの定義、8行目から11行目
まではクラスBの定義である。また説明を簡単にするた
め、各クラスのメンバ関数の定義は省略している。クラ
スAとクラスBは継承関係にある。
The header file "header.h" defines each class and defines member functions. The first to sixth lines define the class A, and the eighth to eleventh lines define the class B. For simplicity, the definition of the member functions of each class is omitted. Class A and class B have an inheritance relationship.

【0041】意味解析が終了した部分に対する位置情報
抽出部404の処理について、図5の位置情報抽出部に
おけるフローチャート、および図10の実施例の位置情
報テーブルを参照しながら説明する。
The processing performed by the position information extraction unit 404 on the part for which the semantic analysis has been completed will be described with reference to the flowchart in the position information extraction unit of FIG. 5 and the position information table of the embodiment of FIG.

【0042】ソースファイルsrc1.ccでは、関数および
オブジェクトの定義、メンバ関数呼び出しの処理を行な
っている。なお、1行目でクラス定義を記述しているヘ
ッダファイルheader.hを読み込んでいる。
The source file src1.cc defines functions and objects and processes member function calls. The first line reads the header file header.h that describes the class definition.

【0043】まず3行目でクラスAのオブジェクト定義
901を行なっている。ここでは暗黙的にクラスAのコ
ンストラクタA()が呼び出されるので、ステップ501
が真となる。よってステップ502に従い、位置情報1
001(クラス名:A、オブジェクト名:objA1、関数
名:A、引数リスト:void、ファイルスコープ:src1.c
c、クラススコープ:なし、関数スコープ:なし、行番
号:3、アドレスラベル:L01)位置情報テーブル1
000に記録する。ここでL01は、コンパイラで自動
的に与えられるラベル名であり、リンク時のアドレス解
決時に実アドレスに変換される。
First, the object definition 901 of the class A is performed on the third line. Here, since the constructor A () of the class A is implicitly called, step 501 is executed.
Becomes true. Therefore, according to step 502, position information 1
001 (Class name: A, Object name: objA1, Function name: A, Argument list: void, File scope: src1.c
c, class scope: none, function scope: none, line number: 3, address label: L01) location information table 1
Record to 000. Here, L01 is a label name automatically given by the compiler, and is converted to a real address at the time of address resolution at the time of linking.

【0044】次に8行目でクラスBのオブジェクト定義
902を行なっている。クラスBはクラスAの派生クラ
スであるので、コンストラクタ時には、基底クラスのコ
ンストラクタも同時に呼び出される。よって3行目と同
様に基底クラスAのコンストラクタA()が暗黙的に呼ば
れるので、ステップ502に従い、位置情報1002
(クラス名:B、オブジェクト名:objB1、関数名:
A、引数リスト:void、ファイルスコープ:src1.cc、
クラススコープ:なし、関数スコープ:func1(void)、
行番号8、アドレスラベル:L02)を位置情報テーブ
ル1000に記録する。
Next, the object definition 902 of the class B is performed in the eighth line. Since the class B is a derived class of the class A, the constructor of the base class is also called at the time of the constructor. Therefore, as in the third line, the constructor A () of the base class A is implicitly called.
(Class name: B, Object name: objB1, Function name:
A, argument list: void, file scope: src1.cc,
Class scope: None, Function scope: func1 (void),
(Line number 8, address label: L02) is recorded in the position information table 1000.

【0045】次に11行目でmfunc()メンバ関数の呼び
出し903が行われているので、ステップ502に従
い、位置情報1003(クラス名:A, オブジェクト
名:objA1、関数名:mfunc、引数リスト:void、ファイ
ルスコープ:src1.cc、クラススコープ:なし、関数ス
コープ:func1(void)、行番号11、アドレスラベル:
L03)を位置情報テーブル1000に記録する。
Next, since the call 903 of the mfunc () member function is performed in the eleventh line, the position information 1003 (class name: A, object name: objA1, function name: mfunc, argument list: void, file scope: src1.cc, class scope: none, function scope: func1 (void), line number 11, address label:
L03) is recorded in the position information table 1000.

【0046】次に12行目で、vfunc()仮想関数呼び出
し904が行われているので、上記と同様に位置情報1
004(クラス名:A、 オブジェクト名:objA2、関数
名:vfunc、引数リスト:void、ファイルスコープ:src
1.cc、クラススコープ:なし、関数スコープ:func1(vo
id)、行番号12、アドレスラベル:L04)を位置情
報テーブル1000に記録する。ここで、この関数は基
底クラスAの仮想関数であるので、派生クラスであるク
ラスBのvfunc()仮想関数呼び出しが行なわれている可
能性がある。よって、ステップ503が真となり、ステ
ップ504に移る。ここでクラス名項目を派生クラス
(この場合はクラスB)に変更した位置情報1005
(クラス名:B、 オブジェクト名:objA2、関数名:vf
unc、引数リスト:void、ファイルスコープ:src1.cc、
クラススコープ:なし、関数スコープ:func1(void)、
行番号12、アドレスラベル:L04)を位置情報テー
ブル1000に記録する処理を行なう。
Next, since the virtual function call 904 of vfunc () is performed on the twelfth line, the position information 1 is obtained in the same manner as described above.
004 (class name: A, object name: objA2, function name: vfunc, argument list: void, file scope: src
1.cc, class scope: none, function scope: func1 (vo
id), line number 12, and address label: L04) are recorded in the position information table 1000. Here, since this function is a virtual function of the base class A, there is a possibility that a vfunc () virtual function call of the class B, which is a derived class, has been made. Therefore, step 503 becomes true, and the process proceeds to step 504. Here, the position information 1005 in which the class name item has been changed to a derived class (in this case, class B)
(Class name: B, Object name: objA2, Function name: vf
unc, argument list: void, file scope: src1.cc,
Class scope: None, Function scope: func1 (void),
A process for recording the line number 12, address label: L04) in the position information table 1000 is performed.

【0047】次に18行目では、クラスAオブジェクト
定義905であるので、クラスAのコンストラクタA()
が呼び出される。よって8行目と同様に、位置情報10
06(クラス名:A、オブジェクト名:objA4、関数
名:A、引数リスト:void、ファイルスコープ:src1.c
c、クラススコープ:なし、関数スコープ:func2(voi
d)、行番号18、アドレスラベル:L05)位置情報テ
ーブル1000に記録する。
Next, in the 18th line, since the class A object definition 905 is used, the class A constructor A ()
Is called. Therefore, similarly to the eighth line, the position information 10
06 (Class name: A, Object name: objA4, Function name: A, Argument list: void, File scope: src1.c
c, class scope: none, function scope: func2 (voi
d), line number 18, address label: L05) Record in the position information table 1000.

【0048】次に21行目ではvfunc()仮想関数呼び出
しであるので、12行目と同様に位置情報1007(ク
ラス名:A、 オブジェクト名:objA3、関数名:vfun
c、引数リスト:void、ファイルスコープ:src1.cc、ク
ラススコープ:なし、関数スコープ:func2(void)、行
番号21、アドレスラベル:L06)および派生クラス
に変更した位置情報1008(クラス名:B, オブジェ
クト名:objA3,関数名:vfunc、引数リスト:void、フ
ァイルスコープ:src1.cc、クラススコープ:なし、関
数スコープ:func2(void)、行番号21、アドレスラベ
ル:L06)を位置情報テーブル1000に記録する。
Next, since the 21st line is a vfunc () virtual function call, position information 1007 (class name: A, object name: objA3, function name: vfunc)
c, argument list: void, file scope: src1.cc, class scope: none, function scope: func2 (void), line number 21, address label: L06) and position information 1008 changed to a derived class (class name: B) , Object name: objA3, function name: vfunc, argument list: void, file scope: src1.cc, class scope: none, function scope: func2 (void), line number 21, address label: L06) and the position information table 1000. To record.

【0049】ソースファイルsrc2.ccでは、src1.ccと同
様に関数およびオブジェクトの定義、メンバ関数呼び出
しの処理を行なっている。位置情報テーブル1000に
対する記録処理は5行目、および8行目でsrc1.ccと同
様に行なわれる。
In the source file src2.cc, similarly to src1.cc, the definition of functions and objects and the processing of calling member functions are performed. Recording processing for the position information table 1000 is performed in the same manner as in src1.cc on the fifth and eighth lines.

【0050】以上の処理によって、図10のオブジェク
ト位置情報テーブル1000が生成される。なおアドレ
スはリンカによってアドレスラベルと置き換えられた値
である。
By the above processing, the object position information table 1000 shown in FIG. 10 is generated. The address is a value replaced with an address label by the linker.

【0051】次にデバッグ処理における中断点設定方法
の詳細を、具体例を挙げて説明する。今、仮想関数vfun
cの起動チェックを行なう場合を考える。デバッグ処理
対象は、src1.ccの範囲とする。この場合、本発明のデ
バッガには、中断点設定条件として"ファイルスコープs
rc1.cc"、"関数vfunc"を与える。これらの情報が与えら
れた時の処理を図7を参照して説明する。
Next, details of a method of setting a break point in the debugging process will be described with reference to a specific example. Now the virtual function vfun
Let's consider a case where a start check of c is performed. The debug processing target is in the range of src1.cc. In this case, the debugger of the present invention includes "file scopes
rc1.cc "and" function vfunc ". Processing when these pieces of information are provided will be described with reference to FIG.

【0052】まず、ステップ801であるコマンド入力
待ち状態において、中断点設定条件として、"ファイル
スコープsrc1.cc"、"関数vfunc"を与えた場合、ステッ
プ802のコマンド入力判定が真となるのでステップ8
03に移行する。次にステップ803で、中断点設定コ
マンドが実行されたことが判定されるので、ステップ7
01に移行する。ステップ701では条件指定と位置情
報テーブル10とを照合する処理を実行する。具体例で
条件に該当する項目は、項目1004、項目1005、
項目1007,そして項目1008である。その後、ス
テップ702に移り、条件指定に該当する中断点設定ア
ドレス、ファイル名、行番号を中断点設定部603に渡
す。つまり、該当する項目の中断点情報であるファイル
名src1.cc、行番号12、アドレス0x4660および、ファ
イル名src1.cc,行番号21、アドレス0x4740が渡され
る。これらのアドレスに対して、ステップ804におい
て、中断点が設定される。以上の処理によって、ユーザ
ーが入力した中断点設定条件に該当する中断点を一度に
複数設定することが可能となる。
First, if "file scope src1.cc" and "function vfunc" are given as interruption point setting conditions in the command input waiting state of step 801, the command input determination of step 802 becomes true. 8
Shift to 03. Next, in step 803, it is determined that the interruption point setting command has been executed.
Move to 01. In step 701, a process of collating the condition specification with the position information table 10 is executed. Items that meet the conditions in the specific example are item 1004, item 1005,
Item 1007 and item 1008. Then, the process proceeds to step 702, where the interruption point setting address, file name, and line number corresponding to the condition specification are passed to the interruption point setting unit 603. That is, the file name src1.cc, line number 12, address 0x4660, and the file name src1.cc, line number 21, address 0x4740, which are break point information of the corresponding item, are passed. For these addresses, a break point is set in step 804. Through the above processing, it is possible to set a plurality of interruption points corresponding to the interruption point setting condition input by the user at a time.

【0053】なお、この具体例では、範囲指定としてフ
ァイルスコープ名の条件指定のみであったが、クラスス
コープ名、関数スコープ名、行番号、アドレスを指定し
ても同様の効果が得られる。また、この具体例では、中
断点設定条件として関数の指定のみであったが、クラス
名、オブジェクト名を指定しても同様の効果が得られ
る。また、具体例では、各項目の条件を一つずつ指定し
たが、例えば“関数mfunc あるいは 関数 vfunc”など
のように各項目に複数の条件を指定しても、同様の効果
が得られる。また、中断点設定部603に渡す位置情報
として具体例ではアドレス、行番号、ファイル名であっ
たが、その他の位置情報を渡してもかまわない。
In this specific example, only the condition specification of the file scope name is specified as the range specification, but the same effect can be obtained by specifying the class scope name, the function scope name, the line number, and the address. In this specific example, only the function is designated as the breakpoint setting condition. However, the same effect can be obtained by designating the class name and the object name. In the specific example, the condition of each item is specified one by one. However, the same effect can be obtained by specifying a plurality of conditions for each item such as “function mfunc or function vfunc”. In the specific example, the position information to be passed to the interruption point setting unit 603 is an address, a line number, and a file name. However, other position information may be passed.

【0054】[0054]

【発明の効果】本発明のプログラム中断点設定方法によ
れば、ユーザーが中断点を設定したい範囲ならびに条件
を指定するだけで、一つまたは複数の中断点を必要な範
囲だけに一度に設定することができる。特に、オブジェ
クト指向言語に基づいた中断点設定条件の指定が可能で
ある。具体的には、あるクラスのメンバ関数すべての呼
び出し点、もしくはあるクラス名、オブジェクト名、メ
ンバ関数名に限定することができ、また設定範囲とし
て、ファイルスコープ情報、関数スコープ情報、クラス
スコープ情報、ソースファイル上での行番号、実行形式
ファイル上のアドレスを指定することができるので、ユ
ーザーが中断点設定を希望する一つあるいは複数のメン
バ関数呼出し点をユーザーに負担をかけることなく設定
することができ、効率的なデバッグ処理が実現できる。
According to the program interruption point setting method of the present invention, one or a plurality of interruption points can be set only in a necessary range at once by simply designating a range and a condition in which a user wants to set an interruption point. be able to. In particular, it is possible to specify breakpoint setting conditions based on an object-oriented language. Specifically, it can be limited to the call points of all the member functions of a certain class, or to certain class names, object names, and member function names, and the setting range is file scope information, function scope information, class scope information, Since the line number on the source file and the address on the executable file can be specified, the user can set one or more member function call points for which a break point is desired without burdening the user. And an efficient debugging process can be realized.

【0055】また、プログラム上で明示的に記述されて
いないため、暗黙的メンバ関数が影響を及ぼす箇所を検
索することが困難であったが、本発明手法を用いれば、
そのメンバ関数を中断点設定条件に指定するだけで、効
率よく影響を及ぼす箇所に中断点を設定することがで
き、効率的なデバッグ処理が実現できる。
Also, since it is not explicitly described in the program, it is difficult to search for a location affected by the implicit member function.
By simply designating the member function as the breakpoint setting condition, a breakpoint can be set at a location that has an effect efficiently, and efficient debugging can be realized.

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

【図1】本発明に係るコンパイラ装置、デバッガ装置、
位置情報テーブルの構成図
FIG. 1 shows a compiler device and a debugger device according to the present invention;
Configuration diagram of location information table

【図2】ソースファイルから実行形式ファイルを生成す
るまでのフローチャート
FIG. 2 is a flow chart until an executable file is generated from a source file.

【図3】(a) コンパイラ装置の構成図 (b) コンパイラ装置におけるフローチャートFIG. 3 (a) Configuration diagram of a compiler device (b) Flow chart in a compiler device

【図4】(a) データ解析部の構成図 (b) データ解析部におけるフローチャートFIG. 4A is a configuration diagram of a data analysis unit. FIG. 4B is a flowchart of the data analysis unit.

【図5】位置情報抽出部におけるフローチャートFIG. 5 is a flowchart in a position information extraction unit.

【図6】デバッガ装置の構成図FIG. 6 is a configuration diagram of a debugger device.

【図7】中断点設定条件照合部におけるフローチャートFIG. 7 is a flowchart of a break point setting condition matching unit;

【図8】デバッガ装置のフローチャートFIG. 8 is a flowchart of a debugger device.

【図9】実施例のソースファイルを示す図FIG. 9 is a diagram showing a source file according to the embodiment;

【図10】実施例の位置情報テーブルを示す図FIG. 10 is a diagram illustrating a position information table according to the embodiment;

【図11】従来の中断点設定例を示す図FIG. 11 is a diagram showing a conventional example of setting a break point.

【図12】仮想関数呼び出し例を示す図FIG. 12 is a diagram showing an example of calling a virtual function;

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

201 ソースファイル 202 コンパイラ 203 アセンブリファイル 204 アセンブラ 205 再配置可能ファイル 206 リンカ 207 実行形式ファイル 301 データ解析部 302 中間コード生成部 303 最適化部 304 資源割付部 305 コード生成部 306 データ解析処理 307 中間コード生成処理 308 最適化処理 309 資源割付処理 310 コード生成処理 401 字句解析部 402 構文解析部 403 意味解析部 404 位置情報抽出部 405 字句解析処理 406 構文解析処理 407 意味解析処理 408 位置情報抽出処理 501 メンバ関数呼び出し判定処理 502 位置情報追加処理 503 基底クラス仮想関数判定処理 504 仮想関数対応処理 600 デバッガ装置 601 入力コマンド処理部 602 中断点設定条件照合部 603 中断点設定部 604 中断点表示部 605 プログラム実行処理部 606 情報表示部 701 位置情報照合処理 702 中断点設定部移行処理 801 コマンド入力待ち状態 802 コマンド入力判定処理 803 入力コマンド解析処理 804 中断点設定処理 805 中断点表示処理 806 プログラム実行処理 807 中断点到達判定処理 808 プログラム中断処理 809 プログラム終了処理 810 情報表示処理 901 クラスAオブジェクト定義 902 クラスBオブジェクト定義 903 mfunc()メンバ関数呼び出し 904 vfunc()仮想関数呼び出し 905 クラスAオブジェクト定義 906 vfunc()仮想関数呼び出し 907 クラスBオブジェクト定義 908 vfunc()仮想関数呼び出し 1000 位置情報テーブル 1001 901の処理により追加された位置情報 1002 902の処理により追加された位置情報 1003 903の処理により追加された位置情報 1004 904の処理により追加された位置情報 1005 904の処理により追加された位置情報 1006 905の処理により追加された位置情報 1007 906の処理により追加された位置情報 1008 906の処理により追加された位置情報 1009 907の処理により追加された位置情報 1010 908の処理により追加された位置情報 1011 908の処理により追加された位置情報 1101 行番号による中断点設定例 1102 行番号による中断点設定例 1103 絶対アドレスによる中断点設定例 1104 絶対アドレスによる中断点設定例 1105 関数による中断点設定例 1106 関数による中断点設定例 1201 動的な仮想関数呼び出し 1202 動的な仮想関数呼び出し Reference Signs List 201 Source file 202 Compiler 203 Assembly file 204 Assembler 205 Relocatable file 206 Linker 207 Executable file 301 Data analyzer 302 Intermediate code generator 303 Optimizer 304 Resource allocation unit 305 Code generator 306 Data analysis processing 307 Intermediate code generation Processing 308 Optimization processing 309 Resource allocation processing 310 Code generation processing 401 Lexical analysis section 402 Syntax analysis section 403 Semantic analysis section 404 Location information extraction section 405 Lexical analysis processing 406 Syntax analysis processing 407 Semantic analysis processing 408 Position information extraction processing 501 Member function Call determination processing 502 Location information addition processing 503 Base class virtual function determination processing 504 Virtual function corresponding processing 600 Debugger device 601 Input command processing unit 602 Interruption Setting condition collation unit 603 Interruption point setting unit 604 Interruption point display unit 605 Program execution processing unit 606 Information display unit 701 Location information collation processing 702 Interruption point setting unit transition processing 801 Command input waiting state 802 Command input determination processing 803 Input command analysis processing 804 Interruption point setting processing 805 Interruption point display processing 806 Program execution processing 807 Interruption point arrival determination processing 808 Program interruption processing 809 Program end processing 810 Information display processing 901 Class A object definition 902 Class B object definition 903 mfunc () member function call 904 vfunc () virtual function call 905 class A object definition 906 vfunc () virtual function call 907 class B object definition 908 vfunc () virtual function call 1000 location information table 100 Position information 1002 added by the processing of 901 1002 Position information added by the processing of 902 1003 Position information added by the processing of 903 Position information added by the processing of 904 1005 Position information added by the processing of 904 1006 Position information added by the processing of 905 1007 Position information added by the processing of 906 1008 Position information added by the processing of 906 1009 Position information added by the processing of 907 1010 Position information added by the processing of 908 Position information added by the processing of step 908 1101 Interruption point setting example by line number 1102 Interruption point setting example by line number 1103 Interruption point setting example by absolute address 1104 Interruption point setting example by absolute address 1105 Interruption point setting by function Break point set by the 1106 function Example 1201 dynamic virtual function call 1202 dynamic virtual function call

───────────────────────────────────────────────────── フロントページの続き (72)発明者 佐山 旬子 大阪府門真市大字門真1006番地 松下電器 産業株式会社内 Fターム(参考) 5B042 GA02 GA08 HH25 LA01  ──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Junko Sayama 1006 Kazuma Kadoma, Kazuma, Osaka Matsushita Electric Industrial Co., Ltd. F term (reference) 5B042 GA02 GA08 HH25 LA01

Claims (12)

【特許請求の範囲】[Claims] 【請求項1】プログラムの解析を行ない特定の処理単位
に対する位置情報を抽出する位置情報抽出手段と、前記
位置情報抽出手段により抽出された位置情報とユーザー
が入力した中断点設定条件とを照合する中断点設定条件
照合手段と、前記中断点設定条件照合手段により照合し
た結果に基づいて中断点設定条件に該当する一つまたは
複数の位置に中断点を設定する中断点設定手段とを備え
ることを特徴とするプログラム中断点設定装置。
1. A position information extracting means for analyzing a program and extracting position information for a specific processing unit, and collating the position information extracted by the position information extracting means with a breakpoint setting condition inputted by a user. Interrupt point setting condition matching means, and interrupt point setting means for setting an interrupt point at one or a plurality of positions corresponding to the interrupt point setting condition based on the result of comparison by the interrupt point setting condition matching means. Characteristic program interruption point setting device.
【請求項2】前記位置情報抽出手段が、プログラムの特
定の処理単位である関数の呼び出し点の位置情報を抽出
することを特徴とする請求項1記載のプログラム中断点
設定装置。
2. The program interruption point setting device according to claim 1, wherein said position information extracting means extracts position information of a call point of a function which is a specific processing unit of the program.
【請求項3】前記位置情報抽出手段が、関数呼び出し形
態が暗黙的呼び出しである関数の呼び出し点の位置情報
を抽出することを特徴とする請求項2記載のプログラム
中断点設定装置。
3. The program interruption point setting device according to claim 2, wherein said position information extracting means extracts position information of a call point of a function whose function call form is an implicit call.
【請求項4】前記位置情報抽出手段が、関数呼び出し点
の位置情報として、関数を呼び出しているオブジェクト
のクラス名、オブジェクト名、関数名、関数の引数リス
ト、ファイルスコープ情報、クラススコープ情報、関数
スコープ情報、関数を呼び出しているソースファイル上
の行番号、関数を呼び出している実行形式ファイル上の
アドレスのうち、少なくとも一つを抽出することを特徴
とする請求項2〜3記載のプログラム中断点設定装置。
4. The method according to claim 1, wherein the position information extracting means includes, as position information of the function call point, a class name, an object name, a function name, a function argument list, a file scope information, a class scope information, a function 4. The program interruption point according to claim 2, wherein at least one of scope information, a line number in a source file calling the function, and an address in an executable file calling the function is extracted. Setting device.
【請求項5】前記中断点設定条件照合手段において、ユ
ーザーが入力する中断点設定条件として、中断点を設定
したい関数呼び出し点の関数を呼び出しているオブジェ
クトのクラス名、オブジェクト名、関数名、多重定義さ
れた関数の場合に限定するための引数リスト、中断点を
設定したいスコープ範囲であるファイルスコープ情報、
関数スコープ情報、クラススコープ情報、ソースファイ
ル上の行番号、実行形式ファイル上のアドレスのうち、
少なくとも一つを入力することを特徴とする請求項1〜
4記載のプログラム中断点設定装置。
5. The interruption point setting condition matching means, wherein the interruption point setting condition input by the user includes a class name, an object name, a function name, and a name of an object calling a function at a function call point at which the interruption point is to be set. Argument list for limiting to defined functions, file scope information that is the scope range where you want to set breakpoints,
Of the function scope information, class scope information, line numbers in the source file, and addresses in the executable file,
At least one is input.
4. The program interruption point setting device according to item 4.
【請求項6】前記中断点設定条件照合手段において、フ
ァイルスコープ情報として、ファイル名、クラススコー
プ情報としてクラス名、関数スコープ情報として引数を
含んだ関数名を用いることを特徴とする請求項5記載の
プログラム中断点設定装置。
6. The interrupt point setting condition collating means uses a file name as file scope information, a class name as class scope information, and a function name including an argument as function scope information. Program break point setting device.
【請求項7】プログラムの解析を行ない特定の処理単位
に対する位置情報を抽出する位置情報抽出ステップと、
前記位置情報抽出ステップにより抽出された位置情報と
ユーザーが入力した中断点設定条件とを照合する中断点
設定条件照合ステップと、前記中断点設定条件照合ステ
ップにより照合した結果に基づいて中断点設定条件に該
当する一つまたは複数の位置に中断点を設定する中断点
設定ステップとを備えることを特徴とするプログラム中
断点設定方法。
7. A position information extracting step of analyzing a program and extracting position information for a specific processing unit;
A breakpoint setting condition matching step of matching the position information extracted by the position information extraction step with a breakpoint setting condition input by a user; and a breakpoint setting condition based on a result of the matching by the breakpoint setting condition matching step. And a break point setting step of setting a break point at one or a plurality of positions corresponding to the above.
【請求項8】前記位置情報抽出ステップが、プログラム
の特定の処理単位である関数の呼び出し点の位置情報を
抽出することを特徴とする請求項7記載のプログラム中
断点設定方法。
8. The program interruption point setting method according to claim 7, wherein said position information extracting step extracts position information of a call point of a function which is a specific processing unit of the program.
【請求項9】前記位置情報抽出ステップが、関数呼び出
し形態が暗黙的呼び出しである関数の呼び出し点の位置
情報を抽出することを特徴とする請求項8記載のプログ
ラム中断点設定方法。
9. The method according to claim 8, wherein the step of extracting the position information extracts position information of a call point of a function whose function call form is an implicit call.
【請求項10】前記位置情報抽出ステップが、関数呼び
出し点の位置情報として、関数を呼び出しているオブジ
ェクトのクラス名、オブジェクト名、関数名、関数の引
数リスト、ファイルスコープ情報、クラススコープ情
報、関数スコープ情報、関数を呼び出しているソースフ
ァイル上の行番号、関数を呼び出している実行形式ファ
イル上のアドレスのうち、少なくとも一つを抽出するこ
とを特徴とする請求項8〜9記載のプログラム中断点設
定方法。
10. The method according to claim 1, wherein the position information extracting step includes, as the position information of the function call point, a class name, an object name, a function name, a function argument list, a file scope information, a class scope information, a function 10. The program interruption point according to claim 8, wherein at least one of scope information, a line number in a source file calling the function, and an address in an executable file calling the function is extracted. Setting method.
【請求項11】前記中断点設定条件照合ステップにおい
て、ユーザーが入力する中断点設定条件として、中断点
を設定したい関数呼び出し点の関数を呼び出しているオ
ブジェクトのクラス名、オブジェクト名、関数名、多重
定義された関数の場合に限定するための引数リスト、中
断点を設定したいスコープ範囲であるファイルスコープ
情報、関数スコープ情報、クラススコープ情報、ソース
ファイル上の行番号、実行形式ファイル上のアドレスの
うち、少なくとも一つを入力することを特徴とする請求
項7〜10記載のプログラム中断点設定方法。
11. In the break point setting condition collating step, as a break point setting condition input by a user, a class name, an object name, a function name, a multiple name of an object calling a function of a function call point at which a break point is desired to be set. Argument list for limiting to the defined function, file scope information, function scope information, class scope information that is the scope range to set the break point, line number in source file, address in executable file 11. The method of setting a program interruption point according to claim 7, wherein at least one of them is input.
【請求項12】前記中断点設定条件照合ステップにおい
て、ファイルスコープ情報として、ファイル名、クラス
スコープ情報としてクラス名、関数スコープ情報として
引数を含んだ関数名を用いることを特徴とする請求項1
1記載のプログラム中断点設定方法。
12. The method according to claim 1, wherein in the step of checking breakpoint setting conditions, a file name is used as file scope information, a class name is used as class scope information, and a function name including an argument is used as function scope information.
1. The method for setting a program interruption point according to 1.
JP2000104656A 2000-04-06 2000-04-06 Device and method for setting program breakpoint Pending JP2001290674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000104656A JP2001290674A (en) 2000-04-06 2000-04-06 Device and method for setting program breakpoint

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000104656A JP2001290674A (en) 2000-04-06 2000-04-06 Device and method for setting program breakpoint

Publications (1)

Publication Number Publication Date
JP2001290674A true JP2001290674A (en) 2001-10-19

Family

ID=18618163

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000104656A Pending JP2001290674A (en) 2000-04-06 2000-04-06 Device and method for setting program breakpoint

Country Status (1)

Country Link
JP (1) JP2001290674A (en)

Cited By (1)

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

Cited By (1)

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

Similar Documents

Publication Publication Date Title
US6367068B1 (en) Dynamic parsing
JP4901075B2 (en) Computer-readable medium, method and computing device
US6412109B1 (en) Method for optimizing java bytecodes in the presence of try-catch blocks
US6381737B1 (en) Automatic adapter/stub generator
JP3612294B2 (en) Debugging method and debugging device
US9417931B2 (en) Unified metadata for external components
US20050223363A1 (en) Evaluation of a code segment
US11579856B2 (en) Multi-chip compatible compiling method and device
CN106325970A (en) Compiling method and compiling system
US8869126B2 (en) Method and apparatus enabling multi threaded program execution for a Cobol program including OpenMP directives by utilizing a two-stage compilation process
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
US7721250B2 (en) System and method for interactive and integrated software development process and phases
JP2002024029A (en) Compiler, compiling method and computer readable recording medium with compile program recorded thereon
JP2005141380A (en) Template compile method
US6976249B1 (en) Method for embedding object codes in source codes
JPH0766342B2 (en) Program test equipment
JP2001290674A (en) Device and method for setting program breakpoint
JP7295469B2 (en) Function generation program, function generation method, and information processing device
JP2009258796A (en) Program development device and program development method
JP2004038279A (en) Compiler, arithmetic operation system and arithmetic operation method
TW200417924A (en) WIN F-language interpreter
JP2013080386A (en) Information processing device and address management method
JP2009515243A (en) Method for generating a simulation program executable on a host computer
JP2679651B2 (en) Compilation method
CN112799942A (en) Software source code and target code coverage rate analysis method and system based on Keil C51