JPH04367946A - Debug information output system - Google Patents

Debug information output system

Info

Publication number
JPH04367946A
JPH04367946A JP3144377A JP14437791A JPH04367946A JP H04367946 A JPH04367946 A JP H04367946A JP 3144377 A JP3144377 A JP 3144377A JP 14437791 A JP14437791 A JP 14437791A JP H04367946 A JPH04367946 A JP H04367946A
Authority
JP
Japan
Prior art keywords
information
source
line number
source program
line
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
JP3144377A
Other languages
Japanese (ja)
Inventor
Kaoru Matsuo
松尾 薫
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 JP3144377A priority Critical patent/JPH04367946A/en
Publication of JPH04367946A publication Critical patent/JPH04367946A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To select one piece information of the information in accordance with a debug state by outputting line number information in a primary source file as debug information, even in the case a secondary source file is inputted. CONSTITUTION:The system is provided with a secondary source file 8 generated by a pre-processor 7 as source program information, and a line number information table for showing the line number of a secondary source program corresponding to the line number of a primary source file 1. A syntax analyzing means is provided with a primary source debug information output processing part 231 for outputting the primary source line number, the secondary source line number, and a relative address of the secondary source program to an object file 3.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はデバッグ情報出力方式に
関し、特に言語処理プログラムのデバッグ情報出力方式
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debug information output method, and more particularly to a debug information output method for language processing programs.

【0002】0002

【従来の技術】従来のデバッグ情報出力方式では、高級
言語で書かれたソースプログラムから作成された実行フ
ァイルのデバッグを次のようにして行なっていた。すな
わち、高級言語デバッガと呼ばれるアプリケーションソ
フトを用い、実行ファイルを実行させながら、ソースプ
ログラムの行単位で処理を停止(以後、ブレークと呼ぶ
)させ、ブレークされた時点での各変数値やレジスタ値
を表示させることにより行なっていた。
2. Description of the Related Art In a conventional debugging information output method, an executable file created from a source program written in a high-level language is debugged in the following manner. In other words, using application software called a high-level language debugger, while executing an executable file, the processing is stopped line by line in the source program (hereinafter referred to as a break), and each variable value and register value at the time of the break is recorded. This was done by displaying the information.

【0003】これは、高級言語デバッガが入力ソースプ
ログラムの行単位のデバッグを実現する上で必要となる
デバッグ情報テーブルが、以下の様な過程で生成されて
いるためである。
This is because the debug information table necessary for a high-level language debugger to perform line-by-line debugging of an input source program is generated through the following process.

【0004】まず、言語処理プログラムは、入力ソース
プログラムを構成する行単位の一連番号すなわち行番号
を示す情報と、その行の相対アドレスがセットされたデ
バッグ情報テーブルがオブジェクト情報と共にオブジェ
クトファイルに出力する。
[0004] First, a language processing program outputs a debug information table containing object information and information indicating the line number, that is, the serial number of each line constituting the input source program, and the relative address of the line. .

【0005】次に、前述のオブジェクトファイルを入力
ファイルとするリンカが、オブジェクトファイル保有の
デバッグ情報テーブルとその他のオブジェクト情報とか
ら、前述のデバッグ情報テーブルの行単位あるいは構造
ブロック単位の絶対アドレスを決定する。これによりリ
ンカは、言語処理プログラム実行時に、高級言語デバッ
ガ対応の入力ソースプログラムにおける行単位のデバッ
グを可能にするオブジェクトデバッグ情報を生成し、こ
れを実行形式のファイル(以下、ロードモジュールファ
イルと呼ぶ)中の他の情報と共に出力する。  前記高
級言語デバッガを組込んだデバッグ装置に、ロードモジ
ュールファイルをダウンロードしこれを実行させる。行
単位のデバッグ情報テーブルから得られるソースプログ
ラムの行単位の絶対アドレスと、デバッグ装置で捉えた
実行中のロードモジュールファイルのアドレスとを比較
し、これと一致したら処理を停止させる。これによって
ユーザは、デバッグ行単位のブレークが可能となる。
[0005] Next, the linker, which uses the aforementioned object file as an input file, determines the absolute address of the aforementioned debug information table in units of rows or structural blocks from the debug information table possessed by the object file and other object information. do. As a result, when the language processing program is executed, the linker generates object debug information that enables line-by-line debugging of the input source program that is compatible with high-level language debuggers, and converts this into an executable file (hereinafter referred to as a load module file). Output along with other information inside. A load module file is downloaded to a debugging device incorporating the high-level language debugger and executed. The line-by-line absolute address of the source program obtained from the line-by-line debugging information table is compared with the address of the load module file being executed captured by the debugging device, and if they match, processing is stopped. This allows the user to break in units of debug lines.

【0006】また、高級言語デバッガには、シンボル情
報やセグメント情報などをデバッグ装置に付属する表示
装置に出力することを可能にする機能も有しており、前
述のブレーク機能と合せて利用することによって、ソー
スプログラムによるデバッグ時の各種情報を得ることが
出来る。
[0006] The high-level language debugger also has a function that allows symbol information, segment information, etc. to be output to a display device attached to the debugging device, and can be used in conjunction with the above-mentioned break function. This allows you to obtain various information when debugging a source program.

【0007】この様に、言語処理プログラムの出力する
デバッグ情報によって行単位のブレークを可能にする事
は、行単位に対応したデバッグ情報をロードモジュール
ファイルへ出力する事によって容易に実現が可能である
[0007] In this way, making line-by-line breaks possible using debug information output from a language processing program can be easily achieved by outputting line-by-line debug information to the load module file. .

【0008】しかし、従来の技術では、ソース記述の一
部の予約語に関してのみ特定の行数分のソース行を展開
する処理を行なうプログラム(以下プリプロセッサと呼
ぶ)を言語処理プログラムの実行の前段階で行ない、前
述の展開行を含む出力ソースプログラム(以下二次ソー
スプログラムと呼ぶ)のファイルを従来の言語処理プロ
グラムに入力することにより処理を実行する場合は、プ
リプロセッサの処理を行なう以前のソースプログラムす
なわち一次ソースプログラムにおける行番号情報がデバ
ッグ情報として出力できなかった。
However, in the conventional technology, a program (hereinafter referred to as a preprocessor) that performs processing to expand a specific number of source lines only with respect to some reserved words in a source description is used as a preprocessor before the execution of a language processing program. When processing is executed by inputting an output source program file (hereinafter referred to as a secondary source program) containing the expansion lines described above to a conventional language processing program, the source program before preprocessor processing is executed. In other words, line number information in the primary source program could not be output as debug information.

【0009】従来のデバッグ情報出力方式のシステムの
一例を図9に示す。
FIG. 9 shows an example of a conventional debug information output system.

【0010】図9において、従来のデバッグ情報出力方
式は、一次ソースファイル1と、プリプロセッサ10と
、二次ソースファイル8と、言語処理プログラム12と
、オブジェクトファイル3と、キーボード4と、デバッ
グ情報格納ファイル5と、オブジェクト情報格納ファイ
ル6とを含んで構成されていた。
In FIG. 9, the conventional debug information output method includes a primary source file 1, a preprocessor 10, a secondary source file 8, a language processing program 12, an object file 3, a keyboard 4, and a debug information storage. It was configured to include a file 5 and an object information storage file 6.

【0011】言語処理プログラム12は、起動行解析部
21と、入力部22と、構文解析部26と、オブジェク
ト情報生成部24と、オブジェクト出力部25とを含ん
でいる。
The language processing program 12 includes a starting line analysis section 21, an input section 22, a syntax analysis section 26, an object information generation section 24, and an object output section 25.

【0012】オブジェクトファイル3は、言語処理プロ
グラム2が出力するデバッグ情報の出力結果であるデバ
ッグ情報テーブル32を含んでいる。
The object file 3 includes a debug information table 32 which is the output result of debug information output by the language processing program 2.

【0013】以上の構成要素はプリプロセッサ10と構
文解析部26を除き後述する本発明の実施例と共通であ
るのでここでは説明を省略する。
The above-mentioned components, except for the preprocessor 10 and the syntax analysis unit 26, are the same as those of the embodiment of the present invention to be described later, so their explanation will be omitted here.

【0014】次に従来のデバッグ情報出力方式の動作に
ついて説明する。
Next, the operation of the conventional debug information output method will be explained.

【0015】図10は、従来のデバッグ情報出力方式の
処理手順を示す図である。まず、プリプロセッサ10は
、図5に示すような一次ソースファイル1を入力される
とこれを処理して図6に示すような二次ソースファイル
8を出力する。次に、二次ソースファイル8は、言語処
理プログラム12に入力され、デバッグ情報出力処理が
なされて結果をオブジェクトファイル3に出力していた
FIG. 10 is a diagram showing the processing procedure of a conventional debug information output method. First, when the preprocessor 10 receives a primary source file 1 as shown in FIG. 5, it processes it and outputs a secondary source file 8 as shown in FIG. Next, the secondary source file 8 is input to the language processing program 12, debug information output processing is performed, and the result is output to the object file 3.

【0016】図11は、従来のデバッグ情報出力方式に
おける言語処理プログラム12の処理内容を示したフロ
ーチャートである。
FIG. 11 is a flowchart showing the processing contents of the language processing program 12 in the conventional debug information output method.

【0017】以下に、図11のフローチャートを参照し
ながら、従来の言語処理プログラム12の各処理機能を
説明する。
Each processing function of the conventional language processing program 12 will be explained below with reference to the flowchart shown in FIG.

【0018】従来の言語処理プログラム12の処理フロ
ーは、二次ソース行番号カウンタや二次ソース読込みポ
インタ等の各変数の初期化処理P1と、1行ソース入力
処理P2と、ソース終り判定処理P3と、終了処理P4
と、二次ソース行番号カウントアップ処理P5と、相対
アドレス計算処理P6と、構文解析処理P7と、オブジ
ェクト出力処理P8と、行単位デバッグ情報テーブル出
力処理P9とから構成される。
The processing flow of the conventional language processing program 12 includes an initialization process P1 for each variable such as a secondary source line number counter and a secondary source read pointer, a one-line source input process P2, and an end-of-source determination process P3. and end processing P4
, a secondary source line number count-up process P5, a relative address calculation process P6, a syntax analysis process P7, an object output process P8, and a line-by-line debug information table output process P9.

【0019】ここで、従来の各処理の機能を説明する。Here, the functions of each conventional process will be explained.

【0020】各変数の初期化処理P1は、二次ソース行
番号カウンタと二次ソース読込みポインタを初期化する
。このとき二次ソース行番号カウンタには0をセットし
ておくものとする。その他の変数は特に本発明の説明に
は不要なのでその初期値については特に明記はしない。
In the initialization process P1 of each variable, a secondary source line number counter and a secondary source read pointer are initialized. At this time, it is assumed that the secondary source line number counter is set to 0. Since the other variables are not particularly necessary for the explanation of the present invention, their initial values will not be particularly specified.

【0021】1行ソース入力処理P2は、現在読み込み
ポインタが指している二次ソースファイル8からソース
プログラムを1行単位で読み込む。この後の読み込みポ
インタは、読み込んだソースプログラムの次の行を指し
ている。
In the one-line source input process P2, the source program is read line by line from the secondary source file 8 currently pointed to by the read pointer. The read pointer after this points to the next line of the loaded source program.

【0022】ソース終り判定処理P3は、前述の1行ソ
ース入力処理P2で入力ファイル1からソースプログラ
ムを1行読み込んだ結果、それが入力ファイル1の終り
であるか否かの判定を行なう処理である。
The end-of-source determination process P3 is a process for determining whether or not the result of reading one line of the source program from the input file 1 in the one-line source input process P2 described above is the end of the input file 1. be.

【0023】終了処理P4は、前記ソース終り判定処理
P3によって入力ファイル1の終りであった場合に行な
う終了処理である。
End processing P4 is an end processing performed when the source end determination processing P3 indicates that the input file 1 has come to an end.

【0024】二次ソース行番号カウントアップ処理P5
は入力ソースプログラムを1行読み込む度にその読み込
んだ行数をカウントアップする処理である。
Secondary source line number count up process P5
is a process of counting up the number of lines read each time one line of the input source program is read.

【0025】相対アドレス計算処理P6は、読み込んだ
ソースプログラムの始まる相対アドレスを算出する処理
である。
Relative address calculation processing P6 is processing for calculating the relative address at which the loaded source program starts.

【0026】構文解析処理P7は、1行ソース入力処理
P2で読み込んだソースプログラム情報を解析しオブジ
ェクト情報(セグメント情報、シンボル情報、テキスト
コード情報等)を生成する処理である。
The syntax analysis process P7 is a process of analyzing the source program information read in the one-line source input process P2 to generate object information (segment information, symbol information, text code information, etc.).

【0027】オブジェクト出力処理P8は、構文解析処
理P7が生成したオブジェクト情報をオブジェクトファ
イル3に出力する処理である。
The object output process P8 is a process for outputting the object information generated by the syntax analysis process P7 to the object file 3.

【0028】行単位デバッグ情報テーブル出力処理P9
は、読み込んだ二次ソースプログラムの行数とその相対
アドレスを、オブジェクトファイル3内のデバッグ情報
テーブル32に出力する処理である。
[0028] Line-by-line debug information table output processing P9
is a process of outputting the number of lines of the read secondary source program and its relative address to the debug information table 32 in the object file 3.

【0029】次に、従来の言語処理プログラム12の処
理の流れを追いながら、図8に示した二次ソースプログ
ラムから図12に示した1行単位或いは構造ブロック単
位のデバッグ情報テーブル32が生成される過程を説明
する。
Next, while following the processing flow of the conventional language processing program 12, the debug information table 32 for each line or structure block shown in FIG. 12 is generated from the secondary source program shown in FIG. Explain the process.

【0030】まず、入力ソースプログラムの二次ソース
行番号カウンタと二次ソース読込みポインタその他変数
等を初期化する処理P1を行なう。
First, a process P1 is performed to initialize the secondary source line number counter, secondary source read pointer, and other variables of the input source program.

【0031】次に、二次ソースファイル8から1行ソー
スプログラムを読み込むための1行ソース入力ソース入
力処理P2を実行する。
Next, a one-line source input process P2 for reading a one-line source program from the secondary source file 8 is executed.

【0032】1行ソース入力処理P2によって入力され
たソースプログラム情報は、ソース終り判定処理P3に
よってソースプログラムの終りか否かが判定される。判
定の結果終りであれば、終了処理P4を行なって処理を
終了する。判定の結果、ソースプログラムの終りでなけ
れば、二次ソース行番号をカウントアップする処理P5
と、その入力ソースプログラムの相対アドレス計算処理
P6を行ない、次に入力した二次ソースプログラム1行
の構文解析処理P7を行なう。
It is determined whether or not the source program information input by the one-line source input process P2 is at the end of the source program by the source end determination process P3. If the result of the determination is that it is the end, a termination process P4 is performed and the process is terminated. As a result of the determination, if it is not the end of the source program, a process P5 of counting up the secondary source line number
Then, relative address calculation processing P6 of the input source program is performed, and then syntax analysis processing P7 of one line of the input secondary source program is performed.

【0033】構文解析処理P7は1行ソース入力処理P
2で読み込んだソースプログラム情報を解析しオブジェ
クト情報を生成しする。構文解析処理P7によって生成
されたオブジェクト情報はオブジェクト出力処理P8が
オブジェクトファイル3に出力する。
Syntax analysis processing P7 is one-line source input processing P
Analyze the source program information read in step 2 and generate object information. The object information generated by the parsing process P7 is output to the object file 3 by the object output process P8.

【0034】最後に、デバッグ情報テーブル出力処理P
9に進み、二次ソースプログラムの行番号情報と相対ア
ドレスのデバッグ情報テーブル32を、先に構文解析処
理P7で生成したオブジェクト情報とともにオブジェク
トファイル3に出力する。
Finally, debug information table output processing P
Proceeding to step 9, the debug information table 32 of the line number information and relative addresses of the secondary source program is output to the object file 3 together with the object information previously generated in the syntax analysis process P7.

【0035】次に、デバッグ情報テーブル出力処理P9
を終了したら、1行ソース入力処理P2へ処理を戻す。
Next, debug information table output processing P9
After finishing, the process returns to the one-line source input process P2.

【0036】この様にして、従来の言語処理プログラム
は、ソースファイル1の終りが来るまでオブジェクト出
力とデバッグ情報の出力を繰り返し実行し、オブジェク
トファイル3に、1行単位のデバッグ情報をデバッグ情
報テーブル32に出力していた。
In this way, the conventional language processing program repeatedly outputs the object and debug information until the end of the source file 1 is reached, and stores the debug information line by line in the object file 3 in the debug information table. It was outputting to 32.

【0037】これに対して、従来の言語処理プログラム
2以降の処理は、まず、リンカが前述のオブジェクトフ
ァイル3から得られるデバッグ情報テーブル32の相対
アドレスから、リンク処理中に絶対アドレスを求める処
理を行なう。これによって、各入力オブジェクトのデバ
ッグ情報テーブルに出力された行単位の絶対アドレスを
表示した、デバッグ情報テーブル32と同様のロードデ
バッグ情報テーブルをロードモジュールファイルに出力
していた。
On the other hand, in the conventional language processing program 2 and subsequent processing, the linker first calculates an absolute address from the relative address in the debug information table 32 obtained from the object file 3 during link processing. Let's do it. As a result, a load debug information table similar to the debug information table 32, which displays the absolute address of each line output to the debug information table of each input object, is output to the load module file.

【0038】[0038]

【発明が解決しようとする課題】上述した従来のデバッ
グ情報出力方式では、入力されたソースファイルのみか
ら行番号情報をデバッグ情報として出力していたため、
言語処理系プリプロセッサ出力である二次ソースファイ
ルが入力された場合は、一次ソースプログラムにおける
行番号情報がデバッグ情報として出力できないという欠
点があった。
[Problems to be Solved by the Invention] In the conventional debug information output method described above, line number information is output as debug information only from the input source file.
When a secondary source file that is the output of a language processing preprocessor is input, there is a drawback that line number information in the primary source program cannot be output as debug information.

【0039】[0039]

【課題を解決するための手段】本発明のデバッグ情報出
力方式は、言語処理系プリプロセッサと、ソースプログ
ラム情報を入力する手段と、入力された前記ソースプロ
グラム情報を分析してデバッグ情報とオブジェクト情報
とを出力する構文解析手段と、前記オブジェクト情報と
前記デバッグ情報とをオブジェクトファイルに出力する
オブジェクト出力手段とを有する言語処理プログラムの
デバッグ情報出力方式において、前記ソースプログラム
情報は一次ソースプログラムの予め定めた予約語に関す
る予め定めた行数分のソース行を展開して前記言語処理
系プリプロセッサが生成する展開行を含む出力ソースプ
ログラムである二次ソースプログラムと、前記一次ソー
スプログラムのソース行の行番号である一次行番号に対
応する前記二次ソースプログラムのソース行の行番号で
ある二次行番号を示す行番号情報テーブルとを備え、前
記構文解析手段は前記一次行番号と前記二次行番号と前
記二次ソースプログラムの相対アドレスとを前記オブジ
ェクトファイルに出力する一次ソースプログラムデバッ
グ情報出力処理手段を有するオブジェクト出力手段とを
備えて構成されている。
[Means for Solving the Problems] The debug information output method of the present invention includes a language processing preprocessor, means for inputting source program information, and analyzing the input source program information to generate debug information and object information. In the debugging information output method for a language processing program, the source program information includes a syntax analysis means for outputting the object information and the object outputting means for outputting the object information and the debugging information to an object file. A secondary source program that is an output source program including expanded lines generated by the language processing preprocessor by expanding a predetermined number of source lines related to reserved words, and line numbers of source lines of the primary source program. and a line number information table indicating a secondary line number which is a line number of a source line of the secondary source program corresponding to a certain primary line number, and the parsing means is configured to analyze the primary line number and the secondary line number. and object output means having a primary source program debug information output processing means for outputting the relative address of the secondary source program to the object file.

【0040】[0040]

【実施例】次に、本発明について図面を参照して説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be explained with reference to the drawings.

【0041】図1は、本発明の一実施例の全体のシステ
ム構成を示すブロック図である。
FIG. 1 is a block diagram showing the overall system configuration of an embodiment of the present invention.

【0042】図1において、本発明のデバッグ情報出力
方式は、一次ソースファイル1と、一次ソースファイル
1を前置処理するプリプロセッサ7と、プリプロセッサ
7から出力される二次ソースファイル8と、プリプロセ
ッサ7から出力され一次ソースファイル1の行番号情報
を示す行番号情報テーブル9と、言語処理プログラム2
と、オブジェクトファイル3と、キーボード4と、デバ
ッグ情報を格納するデバッグ情報格納ファイル5と、オ
ブジェクト情報を格納するオブジェクト情報格納ファイ
ル6とを含んで構成される。
In FIG. 1, the debug information output method of the present invention includes a primary source file 1, a preprocessor 7 that preprocesses the primary source file 1, a secondary source file 8 output from the preprocessor 7, and a preprocessor 7. A line number information table 9 that is output from and shows line number information of the primary source file 1, and a language processing program 2.
, an object file 3, a keyboard 4, a debug information storage file 5 that stores debug information, and an object information storage file 6 that stores object information.

【0043】言語処理プログラム2は、キーボード4か
ら入力された起動行を解析する起動行解析部21と、入
力ファイル1からソースプログラム情報を入力する入力
部22と、同じく入力部22から入力されたソースプロ
グラムを解析してオブジェクト情報を出力する構文解析
部23と、デバッグ情報格納ファイル5とオブジェクト
情報格納ファイル6の2つのテンポラリファイルの情報
からオブジェクトファイル用の情報を生成するオブジェ
クト情報生成部24と、生成されたオブジェクト情報及
びデバッグ情報をオブジェクトファイル3に出力するオ
ブジェクト出力部25とを含んで構成される。
The language processing program 2 includes a startup line analysis section 21 that analyzes startup lines input from the keyboard 4, an input section 22 that inputs source program information from the input file 1, and a startup line analysis section 21 that analyzes startup lines input from the keyboard 4; A syntax analysis unit 23 that analyzes a source program and outputs object information, and an object information generation unit 24 that generates information for object files from information in two temporary files, a debug information storage file 5 and an object information storage file 6. , and an object output unit 25 that outputs generated object information and debug information to the object file 3.

【0044】構文解析部23は、一次行番号と二次行番
号と二次ソースプログラムの相対アドレスとをオブジェ
クトファイル3に出力する一次ソースデバッグ情報出力
処理部231を含む。
The syntax analysis unit 23 includes a primary source debug information output processing unit 231 that outputs the primary line number, secondary line number, and relative address of the secondary source program to the object file 3.

【0045】オブジェクトファイル3は、言語処理プロ
グラム2が出力するデバッグ情報テーブル31を含む。
The object file 3 includes a debug information table 31 output by the language processing program 2.

【0046】オブジェクト情報格納ファイル6に格納さ
れるオブジェクト情報は、構文解析部23の解析結果と
して出力されるセグメント情報、シンボル情報、テキス
ト情報等である。
The object information stored in the object information storage file 6 is segment information, symbol information, text information, etc. output as the analysis result of the syntax analysis section 23.

【0047】図5は一次ソースファイル1の内容の一例
である。左側の数字は説明のために付けた一次ソースフ
ァイル1の行番号である。
FIG. 5 shows an example of the contents of the primary source file 1. The numbers on the left are line numbers of primary source file 1 added for explanation.

【0048】図6は二次ソースファイル8の内容の一例
である。左側の数字は説明のために付けた一次ソースフ
ァイル1の行番号と、これに対応する二次ソースファイ
ル8の行番号である。
FIG. 6 shows an example of the contents of the secondary source file 8. The numbers on the left side are the line numbers of the primary source file 1 added for explanation and the corresponding line numbers of the secondary source file 8.

【0049】次に、本実施例の動作について説明する。Next, the operation of this embodiment will be explained.

【0050】図2は、本実施例のデバッグ情報出力方式
の処理手順を示す図である。まず、プリプロセッサ7は
、図5に示すような一次ソースファイル1を入力される
とこれを処理して図6に示すような二次ソースファイル
8を出力する。同時に、一次ソースプログラムの行番号
に対応する二次ソースプログラムの行番号を出力した図
9に示すような行番号情報テーブル9を出力する。次に
、二次ソースファイル8および行番号情報テーブル9は
、一次ソースデバッグ情報出力処理部231を備える言
語処理プログラム2に入力され、デバッグ情報出力処理
がなされて結果をオブジェクトファイル3に出力する。
FIG. 2 is a diagram showing the processing procedure of the debug information output method of this embodiment. First, when the preprocessor 7 receives a primary source file 1 as shown in FIG. 5, it processes it and outputs a secondary source file 8 as shown in FIG. At the same time, a line number information table 9 as shown in FIG. 9 is output, in which line numbers of the secondary source program corresponding to line numbers of the primary source program are output. Next, the secondary source file 8 and the line number information table 9 are input to the language processing program 2 equipped with the primary source debug information output processing section 231 , where debug information output processing is performed and the results are output to the object file 3 .

【0051】図3は、本実施例のデバッグ情報出力方式
における言語処理プログラム2の処理内容を示したフロ
ーチャートである。
FIG. 3 is a flowchart showing the processing contents of the language processing program 2 in the debug information output method of this embodiment.

【0052】以下に、図3のフローチャートを参照しな
がら、本実施例の言語処理プログラム2の各処理機能を
説明する。
Each processing function of the language processing program 2 of this embodiment will be explained below with reference to the flowchart of FIG.

【0053】ここでは、前述の図11に示した従来の処
理フローチャートとの相違点について説明する。図3に
おいて、処理P2〜P9の処理内容は前述の図11に示
した従来の処理フローチャートと同一の処理であり、説
明が重複するので本発明に直接関係する点以外は省略す
る。
Here, differences from the conventional processing flowchart shown in FIG. 11 described above will be explained. In FIG. 3, the processing contents of processes P2 to P9 are the same as those in the conventional processing flowchart shown in FIG. 11, and since the explanation will be redundant, the explanation will be omitted except for points directly related to the present invention.

【0054】まず、各変数の初期化処理S1は、従来の
各変数の初期化処理P1の二次ソース行番号カウンタと
二次ソース読込みポインタの初期化に加えて、一次ソー
ス行番号カウンタと行番号情報テーブルポインタの初期
化をする。このとき二次ソース行番号カウンタには0を
、また、一次ソースプログラムの行番号カウンタには1
をそれぞれセットしておくものとする。
First, the initialization process S1 of each variable initializes the primary source line number counter and the line Initialize the number information table pointer. At this time, the secondary source line number counter is set to 0, and the primary source program line number counter is set to 1.
shall be set respectively.

【0055】次に、オブジェクト出力処理P8の後に、
一次ソースデバッグ情報出力処理部231により一次ソ
ースデバッグ情報出力処理S2を行なう。
Next, after object output processing P8,
The primary source debug information output processing unit 231 performs primary source debug information output processing S2.

【0056】図4は、一次ソースプログラムデバッグ情
報出力処理S2の細部を示したフローチャートである。
FIG. 4 is a flowchart showing details of the primary source program debug information output processing S2.

【0057】まず、プリプロセッサ7から出力された行
番号情報テーブル9の現在の行番号情報テーブルポイン
タが指す二次ソース行番号情報と現在の二次ソース行番
号カウンタとが一致するかどうかを判定する処理である
、行番号情報テーブル判定処理S21を行なう。両情報
が一致しない場合には一次ソースプログラムデバッグ情
報出力処理S2を終了する。両情報が一致する場合には
、デバッグ情報テーブル31の行番号情報部に一次ソー
ス行番号カウンタの値を出力する処理である一次ソース
行番号カウンタ値出力処理S22を行なう。
First, it is determined whether the secondary source line number information pointed to by the current line number information table pointer of the line number information table 9 output from the preprocessor 7 matches the current secondary source line number counter. A row number information table determination process S21 is performed. If the two pieces of information do not match, the primary source program debug information output process S2 is ended. If both pieces of information match, a primary source line number counter value output process S22 is performed, which is a process of outputting the value of the primary source line number counter to the line number information section of the debug information table 31.

【0058】続いて、一次ソース行番号カウンタをカウ
ントアップする一次ソース行番号カウントアップ処理S
23を行なう。
Next, a primary source line number count up process S for counting up the primary source line number counter
Do 23.

【0059】最後に、行番号情報テーブルポインタを1
つ進める行番号情報テーブルポインタアップ処理S24
を行ない、一次ソースデバッグ情報出力処理S2を終了
する。
Finally, set the line number information table pointer to 1.
Advance row number information table pointer up process S24
Then, the primary source debug information output process S2 is completed.

【0060】以上説明したように、言語処理プログラム
2は、二次ソースファイル9の最終行までオブジェクト
情報とともに1行単位のデバッグ情報を生成する。この
とき、プリプロセッサ7の処理を介する以前の一次ソー
スファイル1の行番号情報も同時に同一ロードモジュー
ルファイルに出力することが可能となる。
As described above, the language processing program 2 generates debug information line by line together with object information up to the last line of the secondary source file 9. At this time, it becomes possible to output line number information of the previous primary source file 1 through the processing of the preprocessor 7 to the same load module file at the same time.

【0061】これにより、言語処理プログラム2以降の
処理は次のようになる。まず、リンカが前述のオブジェ
クトファイル3から得られるデバッグ情報テーブル31
の相対アドレスから、リンク処理中に絶対アドレスを求
める処理をオブジェクト行なう。これにより、各入力オ
ブジェクトの行単位に関して、絶対アドレスを埋めたデ
バッグ情報テーブル31と同様のロードデバッグ情報テ
ーブルをモジュールファイルに出力することが可能とな
る。
[0061] As a result, the processing after the language processing program 2 is as follows. First, the linker uses the debug information table 31 obtained from the object file 3 mentioned above.
During link processing, the object performs processing to obtain the absolute address from the relative address of the object. This makes it possible to output to the module file a load debug information table similar to the debug information table 31 filled with absolute addresses for each line of each input object.

【0062】[0062]

【発明の効果】以上説明したように本発明は、ソースプ
ログラム情報として言語処理系プリプロセッサが生成す
る二次ソースプログラムと、一次ソースプログラムの行
番号に対応する二次ソースプログラムの行番号を示す行
番号情報テーブルとを備え、また、構文解析手段は一次
ソース行番号と二次ソース行番号と二次ソースプログラ
ムの相対アドレスとをオブジェクトファイルに出力する
一次ソースプログラムデバッグ情報出力処理手段を有す
るオブジェクト出力手段とを備えることにより、二次ソ
ースファイルが入力された場合でも、一次ソースプログ
ラムにおける行番号情報をデバッグ情報として出力でき
るので、デバッグ状況に対応してこれらのいずれかの情
報を選択できるという効果がある。
As explained above, the present invention provides a secondary source program generated by a language processing preprocessor as source program information, and a line indicating the line number of the secondary source program that corresponds to the line number of the primary source program. and a number information table, and the syntax analysis means includes a primary source program debug information output processing means for outputting a primary source line number, a secondary source line number, and a relative address of the secondary source program to an object file. Even if a secondary source file is input, the line number information in the primary source program can be output as debugging information, so that one of these pieces of information can be selected depending on the debugging situation. There is.

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

【図1】本発明のデバッグ情報出力方式の一実施例を示
すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a debug information output method of the present invention.

【図2】本実施例のデバッグ情報出力方式の処理手順を
示す図である。
FIG. 2 is a diagram showing a processing procedure of a debug information output method according to the present embodiment.

【図3】本実施例のデバッグ情報出力方式における動作
の一例を示す流れ図である。
FIG. 3 is a flowchart showing an example of the operation in the debug information output method of the present embodiment.

【図4】本実施例のデバッグ情報出力方式における一次
ソースプログラムデバッグ情報出力処理部の動作の一例
を示す流れ図である。
FIG. 4 is a flow chart showing an example of the operation of the primary source program debug information output processing section in the debug information output method of the present embodiment.

【図5】一次ソースファイルの一例を示す図である。FIG. 5 is a diagram showing an example of a primary source file.

【図6】二次ソースファイルの一例を示す図である。FIG. 6 is a diagram showing an example of a secondary source file.

【図7】行番号情報テーブルの一例を示す図である。FIG. 7 is a diagram showing an example of a row number information table.

【図8】本実施例のデバッグ情報テーブルの内容の一例
を示す図である。
FIG. 8 is a diagram showing an example of the contents of a debug information table according to the present embodiment.

【図9】従来のデバッグ情報出力方式の一例を示すブロ
ック図である。
FIG. 9 is a block diagram showing an example of a conventional debug information output method.

【図10】従来のデバッグ情報出力方式の処理手順を示
す図である。
FIG. 10 is a diagram showing a processing procedure of a conventional debug information output method.

【図11】従来のデバッグ情報出力方式における動作の
一例を示す流れ図である。
FIG. 11 is a flowchart illustrating an example of an operation in a conventional debug information output method.

【図12】従来のデバッグ情報テーブルの内容の一例を
示す図である。
FIG. 12 is a diagram showing an example of the contents of a conventional debug information table.

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

1    一次ソースファイル 2,12    言語処理プログラム 3    オブジェクトファイル 4    キーボード 5    デバッグ情報格納ファイル 6    オブジェクト情報格納ファイル7,10  
  プリプロセッサ 8    二次ソースファイル 9    行番号情報テーブル 21    起動行解析部 22    入力部 23,26    構文解析部 24    オブジェクト情報生成部 25    オブジェクト出力部
1 Primary source files 2, 12 Language processing program 3 Object file 4 Keyboard 5 Debug information storage file 6 Object information storage file 7, 10
Preprocessor 8 Secondary source file 9 Line number information table 21 Starting line analysis unit 22 Input units 23, 26 Syntax analysis unit 24 Object information generation unit 25 Object output unit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  言語処理系プリプロセッサと、ソース
プログラム情報を入力する手段と、入力された前記ソー
スプログラム情報を分析してデバッグ情報とオブジェク
ト情報とを出力する構文解析手段と、前記オブジェクト
情報と前記デバッグ情報とをオブジェクトファイルに出
力するオブジェクト出力手段とを有する言語処理プログ
ラムのデバッグ情報出力方式において、前記ソースプロ
グラム情報は一次ソースプログラムの予め定めた予約語
に関する予め定めた行数分のソース行を展開して前記言
語処理系プリプロセッサが生成する展開行を含む出力ソ
ースプログラムである二次ソースプログラムと、前記一
次ソースプログラムのソース行の行番号である一次行番
号に対応する前記二次ソースプログラムのソース行の行
番号である二次行番号を示す行番号情報テーブルとを備
え、前記構文解析手段は前記一次行番号と前記二次行番
号と前記二次ソースプログラムの相対アドレスとを前記
オブジェクトファイルに出力する一次ソースプログラム
デバッグ情報出力処理手段を有するオブジェクト出力手
段とを備えることを特徴とするデバッグ情報出力方式。
1. A language processing preprocessor, means for inputting source program information, syntax analysis means for analyzing the input source program information and outputting debug information and object information, and analyzing the object information and the object information. In a debug information output method for a language processing program, the source program information includes a predetermined number of source lines related to a predetermined reserved word of a primary source program. a secondary source program that is an output source program including expanded lines that are expanded and generated by the language processing system preprocessor; and a secondary source program that corresponds to a primary line number that is a line number of a source line of the primary source program. and a line number information table indicating a secondary line number that is a line number of a source line, and the parsing means converts the primary line number, the secondary line number, and the relative address of the secondary source program into the object file. and object output means having a primary source program debug information output processing means for outputting primary source program debug information.
JP3144377A 1991-06-17 1991-06-17 Debug information output system Pending JPH04367946A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3144377A JPH04367946A (en) 1991-06-17 1991-06-17 Debug information output system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3144377A JPH04367946A (en) 1991-06-17 1991-06-17 Debug information output system

Publications (1)

Publication Number Publication Date
JPH04367946A true JPH04367946A (en) 1992-12-21

Family

ID=15360713

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3144377A Pending JPH04367946A (en) 1991-06-17 1991-06-17 Debug information output system

Country Status (1)

Country Link
JP (1) JPH04367946A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003271415A (en) * 2002-03-13 2003-09-26 Denso Corp Execution history recording device, brake instruction setting device and program
JP2007141173A (en) * 2005-11-22 2007-06-07 Matsushita Electric Ind Co Ltd Compiling system, debug system and program development system
JP2013210920A (en) * 2012-03-30 2013-10-10 Nec Corp Compilation device, compilation method, and compiler

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003271415A (en) * 2002-03-13 2003-09-26 Denso Corp Execution history recording device, brake instruction setting device and program
JP2007141173A (en) * 2005-11-22 2007-06-07 Matsushita Electric Ind Co Ltd Compiling system, debug system and program development system
JP2013210920A (en) * 2012-03-30 2013-10-10 Nec Corp Compilation device, compilation method, and compiler

Similar Documents

Publication Publication Date Title
US7266809B2 (en) Software debugger and software development support system for microcomputer operable to execute conditional execution instruction
JP3612294B2 (en) Debugging method and debugging device
JPH04367946A (en) Debug information output system
JP3196675B2 (en) Language processing method
US5504862A (en) Logic verification method
JP5120103B2 (en) Debugging method and debugging program
JPH04242440A (en) Debugging information output system
JPH0778096A (en) Program test system
KR0175469B1 (en) How to control the visibility of fill program variables
KR100279731B1 (en) How to Display Control Flow for Fill Languages
SU792258A1 (en) Test diagnosis apparatus
JPH06348541A (en) Program test system
JPH0283634A (en) Program debugging system
KR100231692B1 (en) A generation method of chill debugging information
JPH0922346A (en) Compiler system
US7627859B2 (en) Method for configuring non-script language library files to be run as scripts
JP2002073371A (en) Program debugging method
JPH04288635A (en) Debugging information output system
JPH1011311A (en) Test program generating device for processor
JPH06214828A (en) Interactive debug controller
JPH0375936A (en) Debugging information output system for language processing program
JPH05108372A (en) System for outputting compiler optimization processing content
JPH10207738A (en) Language processing system
JPH04282725A (en) Processing system relating to software developing environment
JPH10207740A (en) Debug system