JPH02244341A - Execution subroutine debugging information output trace system - Google Patents
Execution subroutine debugging information output trace systemInfo
- Publication number
- JPH02244341A JPH02244341A JP1066937A JP6693789A JPH02244341A JP H02244341 A JPH02244341 A JP H02244341A JP 1066937 A JP1066937 A JP 1066937A JP 6693789 A JP6693789 A JP 6693789A JP H02244341 A JPH02244341 A JP H02244341A
- Authority
- JP
- Japan
- Prior art keywords
- subroutine
- debugging
- debug
- trace
- statement
- 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
Links
- 238000000034 method Methods 0.000 claims description 16
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
Landscapes
- Devices For Executing Special Programs (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明線、サブルーチン名と引数とを表示すルフログラ
ムを生成する実行サブルーチンデバッグ情報出カドレー
ス方式に関する。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to an execution subroutine debug information output tracing method for generating a refogram displaying subroutine names and arguments.
(従来の技術)
従来から、プログラムをデバッグするには、なんらかの
形でデバッグ情報を収集しているのは公知である。デバ
ッグ情報を収集するには。(Prior Art) It has been known that in order to debug a program, debug information is collected in some form. To collect debug information.
下記の2つの方式がある。There are two methods below.
第1は、ソースプログラム中にデバッグ情報を収集する
文を挿入するものである。第2は、ソフトウェアデバッ
ガでブレークポイントを設定し、プログラム実行途中に
実行を停止させてデバッグ情報を収集するものである。The first method is to insert statements for collecting debug information into the source program. The second method is to set breakpoints in a software debugger, stop program execution midway through execution, and collect debugging information.
(発明が解決しようとする課題)
上述し次従来のデバッグトレース情報収束方式において
、上記第1の方式ではプログラム中に人手によりロジッ
クを挿入する必要がある九め、非常に操作が面倒であり
、且つ、ロジックの誤りを犯しやすいという欠点がある
。いっぼう、上記第2の方式では実行中に何度も実行動
作を停止させるようにソフトウェアデバッガに対して指
示させる必要があるので、操作が面倒であると云う欠点
がある。(Problems to be Solved by the Invention) In the conventional debug trace information convergence method as described above, the first method requires manual insertion of logic into the program, which is extremely troublesome to operate. Another disadvantage is that it is easy to make logic errors. On the other hand, the second method described above has the disadvantage that it is cumbersome to operate because it is necessary to instruct the software debugger to stop the execution operation many times during execution.
本発明の目的は、コンパイラの翻訳処理の一部において
ソースプログラムを読込み、読込まれ次ソースプログラ
ム中にサブルーチンコールがあるか否かを認識しておき
、コンパイル時のデバッグオプションによりデバッグト
レース文の出力可否t−n断し、デバッグトレース出力
時にはサブルーチンのサブルーチン名、およびその引数
値を書式に従つ良形式で表示し、実行文を生成し、コン
パイラの翻訳処理を行うことによって上記欠点全除去し
、操作t−m易化できるように構成し次実行サブルーチ
ンデバッグ情報出カドレース方式を提供することにある
。An object of the present invention is to read a source program as part of the compiler's translation process, recognize whether or not there is a subroutine call in the next source program, and output debug trace statements using the debug option at compile time. All of the above-mentioned drawbacks can be removed by determining whether the subroutine is possible or not, displaying the subroutine name and its argument value in a good format according to the format when outputting a debug trace, generating executable statements, and performing compiler translation processing. The object of the present invention is to provide a next execution subroutine debug information output tracing method that is configured to facilitate operation tm.
(課題を解決するための手段)
本発明による実行サブルーチンデパック情報量カドレー
ス方式はソース読込み手段と、サブルーチンコール認識
手段と、デバッグトレース生成判断手段と、デバッグト
レース生成手段と。(Means for Solving the Problems) The execution subroutine depack information amount quadrase method according to the present invention includes a source reading means, a subroutine call recognition means, a debug trace generation determination means, and a debug trace generation means.
翻訳処理手段とを具備して構成し念ものである。It is convenient to have a translation processing means.
ソース読込み手段は、コンバイ2の翻訳処理の一部でソ
ースプログラムの文を読込む念めのものである。The source reading means is intended to read the sentences of the source program as part of the translation process of the combiner 2.
サブルーチンコール認識手段は、上記読込まれ九ソース
プログラム中にサブルーチンコールが存在するか否かを
認識するためのものである。The subroutine call recognition means is for recognizing whether or not a subroutine call exists in the nine source programs read.
デバッグトレース生成判断手段は、コンパイル時のデバ
ッグオプションによりデパックトレース文の出力の可否
を判断するためのものである。The debug trace generation determination means is for determining whether or not a depack trace statement can be output based on the debug option at compile time.
デバッグトレース生成手段に、デバッグトレース出力時
にはサブルーチンのサブルーチン名およびサブルーチン
の引数値を表示する九め、実行文を生成する九めのもの
である。When outputting a debug trace, the debug trace generating means displays the subroutine name and subroutine argument value, and the ninth generates an executable statement.
翻訳処理手段は、コンパイラの翻訳処理を行う几めのも
のである。The translation processing means is a sophisticated one that performs translation processing of the compiler.
(実 施 例) 次に、本発明について図面を参照して説明する。(Example) Next, the present invention will be explained with reference to the drawings.
第1図は1本発明による実行サブルーチンデバッグ情報
出カドレース方式の一実施例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of an execution subroutine debug information output tracing method according to the present invention.
第1図は、デバッグ情報出力の一実施例を示すブロック
図であり、ここでの処理の流れはコンパイラの処理の一
部として組込まれている。FIG. 1 is a block diagram showing an example of outputting debug information, and the processing flow here is incorporated as part of the compiler processing.
第1図において、1はソース読込み手段、2はサブルー
チンコールiil!識手段、3はデバッグトレース生成
判定手段、4はデバッグトレース生成手段、5は翻訳処
理手段である。In FIG. 1, 1 is a source reading means, 2 is a subroutine call iil! 3 is a debug trace generation determination means, 4 is a debug trace generation means, and 5 is a translation processing means.
まず、ソース読込み手段1により、ソースプログラムの
文を一行づつ読込む。続いて、サブルーチンコール認識
手段2では、ソース読込み手段1により読込まれ構文に
対して構文解析を行い、その文の中にサブルーチンコー
ルカ6 ルか否かを認識する。First, the source reading means 1 reads the sentences of the source program line by line. Subsequently, the subroutine call recognition means 2 parses the syntax read by the source reading means 1 and recognizes whether or not there is a subroutine call code in the sentence.
ソース読込み手段1により読込まれ九ソースプログラム
中にサブルーチンコールがあった場合、デバッグトレー
ス生成判定手段3ではサブルーチンデバッグトレース文
を生成するか否かを判定する。この判定の指示は、コン
パイル時ノテバッグオプションの有無による。デバッグ
トレース生成判定手段3によってデバッグ文を生成する
指示があった場合、デバッグトレース生成手段4は当該
サブルーチンに対してデバッグフラックと、関数名と、
引数名と、サブルーチンの書式に従つ九実行時値を表示
させるためのプリント文とを当該サブルーチンの機械語
命令の前に生成する。When there is a subroutine call in the source program read by the source reading means 1, the debug trace generation determination means 3 determines whether or not to generate a subroutine debug trace statement. The instructions for this judgment depend on the presence or absence of the compile-time notebag option. When there is an instruction to generate a debug statement by the debug trace generation determination means 3, the debug trace generation means 4 generates a debug flag, a function name, and a function name for the subroutine.
An argument name and a print statement for displaying a runtime value according to the format of the subroutine are generated before the machine language instruction of the subroutine.
翻訳処理手段5は、通常のコンパイル処理である。The translation processing means 5 performs normal compiling processing.
第2図は、ソースプログラムとサブルーチンデバッグト
レース文とが埋込まれ友サンプルプログラムであり、C
言語で記述し次ものである。Figure 2 is a friend sample program in which a source program and subroutine debug trace statements are embedded.
It is described in the following language.
理解を容易にするために、第2図によりサンプルプログ
ラムの実例を説明する。To facilitate understanding, an example of a sample program will be explained with reference to FIG.
第2図における入力ソースプログラムの実例では0言語
記述によっている。変更プログラムはコンパイラにより
デバッグオプションを指定した後のものである。In the example of the input source program shown in FIG. 2, the input source program is written in 0 language. The modified program is after debugging options have been specified by the compiler.
該当処理は、サンプルプログラム中の8行目の行番号に
相当する。すなわち、Put2 (c sb);の文が
サブルーチンコールにあ九る。The corresponding process corresponds to the 8th line number in the sample program. That is, the statement Put2 (c sb); is included in the subroutine call.
0言語で社、これを関数コールと云う。そこで、コンパ
イル時の処理により
if(debug) Pr1nt f (’Put2−
(cm%8 、 b−厄)■ ■ ■
■ ■\n”* Csb) :
という文を生成する。In the 0 language, this is called a function call. Therefore, if (debug) Pr1nt f ('Put2-
(cm%8, b-yaku) ■ ■ ■
■■\n”*Csb): Generates the sentence.
■のi f (debug ) Bデバッグフラッグが
オンのときに、以降の文が実行されることを示している
。If (debug) B indicates that the following statements are executed when the debug flag is on.
この種のdebugは、変換後の第1行目に外部宣言文
として実数形の変数で生成される。この文の目的は、当
該サンプルプログラムの実行時に設定されるので、当該
デバッグ情報の出力可否を選択できることにある。例え
ば、ソフトウェアデバッガと併用して使用すれば1部分
的なデバッグ情報の収集が可能となる。This type of debug is generated using real number variables as an external declaration statement in the first line after conversion. The purpose of this statement is that since it is set when the sample program is executed, it is possible to select whether or not to output the debug information. For example, if used in conjunction with a software debugger, it becomes possible to collect partial debugging information.
■のPrfnt(・・・は、0記述で1・・・”の内容
を表示すると云う意味をもつ。■のPu12m(c−は
、コンパイラが宣言され次間数名と、変数名とを表示で
きるように埋込んだものである。■Prfnt (... means to display the contents of 1...'' with 0 description. It is embedded so that it can be done.
■および■は、変数名Cとbとの書式(Cμ文字列、b
は実数)t−満足する形式で表示できるように、コンパ
イラにより生成されたものである。サンプルプログラム
では翻訳処理手段5によりPut2の文に対厄する機械
Rが生成される。■ and ■ are the formats of variable names C and b (Cμ character string, b
is a real number) generated by the compiler so that it can be displayed in a t-satisfying format. In the sample program, the translation processing means 5 generates a machine R that deals with the sentence Put2.
(発明の効果)
以上説明したように本発明は、コンパイル時(7)f/
(ツ/オプシ目ンを活用することにより、デバッグトレ
ース情報全容鳥に収集することができると云う効果があ
る。(Effect of the invention) As explained above, the present invention provides (7) f/
(Using the TS/OPS menu has the effect of being able to collect the entire debug trace information at once.
第1図は1本発明による実行サブルーチンデバッグ情報
量カドレース方式の一実施例全示すブロック図である。
第2図はソースプログラム例を示すサンプログラム図で
ある。
l・・・ソース読込み手段
2・・φサブルーチンコール認識手段
3・・・デバッグトレース生成判定手段4・・・デバッ
グトレース化成手段
5・・・翻訳処理手段
オスFIG. 1 is a block diagram showing an embodiment of the execution subroutine debug information amount quadrase method according to the present invention. FIG. 2 is a sun program diagram showing an example of a source program. l...Source reading means 2...φ subroutine call recognition means 3...Debug trace generation determination means 4...Debug trace creation means 5...Translation processing means (male)
Claims (1)
読込むためのソース読込み手段と、前記読込まれたソー
スプログラム中にサブルーチンコールが存在するか否か
を認識するためのサブルーチンコール認識手段と、コン
パイル時のデバッグオプションによりデバッグトレース
文の出力の可否を判断するためのデバッグトレース生成
判断手段と、デバッグトレース出力時には前記サブルー
チンのサブルーチン名および前記サブルーチンの引数値
を表示するために実行文を生成するためのデバッグトレ
ース生成手段と、前記コンパイラの翻訳処理を行うため
の翻訳処理手段とを具備して構成したことを特徴とする
実行サブルーチンデバッグ情報出力トレース方式。a source reading means for reading statements of a source program as part of a compiler's translation process; a subroutine call recognition means for recognizing whether or not a subroutine call exists in the read source program; A debug trace generation determination means for determining whether a debug trace statement can be output based on a debug option, and a debug trace generation determination means for generating an executable statement to display the subroutine name of the subroutine and the argument value of the subroutine when outputting the debug trace. 1. An execution subroutine debug information output tracing method, comprising: a trace generation means; and a translation processing means for performing translation processing of the compiler.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1066937A JPH02244341A (en) | 1989-03-17 | 1989-03-17 | Execution subroutine debugging information output trace system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1066937A JPH02244341A (en) | 1989-03-17 | 1989-03-17 | Execution subroutine debugging information output trace system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH02244341A true JPH02244341A (en) | 1990-09-28 |
Family
ID=13330414
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1066937A Pending JPH02244341A (en) | 1989-03-17 | 1989-03-17 | Execution subroutine debugging information output trace system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH02244341A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH04307630A (en) * | 1991-04-04 | 1992-10-29 | Nippon Denki Micom Technol Kk | Compiler with simple debugging option |
-
1989
- 1989-03-17 JP JP1066937A patent/JPH02244341A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH04307630A (en) * | 1991-04-04 | 1992-10-29 | Nippon Denki Micom Technol Kk | Compiler with simple debugging option |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Bouchhima et al. | Automatic instrumentation of embedded software for high level hardware/software co-simulation | |
| US5132972A (en) | Assembly language programming potential error detection scheme sensing apparent inconsistency with a previous operation | |
| Rask et al. | Visual studio code vdm support | |
| JPH02244341A (en) | Execution subroutine debugging information output trace system | |
| JPS62113244A (en) | Program test device | |
| JP4055197B2 (en) | Device for analyzing procedures included in the program | |
| JPH10187461A (en) | Language processing system | |
| JP2000353112A (en) | Method and system for debugging intermediate language level | |
| JPH03144832A (en) | Symbolic debugging device for precompiler language program | |
| JP2001147832A (en) | Display system corresponding to source program | |
| van den Brand et al. | TIDE—A Generic Debugging Framework | |
| JPH08212105A (en) | Program management device | |
| Lee | Using LLDB | |
| JPH0272407A (en) | Ladder program converter | |
| JPH0353334A (en) | Output processing system for debug information on language process program | |
| JPH04209029A (en) | Parallel process program translation processor | |
| JPS6365542A (en) | Debugging system | |
| JPH06231003A (en) | Debugger for feasible file | |
| JPH04307630A (en) | Compiler with simple debugging option | |
| JPH05250221A (en) | Simulator execution system | |
| JPH0239331A (en) | Debug sentence producing device | |
| JPH05108372A (en) | System for outputting compiler optimization processing content | |
| JPH0350641A (en) | Debug information output system for language processing program | |
| JPH0588939A (en) | Sub-program unit test method | |
| JPH04250530A (en) | Program conversion and translation device |