JP3107151B2 - Optimized code debugging method - Google Patents
Optimized code debugging methodInfo
- Publication number
- JP3107151B2 JP3107151B2 JP09111855A JP11185597A JP3107151B2 JP 3107151 B2 JP3107151 B2 JP 3107151B2 JP 09111855 A JP09111855 A JP 09111855A JP 11185597 A JP11185597 A JP 11185597A JP 3107151 B2 JP3107151 B2 JP 3107151B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- source
- line
- intermediate language
- optimization
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims description 67
- 238000005457 optimization Methods 0.000 claims description 192
- 230000006870 function Effects 0.000 claims description 66
- 230000000694 effects Effects 0.000 claims description 12
- 230000003111 delayed effect Effects 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 16
- 230000001174 ascending effect Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 238000004804 winding Methods 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
- Devices For Executing Special Programs (AREA)
Description
【0001】[0001]
【発明の属する技術分野】本発明は最適化コードデバッ
グ方式に関し、特に原始プログラムを、より実行効率の
よい、あるいはサイズのより小さい目的プログラムに変
換することを目的にしたコンパイラと、変換された目的
プログラムをデバッグするシンボリックデバッガとから
なる最適化コードデバッグ方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an optimized code debugging method, and more particularly, to a compiler for converting a source program into a more efficient or smaller target program, and a converted object program. The present invention relates to an optimized code debugging method including a symbolic debugger for debugging a program.
【0002】[0002]
【従来の技術】一般に、シンボリックデバッガでの目的
プログラムの実行においては、原始プログラムを行単位
にステップ実行することができる。原始プログラムはソ
ースプログラムとも称せられ、ソースプログラムの1行
をソース行と称する。ステップ実行では、1ソース行が
実行される。2. Description of the Related Art Generally, when a target program is executed by a symbolic debugger, a source program can be step-executed line by line. The source program is also called a source program, and one line of the source program is called a source line. In the step execution, one source line is executed.
【0003】近年のコンパイラにおいては、実行効率ま
たはコードサイズの削減のために、目的プログラムを積
極的に最適化することが普通である。コンパイラが最適
化された目的プログラムを生成する場合、ソースプログ
ラムにおける演算の実行順序と、目的プログラムにおけ
る演算の実行順序とは一致しなくなることがある。In recent compilers, it is common to actively optimize a target program in order to reduce execution efficiency or code size. When the compiler generates an optimized target program, the order of execution of operations in the source program may not match the order of execution of operations in the target program.
【0004】しかし、デバッガが1ステップ実行してソ
ースプログラムでの現在位置だけを表示する従来のデバ
ッグシステムにおいては、ソースプログラムと目的プロ
グラムとで演算の実行順序が一致しない場合でも、不一
致に関して何らの情報を示すことはない。そのため、デ
バッグ実行者がデバッガで変数の値を参照したときに、
値がソースプログラムから推定される変数の期待値でな
い場合、それがコンパイラの最適化によるものか、プロ
グラムの不正によるものかを、デバッグ実行者自身が目
的プログラムの逆アセンブルリストを見て判断しなけれ
ばならず、デバッグに多大な工数を要する。However, in the conventional debugging system in which the debugger executes one step and displays only the current position in the source program, even if the execution order of the operations does not match between the source program and the target program, some sort of mismatch does not occur. No information is shown. Therefore, when the debugger sees the value of a variable in the debugger,
If the value is not the expected value of the variable deduced from the source program, the debugger must determine whether it is due to compiler optimization or incorrect program by looking at the disassembly list of the target program. Debugging requires a lot of man-hours.
【0005】例えば、コンパイラは、公知のコードの巻
き上げ(中田育男箸『コンパイラ』、産業図書、昭和6
3年)と呼ばれる最適化を適用する場合がある。これは
分岐の両方の経路で存在する計算や文を分岐の前に移動
する最適化であり、コードは実行の流れの方向から見れ
ば後向きに、後方移動される。コンパイラの最適化によ
る後方移動の例を示す図5を見ると、コード列S521
が後方移動されている。また、分岐前と、分岐後のどち
らか一方の経路とに同じ変数への代入が存在するとき、
分岐前の代入文を分岐後のもう一方の経路へと移動する
最適化もあり、ここではコードは実行の流れの方向から
見れば前向きに、前方移動される。コンパイラの最適化
による前方移動の例を示す図6を見ると、コード列S6
24が前方移動されている。[0005] For example, a compiler can be used to wind up a known code (Ikuo Nakata, Chopsticks “Compiler”, Sangyo Tosho, Showa 6)
3 years). This is an optimization that moves computations and statements that exist in both paths of the branch before the branch, and the code is moved backward in the direction of execution flow. Referring to FIG. 5 showing an example of backward movement by optimization of a compiler, a code string S521
Has been moved backwards. In addition, when there is an assignment to the same variable before the branch and in one of the paths after the branch,
There is also an optimization that moves the assignment statement before the branch to the other path after the branch, where the code is moved forward, as viewed from the direction of execution flow. Referring to FIG. 6 showing an example of forward movement by optimization of the compiler, the code string S6
24 have been moved forward.
【0006】このような実行順序が変更された目的プロ
グラムをデバッグする場合、デバッグ実行者が変数の値
を参照すると、目的プログラムの停止位置によっては、
ソースプログラム上の現在位置から推定される変数の期
待値がまだ代入されていないことがありうる。これはプ
ログラムの不正ではなく、最適化によるコード移動の影
響である。目的プログラム5cにおいては、実行が分岐
S522まで到達したとき、ソースプログラム表示では
11行目が現在位置として表示される。このとき、12
行目および14行目の文はソースプログラム上は分岐S
511の後であるが、目的プログラムにおいては既にS
521で実行済である。したがって、変数aの値を参照
すると、前倒しに実行された代入のために、0が表示さ
れる。また、目的プログラム6cでは、実行が分岐S6
21まで到達したとき、ソースプログラム上では22行
目が現在位置として表示される。このとき、21行目の
文はソースプログラム上は分岐S612の前であるが、
目的プログラムにおいてはS624までは実行されな
い。したがって、変数sの値を参照すると、変数sへの
0の代入が遅延されているために、0以外の値が表示さ
れる可能性がある。以上のように、ソースプログラム上
の現在位置しか表示しないようなデバッグシステムで
は、変数の値が期待値でなかったとき、それが最適化に
よるものか、プログラムに不正があったのかを判断する
のは容易でない。When debugging a target program whose execution order has been changed, if a debugger refers to the value of a variable, depending on the stop position of the target program,
It is possible that the expected value of the variable estimated from the current position in the source program has not been substituted yet. This is not a program fraud but an effect of code movement due to optimization. In the target program 5c, when the execution reaches the branch S522, the eleventh line is displayed as the current position in the source program display. At this time, 12
The statements on lines 14 and 14 are branch S in the source program
After 511, in the target program already S
521 has already been executed. Therefore, referring to the value of the variable a, 0 is displayed due to the substitution executed earlier. Further, in the target program 6c, the execution is branched S6.
When it reaches 21, the 22nd line is displayed as the current position on the source program. At this time, the statement on line 21 is before the branch S612 on the source program,
In the target program, the processing is not executed until S624. Therefore, referring to the value of the variable s, a value other than 0 may be displayed because the assignment of 0 to the variable s is delayed. As described above, in a debugging system that only displays the current position in the source program, when the value of a variable is not the expected value, it is determined whether the variable was due to optimization or the program was illegal. Is not easy.
【0007】初期のシンボリックデバッガでは、最適化
された目的プログラムについてはアセンブリレベルでし
かデバッグできないものが多かったが、近年の最適化コ
ンパイラの普及に伴い、最適化された目的プログラム
を、ソースレベルでデバッグ可能にするための技術の確
立が、デバッグシステムにおける重大な課題となってい
る。ソースプログラムとは実行順序が変更されているこ
とを、デバッグ実行者にわかりやすく表示できるかどう
かが問題であり、ソースプログラムと目的プログラムと
の対応をデバッガがいかに見やすく表示するかに関して
は論文や特許も数多く出されている。In the early symbolic debuggers, most of the optimized target programs could be debugged only at the assembly level. However, with the spread of the optimizing compiler in recent years, the optimized target programs have been reduced at the source level. Establishing the technology to enable debugging is a significant issue in debugging systems. The problem with the source program is whether it is possible for the debugger to clearly indicate that the execution order has been changed, and how to display the correspondence between the source program and the target program with a debugger is a paper or patent. Many have been issued.
【0008】例えば、特開平5−224987号公報に
開示された「パイプライン処理方式コンピュータ用プロ
グラムのデバッガ」は、ソース行毎に、ソースプログラ
ムの行番号と、目的プログラムのメモリアドレス範囲と
を表示したテーブルを出力することを特徴とする。ソー
スレベルのステップ実行に当っては、機械語命令のステ
ップ実行を繰り返して、ソース行に対応するメモリアド
レス範囲外になった場合を、ステップ実行の終了と判断
する。デバッガは、目的プログラムの停止アドレスと、
テーブル中のメモリアドレス範囲の先頭アドレスとを順
次比較して、デバッグ実行者に停止ソース行番号を表示
する。For example, a "debugger of a computer program for a pipeline processing system" disclosed in Japanese Patent Application Laid-Open No. H5-222487 displays a line number of a source program and a memory address range of a target program for each source line. And outputting the table. In the step execution at the source level, the step execution of the machine language instruction is repeated, and when it is out of the memory address range corresponding to the source line, it is determined that the step execution is completed. The debugger calculates the stop address of the target program,
The stop source line number is displayed to the debugger by sequentially comparing the start address of the memory address range in the table.
【0009】この技術によれば、最適化により実行順序
が変更された目的プログラムをデバッグする際に、ステ
ップ実行によりソースプログラムのソース行が順次、停
止ソース行として表示されるが、デバッグ実行者が停止
ソース行番号の推移を目視して判断する以外には、実行
順序がどのように変更されているかを知ることができな
い。According to this technique, when debugging a target program whose execution order has been changed by optimization, source lines of a source program are sequentially displayed as stopped source lines by step execution. It is not possible to know how the execution order has been changed except by visually checking the transition of the stop source line number.
【0010】また、特開平4−338841号公報に開
示された「デバッガ装置」は、原始プログラムの実行の
流れを表現するグラフを作成し、また、原始プログラム
と翻訳された変換結果プログラムとの処理経路を解析す
ることを特徴とする。デバッガは、グラフと、原始プロ
グラムと、変換結果プログラムとを表示し、各々の表示
において処理経路毎に対応を可視表示する。A "debugger device" disclosed in Japanese Patent Application Laid-Open No. 4-38841 creates a graph representing the flow of execution of a source program, and processes a source program and a translated conversion result program. It is characterized by analyzing a route. The debugger displays the graph, the source program, and the conversion result program, and visually displays the correspondence for each processing path in each display.
【0011】この技術によっても、表示されるのは処理
経路の対応だけであって、各処理経路中のコードの実行
順序が変更されている場合に、原始プログラムでの実行
順序がどのように変更されているかに関しては、表示を
行うことができない。According to this technique, only the correspondence of the processing paths is displayed, and when the execution order of the code in each processing path is changed, how the execution order in the source program is changed. No indication can be made as to whether or not it has been done.
【0012】[0012]
【発明が解決しようとする課題】第1の問題点は、従来
の最適化コードデバッグ方式においては、コンパイラの
最適化により、上記のような原始プログラムと変換結果
プログラムとで実行順序が変更される場合に、デバッグ
実行者が原始プログラムと目的プログラムとのコードを
目視して、自分で対応付けを行わなければならないこと
である。その理由は、最適化コードデバッグ方式が、実
行順序の変更に関して、利用者にわかりやすい表示を行
う手段を持たないからである。The first problem is that, in the conventional optimized code debugging method, the execution order of the above-mentioned source program and conversion result program is changed by optimizing the compiler. In this case, the debugger must visually check the code of the source program and the target program and make the correspondence by himself. The reason for this is that the optimized code debugging method does not have means for providing a user-friendly display of a change in the execution order.
【0013】本発明の目的は、コンパイラの最適化によ
り実行順序が変更された目的プログラムにおいて、ソー
スレベルでのデバッグを可能にする最適化コードデバッ
グ方式を提供することにある。An object of the present invention is to provide an optimized code debugging method which enables debugging at a source level in an object program whose execution order has been changed by optimization of a compiler.
【0014】[0014]
【課題を解決するための手段】本発明の最適化コードデ
バッグ方式は、ソースプログラムを解析して中間言語形
式プログラムに変換する構文解析手段と、前記構文解析
手段によるソースプログラムの解析時に該ソースプログ
ラムの関数内にある一文毎に該文のソース行番号,該文
に対して生成される目的コードの関数先頭アドレスから
のオフセット,および最適化属性を組にした行情報を生
成する行情報生成手段と、前記中間言語形式プログラム
に対して各種の最適化を行い、より効率的な中間言語形
式プログラムに変換する最適化手段と、前記最適化手段
による最適化処理の結果、中間言語命令列の前方移動が
起こった場合には移動された中間言語命令列に対応する
行情報の最適化属性に前方移動フラグを設定するととも
に該中間言語命令列の移動により到達経路に影響を受け
る他の中間言語命令列に対応する行情報の最適化属性に
副次変動フラグを設定し、中間言語命令列の後方移動が
起こった場合には移動された中間言語命令列に対応する
行情報の最適化属性に後方移動フラグを設定するととも
に該中間言語命令列の移動により到達経路に影響を受け
る他の中間言語命令列に対応する行情報の最適化属性に
副次変動フラグを設定する最適化属性設定手段と、前記
中間言語形式プログラムを前記行情報を含んだ目的プロ
グラムに翻訳する翻訳手段とを有するコンパイル処理部
と、前記行情報を含んだ目的プログラムを入力する目的
プログラム入力手段と、前記目的プログラム中の前記行
情報を入力し、ソース行番号,目的コードの関数先頭ア
ドレスからのオフセット,および最適化属性からなる行
情報テーブルを構成する行情報テーブル構成手段と、ソ
ースレベルのステップ実行指示があったときに現在の停
止アドレスから前記行情報テーブルを検索して次に停止
すべきアドレスを求めてソースプログラムにおける一行
文に相当する目的コードを実行し、ソースプログラム表
示の上で現在位置を表示するソースレベルステップ実行
手段と、前記ソースレベルステップ実行手段により実行
される目的コードの最適化属性を前記行情報テーブルか
ら参照し、最適化属性に後方移動フラグが設定されてい
れば「ソースプログラムの実行順序より前倒しに実行す
る」旨のメッセージを表示し、副次変動フラグが設定さ
れていれば「実行順序が変更されたために変数の値など
が影響を受けている可能 性がある」旨のメッセージを表
示し、前方移動フラグが設定されていれば「遅延されて
いた文を実行する」旨のメッセージを表示する実行順序
表示手段とを有するデバッグ処理部とからなることを特
徴とする。SUMMARY OF THE INVENTION An optimized code debugging method according to the present invention analyzes a source program and converts it into an intermediate language format.
Parsing means for converting to an expression program, and said parsing
Source line number of the statement for each sentence at the time of analysis of the source program are within the functions of the source program by means, offset from the function start address of object code generated for the sentence, and the optimization attributes in the set Line information generating means for generating line information, and the intermediate language format program
Various optimizations for
Optimizing means for converting to an expression program, and the optimizing means
As a result of optimization processing by
Corresponds to the moved intermediate language instruction sequence if it occurred
Set the forward movement flag in the optimization attribute of line information and
Affected by the route of movement of the intermediate language instruction sequence
Optimization attribute of line information corresponding to other intermediate language instruction sequence
Set the secondary fluctuation flag to prevent backward movement of the intermediate language instruction sequence.
Corresponds to the moved intermediate language instruction sequence if it occurred
Set the backward movement flag in the optimization attribute of line information and
Affected by the route of movement of the intermediate language instruction sequence
Optimization attribute of line information corresponding to other intermediate language instruction sequence
Optimization attribute setting means for setting a secondary variation flag ;
An intermediate language format program is converted to a target program containing the line information.
A compilation processing unit having translation means for translating into a program, and a purpose of inputting a purpose program including the line information
Program input means , and line information table structuring means for inputting the line information in the target program and forming a line information table comprising a source line number , an offset of a target code from a function head address , and an optimization attribute; Seo
Current stop when a source level step execution instruction is
Search the line information table from the stop address and then stop
One line in the source program to find the address to be
Execute the target code corresponding to the statement, and
Source-level stepping to show current position on display
Means and the source level step executing means
The optimization attribute of the target code to be
And the backward movement flag is set in the optimization attribute.
In other words, "Execute the source program earlier than the execution order.
Is displayed, and the secondary fluctuation flag is set.
If it is, `` The value of a variable etc.
May have been affected. "
If the forward move flag is set,
And a debug processing unit having an execution order display unit for displaying a message of “execute the sentence” .
【0015】また、本発明のコンパイル方式は、ソース
プログラムを解析して中間言語形式プログラムに変換す
る構文解析手段と、前記構文解析手段によるソースプロ
グラムの解析時に該ソースプログラムの関数内にある一
文毎に該文のソース行番号,該文に対して生成される目
的コードの関数先頭アドレスからのオフセット,および
最適化属性を組にした行情報を生成する行情報生成手段
と、前記中間言語形式プログラムに対して各種の最適化
を行い、より効率的な中間言語形式プログラムに変換す
る最適化手段と、前記最適化手段による最適化処理の結
果、中間言語命令列の前方移動が起こった場合には移動
された中間言語命令列に対応する行情報の最適化属性に
前方移動フラグを設定するとともに該中間言語命令列の
移動により到達経路に影響を受ける他の中間言語命令列
に対応する行情報の最適化属性に副次変動フラグを設定
し、中間言語命令列の後方移動が起こった場合には移動
された中間言語命令列に対応する行情報の最適化属性に
後方移動フラグを設定するとともに該中間言語命令列の
移動により到達経路に影響を受ける他の中間言語命令列
に対応する行情報の最適化属性に副次変動フラグを設定
する最適化属性設定手段と、前記中間言語形式プログラ
ムを前記行情報を含んだ目的プログラムに翻訳する翻訳
手段とを有することを特徴とする。[0015] In addition, the compilation method of the present invention, source
Analyze the program and convert it to an intermediate language format program
Parsing means, and a source program by the parsing means.
Source line number of the statement for each sentence at the time of grams of analysis is in the function of the source program, the offset from the top of the function address of the target code generated for the sentence, and
Line information generating means for generating line information with a set of optimization attributes, and various optimizations for the intermediate language format program
And convert it to a more efficient intermediate language format program
Optimization means and the optimization processing by the optimization means.
As a result, if the forward movement of the intermediate language instruction sequence occurs, move
Line information corresponding to the specified intermediate language instruction sequence
Set the forward movement flag and
Other intermediate language instruction sequences affected by travel route due to movement
A secondary fluctuation flag in the optimization attribute of the line information corresponding to
If the backward movement of the intermediate language instruction sequence occurs, move
Line information corresponding to the specified intermediate language instruction sequence
Set the backward movement flag and set the intermediate language instruction sequence
Other intermediate language instruction sequences affected by travel route due to movement
A secondary fluctuation flag in the optimization attribute of the line information corresponding to
And optimization attribute setting means for the intermediate language format program
For translating a program into a target program containing the line information
Means .
【0016】さらに、本発明のデバッグ方式は、行情報
を含んだ目的プログラムを入力する目的プログラム入力
手段と、前記目的プログラム中の前記行情報を入力し、
ソース行番号,目的コードの関数先頭アドレスからのオ
フセット,および最適化属性からなる行情報テーブルを
構成する行情報テーブル構成手段と、ソースレベルのス
テップ実行指示があったときに現在の停止アドレスから
前記行情報テーブルを検索して次に停止すべきアドレス
を求めてソースプログラムにおける一行文に相当する目
的コードを実行し、ソースプログラム表示の上で現在位
置を表示するソースレベルステップ実行手段と、前記ソ
ースレベルステップ実行手段により実行される目的コー
ドの最適化属性を前記行情報テーブルから参照し、最適
化属性に後方移動フラグが設定されていれば「ソースプ
ログラムの実行順序より前倒しに実行する」旨のメッセ
ージを表示し、副次変動フラグが設定されていれば「実
行順序が変更されたために変数の値などが影響を受けて
いる可能性がある」旨のメッセージを表示し、前方移動
フラグが設定されていれば「遅延されていた文を実行す
る」旨のメッセージを表示する実行順序表示手段とを有
することを特徴とする。Further, according to the debugging method of the present invention, the line information
Enter a target program containing a target program
Means, inputting the line information in the object program ,
Source line numbers and line information table configuration means for configuring the line information table of offsets, and optimization attributes from the function start address of object code, source-level scan
From the current stop address when there is a step execution instruction
The next address to search the line information table and stop at
The equivalent of a one-line sentence in the source program
Execute the dynamic code and display the current position on the source program display.
Source level step execution means for displaying the location,
Target code executed by the source level step executing means.
Refer to the row information table for the optimization attribute of the
If the backward movement flag is set for the
Program is executed earlier than the execution order of the program.
Is displayed, and if the secondary fluctuation flag is set,
The value of variables is affected because the row order has been changed
There is a possibility that there is "and move forward
If the flag is set, "Execute the delayed statement
And an execution order display means for displaying a message indicating that
【0017】さらにまた、本発明の最適化コードデバッ
グ方式は、ソースプログラムを解析して中間言語形式プ
ログラムに変換する構文解析手段と、前記構文解析手段
によるソースプログラムの解析時に該ソースプログラム
の関数内にある一文毎に該文のソース行番号,該文に対
して生成される目的コードの関数先頭アドレスからのオ
フセット,および最適化属性を組にした行情報を生成す
る行情報生成手段と、前記中間言語形式プログラムに対
して各種の最適化を行い、より効率的な中間言語形式プ
ログラムに変換する最適化手段と、前記最適化手段によ
る最適化処理の結果、中間言語命令列の前方移動が起こ
った場合には移動された中間言語命令列に対応する行情
報の最適化属性に前方移動フラグを設定するとともに該
中間言語命令列の移動により到達経路に影響を受ける他
の中間言語命令列に対応する行情報の最適化属性に副次
変動フラグを設定し、中間言語命令列の後方移動が起こ
った場合には移動された中間言語命令列に対応する行情
報の最適化属性に後方移動フラグを設定するとともに該
中間言語命令列の移動により到達経路に影響を受ける他
の中間言語命令列に対応する行情報の最適化属性に副次
変動フラグを設定する最適化属性設定手段と、前記中間
言語形式プログラムを前記行情報を含んだ目的プログラ
ムに翻訳する翻訳手段とを有するコンパイル処理部と、
前記行情報を含んだ目的プログラムを入力する目的プロ
グラム入力手段と、前記目的プログラム中の前記行情報
を入力し、ソース行番号および関数先頭からの命令オフ
セットからなり関数毎に命令オフセット順に整列された
行オフセット対応表と、ソース行番号,目的コードの関
数先頭アドレスからのオフセットおよび最適化属性から
なりソースプログラム毎にソース行番号順に整列された
行情報テーブルとを構成する行情報テーブル構成手段
と、ソースプログラム表示指示があったときに指定され
たソースプログラムファイルについて前記行情報テーブ
ルの該当部分を先頭から順次参照して最適化属性が設定
されている行に強調表示を施して表示するソースプログ
ラムおよび実行順序表示手段と、ソースレベルのステッ
プ実行指示があったときに前記行オフセット対応表を検
索して次に停止すべきアドレスを求めてソースプログラ
ムにおける一行文に相当する目的コードを実行するソー
スレベルステップ実行手段と、ソースプログラム表示に
おいて現在の停止行に印を表示する現在位置表示手段と
を有するデバッグ処理部とからなることを特徴とする。Still further, the optimized code debugging method of the present invention analyzes a source program and executes an intermediate language format program.
Parsing means for converting into a program, and said parsing means
Source line number of the statement for each sentence at the time of analysis of the source program are within the functions of the source program by, offset from the function start address of object code generated for the sentence, and the optimization attributes to set and line information generating means for generating a line information, versus the intermediate language format program
And optimizes it for more efficient intermediate language format
Optimizing means for converting into a program,
Of the intermediate language instruction sequence
The line information corresponding to the moved intermediate language instruction sequence.
Set the forward movement flag in the optimization attribute of the
Other than being affected by the arrival route due to the movement of the intermediate language instruction sequence
In the optimization attribute of the line information corresponding to the intermediate language instruction sequence of
Set the fluctuation flag and move backward in the intermediate language instruction sequence.
The line information corresponding to the moved intermediate language instruction sequence.
Set the backward movement flag in the optimization attribute of
Other than being affected by the arrival route due to the movement of the intermediate language instruction sequence
In the optimization attribute of the line information corresponding to the intermediate language instruction sequence of
And optimization attribute setting means for setting a variation flag, the intermediate
A language program is converted to a target program including the line information.
A compilation processing unit having translation means for translating into a system ;
A purpose program for inputting a purpose program including the line information.
A line offset correspondence table , comprising a line input in the target program , a source line number and an instruction offset from the head of the function, the line offset correspondence table being arranged for each function in the order of the instruction offset; From the number, the offset of the target code from the function start address, and the optimization attribute
A line information table composing a line information table arranged in order of source line number for each source program; and a line information table for a source program file designated when a source program display instruction is given. A source program and an execution order display means for sequentially displaying the corresponding part of the line from the top and highlighting and displaying the line where the optimization attribute is set, and the line offset when a source level step execution instruction is given. source program seeking the next address to be stopped by searching the correspondence table
And a debug processing unit having a source level step executing means for executing an object code corresponding to a one-line sentence in a program, and a current position displaying means for displaying a mark at a current stop line in a source program display. .
【0018】また、本発明のデバッグ方式は、行情報を
含んだ目的プログラムを入力する目的プログラム入力手
段と、前記目的プログラム中の前記行情報を入力し、ソ
ース行番号および関数先頭からの命令オフセットからな
り関数毎に命令オフセット順に整列された行オフセット
対応表と、ソース行番号,目的コードの関数先頭アドレ
スからのオフセットおよび最適化属性からなりソースプ
ログラム毎にソース行番号順に整列された行情報テーブ
ルとを構成する行情報テーブル構成手段と、ソースプロ
グラム表示指示があったときに指定されたソースプログ
ラムファイルについて前記行情報テーブルの該当部分を
先頭から順次参照して最適化属性が設定されている行に
強調表示を施して表示するソースプログラムおよび実行
順序表示手段と、ソースレベルのステップ実行指示があ
ったときに前記行オフセット対応表を検索して次に停止
すべきアドレスを求めてソースプログラムにおける一行
文に相当する目的コードを実行するソースレベルステッ
プ実行手段と、ソースプログラム表示において現在の停
止行に印を表示する現在位置表示手段とを有することを
特徴とする。Further, the debugging method of the present invention can
Purpose program input method to enter the target program including
Type and stage, the line information in the object program, it from the instruction offset from the source line number and function leading
Row offset correspondence table arranged in the order of instruction offset for each function, and the source
And line information table configuration means for configuring the aligned row information table in the order of the source line number for each program, source pro
Source program for executing a source program file designated when a program display instruction is given, by sequentially referring to the corresponding part of the line information table from the top and highlighting and displaying a line for which an optimization attribute is set, and executing and order the display unit, the step execution instruction source level there
When the line offset correspondence table is searched, one line in the source program is searched for the next address to be stopped.
A source level step executing means for executing an object code corresponding to a sentence and a current position displaying means for displaying a mark at a current stop line in a source program display are provided.
【0019】一方、本発明の機械読み取り可能な記録媒
体は、コンピュータを、ソースプログラムを解析して中
間言語形式プログラムに変換する構文解析手段と、前記
構文解析手段によるソースプログラムの解析時に該ソー
スプログラムの関数内にある一文毎に該文のソース行番
号,該文に対して生成される目的コードの関数先頭アド
レスからのオフセット,および最適化属性を組にした行
情報を生成する行情報生成手段と、前記中間言語形式プ
ログラムに対して各種の最適化を行い、より効率的な中
間言語形式プログラムに変換する最適化手段と、前記最
適化手段による最適化処理の結果、中間言語命令列の前
方移動が起こった場合には移動された中間言語命令列に
対応する行情報の最適化属性に前方移動フラグを設定す
るとともに該中間言語命令列の移動により到達経路に影
響を受ける他の中間言語命令列に対応する行情報の最適
化属性に副次変動フラグを設定し、中間言語命令列の後
方移動が起こった場合には移動された中間言語命令列に
対応する行情報の最適化属性に後方移動フラグを設定す
るとともに該中間言語命令列の移動により到達経路に影
響を受ける他の中間言語命令列に対応する行情報の最適
化属性に副次変動フラグを設定する最適化属性設定手段
と、前記中間言語形式プログラムを前記行情報を含んだ
目的プログラムに翻訳する翻訳手段とを有するコンパイ
ル処理部として機能させるためのプログラムと、前記行
情報を含んだ目的プログラムを入力する目的プログラム
入力手段と、前記目的プログラム中の前記行情報を入力
し、ソース行番号,目的コードの関数先頭アドレスから
のオフセット,および最適化属性からなる行情報テーブ
ルを構成する行情報テーブル構成手段と、ソースレベル
のステップ実行指示があったときに現在の停止アドレス
から前記行情報テーブルを検索して次に停止すべきアド
レスを求めてソースプログラムにおける一行文に相当す
る目的コードを実行し、ソースプログラム表示の上で現
在位置を表示するソースレベルステップ実行手段と、前
記ソースレベルステップ実行手段により実行される目的
コードの最適化属性を前記行情報テーブルから参照し、
最適化属性に後方移動フラグが設定されていれば「ソー
スプログラムの実行順序より前倒しに実行する」旨のメ
ッセージを表示し、副次変動フラグが設定されていれば
「実行順序が変更されたために変数の値などが影響を受
けている可能性がある」旨のメ ッセージを表示し、前方
移動フラグが設定されていれば「遅延されていた文を実
行する」旨のメッセージを表示する実行順序表示手段と
を有するデバッグ処理部として機能させるためのプログ
ラムとを記録する。On the other hand, the machine-readable recording medium of the present invention is a computer-readable recording medium that analyzes a source program.
Syntactic analysis means for converting into an interlingual form program,
Source line number of the statement for each sentence at the time of analysis of the source program by parsing means is in the function of the source <br/> scan program, offset from the function start address of object code generated for the sentence, a and line information generating means for generating a line information to the set optimization attributes, the intermediate language format flop
Perform various optimizations on the program
Optimizing means for converting to an interlanguage format program;
Before the intermediate language instruction sequence as a result of optimization processing by the optimization means
If the one-way move occurs, the moved intermediate language
Set the forward movement flag to the optimization attribute of the corresponding line information
Movement of the intermediate language instruction sequence and
Optimization of line information corresponding to other affected intermediate language instruction sequences
Set the secondary variation flag to the
If the one-way move occurs, the moved intermediate language
Set the backward movement flag in the optimization attribute of the corresponding line information
Movement of the intermediate language instruction sequence and
Optimization of line information corresponding to other affected intermediate language instruction sequences
Optimizing attribute setting means for setting a secondary variation flag in the optimizing attribute , wherein the intermediate language format program contains the line information.
And program for functioning as a compilation unit and a translation means for translating the object program, said row
Purpose program to enter a purpose program containing information
Input means inputs the line information in the object program, the source line number, the line information table configuration means for configuring offset, and the line information table of optimization attributes from the function start address of object code, source level
Current stop address when a step execution instruction is issued
Search the line information table from
Equivalent to one line sentence in source program
Executes the target code and displays it on the source program display.
Source level step execution means for displaying the location
Purpose executed by source level step execution means
Referring to the optimization information of the code from the line information table,
If the backward movement flag is set for the optimization attribute,
Program is executed ahead of the execution order of the
Display a message and if the secondary fluctuation flag is set
"The value of variables has been affected because the execution order has been changed.
Displays only by potentially have "effect of messages, forward
If the move flag is set, "Execute the delayed statement
And a program for functioning as a debug processing unit having an execution order display means for displaying a message of “ execute ” .
【0020】また、本発明の機械読み取り可能な記録媒
体は、コンピュータを、ソースプログラムを解析して中
間言語形式プログラムに変換する構文解析手段と、前記
構文解析手段によるソースプログラムの解析時に該ソー
スプログラムの関数内にある一文毎に該文のソース行番
号,該文に対して生成される目的コードの関数先頭アド
レスからのオフセット,および最適化属性を組にした行
情報を生成する行情報生成手段と、前記中間言語形式プ
ログラムに対して各種の最適化を行い、より効率的な中
間言語形式プログラムに変換する最適化手段と、前記最
適化手段による最適化処理の結果、中間言語命令列の前
方移動が起こった場合には移動された中間言語命令列に
対応する行情報の最適化属性に前方移動フラグを設定す
るとともに該中間言語命令列の移動により到達経路に影
響を受ける他の中間言語命令列に対応する行情報の最適
化属性に副次変動フラグを設定し、中間言語命令列の後
方移動が起こった場合には移動された中間言語命令列に
対応する行情報の最適化属性に後方移動フラグを設定す
るとともに該中間言語命令列の移動により到達経路に影
響を受ける他の中間言語命令列に対応する行情報の最適
化属性に副次変動フラグを設定する最適化属性設定手段
と、前記中間言語形式プログラムを前記行情報を含んだ
目的プログラムに翻訳する翻訳手段として機能させるた
めのプログラムを記録する。Further, the machine readable recording medium of the present invention is a computer readable medium for analyzing a source program.
Syntactic analysis means for converting into an interlingual form program,
Source line number of the statement for each sentence at the time of analysis of the source program by parsing means is in the function of the source <br/> scan program, offset from the function start address of object code generated for the sentence, a and line information generating means for generating a line information to the set optimization attributes, the intermediate language format flop
Perform various optimizations on the program
Optimizing means for converting to an interlanguage format program;
Before the intermediate language instruction sequence as a result of optimization processing by the optimization means
If the one-way move occurs, the moved intermediate language
Set the forward movement flag to the optimization attribute of the corresponding line information
Movement of the intermediate language instruction sequence and
Optimization of line information corresponding to other affected intermediate language instruction sequences
Set the secondary variation flag to the
If the one-way move occurs, the moved intermediate language
Set the backward movement flag in the optimization attribute of the corresponding line information
Movement of the intermediate language instruction sequence and
Optimization of line information corresponding to other affected intermediate language instruction sequences
Optimizing attribute setting means for setting a secondary variation flag in the optimizing attribute , wherein the intermediate language format program contains the line information.
Recording a program for functioning as a translation means for translating the object program.
【0021】さらに、本発明の機械読み取り可能な記録
媒体は、コンピュータを、行情報を含んだ目的プログラ
ムを入力する目的プログラム入力手段と、前記目的プロ
グラム中の前記行情報を入力し、ソース行番号,目的コ
ードの関数先頭アドレスからのオフセット,および最適
化属性からなる行情報テーブルを構成する行情報テーブ
ル構成手段と、ソースレベルのステップ実行指示があっ
たときに現在の停止アドレスから前記行情報テーブルを
検索して次に停止すべきアドレスを求めてソースプログ
ラムにおける一行文に相当する目的コードを実行し、ソ
ースプログラム表示の上で現在位置を表示するソースレ
ベルステップ実行手段と、前記ソースレベルステップ実
行手段により実行される目的コードの最適化属性を前記
行情報テーブルから参照し、最適化属性に後方移動フラ
グが設定されていれば「ソースプログラムの実行順序よ
り前倒しに実行する」旨のメッセージを表示し、副次変
動フラグが設定されていれば「実行順序が変更されたた
めに変数の値などが影響を受けている可能性がある」旨
のメッセージを表示し、前方移動フラグが設定されてい
れば「遅延されていた文を実行する」旨のメッセージを
表示する実行順序表示手段として機能させるためのプロ
グラムを記録する。Further, the machine-readable recording medium of the present invention is a computer-readable recording medium capable of controlling a computer to execute a target program including line information.
A purpose program input means for inputting a program,
The line information in the program is input, a line information table forming means for forming a line information table including a source line number , an offset from a function start address of a target code , and an optimization attribute, and a source-level step execution instruction. Ah
The line information table from the current stop address when
Search and find the next stop address
Executes the target code corresponding to one line statement in the
Display the current position on the source program display.
Bell step executing means and the source level step execution means.
The optimization attribute of the target code executed by the
Refer to the line information table, and set the optimization attribute
Is set, the order of execution of the source program
Message is displayed.
If the execution flag is set, the message "The execution order has been changed.
May have affected the value of variables, etc. "
Message is displayed and the forward movement flag is set.
Message "Execute the delayed statement"
Recording a program for functioning as an execution order display means for displaying.
【0022】さらにまた、本発明の機械読み取り可能な
記録媒体は、コンピュータを、ソースプログラムを解析
して中間言語形式プログラムに変換する構文解析手段
と、前記構文解析手段によるソースプログラムの解析時
に該ソースプログラムの関数内にある一文毎に該文のソ
ース行番号,該文に対して生成される目的コードの関数
先頭アドレスからのオフセット,および最適化属性を組
にした行情報を生成する行情報生成手段と、前記中間言
語形式プログラムに対して各種の最適化を行い、より効
率的な中間言語形式プログラムに変換する最適化手段
と、前記最適化手段による最適化処理の結果、中間言語
命令列の前方移動が起こった場合には移動された中間言
語命令列に対応する行情報の最適化属性に前方移動フラ
グを設定するとともに該中間言語命令列の移動により到
達経路に影響を受ける他の中間言語命令列に対応する行
情報の最適化属性に副次変動フラグを設定し、中間言語
命令列の後方移動が起こった場合には移動された中間言
語命令列に対応する行情報の最適化属性に後方移動フラ
グを設定するとともに該中間言語命令列の移動により到
達経路に影響を受ける他の中間言語命令列に対応する行
情報の最適化属性に副次変動フラグを設定する最適化属
性設定手段と、前記中間言語形式プログラムを前記行情
報を含んだ目的プログラムに翻訳する翻訳手段とを有す
るコンパイル処理部として機能させるためのプログラム
と、前記行情報を含んだ目的プログラムを入力する目的
プログラム入力手段と、前記目的プログラム中の前記行
情報を入力し、ソース行番号および関数先頭からの命令
オフセットからなり関数毎に命令オフセット順に整列さ
れた行オフセット対応表と、ソース行番号,目的コード
の関数先頭アドレスからのオフセットおよび最適化属性
からなりソースプログラム毎にソース行番号順に整列さ
れた行情報テーブルとを構成する行情報テーブル構成手
段と、ソースプログラム表示指示があったときに指定さ
れたソースプログラムファイルについて前記行情報テー
ブルの該当部分を先頭から順次参照して最適化属性が設
定されている行に強調表示を施して表示するソースプロ
グラムおよび実行順序表示手段と、ソースレベルのステ
ップ実行指示があったときに前記行オフセット対応表を
検索して次に停止すべきアドレスを求めてソースプログ
ラムにおける一行文に相当する目的コードを実行するソ
ースレベルステップ実行手段と、ソースプログラム表示
において現在の停止行に印を表示する現在位置表示手段
とを有するデバッグ処理部として機能させるためのプロ
グラムとを記録する。Still further, the machine readable recording medium of the present invention provides a computer which analyzes a source program.
Parsing means for converting to an intermediate language format program
And when analyzing the source program by the syntax analysis means.
The source program source line number of the statement for each sentence within function, generates the line information which is offset, and the optimization attributes in the set of the function start address of the target code generated for the sentence Line information generating means, and the intermediate language
Performs various optimizations for word-form programs to
Optimizer to convert to efficient intermediate language format program
And the result of the optimization processing by the optimization means, the intermediate language
If the forward movement of the instruction sequence occurs, the intermediate language moved
A forward move flag is added to the optimization attribute of the line information corresponding to the word instruction sequence.
Setting and moving the intermediate language instruction sequence.
Lines corresponding to other intermediate language instruction sequences affected by the route
Set the secondary fluctuation flag in the information optimization attribute and set the intermediate language
If the backward movement of the instruction sequence occurs, the moved intermediate language
The backward movement flag is added to the optimization attribute of the line information corresponding to the word instruction sequence.
Setting and moving the intermediate language instruction sequence.
Lines corresponding to other intermediate language instruction sequences affected by the route
Optimization attribute setting means for setting a secondary variation flag in an information optimization attribute ;
For functioning as a compile processing unit having translation means for translating into a target program containing information, and a purpose of inputting the target program containing the line information
A program input means for inputting the line information in the target program, and comprising a source line number and an instruction offset from the head of the function, arranged in the order of instruction offset for each function;
Rows offset correspondence table and the source line number, the alignment of the source line number order for each source program consists offset and optimization attributes from the function start address of the object code
And line information table configuration means for configuring the line information table, optimization attributes that portion of the line information table for the given source program file are sequentially referred to from the beginning when there is a source program display instruction Source program and execution order display means for highlighting and displaying a set line, and searching the line offset correspondence table when a source level step execution instruction is issued to find an address to be stopped next. Source program
A program for functioning as a debug processing unit having a source level step executing means for executing an object code corresponding to a one-line sentence in a ram, and a current position displaying means for displaying a mark on a current stop line in a source program display. Record.
【0023】また、本発明の機械読み取り可能な記録媒
体は、コンピュータを、行情報を含んだ目的プログラム
を入力する目的プログラム入力手段と、前記目的プログ
ラム中の前記行情報を入力し、ソース行番号および関数
先頭からの命令オフセットからなり関数毎に命令オフセ
ット順に整列された行オフセット対応表と、ソース行番
号,目的コードの関数先頭アドレスからのオフセットお
よび最適化属性からなりソースプログラム毎にソース行
番号順に整列された行情報テーブルとを構成する行情報
テーブル構成手段と、ソースプログラム表示指示があっ
たときに指定されたソースプログラムファイルについて
前記行情報テーブルの該当部分を先頭から順次参照して
最適化属性が設定されている行に強調表示を施して表示
するソースプログラムおよび実行順序表示手段と、ソー
スレベルのステップ実行指示があったときに前記行オフ
セット対応表を検索して次に停止すべきアドレスを求め
てソースプログラムにおける一行文に相当する目的コー
ドを実行するソースレベルステップ実行手段と、ソース
プログラム表示において現在の停止行に印を表示する現
在位置表示手段を有するデバッグ処理部として機能させ
るためのプログラムを記録する。[0023] The machine-readable recording medium of the present invention is a computer-readable recording medium for storing a computer-readable program including line information.
Target program input means for inputting a target program, and the target program
The line information in the RAM is input, and an instruction offset is provided for each function, comprising a source line number and an instruction offset from the beginning of the function.
Source offset for each source program, consisting of a row offset correspondence table sorted in the order of
There is a line information table composing means for composing a line information table arranged in numerical order and a source program display instruction.
A source program and an execution order display means for displaying a line in which the optimization attribute is set by referring to the corresponding portion of the line information table sequentially from the beginning for the specified source program file when the line is set, Source level step executing means for executing the target code corresponding to one line sentence in the source program by searching the line offset correspondence table when there is a source level step execution instruction and obtaining the next stop address; A program for functioning as a debug processing unit having a current position display means for displaying a mark at a current stop line in a program display is recorded.
【0024】[0024]
【発明の実施の形態】次に、本発明の実施の形態につい
て、図面を参照して詳細に説明する。Next, an embodiment of the present invention will be described in detail with reference to the drawings.
【0025】図1は、本発明の第1の実施の形態に係る
最適化コードデバッグ方式の構成を示すブロック図であ
る。図1を参照すると、本実施の形態に係る最適コード
デバッグ方式は、コンパイラ11と、目的プログラム1
2と、シンボリックデバッガ13とから、その主要部が
構成されている。FIG. 1 is a block diagram showing a configuration of an optimized code debugging system according to the first embodiment of the present invention. Referring to FIG. 1, an optimal code debugging method according to the present embodiment includes a compiler 11 and a target program 1.
2 and the symbolic debugger 13 constitute the main part.
【0026】コンパイラ11は、構文解析手段111
と、行情報生成手段112と、最適化手段113と、最
適化属性設定手段114と、翻訳手段115とを含んで
構成されている。The compiler 11 includes a syntax analysis unit 111
, Line information generating means 112, optimizing means 113, optimizing attribute setting means 114, and translating means 115.
【0027】シンボリックデバッガ13は、目的プログ
ラム入力手段131と、行情報テーブル構成手段132
と、ソースレベルステップ実行手段133と、実行順序
表示手段134とを含んで構成されている。The symbolic debugger 13 includes a target program input unit 131 and a line information table forming unit 132
, A source level step executing unit 133 and an execution order displaying unit 134.
【0028】このうち、特に本発明の特徴を表す手段
は、行情報生成手段112,最適化属性設定手段11
4,行情報テーブル構成手段132,および実行順序表
示手段134である。Among these, the means that particularly represent the features of the present invention are the line information generating means 112 and the optimization attribute setting means 11
4, a row information table composing means 132 and an execution order displaying means 134.
【0029】構文解析手段11lは、ソースプログラム
を解析し、最適化が容易に行える中間言語形式に変換す
る。The syntax analysis unit 111 analyzes the source program and converts it into an intermediate language format that can be easily optimized.
【0030】行情報生成手段112は、ソースプログラ
ムを解析する際に、ソースプログラム中の関数内の文の
単位で、その文のソースファイル中の行番号を示す情報
をその文に対応する中間言語形式の前に挿入する。When analyzing a source program, the line information generating means 112 converts, in units of a statement in a function in the source program, information indicating a line number in the source file of the statement into an intermediate language corresponding to the statement. Insert before format.
【0031】最適化手段113は、構文解析手段111
によって変換されたプログラムの中間言語形式に対して
各種の最適化を行い、より効率的な中間言語形式に変換
するものである。The optimizing unit 113 includes a syntactic analyzing unit 111
Various optimizations are performed on the intermediate language format of the program converted by the above, and the program is converted into a more efficient intermediate language format.
【0032】最適化属性設定手段114は、最適化手段
113により元のソースプログラムの実行順序とは異な
る実行順序に変更された場合に、行情報生成手段112
により挿入された行番号の情報に、最適化による影響を
示すフラグを付加する。The optimizing attribute setting means 114 sets the line information generating means 112 when the optimizing means 113 changes the execution order to that of the original source program.
A flag indicating the influence of the optimization is added to the information of the line number inserted by (1).
【0033】翻訳手段115は、中間言語形式を目的コ
ードヘと翻訳するが、その際に、その文に対して生成さ
れる目的コードの関数先頭からの命令オフセットと、ソ
ースファイル中の行番号と、最適化属性設定手段114
により付加された最適化による影響を示すフラグとを組
にした行情報も生成する。行情報は、目的プログラム1
2の一部として出力される。The translation means 115 translates the intermediate language format into the target code. At this time, the instruction offset from the head of the function of the target code generated for the statement, the line number in the source file, Optimization attribute setting means 114
Also, line information in which a flag indicating the effect of the optimization added by the combination is generated. Line information is the target program 1
2 as part of
【0034】目的プログラム入力手段131は、行情報
を含んだ目的プログラム12を入力する。The target program input means 131 inputs the target program 12 including the line information.
【0035】行情報テーブル構成手段132は、ソース
プログラムの一文毎に、行番号と、その文から翻訳され
た目的コードの関数内命令オフセットと、その目的コー
ドに関する最適化属性との対応を示す行情報テーブルを
構成する。For each sentence of the source program, the line information table constructing means 132 has a line indicating the correspondence between the line number, the instruction offset in the function of the target code translated from the sentence, and the optimization attribute related to the target code. Construct an information table.
【0036】ソースレベルステップ実行手段133は、
行情報テーブルを参照して、ソースプログラムにおける
一行文に相当する目的プログラムを実行し、ソースプロ
グラム表示の上で、現在位置を表示する。The source level step execution means 133
The target program corresponding to one line statement in the source program is executed with reference to the line information table, and the current position is displayed on the source program display.
【0037】実行順序表示手段134は、ソースプログ
ラム中の元の実行順序より早く前倒しに実行されたり、
元の実行順序より遅く遅延して実行されたり、実行順序
の変更により影響を受けているコードについて、メッセ
ージを表示する。The execution order display means 134 is executed earlier than the original execution order in the source program,
Display a message about code that runs later than the original execution order or that is affected by a change in execution order.
【0038】図2は、第1の実施の形態に係る最適化コ
ードデバッグ方式におけるコンパイラ11およびシンボ
リックデバッガ13の処理の流れを示す図である。コン
パイラ11の処理は、構文解析処理221と、行情報生
成処理222と、最適化処理223と、移動判断224
と、最適化属性設定処理225と、翻訳処理226とか
らなる。シンボリックデバッガ13の処理は、目的プロ
グラム入力処理251と、行情報テーブル構成処理25
2と、ソースレベルステップ実行処理253と、実行順
序表示処理254とからなる。なお、図2中、符号21
はソースプログラム、23は中間言語形式プログラム、
26は行情報テーブル、27は表示装置をそれぞれ示
す。FIG. 2 is a diagram showing a processing flow of the compiler 11 and the symbolic debugger 13 in the optimized code debugging method according to the first embodiment. The processing of the compiler 11 includes a syntax analysis processing 221, a line information generation processing 222, an optimization processing 223, and a movement determination 224.
, An optimization attribute setting process 225, and a translation process 226. The symbolic debugger 13 performs a target program input process 251 and a line information table configuration process 25.
2, a source level step execution process 253, and an execution order display process 254. In addition, in FIG.
Is a source program, 23 is an intermediate language format program,
26 indicates a line information table, and 27 indicates a display device.
【0039】図3は、行情報テーブル26を例示する説
明図であり、各エントリは、欄31がソース行番号、欄
32が関数先頭からの命令オフセット、欄33が最適化
属性からなる。行情報テーブル26中の各エントリは、
関数毎に命令オフセットで昇順に整列される。行情報テ
ーブル例26aは、図5で示した後方移動の例における
構成を示し、行情報テーブル例26bは、図6で示した
前方移動の例における構成を示す。FIG. 3 is an explanatory diagram exemplifying the row information table 26. In each entry, a column 31 includes a source line number, a column 32 includes an instruction offset from the head of a function, and a column 33 includes an optimization attribute. Each entry in the row information table 26 is
Sorted in ascending order by instruction offset for each function. The example row information table 26a shows the configuration in the example of the backward movement shown in FIG. 5, and the example row information table 26b shows the configuration in the example of the forward movement shown in FIG.
【0040】図4を参照すると、ソースレベルステップ
実行処理253および実行順序表示処理254のさらに
詳しい処理は、停止アドレス取得ステップS401と、
行情報テーブル参照ステップS402と、後方移動フラ
グ判定ステップS403と、メッセージ表示ステップS
404と、副次変動フラグ判定ステップS405と、メ
ッセージ表示ステップS406と、前方移動フラグS4
07と、メッセージ表示ステップS408と、設定フラ
グ有無判定ステップS409と、メッセージクリアステ
ップS410と、停止アドレスまで実行ステップS41
1と、現在位置表示ステップS412とからなる。Referring to FIG. 4, further details of the source level step execution processing 253 and the execution order display processing 254 include a stop address acquisition step S401 and a stop address acquisition step S401.
Line information table reference step S402, backward movement flag determination step S403, and message display step S
404, a secondary variation flag determination step S405, a message display step S406, and a forward movement flag S4.
07, a message display step S408, a setting flag presence / absence determination step S409, a message clear step S410, and an execution step S41 up to the stop address.
1 and a current position display step S412.
【0041】図5は、最適化により後方移動が行われる
例を示す説明図であり、図6は、最適化により前方移動
が行われる例を示す説明図である。FIG. 5 is an explanatory diagram showing an example in which backward movement is performed by optimization, and FIG. 6 is an explanatory diagram showing an example in which forward movement is performed by optimization.
【0042】次に、このように構成された第1の実施の
形態に係る最適化コードデバッグ方式の動作について説
明する。Next, the operation of the optimized code debugging system according to the first embodiment configured as described above will be described.
【0043】(1) まず、コンパイラ11の動作につ
いて説明する。(1) First, the operation of the compiler 11 will be described.
【0044】コンパイラ11は、構文解析手段111に
より、ソースプログラム21に対して構文解析処理22
1を行い、中間言語形式プログラム23に変換する。The compiler 11 performs a syntax analysis process 22 on the source program 21 by the syntax analysis means 111.
1 to convert to the intermediate language format program 23.
【0045】次に、コンパイラ11は、行情報生成手段
112により、行情報生成処理222を行い、ソースプ
ログラム21中の関数内の文の単位で、l文ずつに対
し、その文のソースプログラム21中の行番号を示す中
間言語命令(以下、行番号中間コードと記す)を、その
文に対応する中間言語命令列のすぐ上に挿入する。行番
号中間コードは、最適化による影響を示す最適化属性を
持っている。Next, the compiler 11 performs the line information generation processing 222 by the line information generation means 112, and for each statement in the function in the source program 21, for each statement, the source program 21 of the statement An intermediate language instruction indicating a line number in the middle (hereinafter referred to as a line number intermediate code) is inserted immediately above the intermediate language instruction sequence corresponding to the sentence. The line number intermediate code has an optimization attribute indicating the effect of the optimization.
【0046】続いて、コンパイラ11は、最適化手段1
13により、中間言語形式プログラム23に対して最適
化処理223を行う。最適化処理223では、ソースプ
ログラム21の各関数内の実行の流れをグラフとして持
っていて、コードを移動する場合に、それが後方移動
か、前方移動かを判別している。Subsequently, the compiler 11 sets the optimization unit 1
13 performs an optimization process 223 on the intermediate language format program 23. In the optimization process 223, the execution flow in each function of the source program 21 is represented as a graph, and when the code is moved, it is determined whether the code is moved backward or forward.
【0047】最適化処理223の後で、コンパイラ11
は、最適化属性設定手段114により、コードの前方移
動または後方移動が起こったか否かの判断224を行
い、移動が起こった場合には、最適化属性設定処理22
5を行い、移動された中間言語命令列や、その移動によ
り到達経路に影響を受ける中間言語命令列について、対
応する行番号中間コードの最適化属性に各々フラグを設
定する。After the optimization process 223, the compiler 11
The optimization attribute setting means 114 determines 224 whether or not the code has moved forward or backward, and if the code has occurred, the optimization attribute setting processing 22
5, the flag is set to the optimization attribute of the corresponding line number intermediate code for the moved intermediate language instruction sequence and the intermediate language instruction sequence affected by the movement due to the movement.
【0048】ここで、コンパイラ11の最適化属性設定
処理225について、図5および図6を参照してより詳
細に説明する。Here, the optimization attribute setting process 225 of the compiler 11 will be described in more detail with reference to FIGS.
【0049】ソースプログラム5aがコンパイルされ、
コードの巻き上げの最適化が行われる。目的プログラム
の流れ5cで、コード列S521に後方移動が行われて
いて、ソースプログラムの流れ5bでは文S512およ
び文S514がこのコード列に対応している。最適化属
性設定処理255では、文S512および文S514に
対応する行番号中間コードの最適化属性として、後方移
動フラグを設定する。次に、最適化属性設定処理255
では、後方移動により前倒しで実行される文があるため
に、変数の値が早まって更新される等の副次的な変動の
ある文、すなわち、分岐S511から、分岐の後の双方
の経路にあって移動された文の直前までの文(5bでは
分岐S511のみ)に対応する行番号中間コードの最適
化属性として、副次変動フラグを設定する。The source program 5a is compiled,
Code winding optimization is performed. In the flow 5c of the target program, backward movement is performed on the code sequence S521, and in the flow 5b of the source program, the statements S512 and S514 correspond to this code sequence. In the optimization attribute setting process 255, a backward movement flag is set as an optimization attribute of the line number intermediate code corresponding to the statements S512 and S514. Next, optimization attribute setting processing 255
Then, since there is a sentence executed earlier due to backward movement, a sentence having a secondary change such as a variable value being updated prematurely, that is, from the branch S511, to both paths after the branch. A secondary variation flag is set as an optimization attribute of the line number intermediate code corresponding to the sentence up to the sentence immediately before the sentence (only branch S511 in 5b).
【0050】翻訳処理226が生成する行情報では、1
2行目と14行目の行情報の最適化属性に後方移動フラ
グが、11行目の行情報の最適化属性に副次変動フラグ
が設定されている。In the line information generated by the translation process 226, 1
The backward movement flag is set in the optimization attribute of the row information of the second and fourteenth rows, and the secondary variation flag is set in the optimization attribute of the row information of the eleventh row.
【0051】また、ソースプログラム6aについては、
ソースプログラムの流れ6bで、分岐S612の前にあ
る文S611と、分岐612の後の一方の経路にある文
S614とは同じ変数sへの代入であり、文S611を
分岐後のもう一方の経路の先頭へと移動する最適化が行
われる。目的プログラムの流れ6cで、コード列S62
4に前方移動が行われていて、ソースプログラムの流れ
6bでは文S611がこのコード列に対応している。最
適化属性設定処理225では、まず文S611に対応す
る行番号中間コードに最適化による影響を示す属性とし
て前方移動フラグを設定する。次に、最適化属性設定処
理225では、前方移動により実行が遅延される文があ
るために、変数の値が更新されていない等の副次的な変
動のある文、すなわち、文S611の次から分岐S61
2まで、そして、分岐S612から同じ変数への代入文
S614の直前の文S613までの文に対応する行番号
中間コードの最適化属性として副次変動フラグを設定す
る。翻訳処理226が生成する行情報では、21行目の
行情報の最適化属性に前方移動フラグが、22行目およ
び23行目の行情報の最適化属性に副次変動フラグが設
定されている。For the source program 6a,
In the flow 6b of the source program, the statement S611 before the branch S612 and the statement S614 on one path after the branch 612 are assignments to the same variable s, and the other path after the statement S611 is branched. Optimization to move to the beginning of In the target program flow 6c, the code string S62
4, a forward movement is performed, and in the flow 6b of the source program, the statement S611 corresponds to this code string. In the optimization attribute setting process 225, first, a forward movement flag is set as an attribute indicating the effect of the optimization in the line number intermediate code corresponding to the statement S611. Next, in the optimization attribute setting process 225, since there is a statement whose execution is delayed due to the forward movement, a statement having a secondary change such as the variable value is not updated, that is, a statement following the statement S611. Branch from S61
A secondary variation flag is set as the optimization attribute of the line number intermediate code corresponding to the statement up to 2, and from the branch S612 to the statement S613 immediately before the assignment statement S614 to the same variable. In the line information generated by the translation processing 226, the forward movement flag is set in the optimization attribute of the line information on the 21st line, and the secondary variation flag is set in the optimization attribute of the line information on the 22nd and 23rd lines. .
【0052】最後に、コンパイラ11は、翻訳手段11
5により、翻訳処理226を行い、中間言語形式プログ
ラム23から目的プログラム24を生成する。行番号中
間コードは、行番号,生成された目的コードの関数先頭
からの命令オフセット,および最適化属性の組である行
情報に変換され、目的プログラム12の一部として出力
される。Finally, the compiler 11 includes a translating unit 11
5, a translation process 226 is performed to generate a target program 24 from the intermediate language format program 23. The line number intermediate code is converted into line information, which is a set of a line number, an instruction offset from the head of the function of the generated target code, and an optimization attribute, and is output as a part of the target program 12.
【0053】(2) 次に、シンボリックデバッガ13
の動作について説明する。(2) Next, the symbolic debugger 13
Will be described.
【0054】目的プログラム入力手段131は、目的プ
ログラム入力処理251で、目的プログラム12を入力
して、行情報については行情報テーブル構成手段132
により行情報テーブル構成処理252を行う。The target program input means 131 inputs the target program 12 in the target program input processing 251 and, for the line information, the line information table forming means 132
Performs the row information table configuration process 252.
【0055】デバッグ実行者が、ソースレベルのステッ
プ実行指示を行うと、ソースレベルステップ実行手段1
33によるソースレベルステップ実行処理253および
実行順序表示手段134による実行順序表示処理254
が、図4のフローチャートに示すように行われる。When the debugger gives a source level step execution instruction, the source level step execution means 1
33, a source level step execution process 253 and an execution order display process 254 by the execution order display means 134.
Is performed as shown in the flowchart of FIG.
【0056】まず、ソースレベルステップ実行処理25
3では、現在の停止アドレスから行情報テーブル26を
検索して次に停止すべきアドレスを求める(ステップS
401)。次に、実行順序表示処理254では、これか
ら実行しようとする目的コードの最適化属性を行情報テ
ーブル26から参照し(ステップS402)、設定され
ているフラグによって、デバッグ実行者に注意を促すた
めのメッセージの表示を行う。メッセージの表示の形態
はいくつか可能であるが、例えば、表示装置27上の特
定の領域に配置されるメッセージウィンドウなどに出力
し、次のステップ実行により、次の目的コードについて
の最適化の影響を表示するまで、表示を継続しておくよ
うにできる。すなわち、実行順序表示処理254では、
最適化属性に後方移動フラグが設定されていれば(ステ
ップS403)、「ソースプログラムの実行順序より、
前倒しに実行する」というメッセージを表示する(ステ
ップS404)。また、副次変動フラグが設定されてい
れば(ステップS405)、「実行順序が変更されたた
め、変数の値などが影響を受けている可能性がある」と
いうメッセージを表示する(ステップS406)。さら
に、前方移動フラグが設定されていれば(ステップS4
07)、「遅延されていた文を実行する」というメッセ
ージを表示する(ステップS408)。いずれのフラグ
も設定されていなければ(ステップS409)、それま
で表示していた実行順序に関するメッセージをクリアす
る(ステップS410)。First, source level step execution processing 25
In step 3, the line information table 26 is searched from the current stop address to find the next stop address (step S).
401). Next, in the execution order display process 254, the optimization attribute of the target code to be executed is referenced from the line information table 26 (step S402), and the flag set to call attention to the debugger by the set flag. Display a message. Although there are several possible forms of displaying the message, for example, the message is output to a message window arranged in a specific area on the display device 27, and the next step execution causes the effect of optimization on the next object code Until is displayed, the display can be continued. That is, in the execution order display process 254,
If the backward movement flag is set in the optimization attribute (step S403), “from the execution order of the source program,
Message is displayed (step S404). If the secondary variation flag has been set (step S405), a message is displayed indicating that "the execution order has been changed and the value of the variable may be affected" (step S406). Further, if the forward movement flag is set (step S4)
07), a message “execute the delayed sentence” is displayed (step S408). If none of the flags is set (step S409), the message regarding the execution order that has been displayed until then is cleared (step S410).
【0057】その後、ソースレベルステップ実行処理2
53では、ステップS401で求めたアドレスまで目的
コードを実行し(ステップS411)、ソースプログラ
ム表示において適当な強調表示等を使用して現在の停止
行を表示する(ステップS412)。Thereafter, source level step execution processing 2
In 53, the target code is executed up to the address obtained in step S401 (step S411), and the current stop line is displayed using appropriate highlighting or the like in the source program display (step S412).
【0058】図7は、第1の実施の形態に係る最適化コ
ードデバッグ方式での、実行順序の変更に関するメッセ
ージ表示例の説明図である。7a〜7dは、ステップ実
行を繰り返し指示したときに、その経過で順次更新され
るシンボリックデバッガ13の表示を示している。ソー
スプログラム上の現在位置は印71で可視表示され、実
行順序の変更に関してのメッセージ72が表示される。
表示7aおよび7cでは、実行順序の変更による影響は
なく、メッセージは表示されていない。FIG. 7 is an explanatory diagram of a message display example regarding a change in the execution order in the optimized code debugging method according to the first embodiment. 7a to 7d show the display of the symbolic debugger 13 which is sequentially updated as step execution is repeatedly instructed. The current position on the source program is visually displayed by a mark 71, and a message 72 regarding a change in the execution order is displayed.
In the displays 7a and 7c, there is no effect due to the change in the execution order, and no message is displayed.
【0059】次に、本発明の第2の実施の形態につい
て、図8を参照して説明する。Next, a second embodiment of the present invention will be described with reference to FIG.
【0060】図8は、本発明の第2の実施の形態に係る
最適化コードデバッグ方式におけるシンボリックデバッ
ガ91の処理の流れを示す図である。第2の実施の形態
に係る最適化コードデバッグ方式におけるコンパイラの
処理の流れは、第2の実施の形態に係る最適化コードデ
バッグ方式におけるコンパイラ11の処理の流れと同様
であるので、その詳しい説明を割愛する。シンボリック
デバッガ91の処理は、目的プログラム入力処理911
と、行情報テーブル構成処理912と、ソースレベルス
テップ実行処理913と、現在位置表示処理914と、
ソースプログラムおよび実行順序表示処理915とから
なる。なお、図8中、符号92は行オフセット対応表、
符号93は行情報テーブルをそれぞれ示す。FIG. 8 is a diagram showing a processing flow of the symbolic debugger 91 in the optimized code debugging method according to the second embodiment of the present invention. The flow of the processing of the compiler in the optimized code debugging method according to the second embodiment is the same as the flow of the processing of the compiler 11 in the optimized code debugging method according to the second embodiment. Omit. The symbolic debugger 91 performs a target program input process 911
A line information table configuration process 912, a source level step execution process 913, a current position display process 914,
It comprises a source program and execution order display processing 915. In FIG. 8, reference numeral 92 denotes a row offset correspondence table,
Reference numeral 93 indicates a row information table.
【0061】目的プログラム入力処理911では、目的
プログラム12を入力して、行情報については行情報テ
ーブル構成処理912で、行オフセット対応表92と行
情報テーブル93とを構成する。行オフセット対応表9
2の各エントリは、ソース行番号と関数先頭からの命令
オフセットとからなり、関数毎に命令オフセットで昇順
に整列される。行情報テーブル93の各エントリは、ソ
ース行番号,関数先頭からの命令オフセット,および最
適化属性からなるが、第1の実施の形態における行情報
テーブル26と異なり、ソースプログラムファイル毎に
ソース行番号で昇順に整列される。In the target program input process 911, the target program 12 is input, and the row information table forming process 912 forms the row offset correspondence table 92 and the row information table 93 for the row information. Row offset correspondence table 9
Each entry of No. 2 includes a source line number and an instruction offset from the head of the function, and is sorted in ascending order by the instruction offset for each function. Each entry of the line information table 93 includes a source line number, an instruction offset from the head of the function, and an optimization attribute. Unlike the line information table 26 in the first embodiment, the source line number is different for each source program file. To sort in ascending order.
【0062】デバッグ実行者が、ソースプログラム表示
指示を行うと、ソースプログラムおよび実行順序表示処
理915では、指定されたソースプログラムファイルに
ついて行情報テーブル93の該当部分を先頭から順次参
照し、最適化属性が設定されている行は、反転,下線な
どの強調表示を施して表示し、最適化属性が設定されて
いない行はそのまま表示する。When the debugger gives a source program display instruction, in the source program and execution order display processing 915, the specified portion of the line information table 93 is sequentially referred to from the top of the specified source program file, and the optimization attribute Are displayed with emphasis such as inversion and underlining, and lines without the optimization attribute are displayed as they are.
【0063】図9は、第2の実施の形態に係る最適化コ
ードデバッグ方式によるソースプログラム表示例101
の説明図である。デバッグ実行者が、ソースレベルのス
テップ実行指示を行うと、ソースレベルステップ実行処
理913では、行オフセット対応表92を検索して次に
停止すべきアドレスを求め、目的コードを実行する。そ
の後、現在位置表示処理914では、ソースプログラム
表示において、現在の停止行を印102として表示す
る。FIG. 9 shows a display example 101 of a source program by the optimized code debugging method according to the second embodiment.
FIG. When the debugger gives a source level step execution instruction, the source level step execution processing 913 searches the row offset correspondence table 92 to find an address to be stopped next, and executes the target code. Thereafter, in the current position display processing 914, the current stop line is displayed as the mark 102 in the source program display.
【0064】第2の実施の形態に係る最適化コードデバ
ッグ方式では、シンボリックデバッガ91がソースプロ
グラム表示を行うとき、デバッグ開始当初の、まだステ
ップ実行を開始していない状態でも、常時、ソースプロ
グラムの各行について、強調表示を用いて最適化の影響
を併せて表示することができる。このようにすれば、ソ
ースプログラム表示を見ると、デバッグ実行者は、変数
が、最適化の影響にかかわらず、期待値を確実に保持す
る位置を知ることができる。In the optimized code debugging method according to the second embodiment, when the symbolic debugger 91 displays a source program, even if the step execution has not yet started at the beginning of debugging, the source program is always displayed. For each row, the effect of the optimization can also be displayed using highlighting. In this way, when viewing the source program display, the debugger can know the position where the variable reliably holds the expected value regardless of the effect of the optimization.
【0065】次に、本発明の第3の実施の形態に係る最
適化コードデバッグ方式について、図10を参照して説
明する。Next, an optimized code debugging method according to a third embodiment of the present invention will be described with reference to FIG.
【0066】図10を参照すると、本発明の第3の実施
の形態に係る最適化コードデバッグ方式は、入力装置8
1と、データ処理装置82と、中間言語形式プログラム
831,目的プログラム832および行情報テーブル8
33を格納する記憶装置83と、出力装置84と、記録
媒体85とから構成されている。記録媒体85は、コン
パイラ11に相当するコンパイル処理プログラムおよび
シンボリックデバッガ13に相当するデバッグ処理プロ
グラムを記録する。この記録媒体85は、磁気ディス
ク,半導体メモリその他の記録媒体であってよい。Referring to FIG. 10, the optimized code debugging method according to the third embodiment of the present invention
1, data processing device 82, intermediate language format program 831, target program 832, and line information table 8
It comprises a storage device 83 for storing 33, an output device 84, and a recording medium 85. The recording medium 85 records a compile processing program corresponding to the compiler 11 and a debug processing program corresponding to the symbolic debugger 13. This recording medium 85 may be a magnetic disk, a semiconductor memory, or another recording medium.
【0067】コンパイル処理プログラムおよびデバッグ
処理プログラムは記録媒体85からデータ処理装置82
に読み込まれ、データ処理装置82の動作をコンパイラ
11およびシンボリックデバッガ13として制御する。
データ処理装置82は、コンパイル処理プログラムおよ
びデバッグ処理プログラムの制御により、以下の処理を
実行する。The compile processing program and the debug processing program are transferred from the recording medium 85 to the data processing device 82.
, And controls the operation of the data processing device 82 as the compiler 11 and the symbolic debugger 13.
The data processing device 82 executes the following processing under the control of the compile processing program and the debug processing program.
【0068】入力装置81からソースプログラムが与え
られると、まず、このソースプログラムを中間言語形式
プログラム831に変換し、ソースプログラムの一文毎
に対して行情報を生成する。中間言語形式プログラム8
31を最適化してコードが移動すると、行情報に、コー
ドの移動や実行順序の変更を示すフラグを設定する。最
適化の後、中間言語形式プログラム831を翻訳し、行
情報とともに記憶装置83内の目的プログラム832に
格納する。When a source program is given from the input device 81, the source program is first converted into an intermediate language format program 831 and line information is generated for each sentence of the source program. Intermediate language format program 8
When the code is moved by optimizing 31, a flag indicating the movement of the code or a change in the execution order is set in the line information. After the optimization, the intermediate language format program 831 is translated and stored in the target program 832 in the storage device 83 together with the line information.
【0069】次に、目的プログラム832に記憶されて
いる行情報から、行情報テーブル833を構成する。入
力装置81から目的プログラム832のステップ実行が
指示されると、目的プログラム832の実行時に、ソー
スプログラムテキスト上で行単位での現在位置を出力装
置84に表示させる。これと同時に、目的プログラムに
対する最適化の影響を示すメッセージを出力装置84に
表示させる。Next, a line information table 833 is constructed from the line information stored in the target program 832. When the execution of the target program 832 is instructed from the input device 81, the current position of the source program text on a line basis is displayed on the output device 84 when the target program 832 is executed. At the same time, a message indicating the effect of the optimization on the target program is displayed on the output device 84.
【0070】[0070]
【発明の効果】第1の効果は、コンパイラの最適化によ
りコードの移動が行われ、実行順序が変更されている目
的プログラムに対して、ソースレベルデバッグが可能と
なり、デバッグに要する工数が削減されることである。
その理由は、コンパイラが、プログラム中の特定の位置
における、変数の値のような、プログラムの状態に影響
を及ぼす最適化を行う場合に、シンボリックデバッガ
が、デバッグ実行者の注意を促すためのメッセージを表
示するからである。The first effect is that the code is moved by the optimization of the compiler, and the source program can be debugged for the target program whose execution order has been changed, and the number of steps required for debugging can be reduced. Is Rukoto.
The reason is that when the compiler makes optimizations that affect the state of the program, such as the value of a variable at a particular point in the program, the symbolic debugger will send a message to alert the debugger. Is displayed.
【図1】本発明の第1の実施の形態に係る最適化コード
デバッグ方式の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of an optimized code debugging system according to a first embodiment of the present invention.
【図2】第1の実施の形態に係る最適化コードデバッグ
方式における処理の流れを示す図である。FIG. 2 is a diagram showing a flow of processing in an optimized code debugging method according to the first embodiment.
【図3】第1の実施の形態に係る最適化コードデバッグ
方式における行情報テーブル例を示す説明図である。FIG. 3 is an explanatory diagram showing an example of a row information table in an optimized code debugging method according to the first embodiment.
【図4】第1の実施の形態に係る最適化コードデバッグ
方式におけるシンボリックデバッガ中の処理手順を示す
フローチャートである。FIG. 4 is a flowchart showing a processing procedure in a symbolic debugger in the optimized code debugging method according to the first embodiment.
【図5】図1中のコンパイラの最適化による後方移動の
例を示す説明図である。FIG. 5 is an explanatory diagram showing an example of backward movement by optimization of a compiler in FIG. 1;
【図6】図1中のコンパイラの最適化による前方移動の
例を示す説明図である。FIG. 6 is an explanatory diagram showing an example of forward movement by optimization of a compiler in FIG. 1;
【図7】第1の実施の形態に係る最適化コードデバッグ
方式による実行順序の変更に関する表示例を示す説明図
である。FIG. 7 is an explanatory diagram showing a display example regarding a change in the execution order by the optimized code debugging method according to the first embodiment.
【図8】本発明の第2の実施の形態に係る最適化コード
デバッグ方式におけるシンボリックデバッガの処理の流
れを示す図である。FIG. 8 is a diagram showing a flow of processing of a symbolic debugger in an optimized code debugging method according to a second embodiment of the present invention.
【図9】第2の実施の形態に係る最適化コードデバッグ
方式によるソースプログラム表示例の説明図である。FIG. 9 is an explanatory diagram of an example of a source program displayed by the optimized code debugging method according to the second embodiment.
【図10】本発明の第3の実施の形態に係る最適化コー
ドデバッグ方式を示すブロック図である。FIG. 10 is a block diagram showing an optimized code debugging method according to a third embodiment of the present invention.
5a コンパイラの後方移動最適化の対象となるソース
プログラム例 5b ソースプログラム例の実行の流れ 5c 目的プログラム例の実行の流れ 6a コンパイラの前方移動最適化の対象となるソース
プログラム例 6b ソースプログラム例の実行の流れ 6c 目的プログラム例の実行の流れ 11 コンパイラ(コンパイル処理部) 12 目的プログラム 13 シンボリックデバッガ(デバッグ処理部) 21 ソースプログラム 23 中間言語形式プログラム 26 行情報テーブル 26a 後方移動が行われた目的プログラムに対する行
情報テーブル例 26b 前方移動が行われた目的プログラムに対する行
情報テーブル例 27 表示装置 81 入力装置 82 データ処理装置 83 記憶装置 84 出力装置 85 記録媒体 91 シンボリックデバッガ 92 行オフセット対応表 93 行情報テーブル 101 ソースプログラム表示例 102 印 111 構文解析手段 112 行情報生成手段 113 最適化手段 114 最適化属性設定手段 115 翻訳手段 131 目的プログラム入力手段 132 行情報テーブル構成手段 133 ソースレベルステップ実行手段 134 実行順序表示手段 221 構文解析処理 222 行情報生成処理 223 最適化処理 224 移動判断 225 最適化属性設定処理 226 翻訳処理 251 目的プログラム入力処理 252 行情報テーブル構成処理 253 ソースレベルステップ実行処理 254 実行順序表示処理 831 中間言語形式プログラム 832 目的プログラム 833 行情報テーブル 911 目的プログラム入力処理 912 行情報テーブル構成処理 913 ソースレベルステップ実行処理 914 現在位置表示処理 915 ソースプログラムおよび実行順序表示処理5a Example of source program to be optimized for backward movement of compiler 5b Flow of execution of example of source program 5c Flow of execution of example of target program 6a Example of source program to be optimized for forward movement of compiler 6b Execution of example of source program 6c Flow of execution of example target program 11 Compiler (compile processing unit) 12 Target program 13 Symbolic debugger (debug processing unit) 21 Source program 23 Intermediate language format program 26 Line information table 26a For target program that has been moved backward Example of line information table 26b Example of line information table for the target program moved forward 27 display device 81 input device 82 data processing device 83 storage device 84 output device 85 recording medium 91 symbolic debugger 9 Line offset correspondence table 93 Line information table 101 Source program display example 102 Mark 111 Syntax analysis means 112 Line information generation means 113 Optimization means 114 Optimization attribute setting means 115 Translation means 131 Object program input means 132 Line information table construction means 133 Source Level step execution means 134 execution order display means 221 syntax analysis processing 222 line information generation processing 223 optimization processing 224 movement determination 225 optimization attribute setting processing 226 translation processing 251 target program input processing 252 line information table configuration processing 253 source level step execution Process 254 Execution order display process 831 Intermediate language format program 832 Object program 833 Line information table 911 Object program input process 912 Line information table configuration process 913 Scan level step execution process 914 current position display processing 915 source program and execution sequence display processing
───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 11/28 - 11/36 G06F 9/06 G06F 9/45 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 11/28-11/36 G06F 9/06 G06F 9/45
Claims (10)
プログラムに変換する構文解析手段と、前記構文解析手
段によるソースプログラムの解析時に該ソースプログラ
ムの関数内にある一文毎に該文のソース行番号,該文に
対して生成される目的コードの関数先頭アドレスからの
オフセット,および最適化属性を組にした行情報を生成
する行情報生成手段と、前記中間言語形式プログラムに
対して各種の最適化を行い、より効率的な中間言語形式
プログラムに変換する最適化手段と、前記最適化手段に
よる最適化処理の結果、中間言語命令列の前方移動が起
こった場合には移動された中間言語命令列に対応する行
情報の最適化属性に前方移動フラグを設定するとともに
該中間言語命令列の移動により到達経路に影響を受ける
他の中間言語命令列に対応する行情報の最適化属性に副
次変動フラグを設定し、中間言語命令列の後方移動が起
こった場合には移動された中間言語命令列に対応する行
情報の最適化属性に後方移動フラグを設定するとともに
該中間言語命令列の移動により到達経路に影響を受ける
他の中間言語命令列に対応する行情報の最適化属性に副
次変動フラグを設定する最適化属性設定手段と、前記中
間言語形式プログラムを前記行情報を含んだ目的プログ
ラムに翻訳する翻訳手段とを有するコンパイル処理部
と、前記行情報を含んだ目的プログラムを入力する目的プロ
グラム入力手段と、前記目的プログラム中の前記 行情報
を入力し、ソース行番号,目的コードの関数先頭アドレ
スからのオフセット,および最適化属性からなる行情報
テーブルを構成する行情報テーブル構成手段と、ソース
レベルのステップ実行指示があったときに現在の停止ア
ドレスから前記行情報テーブルを検索して次に停止すべ
きアドレスを求めてソースプログラムにおける一行文に
相当する目的コードを実行し、ソースプログラム表示の
上で現在位置を表示するソースレベルステップ実行手段
と、前記ソースレベルステップ実行手段により実行され
る目的コードの最適化属性を前記行情報テーブルから参
照し、最適化属性に後方移動フラグが設定されていれば
「ソースプログラムの実行順序より前倒しに実行する」
旨のメッセージを表示し、副次変動フラグが設定されて
いれば「実行順序が変更されたために変数の値などが影
響を受けている可能性がある」旨のメッセージを表示
し、前方移動フラ グが設定されていれば「遅延されてい
た文を実行する」旨のメッセージを表示する実行順序表
示手段とを有するデバッグ処理部とからなることを特徴
とする最適化コードデバッグ方式。An intermediate language format by analyzing a source program.
Parsing means for converting into a program;
Source line number of the statement for each sentence at the time of analysis of the source program by stages lies in the function of the source program, the offset from the top of the function address of the target code generated for the sentence, and the optimization attributes in the set Line information generating means for generating line information ,
Performs various optimizations for the intermediate language format that is more efficient
Optimizing means for converting to a program, and
As a result, the intermediate language instruction sequence moves forward.
In this case, the line corresponding to the moved intermediate language instruction sequence
Set the forward movement flag in the information optimization attribute and
The destination path is affected by the movement of the intermediate language instruction sequence
The sub attribute is added to the optimization attribute of the line information corresponding to the other intermediate language instruction sequence.
Sets the next fluctuation flag, causing backward movement of the intermediate language instruction sequence.
In this case, the line corresponding to the moved intermediate language instruction sequence
Set the backward movement flag in the information optimization attribute and
The destination path is affected by the movement of the intermediate language instruction sequence
The sub attribute is added to the optimization attribute of the line information corresponding to another intermediate language instruction sequence.
And optimization attribute setting means for setting a next change flag, the in
A target program containing the line information
A compilation processing unit having translation means for translating into a program, and a target program for inputting a target program including the line information.
A line information table structuring means for inputting the line information in the target program and forming a line information table including a source line number , an offset of a target code from a function head address , and an optimization attribute; Source
The current stop address will be
Search the line information table from the dress and then stop
A single line sentence in the source program
Execute the corresponding target code and display the source program.
Source level step execution means for displaying the current position on the screen
Executed by the source level step executing means.
The optimization attribute of the target code to be
If the backward movement flag is set in the optimization attribute
"Execute ahead of source program execution order"
Is displayed and the secondary fluctuation flag is set.
If it says, “The execution order has been changed,
May be affected. "
And, it has been "delayed if it is set forward movement flag
And a debug processing unit having an execution order display means for displaying a message of "execute the executed statement" .
プログラムに変換する構文解析手段と、前記構文解析手
段によるソースプログラムの解析時に該ソースプログラ
ムの関数内にある一文毎に該文のソース行番号,該文に
対して生成される目的コードの関数先頭アドレスからの
オフセット,および最適化属性を組にした行情報を生成
する行情報生成手段と、前記中間言語形式プログラムに
対して各種の最適化を行い、より効率的な中間言語形式
プログラムに変換する最適化手段と、前記最適化手段に
よる最適化処理の結果、中間言語命令列の前方移動が起
こった場合には移動された中間言語命令列に対応する行
情報の最適化属性に前方移動フラグを設定するとともに
該中間言語命令列の移動により到達経路に影響を受ける
他の中間言語命令列に対応する行情報の最適化属性に副
次変動フラグを設定し、中間言語命令列の後方移動が起
こった場合には移動された中間言語命令列に対応する行
情報の最適化属性に後方移動フラグを設定するとともに
該中間言語命令列の移動により到達経路に影響を受ける
他の中間言語命令列に対応する行情報の最適化属性に副
次変動フラグを設定する最適化属性設定手段と、前記中
間言語形式プログラムを前記行情報を含んだ目的プログ
ラムに翻訳する翻訳手段とを有することを特徴とするコ
ンパイル方式。2. An intermediate language format by analyzing a source program.
Parsing means for converting into a program;
Source line number of the statement for each sentence at the time of analysis of the source program by stages lies in the function of the source program, the offset from the top of the function address of the target code generated for the sentence, and the optimization attributes in the set Line information generating means for generating line information ,
Performs various optimizations for the intermediate language format that is more efficient
Optimizing means for converting to a program, and
As a result, the intermediate language instruction sequence moves forward.
In this case, the line corresponding to the moved intermediate language instruction sequence
Set the forward movement flag in the information optimization attribute and
The destination path is affected by the movement of the intermediate language instruction sequence
The sub attribute is added to the optimization attribute of the line information corresponding to the other intermediate language instruction sequence.
Sets the next fluctuation flag, causing backward movement of the intermediate language instruction sequence.
In this case, the line corresponding to the moved intermediate language instruction sequence
Set the backward movement flag in the information optimization attribute and
The destination path is affected by the movement of the intermediate language instruction sequence
The sub attribute is added to the optimization attribute of the line information corresponding to the other intermediate language instruction sequence.
And optimization attribute setting means for setting a next change flag, the in
A target program containing the line information
And a translation means for translating into a ram .
目的プログラム入力手段と、前記目的プログラム中の前
記行情報を入力し、ソース行番号,目的コードの関数先
頭アドレスからのオフセット,および最適化属性からな
る行情報テーブルを構成する行情報テーブル構成手段
と、ソースレベルのステップ実行指示があったときに現
在の停止アドレスから前記行情報テーブルを検索して次
に停止すべきアドレスを求めてソースプログラムにおけ
る一行文に相当する目的コードを実行し、ソースプログ
ラム表示の上で現在位置を表示するソースレベルステッ
プ実行手段と、前記ソースレベルステップ実行手段によ
り実行される目的コードの最適化属性を前記行情報テー
ブルから参照し、最適化属性に後方移動フラグが設定さ
れていれば「ソースプログラムの実行順序より前倒しに
実行する」旨のメッセー ジを表示し、副次変動フラグが
設定されていれば「実行順序が変更されたために変数の
値などが影響を受けている可能性がある」旨のメッセー
ジを表示し、前方移動フラグが設定されていれば「遅延
されていた文を実行する」旨のメッセージを表示する実
行順序表示手段とを有することを特徴とするデバッグ方
式。3. Inputting a target program including line information
Objective program input means, and before the objective program
Enter the serial line information, the source line number, the line information table configuration means for configuring the line information table of offsets, and optimization attributes from the function start address of object code, when a step execution instruction source level Present
Search the line information table from the current stop address and
In the source program to find the address to stop
Executes the target code equivalent to one line sentence
Source level step to display the current position on the
Step execution means and the source level step execution means.
The optimization attribute of the target code to be executed
Table, and the backward movement flag is set in the optimization attribute.
If it says, "Before the execution order of the source program
Displays a message of execution to "effect, a secondary change flag
If it is set, the message "The execution order has been changed
The value may have been affected. "
Message is displayed, and if the forward movement flag is set,
And an execution order display means for displaying a message indicating "execute the sentence" .
プログラムに変換する構文解析手段と、前記構文解析手
段によるソースプログラムの解析時に該ソースプログラ
ムの関数内にある一文毎に該文のソース行番号,該文に
対して生成される目的コードの関数先頭アドレスからの
オフセット,および最適化属性を組にした行情報を生成
する行情報生成手段と、前記中間言語形式プログラムに
対して各種の最適化を行い、より効率的な中間言語形式
プログラムに変換する最適化手段と、前記最適化手段に
よる最適化処理の結果、中間言語命令列の前方移動が起
こった場合には移動された中間言語命令列に対応する行
情報の最適化属性に前方移動フラグを設定するとともに
該中間言語命令列の移動により到達経路に影響を受ける
他の中間言語命令列に対応する行情報の最適化属性に副
次変動フラグを設定し、中間言語命令列の後方移動が起
こった場合には移動された中間言語命令列に対応する行
情報の最適化属性に後方移動フラグを設定するとともに
該中間言語命令列の移動により到達経路に影響を受ける
他の中間言語命令列に対応する行情報の最適化属性に副
次変動フラグを設定する最適化属性設定手段と、前記中
間言語形式プログラムを前記行情報を含んだ目的プログ
ラムに翻訳する翻訳手段とを有するコンパイル処理部
と、前記行情報を含んだ目的プログラムを入力する目的プロ
グラム入力手段と、前記目的プログラム中の前記 行情報
を入力し、ソース行番号および関数先頭からの命令オフ
セットからなり関数毎に命令オフセット順に整列された
行オフセット対応表と、ソース行番号,目的コードの関
数先頭アドレスからのオフセットおよび最適化属性から
なりソースプログラム毎にソース行番号順に整列された
行情報テーブルとを構成する行情報テーブル構成手段
と、ソースプログラム表示指示があったときに指定され
たソースプログラムファイルについて前記行情報テーブ
ルの該当部分を先頭から順次参照して最適化属性が設定
されている行に強調表示を施して表示するソースプログ
ラムおよび実行順序表示手段と、ソースレベルのステッ
プ実行指示があったときに前記行オフセット対応表を検
索して次に停止すべきアドレスを求めてソースプログラ
ムにおける一行文に相当する目的コードを実行するソー
スレベルステップ実行手段と、ソースプログラム表示に
おいて現在の停止行に印を表示する現在位置表示手段と
を有するデバッグ処理部とからなることを特徴とする最
適化コードデバッグ方式。4. An intermediate language format by analyzing a source program.
Parsing means for converting into a program;
Source line number of the statement for each sentence at the time of analysis of the source program by stages lies in the function of the source program, the offset from the top of the function address of the target code generated for the sentence, and the optimization attributes in the set Line information generating means for generating line information ,
Performs various optimizations for the intermediate language format that is more efficient
Optimizing means for converting to a program, and
As a result, the intermediate language instruction sequence moves forward.
In this case, the line corresponding to the moved intermediate language instruction sequence
Set the forward movement flag in the information optimization attribute and
The destination path is affected by the movement of the intermediate language instruction sequence
The sub attribute is added to the optimization attribute of the line information corresponding to the other intermediate language instruction sequence.
Sets the next fluctuation flag, causing backward movement of the intermediate language instruction sequence.
In this case, the line corresponding to the moved intermediate language instruction sequence
Set the backward movement flag in the information optimization attribute and
The destination path is affected by the movement of the intermediate language instruction sequence
The sub attribute is added to the optimization attribute of the line information corresponding to another intermediate language instruction sequence.
And optimization attribute setting means for setting a next change flag, the in
A target program containing the line information
A compilation processing unit having translation means for translating into a program, and a target program for inputting a target program including the line information.
A line offset correspondence table , comprising a line input in the target program , a source line number and an instruction offset from the head of the function, the line offset correspondence table being arranged for each function in the order of the instruction offset; From the number, the offset of the target code from the function start address, and the optimization attribute
A line information table composing a line information table arranged in order of source line number for each source program; and a line information table for a source program file designated when a source program display instruction is given. A source program and an execution order display means for sequentially displaying the corresponding part of the line from the top and highlighting and displaying the line where the optimization attribute is set, and the line offset when a source level step execution instruction is given. source program seeking the next address to be stopped by searching the correspondence table
And a debug processing unit having a source level step executing means for executing an object code corresponding to a one-line sentence in a program, and a current position displaying means for displaying a mark at a current stop line in a source program display. Optimized code debugging method.
目的プログラム入力手段と、前記目的プログラム中の前
記行情報を入力し、ソース行番号および関数先頭からの
命令オフセットからなり関数毎に命令オフセット順に整
列された行オフセット対応表と、ソース行番号,目的コ
ードの関数先頭アドレスからのオフセットおよび最適化
属性からなりソースプログラム毎にソース行番号順に整
列された行情報テーブルとを構成する行情報テーブル構
成手段と、ソースプログラム表示指示があったときに指
定されたソースプログラムファイルについて前記行情報
テーブルの該当部分を先頭から順次参照して最適化属性
が設定されている行に強調表示を施して表示するソース
プログラムおよび実行順序表示手段と、ソースレベルの
ステップ実行指示があったときに前記行オフセット対応
表を検索して次に停止すべきアドレスを求めてソースプ
ログラムにおける一行文に相当する目的コードを実行す
るソースレベルステップ実行手段と、ソースプログラム
表示において現在の停止行に印を表示する現在位置表示
手段とを有することを特徴とするデバッグ方式。5. Inputting a target program including line information
Objective program input means, and before the objective program
Enter the serial line information, for each function consists of instruction offset from the source line number and function top integer in the order of instruction offset
A row offset correspondence table is column, the source line number, integer source line number order for each becomes the source program from the offset and optimization attributes from the function start address of the object code
And line information table configuration means for configuring the column row information table, sequentially referring to that portion of the line information table for the finger <br/> constant is a source program file when there is a source program display instruction from the head A source program and an execution order display means for highlighting and displaying the line on which the optimization attribute is set, and searching the line offset correspondence table when there is a source level step execution instruction. Source program to find the address to stop
A debugging method comprising: source level step executing means for executing an object code corresponding to one line sentence in a program; and current position displaying means for displaying a mark on a current stop line in a source program display.
して中間言語形式プログラムに変換する構文解析手段
と、前記構文解析手段によるソースプログラムの解析時
に該ソースプログラムの関数内にある一文毎に該文のソ
ース行番号,該文に対して生成される目的コードの関数
先頭アドレスからのオフセット,および最適化属性を組
にした行情報を生成する行情報生成手段と、前記中間言
語形式プログラムに対して各種の最適化を行い、より効
率的な中間言語形式プログラムに変換する最適化手段
と、前記最適化手段による最適化処理の結果、中間言語
命令列の前方移動が起こった場合には移動された中間言
語命令列に対応する行情報の最適化属性に前方移動フラ
グを設定するとともに該中間言語命令列の移動により到
達経路に影響を受ける他の中間言語命令列に対応する行
情報の最適化属性に副次変 動フラグを設定し、中間言語
命令列の後方移動が起こった場合には移動された中間言
語命令列に対応する行情報の最適化属性に後方移動フラ
グを設定するとともに該中間言語命令列の移動により到
達経路に影響を受ける他の中間言語命令列に対応する行
情報の最適化属性に副次変動フラグを設定する最適化属
性設定手段と、前記中間言語形式プログラムを前記行情
報を含んだ目的プログラムに翻訳する翻訳手段とを有す
るコンパイル処理部として機能させるためのプログラム
と、前記行情報を含んだ目的プログラムを入力する目的
プログラム入力手段と、前記目的プログラム中の前記行
情報を入力し、ソース行番号,目的コードの関数先頭ア
ドレスからのオフセット,および最適化属性からなる行
情報テーブルを構成する行情報テーブル構成手段と、ソ
ースレベルのステップ実行指示があったときに現在の停
止アドレスから前記行情報テーブルを検索して次に停止
すべきアドレスを求めてソースプログラムにおける一行
文に相当する目的コードを実行し、ソースプログラム表
示の上で現在位置を表示するソースレベルステップ実行
手段と、前記ソースレベルステップ実行手段により実行
される目的コードの最適化属性を前記行情報テーブルか
ら参照し、最適化属性に後方移動フラグが設定されてい
れば「ソースプログラムの実行順序より前倒しに実行す
る」旨のメッセージを表示し、副次変動フラグが設定さ
れていれば「実行順序が変更されたために変数の値など
が影響を受けている可能性がある」旨のメッセージを表
示し、前方移動フラグが設定されていれば「遅延されて
いた文を実行する」旨のメッセージを表示する実行順序
表示手段とを有するデバッグ処理部として機能させるた
めのプログラムとを記録した機械読み取り可能な記録媒
体。6. The computer analyzes a source program.
Parsing means for converting to an intermediate language format program
And when analyzing the source program by the syntax analysis means.
The source program source line number of the statement for each sentence within function, generates the line information which is offset, and the optimization attributes in the set of the function start address of the target code generated for the sentence Line information generating means, and the intermediate language
Performs various optimizations for word-form programs to
Optimizer to convert to efficient intermediate language format program
And the result of the optimization processing by the optimization means, the intermediate language
If the forward movement of the instruction sequence occurs, the intermediate language moved
A forward move flag is added to the optimization attribute of the line information corresponding to the word instruction sequence.
Setting and moving the intermediate language instruction sequence.
Lines corresponding to other intermediate language instruction sequences affected by the route
Set the secondary fluctuations flag to optimize the attributes of information, the intermediate language
If the backward movement of the instruction sequence occurs, the moved intermediate language
The backward movement flag is added to the optimization attribute of the line information corresponding to the word instruction sequence.
Setting and moving the intermediate language instruction sequence.
Lines corresponding to other intermediate language instruction sequences affected by the route
Optimization attribute setting means for setting a secondary variation flag in an information optimization attribute ;
For functioning as a compile processing unit having translation means for translating into a target program containing information, and a purpose of inputting the target program containing the line information
Program input means , and line information table forming means for inputting the line information in the target program and forming a line information table comprising a source line number , an offset of a target code from a function head address , and an optimization attribute; Seo
Current stop when a source level step execution instruction is
Search the line information table from the stop address and then stop
One line in the source program to find the address to be
Execute the target code corresponding to the statement, and
Source-level stepping to show current position on display
Means and the source level step executing means
The optimization attribute of the target code to be
And the backward movement flag is set in the optimization attribute.
In other words, "Execute the source program earlier than the execution order.
Is displayed, and the secondary fluctuation flag is set.
If it is, `` The value of a variable etc.
May have been affected. "
If the forward move flag is set,
And a program for causing the program to function as a debug processing unit having an execution order display means for displaying a message of “execute a sentence” .
して中間言語形式プログラムに変換する構文解析手段
と、前記構文解析手段によるソースプログラムの解析時
に該ソースプログラムの関数内にある一文毎に該文のソ
ース行番号,該文に対して生成される目的コードの関数
先頭アドレスからのオフセット,および最適化属性を組
にした行情報を生成する行情報生成手段と、前記中間言
語形式プログラムに対して各種の最適化を行い、より効
率的な中間言語形式プログラムに変換する最適化手段
と、前記最適化手段による最適化処理の結果、中間言語
命令列の前方移動が起こった場合には移動された中間言
語命令列に対応する行情報の最適 化属性に前方移動フラ
グを設定するとともに該中間言語命令列の移動により到
達経路に影響を受ける他の中間言語命令列に対応する行
情報の最適化属性に副次変動フラグを設定し、中間言語
命令列の後方移動が起こった場合には移動された中間言
語命令列に対応する行情報の最適化属性に後方移動フラ
グを設定するとともに該中間言語命令列の移動により到
達経路に影響を受ける他の中間言語命令列に対応する行
情報の最適化属性に副次変動フラグを設定する最適化属
性設定手段と、前記中間言語形式プログラムを前記行情
報を含んだ目的プログラムに翻訳する翻訳手段として機
能させるためのプログラムを記録した機械読み取り可能
な記録媒体。7. A computer analyzes a source program.
Parsing means for converting to an intermediate language format program
And when analyzing the source program by the syntax analysis means.
The source program source line number of the statement for each sentence within function, generates the line information which is offset, and the optimization attributes in the set of the function start address of the target code generated for the sentence Line information generating means, and the intermediate language
Performs various optimizations for word-form programs to
Optimizer to convert to efficient intermediate language format program
And the result of the optimization processing by the optimization means, the intermediate language
If the forward movement of the instruction sequence occurs, the intermediate language moved
A forward move flag is added to the optimization attribute of the line information corresponding to the word instruction sequence.
Setting and moving the intermediate language instruction sequence.
Lines corresponding to other intermediate language instruction sequences affected by the route
Set the secondary fluctuation flag in the information optimization attribute and set the intermediate language
If the backward movement of the instruction sequence occurs, the moved intermediate language
The backward movement flag is added to the optimization attribute of the line information corresponding to the word instruction sequence.
Setting and moving the intermediate language instruction sequence.
Lines corresponding to other intermediate language instruction sequences affected by the route
Optimization attribute setting means for setting a secondary variation flag in an information optimization attribute ;
Recorded machine-readable recording medium a program for functioning as a translation means for translating the containing broadcast object program.
グラムを入力する目的プログラム入力手段と、前記目的
プログラム中の前記行情報を入力し、ソース行番号,目
的コードの関数先頭アドレスからのオフセット,および
最適化属性からなる行情報テーブルを構成する行情報テ
ーブル構成手段と、ソースレベルのステップ実行指示が
あったときに現在の停止アドレスから前記行情報テーブ
ルを検索して次に停止すべきアドレスを求めてソースプ
ログラムにおける一行文に相当する目的コードを実行
し、ソースプログラム表示の上で現在位置を表示するソ
ースレベルステップ実行手段と、前記ソースレベルステ
ップ実行手段により実行される目的コードの最適化属性
を前記行情報テーブルから参照し、最適化属性に後方移
動フラグが設定されていれば「ソースプログラムの実行
順序より前倒しに実行する」旨のメッセージを表示し、
副次変動フラグが設定されていれば「実行順序が変更さ
れたために変数の値などが影響を受けている可能性があ
る」旨のメッセージを表示し、前方移動フラグが設定さ
れていれば「遅延されていた文を実行する」旨のメッセ
ージを表示する実行順序表示手段として機能させるため
のプログラムを記録した機械読み取り可能な記録媒体。8. The computer according to claim 1 , wherein said computer includes a target program including line information.
Program input means for inputting a program
A line information table structuring means for inputting the line information in the program, constructing a line information table comprising a source line number , an offset of a target code from a function start address , and an optimization attribute ; Step execution instruction
When there is a line information table from the current stop address
Search the source file for the next address to stop.
Execute the target code corresponding to one line statement in the program
To display the current position on the source program display.
Source level step executing means;
Attribute of the target code executed by the backup execution means
Is referenced from the row information table and moved backward to the optimization attribute.
If the run flag is set,
Run ahead of schedule "
If the secondary fluctuation flag is set, the
May have affected the value of variables.
Message is displayed and the forward movement flag is set.
If it is, a message stating "execute the delayed statement"
A machine-readable recording medium on which a program for functioning as an execution order display means for displaying a page is recorded.
して中間言語形式プログラムに変換する構文解析手段
と、前記構文解析手段によるソースプログラムの解析時
に該ソースプログラムの関数内にある一文毎に該文のソ
ース行番号,該文に対して生成される目的コードの関数
先頭アドレスからのオフセット,および最適化属性を組
にした行情報を生成する行情報生成手段と、前記中間言
語形式プログ ラムに対して各種の最適化を行い、より効
率的な中間言語形式プログラムに変換する最適化手段
と、前記最適化手段による最適化処理の結果、中間言語
命令列の前方移動が起こった場合には移動された中間言
語命令列に対応する行情報の最適化属性に前方移動フラ
グを設定するとともに該中間言語命令列の移動により到
達経路に影響を受ける他の中間言語命令列に対応する行
情報の最適化属性に副次変動フラグを設定し、中間言語
命令列の後方移動が起こった場合には移動された中間言
語命令列に対応する行情報の最適化属性に後方移動フラ
グを設定するとともに該中間言語命令列の移動により到
達経路に影響を受ける他の中間言語命令列に対応する行
情報の最適化属性に副次変動フラグを設定する最適化属
性設定手段と、前記中間言語形式プログラムを前記行情
報を含んだ目的プログラムに翻訳する翻訳手段とを有す
るコンパイル処理部として機能させるためのプログラム
と、前記行情報を含んだ目的プログラムを入力する目的
プログラム入力手段と、前記目的プログラム中の前記行
情報を入力し、ソース行番号および関数先頭からの命令
オフセットからなり関数毎に命令オフセット順に整列さ
れた行オフセット対応表と、ソース行番号,目的コード
の関数先頭アドレスからのオフセットおよび最適化属性
からなりソースプログラム毎にソース行番号順に整列さ
れた行情報テーブルとを構成する行情報テーブル構成手
段と、ソースプログラム表示指示があったときに指定さ
れたソースプログラムファイルについて前記行情報テー
ブルの該当部分を先頭から順次参照して最適化属性が設
定されている行に強調表示を施して表示するソースプロ
グラムおよび実行順序表示手段と、ソースレベルのステ
ップ実行指示があったときに前記行オフセット対応表を
検索して次に停止すべきアドレスを求めてソースプログ
ラムにおける一行文に相当する目的コードを実行するソ
ースレベルステップ実行手段と、ソースプログラム表示
において現在の停止行に印を表示する現在位置表示手段
とを有するデバッグ処理部として機能させるためのプロ
グラムとを記録した機械読み取り可能な記録媒体。9. A computer for analyzing a source program
Parsing means for converting to an intermediate language format program
And when analyzing the source program by the syntax analysis means.
The source program source line number of the statement for each sentence within function, generates the line information which is offset, and the optimization attributes in the set of the function start address of the target code generated for the sentence Line information generating means, and the intermediate language
It performs various optimization of for the word format program, more efficiency
Optimizer to convert to efficient intermediate language format program
And the result of the optimization processing by the optimization means, the intermediate language
If the forward movement of the instruction sequence occurs, the intermediate language moved
A forward move flag is added to the optimization attribute of the line information corresponding to the word instruction sequence.
Setting and moving the intermediate language instruction sequence.
Lines corresponding to other intermediate language instruction sequences affected by the route
Set the secondary fluctuation flag in the information optimization attribute and set the intermediate language
If the backward movement of the instruction sequence occurs, the moved intermediate language
The backward movement flag is added to the optimization attribute of the line information corresponding to the word instruction sequence.
Setting and moving the intermediate language instruction sequence.
Lines corresponding to other intermediate language instruction sequences affected by the route
Optimization attribute setting means for setting a secondary variation flag in an information optimization attribute ;
For functioning as a compile processing unit having translation means for translating into a target program containing information, and a purpose of inputting the target program containing the line information
A program input means for inputting the line information in the target program, and comprising a source line number and an instruction offset from the head of the function, arranged in the order of instruction offset for each function;
Rows offset correspondence table and the source line number, the alignment of the source line number order for each source program consists offset and optimization attributes from the function start address of the object code
And line information table configuration means for configuring the line information table, optimization attributes that portion of the line information table for the given source program file are sequentially referred to from the beginning when there is a source program display instruction Source program and execution order display means for highlighting and displaying a set line, and searching the line offset correspondence table when a source level step execution instruction is issued to find an address to be stopped next. Source program
A program for functioning as a debug processing unit having source level step executing means for executing an object code corresponding to a one-line sentence in a ram, and current position display means for displaying a mark at a current stop line in a source program display. A recorded machine-readable recording medium.
ログラムを入力する目的プログラム入力手段と、前記目
的プログラム中の前記行情報を入力し、ソース行番号お
よび関数先頭からの命令オフセットからなり関数毎に命
令オフセット順に整列された行オフセット対応表と、ソ
ース行番号,目的コードの関数先頭アドレスからのオフ
セットおよび最適化属性からなりソースプログラム毎に
ソース行番号順に整列された行情報テーブルとを構成す
る行情報テーブル構成手段と、ソースプログラム表示指
示があったときに指定されたソースプログラムファイル
について前記行情報テーブルの該当部分を先頭から順次
参照して最適化属性が設定されている行に強調表示を施
して表示するソースプログラムおよび実行順序表示手段
と、ソースレベルのステップ実行指示があったときに前
記行オフセット対応表を検索して次に停止すべきアドレ
スを求めてソースプログラムにおける一行文に相当する
目的コードを実行するソースレベルステップ実行手段
と、ソースプログラム表示において現在の停止行に印を
表示する現在位置表示手段を有するデバッグ処理部とし
て機能させるためのプログラムを記録した機械読み取り
可能な記録媒体。10. A computer, comprising: an object program including line information;
Program input means for inputting a program,
The line information in the dynamic program is input, and a command is issued for each function, comprising the source line number and the instruction offset from the beginning of the function
A row offset correspondence table aligned in order decree offset, source line number for each becomes the source program from the offset and optimization attributes from the function start address of the object code
And line information table configuration means for configuring a line information table which is aligned in the order of the source line number, a source program display finger
A source program and an execution order display for highlighting and displaying a line for which an optimization attribute has been set by sequentially referring to a corresponding part of the line information table from the top of the specified source program file when indicated. Means for searching a line offset correspondence table when a source level step execution instruction is issued, finding an address to be stopped next, and corresponding to one line sentence in a source program. A machine-readable recording medium recording a program for functioning as a debug processing unit having a source level step execution unit for executing code and a current position display unit for displaying a mark at a current stop line in a source program display.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP09111855A JP3107151B2 (en) | 1997-04-14 | 1997-04-14 | Optimized code debugging method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP09111855A JP3107151B2 (en) | 1997-04-14 | 1997-04-14 | Optimized code debugging method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH10289123A JPH10289123A (en) | 1998-10-27 |
| JP3107151B2 true JP3107151B2 (en) | 2000-11-06 |
Family
ID=14571860
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP09111855A Expired - Fee Related JP3107151B2 (en) | 1997-04-14 | 1997-04-14 | Optimized code debugging method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3107151B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8370810B2 (en) | 2007-11-29 | 2013-02-05 | Kabushiki Kaisha Toshiba | Debugging device and debugging method |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4894362B2 (en) | 2006-06-09 | 2012-03-14 | 富士通株式会社 | Operation status monitoring program |
| JP2010049474A (en) * | 2008-08-21 | 2010-03-04 | Nec Corp | Program development support system and program development support method |
| JP5891976B2 (en) * | 2012-07-03 | 2016-03-23 | 富士通株式会社 | Compile execution / management method, apparatus, and program |
-
1997
- 1997-04-14 JP JP09111855A patent/JP3107151B2/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8370810B2 (en) | 2007-11-29 | 2013-02-05 | Kabushiki Kaisha Toshiba | Debugging device and debugging method |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH10289123A (en) | 1998-10-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0643851B1 (en) | Debugger program which includes correlation of computer program source code with optimized objet code | |
| US6305008B1 (en) | Automatic statement completion | |
| US6091896A (en) | Debugging optimized code using data change points | |
| US9141603B2 (en) | Computer program product and computer system for language-enhanced programming tools | |
| EP3336721B1 (en) | Method and system for generating a parser and parsing complex data | |
| US6189143B1 (en) | Method and system for reducing an intentional program tree represented by high-level computational constructs | |
| US8185878B2 (en) | Program maintenance support device, program maintenance supporting method, and program for the same | |
| JP4822817B2 (en) | Compilation system | |
| JPH08202545A (en) | Object-oriented system and method for generation of target language code | |
| EP1918812A1 (en) | A software development system | |
| JPS6375835A (en) | Apparatus for generating intended code, program, list and design document | |
| JPH02272645A (en) | Method for supporting program debugging | |
| US20130152061A1 (en) | Full fidelity parse tree for programming language processing | |
| US7607099B2 (en) | Method and system for reversible design tree transformations | |
| JP3494376B1 (en) | Program analysis device and program | |
| JP3107151B2 (en) | Optimized code debugging method | |
| CN114564195B (en) | A secondary development method of cloud CAD platform based on B/S architecture | |
| US20090064092A1 (en) | Visual programming language optimization | |
| CN117075874A (en) | SCADE model and C code mapping tool | |
| CN117407403A (en) | Data update method and device | |
| Snelting | Experiences with the PSG—Programming System Generator | |
| JPH11154093A (en) | Program Compiler and Recording Medium Recording Compiler Program | |
| JPH0954696A (en) | Program generation method and translator, compiler, and runtime library | |
| KR20240145753A (en) | System and method for coding education | |
| JP3370243B2 (en) | Compilation method and apparatus |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080908 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080908 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090908 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090908 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100908 Year of fee payment: 10 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100908 Year of fee payment: 10 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100908 Year of fee payment: 10 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110908 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110908 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120908 Year of fee payment: 12 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120908 Year of fee payment: 12 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130908 Year of fee payment: 13 |
|
| LAPS | Cancellation because of no payment of annual fees |