JPH03179535A - Debug supporting device - Google Patents

Debug supporting device

Info

Publication number
JPH03179535A
JPH03179535A JP1317566A JP31756689A JPH03179535A JP H03179535 A JPH03179535 A JP H03179535A JP 1317566 A JP1317566 A JP 1317566A JP 31756689 A JP31756689 A JP 31756689A JP H03179535 A JPH03179535 A JP H03179535A
Authority
JP
Japan
Prior art keywords
line
file
source code
code
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1317566A
Other languages
Japanese (ja)
Inventor
Satoru Koike
小池 哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP1317566A priority Critical patent/JPH03179535A/en
Publication of JPH03179535A publication Critical patent/JPH03179535A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To enable a machine code to use a source code debugger by gathering the ranges where the inversion occurs into a block and preventing the inversion of the correspondence between an optimized machine code and a source code. CONSTITUTION:A source code file 11 has an input to the front end processing part 21 of a language processing system 12, and an assembler source file 22 with the row information outputted from the part 21 has an input to an optimization processing part 23. The part 23 optimizes the file 22 and outputs an assembler source file 24 with the row information. An assembly processing part 25 inputs the file 24 and gathers plural source code rows into a block to output an object module file 26 including a block information entry. A link processing part 28 inputs plural files 26 and outputs a single load modulefile 13 to input it to a source code debugger 14. The file 11 is also inputted to the debugger 14, and the debugging operation is carried out via a man-machine interface terminal equipment 15.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はソフトウェア開発のデバッグ工程での支援ツー
ルであるソース・コード・レベルでのデバッグを可能に
するデバッグ支援装置に係わり、特にデバッグの対象と
なるプログラムのマシン・コードがコンパイラの最適化
処理を受けたマシン・コードの場合のデバッガとユーザ
の間で使用される実行ポイント情報を実現するためのデ
バッグ支援装置に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a debugging support device that enables debugging at the source code level, which is a support tool in the debugging process of software development. The present invention relates to a debugging support device for realizing execution point information used between a debugger and a user when the machine code of a program has been optimized by a compiler.

〔従来の技術〕[Conventional technology]

デバッグの対象となるプログラムのマシン・コードがコ
ンパイラの最適化処理を受けたマシン・コードの場合に
は、実行ポイント情報として従来からソース・コードの
行番号を使用していた。
When the machine code of a program to be debugged has undergone optimization processing by a compiler, line numbers of the source code have traditionally been used as execution point information.

このようなデバッグ支援装置には、次の3種類が存在し
た。
There were three types of such debugging support devices:

(1〉第1のデバッグ支援装置は、コンパイラで最適化
処理を行っていないマシン・コードニ対シてのみ適用さ
れるものである。この装置では、言語処理系が出力する
マシン・コードを収容するオブジェクト・モジュール・
ファイルとロード・モジュール・ファイル中に、ソース
・コードの行情報を有している。また、マシン・コード
生成処理部には、ソース・コード1行ごとに対応する複
数のマシン・コードに対してそのソース・コードの行番
号を付与して行情報を出力するための出力処理部を有し
ている。更に、ソース・コード・デバッガには、この行
情報を使用して実行ポイントの指定と表示を行う処理部
を有している。
(1> The first debugging support device is applicable only to machine code that has not been optimized by a compiler. This device accommodates the machine code output by the language processing system. Object module
The source code line information is contained in the file and load module file. In addition, the machine code generation processing section includes an output processing section that assigns line numbers of the source code to multiple machine codes corresponding to each line of source code and outputs line information. have. Furthermore, the source code debugger has a processing section that uses this line information to specify and display execution points.

この第1のデバッグ支援装置では、行で指定を行うと、
それに対応する複数の連続マシン・コードの先頭のマシ
ン・コードが指定され、任意のマシン・コードからそれ
が属するソース・コードの行を表示している。この装置
では、最適化処理を行っていないため、ソース・コード
の記述順序とマシン・コードの収容順は原則として一致
する。
In this first debug support device, if you specify by line,
The first machine code of a plurality of corresponding consecutive machine codes is specified, and the line of source code to which it belongs is displayed from any machine code. Since this device does not perform optimization processing, the order in which the source code is written and the order in which the machine code is stored are, in principle, the same.

このため、ユーザはソース・コード・レベルの思考でデ
バッグを行うことができる。
Therefore, the user can debug at the source code level.

(2〉第2のデバッグ支援装置は、コンパイラの最適化
処理を受けたマシン・コードに対して適用される装置で
ある。この装置では、第1のデバッグ支援装置と同様に
オブジェクト・モジュール・ファイルとロード・モジュ
ール・ファイル中に、ソース・コードの行情報を有して
いる。また、言語処理系において最適化処理を実行する
前にすべてのマシン・コードに対して対応するソース・
コードの行番号を付与してから最適化処理を行い、マシ
ン・コードの移動、削除、変更等を行って、この結果の
マシン・コードの収容順にその行情報を出力するように
した出力処理部を有している。
(2> The second debug support device is a device that is applied to machine code that has undergone compiler optimization processing. In this device, like the first debug support device, the object module file In addition, the source code line information is included in the load module file.Also, before the language processing system performs optimization processing, the corresponding source code is created for all machine code.
An output processing unit that assigns code line numbers, performs optimization processing, moves, deletes, changes, etc. the machine code, and outputs the line information in the order in which the resulting machine code is accommodated. have.

また、ソース・コード・デバッガには、この行情報を使
用して実行ポイントの指定と表示を行う処理部を有して
いる。
The source code debugger also has a processing unit that uses this line information to specify and display execution points.

この第2のデバッグ支援装置では、行で指定を行うとそ
れに対応する複数の不連続マシン・コードのうちの最初
のマシン・コードが指定され、任意のマシン・コードか
ら対応するソース・コードの行を表示するようになって
いる。この装置については、例えば’An Overv
iew of the PL、8Compiler、 
 Marc Au5lander and 1Jart
in11opkins、 1B!J T、 J、 Wa
tson Re5earch Centerに記載があ
る。
In this second debugging support device, when a line specification is made, the first machine code among a plurality of corresponding discontinuous machine codes is specified, and the corresponding source code line is extracted from any machine code. is now displayed. For this device, for example 'An Overv
iew of the PL, 8Compiler,
Marc Au5lander and 1Jart
in11opkins, 1B! JT, J, Wa
There is a description in tson Research Center.

(3)第3のデバッグ支援装置は、第2のデバッグ支援
装置と同様にコンパイラの最適化処理を受けたマシン・
コードに対して適用される装置である。この装置では、
第1のデバッグ支援装置と同様にオブジェクト・モジュ
ール・ファイルとロード・モジュール・ファイル中に、
ソース・コードの行情報を有している。また、言語処理
系において最適化処理を実行する前に、ソース・コード
1行ごとに対応する複数のマシン・コードの最初のマシ
ン・コードの前の位置にそのソース・コードの行番号情
報を置いてから最適化処理を行う。また、マシン・コー
ドの移動、削除、変更等を行うとき行番号情報を置いた
位置を変えないで行う。
(3) The third debug support device is a machine that has undergone compiler optimization processing in the same way as the second debug support device.
It is a device applied to the code. With this device,
Similarly to the first debug support device, in the object module file and load module file,
Contains source code line information. Also, before executing optimization processing in the language processing system, the line number information of the source code is placed in the position before the first machine code of the multiple machine codes corresponding to each line of source code. After that, perform optimization processing. Also, when moving, deleting, changing, etc. the machine code, it is done without changing the position where the line number information is placed.

この結果として行番号情報を置いた位置の間に挟まれる
複数のマシン・コードに対しては、その前にある行番号
情報の行番号を付与する。間に挟まれる複数のマシン・
コードが1個も存在してないときには、この対の後の行
番号情報とその次の行番号情報を置いた位置の間に挟ま
れる複数のマシン・コードに対してその前にある行番号
情報と、その1つ前の行番号情報の行番号2個を付与す
る。
As a result, the line number of the previous line number information is assigned to a plurality of machine codes sandwiched between the positions where the line number information is placed. Multiple machines caught in between
If no code exists, the line number information that precedes the multiple machine codes that are sandwiched between the line number information after this pair and the position where the next line number information is placed. and the two line numbers of the previous line number information are assigned.

更に、間に挟まれる複数のマシン・コードがない行番号
情報の位置が続く場合には、その後にある複数のマシン
・コードに対してその前の連続して間にマシン・コード
のない行番号情報の行番号を複数個付与する。そして、
行番号情報を置いた数だけ置いた順にその行番号とその
行番号を付与した複数のマシン・コードの先頭のマシン
・コードに対応させた行情報を出力するようにした出力
処理部を有している。また、ソース・コード・デバッガ
にこの行情報を使用して実行ポイントの指定と表示を行
う処理部を有している。
Furthermore, if the position of line number information with no intervening machine code is consecutive, the previous consecutive line number with no intervening machine code will be used for the subsequent multiple machine codes. Assign multiple line numbers to the information. and,
It has an output processing unit that outputs the line number and line information corresponding to the first machine code of a plurality of machine codes to which the line number is assigned in the order in which the line number information is placed. ing. The source code debugger also has a processing section that uses this line information to specify and display execution points.

この第3のデバッグ支援装置では、行で指定を行うとそ
の行の行情報のマシン・コードが指定され、任意のマシ
ン・コードから対応する複数個の行番号の最も大きな行
を表示する。この装置については、例えば°’DOC:
 A Practical Approach t。
In this third debugging support device, when a line is specified, the machine code of the line information of that line is specified, and the line with the largest corresponding line number from the arbitrary machine code is displayed. For this device, for example °'DOC:
A Practical Approach.

5ource−Level  Debugging  
of  G!obally  0pti+n+zedC
ode、  Deborah S、Coutant、 
 Sue Meloy。
5source-Level Debugging
of G! obally 0pti+n+zedC
ode, Deborah S., Coutant,
Sue Meloy.

Michelle Ru5cetta、 Hewlet
t−Packard に記載がある。
Michelle Ru5cetta, Hewlett
It is described in t-Packard.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

このうち第1のデバッグ支援装置では、最適化処理を行
ったマシン・コードに対してはソース・コード・デバッ
ガを使用することができないという問題がある。
The first debugging support device has a problem in that a source code debugger cannot be used for machine code that has undergone optimization processing.

また、第2のデバッグ支援装置では、最適化されたマシ
ン・コード対応でソース・コードの行に変換される。し
たがって、あるソース・コードの行が複数のマシン・コ
ードに展開され、それらが別の行のマシン・コードをま
たいで分離された位置に置かれた場合には、種々の問題
が生じる。すなわちマシン・コードの実行に合わせて対
応するソース・コードヲ表示スると、ソース・コード・
レベルの思考では一度実行すれば良い行の実行が複数回
実行されたり、ソース・コードとマシン・コードの対応
で順序性について反転が起きている場合、マシン・コー
ドの実行に合わせて対応するソース・コードヲ表示する
と、ソース・コード・レベルの思考では先に実行すべき
行の実行が後から実行されるという問題が発生する。
Further, in the second debugging support device, the lines are converted into lines of source code in accordance with the optimized machine code. Accordingly, various problems arise when a line of source code is expanded into multiple machine codes that are placed in separate locations across different lines of machine code. In other words, when the corresponding source code is displayed as the machine code is executed, the source code
In level thinking, when a line that should be executed once is executed multiple times, or when the correspondence between source code and machine code is reversed in terms of order, the corresponding source code is - When displaying code, a problem arises in that lines that should be executed first are executed later when thinking at the source code level.

更に、第3のデバッグ支援装置では、最適化を行う前の
ソース・コードの行に対応する行情報を置く位置を固定
化しマシン・コードの移動や削除等を行っている。この
ため、行情報での指定や表示では正しくソース・コード
とマシン・コードが対応していない場合が多いという問
題がある。
Further, in the third debugging support device, the position where line information corresponding to the source code line before optimization is placed is fixed, and the machine code is moved or deleted. For this reason, there is a problem in that the source code and machine code often do not correspond correctly when specifying or displaying line information.

そこで本発明の目的は、最適化処理を行ったマシン・コ
ードに対してソース・コード・デバッガを使用すること
ができ、しかも行の実行回数や順序が乱れス、またソー
ス・コードとマシン・コードが正しく対応するデバッグ
支援装置を提供することにある。
Therefore, an object of the present invention is to make it possible to use a source code debugger on machine code that has been subjected to optimization processing, and to avoid problems such as the number of executions of lines, irregularities in the order of lines, and source code and machine code. The purpose of the present invention is to provide a debugging support device that correctly handles the problem.

〔課題を解決するための手段〕[Means to solve the problem]

本発明では、(i)言語処理系のコンパイラ最適化処理
部に設けられ、マシン・コード単位にソース・コードの
行情報を付与する行情報付与手段と、(11)言語処理
系のマシン・コード生成処理部に設けられ、ソース・コ
ードとマシン・コードの対応で順序性について反転の起
きる範囲の複数行をまとめて1つのブロックとするブロ
ック情報の出力処理手段と、(iii )ソース・コー
ド・デバッガにこのブロック情報を使用して実行ポイン
トの指定と表示を行う処理部とをデバッグ支援装置に具
備させる。
In the present invention, (i) a line information adding means provided in a compiler optimization processing section of a language processing system and adding source code line information to each machine code unit; (iii) a block information output processing means provided in the generation processing unit, which collects a plurality of lines in a range where the ordering is reversed in the correspondence between the source code and the machine code into one block; The debugging support device is equipped with a processing unit that specifies and displays an execution point using this block information in the debugger.

そして、反転が発生する範囲をブロックという概念でま
とめ、上述した目的を達成する。
Then, the range in which the inversion occurs is summarized using the concept of a block, and the above-mentioned purpose is achieved.

〔実施例〕〔Example〕

以下、実施例につき本発明の詳細な説明する。 Hereinafter, the present invention will be described in detail with reference to Examples.

第1図は本発明の一実施例におけるデバッグ支援装置の
構成を表わしたものである。このデバッグ支援装置は、
ソース・コード・ファイル11を人力する言語処理系1
2と、この言語処理系12から出力されるロード・モジ
ュール・ファイル13と前記したソース・コード・ファ
イル11を入カスるソース・コード・デバッガ14と、
ソース・コード・デバッガ14に接続されたマン・マシ
ン・インターフェース端末装置15とによって構成され
ている。マン・マシン・インターフェース端末装置15
は、デバッグを行う際の使用者16の指示を入力したり
、必要なデータを出力するための装置である。
FIG. 1 shows the configuration of a debugging support device in an embodiment of the present invention. This debug support device is
Language processing system 1 that manually creates source code files 11
2, a source code debugger 14 into which the load module file 13 output from the language processing system 12 and the source code file 11 described above are input;
A human-machine interface terminal device 15 is connected to a source code debugger 14. Man-machine interface terminal device 15
is a device for inputting instructions from the user 16 and outputting necessary data when debugging.

言語処理系12には、言語の種別ごとに用意されたフロ
ント・エンド・処理部21が配置されている。フロント
・エンド・処理部21から出力される行情報付アセンブ
ラ・ソース・ファイル22は最適化処理部23に入力さ
れるようになっている。最適化処理部23はこれを変更
して行情報付アセンブラ・ソース・ファイル24を出力
する。
The language processing system 12 includes front end processing units 21 prepared for each type of language. An assembler source file 22 with line information outputted from the front end processing section 21 is input to an optimization processing section 23 . The optimization processing unit 23 changes this and outputs an assembler source file 24 with line information.

アセンブル処理部25は、このアセンブラ・ソース・フ
ァイル24を入力してブロック情報エントリを含んだオ
ブジェクト・モジュール・ファイル26を出力する。リ
ンク処理部28は複数のオブジェクト・モジュール・フ
ァイル26を人力して1本のロード・モジュール・ファ
イル13を出力するようになっている。
The assemble processing unit 25 inputs this assembler source file 24 and outputs an object module file 26 containing block information entries. The link processing unit 28 manually processes a plurality of object module files 26 and outputs one load module file 13.

第2図は、このような構成のデバッグ支援装置のソース
・コード・ファイルの一部分の内容を表わしたものであ
る。ソース・コード・ファイル11の第2図で示した部
分としての第10行から第12行にはそれぞれ実行文が
記載されている。
FIG. 2 shows the contents of a portion of the source code file of the debug support device having such a configuration. Executable statements are written in the 10th to 12th lines of the source code file 11 as shown in FIG. 2, respectively.

ソース・コード・ファイル11は、言語処理系12に人
力されフロント・エンド・処理!!21を経て行情報付
アセンブラ・ソース・ファイル22となる。
The source code file 11 is manually input to the language processing system 12 for front-end processing! ! 21, it becomes an assembler source file 22 with line information.

第3図は、この行情報付アセンブラ・ソース・ファイル
の一部の内容として第2図に対応する部分を表わしたも
のである。最適化前の行情報付アセンブラ・ソース・フ
ァイル22では、第2図で示、した実行文が行情報付き
で展開されていることがわかる。すなわち第10行から
第12行の各行では、最初に行情報アセンブラ仮想命令
があり、1行の実行文が複数のアセンブラ命令に展開さ
れている。各行の展開順序は、ソース・コード・ファイ
ル11の行の順序である。
FIG. 3 shows a portion corresponding to FIG. 2 as part of the contents of this assembler source file with line information. It can be seen that in the assembler source file 22 with line information before optimization, the executable statement shown in FIG. 2 is expanded with line information. That is, in each line from the 10th line to the 12th line, there is a line information assembler virtual instruction at the beginning, and one line of executable statement is expanded into a plurality of assembler instructions. The expansion order of each line is the order of the lines in the source code file 11.

第4図は、最適化処理部で処理した後の行情報付アセン
ブラ・ソース・ファイルの一部分の内容を表わしたもの
である。第3図に示した行情報付アセンブラ・ソース・
ファイル22が最適化処理部23によって最適化処理を
受けて、命令の移動や削除が行われたことがわかる。す
なわち、同一行から展開されたアセンブラ命令が続く場
合以外には、アセンブラ命令ごとにその前に行情報アセ
ンブラ仮想命令が配置されている。また、同一行から展
開されたアセンブラ命令の途中に別の行のアセンブラ命
令が入るような移動があったり、ソース・コード・ファ
イル11の行順番と展開後のアセンブラ命令での対応行
の関係が反転したりしている。
FIG. 4 shows the contents of a portion of the assembler source file with line information after being processed by the optimization processing section. Assembler source with line information shown in Figure 3
It can be seen that the file 22 has been subjected to optimization processing by the optimization processing unit 23, and instructions have been moved or deleted. That is, unless an assembler instruction expanded from the same line follows, a line information assembler virtual instruction is placed before each assembler instruction. In addition, there may be a shift such that an assembler instruction on another line is inserted in the middle of an assembler instruction expanded from the same line, or the relationship between the line order of the source code file 11 and the corresponding line in the expanded assembler instruction may be incorrect. It's reversed.

第5図は、アセンブル処理部で処理した後のオブジェク
ト・モジュール・ファイルやロード・モジュール・ファ
イルの行情報部の一部分の内容を表わしたものである。
FIG. 5 shows the contents of a portion of the line information section of the object module file and load module file after being processed by the assembler.

第4図で示した範囲のアセンブラ命令群が1つのブロッ
クを構成していることが示されている。
It is shown that the assembler instruction group in the range shown in FIG. 4 constitutes one block.

すなわち、第4図のアセンブラ・ソース・ファイル24
における第12行のアセンブラ命令2よりも前には、ソ
ース・コード・ファイル11の第9行より老番の行から
展開されるアセンブラ命令はなく、第4図の第10行の
アセンブラ命令2より後には第13行より若番の行から
展開されるアセンブラ命令はない。また、第10行から
第12行までのソース・コード・ファイル11の行かe
展開されるアセンブラ命令群が対応行の関係で反転して
いる場合、ブロック情報エントリを第10行から第12
行に関する行情報エン) IJ群の前に配置している。
That is, assembler source file 24 in FIG.
Before assembler instruction 2 on line 12 in the source code file 11, there is no assembler instruction that is expanded from a line older than line 9 of source code file 11, and assembler instruction 2 on line 10 in FIG. After that, there are no assembler instructions that are expanded from lines smaller than the 13th line. Also, line e of source code file 11 from line 10 to line 12
If the assembler instructions to be expanded are reversed due to the relationship between corresponding lines, the block information entry is changed from the 10th line to the 12th line.
Line information related to the line) It is placed before the IJ group.

このエントリには、開始行、終了行および次ブロツク情
報エントリへのリンクの3項目がある。また、ブロック
を構成する行情報エントリは、行情報アセンブラ仮想命
令ごとに生成されていて、行番号を入れる項目とその仮
想命令のすぐ後に続くアセンブラ命令の実行ロケーショ
ンを示すプログラム・カウンク値(PC)の値を入れる
項目から成ることが示されている。
This entry has three items: a start line, an end line, and a link to the next block information entry. In addition, the line information entry that constitutes a block is generated for each line information assembler virtual instruction, and includes an item containing the line number and a program count value (PC) that indicates the execution location of the assembler instruction immediately following the virtual instruction. It is shown that it consists of items that contain the values of .

第6図Aは、第1図に示したマン・マシン・インターフ
ェース端末装置の表示状態の一例を示している。この例
では、マン・マシン・インターフェース端末装置15の
端末画面31にソース・コード・ファイル11の第11
行目にデバッグのためのブレーク・ポイントを設定する
ときの表示が行われている。マシン・コードは第4図の
アセンブラ命令からできており、第6図Bに示す通りと
なる。同図へに示す表示状態では、ソース・コード・フ
ァイル11の第11行が白黒反転表示されて該当行が指
定されている。この指定によって、該当行の属するブロ
ックの先頭の命令が設定ポイントになる。この例では、
第6図Bに示すように第12行の命令2が設定ポイント
になる。
FIG. 6A shows an example of a display state of the man-machine interface terminal device shown in FIG. In this example, the 11th page of the source code file 11 is displayed on the terminal screen 31 of the man-machine interface terminal device 15.
The display when setting a break point for debugging is shown on line 1. The machine code is made up of the assembler instructions shown in FIG. 4 and is as shown in FIG. 6B. In the display state shown in the figure, the 11th line of the source code file 11 is displayed in reverse black and white to designate the corresponding line. With this specification, the first instruction of the block to which the relevant line belongs becomes the setting point. In this example,
As shown in FIG. 6B, instruction 2 on the 12th line becomes the setting point.

第7図は、第6図と同様に第1図に示したマン・マシン
・インターフェース端末装置の表示状態の一例を示して
いる。この例では、マン・マシン・インターフェース端
末装置15の端末画面31にマシン・コードで停止した
場合の停止ポイントの表示が行われている。マシン・コ
ードは同様に第4図のアセンブラ命令からできており、
第7図Bに示す通りとなる。このようにある命令で停止
すると、その命令の属するブロックの対応するソース・
コード・ファイルの連続複数行が白黒反転を行って停止
ブロックを表示するようになっている。
Similar to FIG. 6, FIG. 7 shows an example of the display state of the man-machine interface terminal device shown in FIG. In this example, the stop point when the machine code is used to stop is displayed on the terminal screen 31 of the man-machine interface terminal device 15. The machine code is also made up of assembler instructions in Figure 4,
The result is as shown in FIG. 7B. If you stop at a certain instruction in this way, the corresponding source code of the block to which that instruction belongs
Consecutive lines of the code file are inverted in black and white to indicate stopped blocks.

第8図は、最適化処理部の入力処理部の処理を表わした
ものである。第1図に示した最適化処理部23における
人力部は、マシン・コード単位ニソース・コードの行情
報を引き継ぐ処理の前段処理を行う。ここでは、行情報
アセンブラ仮想命令が入力するたびに行番号ワーク(メ
モリ)41にその行番号値を設定する。中間コード・エ
ントリ42は中間コード設定項目43と行番号設定項目
44とがあり、アセンブラ命令が入力するたびにこれを
中間コードに変換して中間コード設定項目43に設定す
る。そして、このときの行番号ワーク41の値が行番号
設定項目44に設定され、中間コードファイルが作成さ
れる。
FIG. 8 shows the processing of the input processing section of the optimization processing section. The human power section in the optimization processing section 23 shown in FIG. 1 performs the pre-processing of the process of inheriting the line information of the source code of the machine code unit. Here, each time a line information assembler virtual command is input, the line number value is set in the line number work (memory) 41. The intermediate code entry 42 has an intermediate code setting item 43 and a line number setting item 44, and each time an assembler instruction is input, this is converted into an intermediate code and set in the intermediate code setting item 43. Then, the value of the line number work 41 at this time is set in the line number setting item 44, and an intermediate code file is created.

第9図は、第8図に示した最適化処理部の人力処理部の
処理動作の流れを表わしたものである。
FIG. 9 shows the flow of processing operations of the human processing section of the optimization processing section shown in FIG. 8.

行番号ワークはまず初期化され(第9図ステップの〉、
1命令が入力されたら(ステップ■〉、それが行情報ア
センブラ仮想命令であるか否かが判別される(ステップ
■)。行情報アセンブラ仮想命令であれば(Y)、行番
号ワーク41にその行番号値を設定する(ステップ■)
。そして、ステップ■に戻る。
The line number work is first initialized (step in Figure 9),
When one instruction is input (step ■), it is determined whether or not it is a line information assembler virtual instruction (step ■). If it is a line information assembler virtual instruction (Y), the line number work 41 contains that instruction. Set the line number value (step ■)
. Then, return to step ■.

行情報アセンブラ仮想命令でなければ(ステップ■;N
)、その行のアセンブラ命令なので中間コード設定項目
43と行番号設定項目44を中間コードに変換する(ス
テップ■)。そして、行番号ワークが初期化状態である
かどうかの判別を行う(ステップ■)。初期化状態であ
れば、変換した中間コードをそのまま出力して(ステッ
プ■〉、ステップ■に戻る。初期化状態でなければ、中
間コードに行番号を付加しくステップ■〉、これを出力
して(ステップ■)、ステップ■に戻る。
If it is not a line information assembler virtual instruction (step ■; N
), the line is an assembler instruction, so the intermediate code setting item 43 and line number setting item 44 are converted into intermediate code (step 2). Then, it is determined whether or not the line number work is in an initialized state (step ■). If it is in the initialized state, output the converted intermediate code as it is (step ■>, and return to step ■. If it is not in the initialized state, add a line number to the intermediate code and output it). (Step ■), return to Step ■.

第10図は、最適化処理部の出力処理部の処理を表わし
たものである。最適化処理部23の出力部は、マシン・
コード単位にソース・コードの行情報を引き継ぐ処理の
後段処理を行う。ここでは、行番号ワーク(メモリ)5
1が最初に1回“0”に初期的にクリアされる。そして
、中間コード・エントリ52が入力するたびにその行番
号設定項目53と行番号ワーク51の値が比較され、不
一致の場合には行番号設定項目53の値が行番号ワーク
51に格納される。この行番号ワーク51の値から行情
報アセンブラ仮想命令が出力される。
FIG. 10 shows the processing of the output processing section of the optimization processing section. The output section of the optimization processing section 23 is a machine/
Performs the subsequent processing of inheriting source code line information on a code-by-code basis. Here, line number work (memory) 5
1 is initially cleared to "0" once. Each time an intermediate code entry 52 is input, the values of the line number setting item 53 and the line number work 51 are compared, and if they do not match, the value of the line number setting item 53 is stored in the line number work 51. A line information assembler virtual instruction is output from the value of this line number work 51.

また、比較結果の一致、不一致を問わず、中間コード・
エントリ52の中間コード設定項目54の値からアセン
ブラ命令に変換が行われ、出力される。
In addition, regardless of whether the comparison results match or do not match, the intermediate code
The value of the intermediate code setting item 54 of the entry 52 is converted into assembler instructions and output.

第11図は、第10図に示した最適化処理部の出力処理
部の処理動作の流れを表わしたものである。行番号ワー
クがまず初期化され〈第11図ステップ■)、中間コー
ド・エントリが入力されたら(ステップ■〉、行番号設
定項目53と行番号ワーク51の値が比較される(ステ
ップ■)。そして、これが一致している場合には中間コ
ード・エントリ52の中間コード設定項目54の値から
アセンブラ命令に変換が行われ、これが出力されて(ス
テップ■)、ステップ■に戻る。比較結果が不一致の場
合には、行番号設定項目53の値が行番号ワーク51に
格納される(ステップ■〉。
FIG. 11 shows the flow of processing operations of the output processing section of the optimization processing section shown in FIG. 10. The line number work is first initialized (step ■ in FIG. 11), and when an intermediate code entry is input (step ■), the values of the line number setting item 53 and the line number work 51 are compared (step ■). If they match, the value of the intermediate code setting item 54 of the intermediate code entry 52 is converted to an assembler instruction, this is output (step ■), and the process returns to step ■.The comparison result does not match. In this case, the value of the line number setting item 53 is stored in the line number work 51 (step ■).

そして、この行番号ワーク51の値から行情報アセンブ
ラ仮想命令が出力され(ステップ■〉、この後ステップ
■に進む。
Then, a line information assembler virtual instruction is output from the value of this line number work 51 (step ≦), and the process then proceeds to step ①.

第12図は、第1図に示したアセンブル処理部における
ブロック情報エントリと行情報エントリの出力処理の様
子を表わしたものである。アセンブル処理部25では、
複数の連続マシン・コードに対応する複数のソース・コ
ード行をブロックとしてまとめるブロック情報エントリ
の処理と、行情報エン) +7の出力処理を行っている
。このために、ブロックの後尾行情報エントリのインデ
ックス値MAXとして、開始インデックス値の入った変
数5TARTを入力しく第12図ステップ■)、ブロッ
クの先頭行情報エントリのインテ・ンクス値FROMと
しても開始インデックス値の入った変数5TARTを入
力する(ステップ■)。
FIG. 12 shows the output processing of block information entries and line information entries in the assembler shown in FIG. 1. In the assemble processing section 25,
It performs block information entry processing in which multiple source code lines corresponding to multiple continuous machine codes are grouped together as a block, and output processing of line information (en) +7. For this purpose, input the variable 5TART containing the start index value as the index value MAX of the trailing row information entry of the block. Input the variable 5TART containing the value (step ■).

ところで、第13図は行情報エントリ・テーブルにおけ
る最適化処理単位に対応する範囲を示したものである。
By the way, FIG. 13 shows the range corresponding to the optimization processing unit in the row information entry table.

この行情報エントリ・テーブル61には、インデックス
値mからインデックス値nまでの範囲に最適化処理単位
に対応する行情報エントリが格納されている。この場合
、第14図に示すように変数5TARTのインデックス
値は“m”となり、変数ENDのインデックス値はn”
となる。
This row information entry table 61 stores row information entries corresponding to optimization processing units in the range from index value m to index value n. In this case, as shown in FIG. 14, the index value of variable 5TART is "m", and the index value of variable END is "n".
becomes.

第12図に戻って説明を続ける。ステ・ノブ■では変数
FROMが変数END以下であるか否かの判別が行われ
る。以下であれば(Y〉、反転基準となる行番号が入っ
ている行情報エン) IJのインデックス値IXに変数
FROMをセットする(ステップ■)。そして、インデ
ックス値Ixが、ブロックの後尾行情報エントリのイン
デックス値MAX以下であるか否かが判別され(ステッ
プ■〉、以下であれば(Y)、インデックス(11Xの
行番号をキーとしてインデックス値IXと変数END間
で反転するエン) IJのインデックスの最大のものを
検出する(ステップ■)。この検出が行われ、かつこれ
がインデックス値MAXより大きければ〈ステップ■;
Y〉、インデックス値MAXとして検出したインデック
ス値を人力する(ステップ■)。そして、インデックス
イ直IXを“l”だ(す加算して(ステップ■)、ステ
ップ■に進む。ステップ■でこれ以外の場合にはステッ
プ■に進んでインデックス値IXを“l”だけ加算し、
ステップ■に進むことになる。
Returning to FIG. 12, the explanation will be continued. At step knob ■, it is determined whether the variable FROM is less than or equal to the variable END. If it is below (Y>, line information containing the line number serving as the inversion reference), set the variable FROM to the index value IX of IJ (step ■). Then, it is determined whether the index value Ix is less than or equal to the index value MAX of the trailing row information entry of the block (step ■), and if it is less than (Y), the index value Ix is EN inverted between IX and variable END) Detect the maximum index of IJ (step ■). If this detection is performed and this is greater than the index value MAX, <step ■;
Y>, manually input the detected index value as the index value MAX (step ■). Then, add "l" to the index value IX (step ■), and proceed to step ■.If the case is other than this in step ■, proceed to step ■, and add "l" to the index value IX. ,
We will proceed to step ■.

また、ステップ■でインデックス1直IXが、ブロック
の後尾行情報エントリのインデックス値MAXよりも大
きな場合には(N)、変数FROMからインデックス値
MAXのエントリでブロックを作威し、ブロック情報エ
ントリ、行情報エントリ群を出力する(ステップ0)。
In addition, if the index 1 direct IX is larger than the index value MAX of the trailing row information entry of the block in step (2) (N), a block is created from the variable FROM with the entry of the index value MAX, and the block information entry, A group of row information entries is output (step 0).

そして、変数FROMにインデックス値MAXよりも“
1”多い数値を入力して(ステップ■〉、ステップ■に
進むことになる。
Then, the variable FROM is set to “
Enter a value that is 1” higher (step ■) and proceed to step ■.

第15図は、第1図に示したソース・コード・デバッガ
の実行ポイントの表示を行うための開始行と終了行を求
める処理を表わしたものである。
FIG. 15 shows the process of determining the start line and end line for displaying the execution point of the source code debugger shown in FIG.

プログラム・カウンタ値が入力されると、この入力PC
値より行情報エントリが抽出される(第15図ステップ
の)。そして、抽出された行情報エントリよりブロック
情報エントリが抽出され(ステップ■〉、このブロック
情報エントリから開始行と終了行が出力されることにな
る(ステップ■〉。
When the program counter value is entered, this input PC
A row information entry is extracted from the value (step in FIG. 15). Then, a block information entry is extracted from the extracted line information entries (step ■), and a start line and an end line are output from this block information entry (step ■).

第16図はロード・モジュール・ファイルの行情報部の
一部を表わしたものである。この図に示したように行情
報B71において人力PC値より行情報エントリが抽出
され、これを基にブロック情報エントリが抽出されるこ
とがわかる。
FIG. 16 shows a part of the line information section of the load module file. As shown in this figure, it can be seen that in the row information B71, the row information entry is extracted from the human PC value, and the block information entry is extracted based on this.

第17図は該当するブロックの先頭のプログラム・カウ
ンタを求めるための処理を表わしたものである。行番号
が入力されると、これを基にしてブロック情報エントリ
が抽出される(第17図ステップ■〉。そして、抽出ブ
ロックエントリ直後の行情報エントリが抽出される(ス
テップ■)。
FIG. 17 shows the process for finding the program counter at the beginning of the corresponding block. When a line number is input, a block information entry is extracted based on this (step 2 in FIG. 17).Then, a line information entry immediately after the extracted block entry is extracted (step 2).

この抽出された行情報エントリのプログラム・カウンタ
値が出力されることになる。
The program counter value of this extracted line information entry will be output.

第18図はロード・モジュール・ファイルの行情報部の
一部を表わしたものである。人力された行番号は開始行
と終了行の間なので、これを基にしてブロック情報エン
トリがまず抽出され、続いて行情報エン) IJが抽出
されることがわかる。
FIG. 18 shows a part of the line information section of the load module file. Since the manually entered line number is between the start line and the end line, it can be seen that the block information entry is first extracted based on this, and then the line information (IJ) is extracted.

第19図は行情報アセンブラ・ソース・ファイル22を
最適化処理部23を経ずに直接アセンブル処理部25で
処理した場合のオブジェクト・モジュール・ファイルや
ロード・モジュール・ファイルの行情報部の一部分の内
容を表わしたものである。第3図で示した範囲のアセン
ブラ命令群に対応し、lブロック1行対応で構成される
ことを示している。
FIG. 19 shows a part of the line information portion of an object module file or a load module file when the line information assembler source file 22 is processed directly by the assemble processing section 25 without going through the optimization processing section 23. It represents the content. It corresponds to a group of assembler instructions in the range shown in FIG. 3, and is composed of l blocks corresponding to one line.

〔発明の効果〕 以上説明したように、本発明によれば反転が発生する範
囲をブロックという概念でまとめたので、言語処理系の
最適化処理を受けたマシン・コードとソース・コードを
対応させる際に、このブロックに関しては対応に反転が
生じない。このため、ブロックを単位としてソース・コ
ード・レベルで思考し、デバッグができるという効果が
ある。
[Effects of the Invention] As explained above, according to the present invention, the range in which inversion occurs is summarized by the concept of a block, so that the machine code that has been optimized by the language processing system and the source code can be made to correspond. In this case, no reversal occurs in the correspondence for this block. Therefore, it is possible to think and debug blocks at the source code level.

更に、ブロック単位ではデバッグが困難な場合、その該
当するソース・ファイルだけ最適化処理をしないことに
より、1ブロック1行対応、すなわち1行ごとに制御で
きるデバッグもできるという効果がある。
Furthermore, when debugging is difficult in block units, by not optimizing only the relevant source file, it is possible to perform debugging that can be controlled on a line-by-line basis, that is, on a line-by-line basis.

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

図面は本発明の一実施例を説明するためのもので、この
うち第1図はデバッグ支援装置の構成の概要を表わした
概略構成図、第2図はソース・コード・ファイルの一部
分の内容を表わした説明図、第3図は行情報付アセンブ
ラ・ソース・ファイルの一部の内容を表わした説明図、
第4図は最適化処理部で処理した後の行情報付アセンブ
ラ・ソース・ファイルの一部分の内容を表わした説明図
、第5図はアセンブル処理部で処理した後のオブジェク
ト・モジュール・ファイルやロード・モジュール・ファ
イルの行情報部の一部分の内容を表わした説明図、第6
図Aは、第1図に示したマン・マシン・インターフェー
ス端末装置の表示状態の一例を示す正面図、第6図Bは
同図Aに示した表示状態におけるマシン・コードでの設
定ポイントを示す説明図、第7図Aはマン・マシン・イ
ンターフェース端末装置の表示状態の他の例を示す正面
図、第7図Bは同図Aに示した表示状態におけるマシン
・コードでの停止ポイントを示す説明図゛、第8図は最
適化処理部の人力処理部の処理を表わした説明図、第9
図は第8図に示した最適化処理部の人力処理部の処理動
作の流れを表わした流れ図、第10図は最適化処理部の
出力処理部の処理を表わした説明図、第11図は第10
図に示した最適化処理部の出力処理部の処理動作の流れ
を表わした流れ図、第12図はアセンブル処理部におけ
るブロック情報エントリと行情報エントリの出力処理の
様子を表わした流れ図、第13図は行情報エントリ・テ
ーブルにおける最適化処理単位に対応する範囲を示した
説明図、第14図は変数5TARTと変数ENDのイン
デックス値の一例を示す説明図、第15図はソース・コ
ード・デバッガの実行ポイントの表示を行うための開始
行と終了行を求める処理を表わした流れ図、第16図は
ロード・モジュール・ファイルの行情報部の一部を表わ
した説明図、第17図は該当するブロックの先頭のプロ
グラム・カウンタを求めるための処理を表わした流れ図
、第18図はロード・モジュール・ファイルの行情報部
の一部を表わした説明図、第19図は最適化処理をして
いない場合のオブジェクト・モジュール・ファイルやロ
ード・モジュール・ファイルの行情報部の一部分の内容
を表わした説明図である。 11・・・・・・ソース・コード・ファイル、12・・
・・・・言語処理系、 13・・・・・・ロード・モジュー・ル・ファイル、1
4・・・・・・ソース・コード・デバッガ、15・・・
・・・マン・マシン・インターフェース端末装置、 21・・・・・・フロント・エンド・処理部、22・・
・・・・行情報付アセンブラ・ソース・ファイル、 23・・・・・・最適化処理部、 24・・・・・・行情報付アセンブラ・ソース・ファイ
ル、 25・・・・・・アセンブル処理部、 26・・・・・・オブジェクト・モジュール・ファイル
、28・・・・・・リンク処理部、31・・・・・・端
末画面、71・・・・・・行情報部。
The drawings are for explaining one embodiment of the present invention. Among them, Fig. 1 is a schematic configuration diagram showing the outline of the configuration of the debugging support device, and Fig. 2 shows the contents of a part of the source code file. Figure 3 is an explanatory diagram showing part of the contents of an assembler source file with line information.
Figure 4 is an explanatory diagram showing the contents of a portion of the assembler source file with line information after processing by the optimization processing unit, and Figure 5 shows the object module file and load after processing by the assembly processing unit.・Explanatory diagram showing the contents of a part of the line information section of the module file, Part 6
Figure A is a front view showing an example of the display state of the man-machine interface terminal device shown in Figure 1, and Figure 6B shows setting points in the machine code in the display state shown in Figure A. Explanatory drawings, FIG. 7A is a front view showing another example of the display state of the man-machine interface terminal device, and FIG. 7B shows stopping points in the machine code in the display state shown in FIG. 7A. Explanatory diagram ゛, Figure 8 is an explanatory diagram showing the processing of the human processing unit of the optimization processing unit, Figure 9
The figure is a flowchart showing the flow of processing operations of the human processing unit of the optimization processing unit shown in Fig. 8, Fig. 10 is an explanatory diagram showing the processing of the output processing unit of the optimization processing unit, and Fig. 11 is 10th
FIG. 12 is a flowchart showing the flow of processing operations of the output processing section of the optimization processing section shown in the figure. FIG. 12 is a flowchart showing the output processing of block information entries and line information entries in the assembling processing section. is an explanatory diagram showing the range corresponding to the optimization processing unit in the row information entry table, Fig. 14 is an explanatory diagram showing an example of the index value of variable 5TART and variable END, and Fig. 15 is an explanatory diagram showing an example of the index value of variable 5TART and variable END. A flowchart showing the process of finding the start line and end line for displaying the execution point. Figure 16 is an explanatory diagram showing part of the line information section of the load module file. Figure 17 is the corresponding block. Figure 18 is an explanatory diagram showing a part of the line information section of the load module file. Figure 19 is the case where optimization processing is not performed. FIG. 3 is an explanatory diagram showing the contents of a part of the line information section of the object module file and load module file of FIG. 11... Source code file, 12...
...Language processing system, 13...Load module file, 1
4... Source code debugger, 15...
...Man-machine interface terminal device, 21...Front end processing section, 22...
...Assembler source file with line information, 23...Optimization processing section, 24...Assembler source file with line information, 25...Assemble processing 26...Object module file, 28...Link processing section, 31...Terminal screen, 71...Line information section.

Claims (1)

【特許請求の範囲】 1、言語処理系のコンパイラ最適化処理部に設けられ、
マシン・コード単位にソース・コードの行情報を付与す
る行情報付与手段と、 言語処理系のマシン・コード生成処理部に設けられ、ソ
ース・コードとマシン・コードの対応で順序性について
反転の起きる範囲の複数行をまとめて1つのブロックと
するブロック情報の出力処理手段と、 ソース・コード・デバッガにこのブロック情報を使用し
て実行ポイントの指定と表示を行う処理部 とを具備することを特徴とするデバッグ支援装置。 2、言語処理系が出力するマシン・コードを収容するオ
ブジェクト・モジュール・ファイルとロード・モジュー
ル・ファイル中に設けられ、ソース・コードの行情報に
追加して複数行をまとめたブロック情報エントリを具備
することを特徴とする請求項1記載のデバッグ支援装置
。 3、言語処理系のコンパイラ最適化処理部の入出力ファ
イルの形式を同じにすることを特徴とする請求項1記載
のデバッグ支援装置。
[Claims] 1. Provided in a compiler optimization processing section of a language processing system,
A line information adding means that adds source code line information to each machine code unit and a machine code generation processing unit of a language processing system are provided to prevent order reversal in the correspondence between source code and machine code. The present invention is characterized by comprising a block information output processing means that collects multiple lines in a range into one block, and a processing unit that uses this block information to specify and display an execution point in a source code debugger. A debugging support device. 2. Provided in the object module file and load module file that contain the machine code output by the language processing system, and includes a block information entry that summarizes multiple lines in addition to the line information of the source code. The debugging support device according to claim 1, characterized in that: 3. The debugging support device according to claim 1, wherein the input and output files of the compiler optimization processing section of the language processing system have the same format.
JP1317566A 1989-12-08 1989-12-08 Debug supporting device Pending JPH03179535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1317566A JPH03179535A (en) 1989-12-08 1989-12-08 Debug supporting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1317566A JPH03179535A (en) 1989-12-08 1989-12-08 Debug supporting device

Publications (1)

Publication Number Publication Date
JPH03179535A true JPH03179535A (en) 1991-08-05

Family

ID=18089686

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1317566A Pending JPH03179535A (en) 1989-12-08 1989-12-08 Debug supporting device

Country Status (1)

Country Link
JP (1) JPH03179535A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05233365A (en) * 1992-02-19 1993-09-10 Nec Corp Optimized code debugging system
JPH06242942A (en) * 1993-02-15 1994-09-02 Nec Corp Source code level debugging device
JPH06242943A (en) * 1993-02-15 1994-09-02 Nec Corp Source code level debugging device
JPH08171499A (en) * 1994-12-20 1996-07-02 Nec Software Ltd Debugging device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05233365A (en) * 1992-02-19 1993-09-10 Nec Corp Optimized code debugging system
JPH06242942A (en) * 1993-02-15 1994-09-02 Nec Corp Source code level debugging device
JPH06242943A (en) * 1993-02-15 1994-09-02 Nec Corp Source code level debugging device
JPH08171499A (en) * 1994-12-20 1996-07-02 Nec Software Ltd Debugging device

Similar Documents

Publication Publication Date Title
US8136093B2 (en) System for adding code commentary to source code during software debugging
US6981248B2 (en) Conditional breakpoint encountered indication
US7149680B2 (en) System and method for providing language-specific extensions to the compare facility in an edit system
US6289264B1 (en) Debugging system for robot programs
JPH03179535A (en) Debug supporting device
JPH05298052A (en) Window system and event processing method
JP2864979B2 (en) Software debugger
JPH02275539A (en) Debugging system
CN112860241B (en) Interface development method, display method, device, electronic equipment and medium
JPH0457089A (en) Multi-window display device
JP2811804B2 (en) Variable output range specification method
JPH06332750A (en) Interfacial screen debug system
JPH05108404A (en) Debugger system
JPH05189224A (en) Management system for processing method
JP3105546B2 (en) Assembler symbol debug information processing method
JPS6033640A (en) Data monitoring system
JPS6170610A (en) Numerical controller
JPH03273346A (en) Dynamic call relation analyzing system by symbolic debugger
JPH05224981A (en) Debugger
JPS63640A (en) Execution control system for partial unit of data flow
JPH04333146A (en) Program execution control system for debugging
JPH0833846B2 (en) Function trace / step trace switching control method
JPH03282760A (en) Screen display method in online system
JPS63180141A (en) Debugging system by conversational debugger
JP2001067245A (en) Simulation method and simulation device