JPH01211135A - Program debugging system - Google Patents
Program debugging systemInfo
- Publication number
- JPH01211135A JPH01211135A JP63037928A JP3792888A JPH01211135A JP H01211135 A JPH01211135 A JP H01211135A JP 63037928 A JP63037928 A JP 63037928A JP 3792888 A JP3792888 A JP 3792888A JP H01211135 A JPH01211135 A JP H01211135A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- subroutine
- debugging
- routine
- time
- 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 23
- 238000010586 diagram Methods 0.000 description 6
- 238000004904 shortening Methods 0.000 description 1
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
この発明は、高級言語で記述されたプログラムの単体試
験、組合せ試験時のデバッグ効率を向上させるプログラ
ムデバッグ方式に関するものである0
〔従来の技術〕
第4図は例えばO860/UMX FORTRAN 7
7説明書(昭和60年11月20日三菱電機株式会社発
行)の第10〜11頁に示される「選択的コンパイル行
」を用いた、従来のプログラムデバッグ方式を示すソー
ス形式図で、高級言語の1つであるフォートラン(FO
RTRAN )言語を用いて記述されておシ、図におい
て、1はメインルーチン、2はサブルーチン、3はメイ
ンルーチン1内に前記「選択的コンパイル行」にて記述
された、特殊処理の一例としてのデバッグプリント出力
の命令、4は同様にメインルーチン1内に前記「選択的
コンパイル行」Kて記述された、前記サブルーチン2を
呼び出すためのサブルーチンコールの命令である0次に
動作について説明する。第5図はそのデバッグの手順を
示すフローチャートであシ、第4図に示すようにデバッ
グプリント出力の命令3を「選択的コンパイル行」とし
て、この第5図のフローチャートに従って作業を進めて
ゆくもので、まず、ステップSTIにてデバッグプリン
ト出力の要否が判定される。その結果、デバッグプリン
トの出力が必要である場合には、処理はステップST2
に渡されて、例えばOS 60 / UMX FORT
RAN 77利用の手引き(昭和60年4月20日三菱
電機株式会社発行)の第5〜6頁に示される[コンパイ
ルオプションX」を指定あシとしてコンパイルが実行さ
れ、また、デバッグプリントの出力が不要であれば、処
理はステップST3へ渡されて「コンパイルオプション
X」指定なしとしてコンパイルが実行される。その後、
ステップST4にてリンクされ、ステップST5にてデ
バッグが行われる。[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a program debugging method that improves debugging efficiency during unit tests and combination tests of programs written in a high-level language. ] Figure 4 shows, for example, O860/UMX FORTRAN 7
This is a source format diagram showing the conventional program debugging method using the "selective compile line" shown on pages 10-11 of the 7 Instruction Manual (published by Mitsubishi Electric Corporation on November 20, 1985). Fortran (FO) is one of the
In the figure, 1 is a main routine, 2 is a subroutine, and 3 is an example of special processing described in the "selective compilation line" in the main routine 1. The debug print output instruction 4 will also be described with respect to the 0th order operation, which is a subroutine call instruction for calling the subroutine 2, which is written in the main routine 1 as the "selective compile line" K. Figure 5 is a flowchart showing the debugging procedure.As shown in Figure 4, instruction 3 of the debug print output is set as a "selective compile line" and the work is carried out according to the flowchart in Figure 5. First, in step STI, it is determined whether debug print output is necessary. As a result, if it is necessary to output a debug print, the process proceeds to step ST2.
For example OS 60/UMX FORT
Compilation is executed with the [Compile option If unnecessary, the process is passed to step ST3, and compilation is executed without specifying "compile option X". after that,
Linking is performed in step ST4, and debugging is performed in step ST5.
第6図はこのようにして第4図に示すソースリストをコ
ンパイル・リンクした場合のロードモジュールの構成を
示す説明図であシ、同図(4)は「コンパイルオプショ
ンX」指定あシでコンパイル・リンクした場合のロード
モジュールを示し、同図CB)ハrコンパイルオプシコ
ンX J 指定fx L テコンパイル・リンクした場
合のロードモジュールを示している。「コンパイルオプ
ションX」指定あシの場合、第6図(ト)に示すように
「選択的コンパイル行」で記述されたデバッグプリント
出力の命令3、及びサブルーチンコールの命令4の各命
令が実行文3aもしくは4aとしてコンパ、イルされ、
ステップST4にてリンクされると、サブルーチンコー
ルの命令4に従ってサブルーチン2が取シ込まれ、実行
時にはデバッグプリント出力の命令3に従ってデバッグ
プリントが出力され、サブルーチン2が実行される。ま
た、「コンパイルオプションX」指定なしの場合には、
第6図の)K示すように「選択的コンパイル行」で記述
された各命令3.4は非実行文(コメント)3b 、4
bとしてコンパイルされ、これらのコメント3a 、4
bは実行時にスキップされて実行されないため、リンク
してもサブルーチン2が取シ込まれることはなく、デバ
ッグプリントが出力されることもない。Figure 6 is an explanatory diagram showing the structure of the load module when the source list shown in Figure 4 is compiled and linked in this way, and (4) in the same figure is compiled with "compile option X" specified.・This shows the load module when linked, and shows the load module when linked. In the case of "Compile option Compiled and compiled as 3a or 4a,
When linked in step ST4, subroutine 2 is loaded in accordance with subroutine call instruction 4, and during execution, a debug print is output in accordance with debug print output instruction 3, and subroutine 2 is executed. Also, if "compile option X" is not specified,
As shown in Figure 6), each instruction 3.4 written in a "selective compilation line" is a non-executable statement (comment) 3b, 4.
Compiled as b, these comments 3a, 4
Since subroutine b is skipped during execution and is not executed, subroutine 2 is not imported even if it is linked, and no debug print is output.
デバッグプリント出力要否の変更の有無はステップST
6にてチエツクされておシ、ステップST5におけるデ
バッグの途中でデバッグプリント出力の要否を変更する
時は、処理をステップST1へ戻してコンパイルよシ作
業を再開する。ここで、第4図に示すごとく、コンパイ
ル処理には20〜30分程度の処理時間を必要とし、リ
ンク処理には5〜7分程度の処理時間を必要とする。Check whether or not to change the necessity of debug print output in step ST.
If the necessity of debug print output is changed during debugging in step ST5, the process returns to step ST1 and the compiling operation is restarted. Here, as shown in FIG. 4, the compiling process requires a processing time of about 20 to 30 minutes, and the linking process requires a processing time of about 5 to 7 minutes.
従来のプログラムデバッグ方式は以上のように構成され
ているので、デバッグプリント出力等の特殊処理の使用
/不使用を変更する場合には、再度コンパイル・リンク
を行わなければならず、この再コンパイル・リンクの処
理には前述のごとく30〜40分程度の処理時間を必要
とするため、デバッグ効率が非常に悪くなるという問題
点があった。Conventional program debugging methods are configured as described above, so if you want to change the use/non-use of special processing such as debug print output, you must compile and link again. As mentioned above, link processing requires a processing time of about 30 to 40 minutes, which poses a problem in that debugging efficiency becomes extremely poor.
この発明は上記のような問題点を解消するためになされ
たもので、特殊処理の使用/不使用の変更時に処理され
る、再コンパイル・リンクのために費やされる無駄な時
間を省き、デバッグ効率の良いプログラムデバッグ方式
を得ることを目的とする。This invention was made to solve the above-mentioned problems, and it eliminates wasted time spent on recompiling and linking when changing the use/non-use of special processing, and improves debugging efficiency. The purpose is to obtain a good program debugging method.
この発明に係るプログラムデバッグ方式は、デバッグプ
リント出力等の特殊処理をサブルーチン化してコンパイ
ルし、当該特殊処理の不使用時には前記サブルーチンの
先頭の命令をユーティリティプログラムによって無条件
リターンに書き換えるものである。The program debugging method according to the present invention compiles special processing such as debug printout into a subroutine, and when the special processing is not used, the instruction at the head of the subroutine is rewritten to an unconditional return by a utility program.
この発明におけるプログラムデバッグ方式は、デバッグ
プリント出力等の特殊処理をサブルーチン化し、その特
殊処理の使用/不使用に対応してサブルーチンの先頭の
命令をユーティリティプログラムにて書き換えることに
よシ、特殊処理が必要な場合には前記サブルーチンの先
頭の命令をそのままにして、サブルーチンコールされる
と当該サブルーチンが実行されてデバッグプリントの出
力等が行われるようにし、特殊処理が不要の場合には前
記サブルーチンの先頭の命令を無条件リターンに置き換
え、サブルーチンコールされても当該サブルーチンは実
行されずにメインルーチンへ無条件でリターンされて、
デバッグプリントの出力等が行われないようにする。The program debugging method according to the present invention converts special processing such as debug print output into a subroutine, and rewrites the instruction at the beginning of the subroutine with a utility program depending on whether the special processing is used or not. If necessary, leave the instruction at the beginning of the subroutine as is, so that when the subroutine is called, the subroutine will be executed and output a debug print, etc. If special processing is not required, the instruction at the beginning of the subroutine will be left as is. Replace the command with an unconditional return, so that even if a subroutine is called, the subroutine will not be executed and will return to the main routine unconditionally.
Prevent debug prints from being output.
以下、この発明の一実施例を図について説明する。第1
図において、1はメインルーチン、2はサブルーチン、
5はこのサブルーチン2を呼び出すため前記メインルー
チン1内にあるサブルーチンコールの命令、6は前記サ
ブルーチン2内にあり、特殊処理の一例としてのデバッ
グプリント出力の命令である。ここで、この第1図に示
すソースリストも従来のそれと同様に、高級言語の1つ
であるFORTRAN言語TR−て記述されている。An embodiment of the present invention will be described below with reference to the drawings. 1st
In the figure, 1 is the main routine, 2 is the subroutine,
Reference numeral 5 indicates a subroutine call instruction within the main routine 1 to call this subroutine 2, and 6 indicates a debug print output instruction located within the subroutine 2 as an example of special processing. Here, the source list shown in FIG. 1 is also written in the FORTRAN language TR-, which is one of the high-level languages, like the conventional one.
次に動作について説明する。第2図はそのデバッグの手
順を示すフローチャートであり、まず、ステップST7
にて第1図に示すソースリストをコンパイルし、さらに
ステップST8にてリンクして第3図(3)に示すロー
ドモジュールを得る。次にステップST9でデバッグプ
リント出力の要否の選択をし、必要であればステップS
T 10にてサブルーチン2の先頭の命令8を“NOP
”に、不要であればステップ5T11にて前記命令8を
無条件リターンの“RETURN″に書き換える。デバ
ッグプリント出力要否の変更の有無はステップ5T13
にてチエツクされておシ、ステップ5T12におけるデ
バッグの途中でデバッグプリント出力の要否を変更する
時は、処理をステップST7まで戻して再コンパイル・
リンクすることなく、直接ステップST9に戻して作業
を再開する。Next, the operation will be explained. FIG. 2 is a flowchart showing the debugging procedure. First, step ST7
The source list shown in FIG. 1 is compiled in step ST8, and linked in step ST8 to obtain the load module shown in FIG. 3 (3). Next, in step ST9, it is selected whether or not to output a debug printout, and if necessary, step S
At T10, the first instruction 8 of subroutine 2 is set to “NOP”.
”, if unnecessary, the instruction 8 is rewritten to “RETURN” for unconditional return in step 5T11. Whether or not to change the necessity of debug print output is determined in step 5T13.
If you want to change the necessity of debug print output during debugging in step 5T12, return the process to step ST7 and recompile.
Directly return to step ST9 and restart the work without linking.
ここで、前記ステップST7 、ステップST8のコン
パイル・リンクによって得られた第3図(ト)に示すロ
ードモジュールでは、サブルーチンコールの命令5がサ
ブルーチン2を呼び出す機械語5aに変換され、デバッ
グプリント出力の命令6がデバッグプリント出力の機械
語6aに変換される。このような第2図(ト)のロード
モジュールにおいてプログラムを実行すると、メインル
ーチン1の先頭の命令7から処理が開始され、処理が前
記サブルーチン2を呼び出す機械語5aまで進むと、サ
ブルーチン2が呼び出されてその先頭の命令8に処理が
移る。ここで、このコンパイル管リンク直後では当該サ
ブルーチン2の先頭の命令8は’NOP”であるため、
以下、順次サブルーチン2の命令が実行されてゆき、デ
バッグプリント出力の機械語Satで処理が進むとデバ
ッグプリントが出力される。その後、処理がサブルーチ
ン2の最後の命令9に進むと処理は当該命令9に従って
メインルーチン1へ戻され、前記サブルーチン2を呼び
出す機械語5aの次の命令10から処理が開始され、メ
インルーチン1の最後の命令11を処理して終了する。Here, in the load module shown in FIG. 3 (G) obtained by compiling and linking in steps ST7 and ST8, subroutine call instruction 5 is converted to machine language 5a that calls subroutine 2, and the debug print output is Instruction 6 is converted into machine language 6a for debug print output. When a program is executed in the load module shown in FIG. Then, processing moves to the first instruction 8. Here, immediately after this compile tube link, the first instruction 8 of the subroutine 2 is 'NOP', so
Thereafter, the instructions of subroutine 2 are sequentially executed, and as the processing progresses in the machine language Sat for debug print output, a debug print is output. Thereafter, when the process advances to the last instruction 9 of the subroutine 2, the process returns to the main routine 1 according to the instruction 9, and the process starts from the next instruction 10 of the machine language 5a that calls the subroutine 2. The last instruction 11 is processed and the process ends.
ここで、デバッグプリント出力が不要である場合には、
前記ステップ5T11にてサブルーチン2の先頭の命令
8を“NOP”から無条件リターンの#RETURN”
に書き換える。この書き換えはユーティリティプログラ
ムによって行われる。第3図(B)はこのようにして得
られたロードモジー−ルの構成を示す説明図である。こ
の第2図の)のロードモジュールにおいてプログラムを
実行すると、処理がメインルーチン1の先頭の命令7か
らサブルーチン2を呼び出す機械語5aまで進むと、サ
ブルーチン2が呼び出されてその先頭の命令8に処理が
移る。ここで、このサブルーチン2の先頭の命令8は前
述のごとく“RETURN″に書き換えられているため
、サブルーチン2は実行されずに処理は無条件でメイン
ルーチン1へ戻され、前記サブルーチン2を呼び出す機
械語5aの次の命令10から処理が開始され、メインル
ーチン1の最後の命令11を処理して終了する。デバッ
グ中に、再度デバッグプリントの出力が必要になれば、
前記ステップ5T10においてユーティリティプログラ
ムを用いて、前記サブルーチン2の先頭の命令8を”
RETURN″から“NOP″に書き換える。Here, if you do not need debug print output,
At step 5T11, the first instruction 8 of subroutine 2 is changed from "NOP" to "#RETURN" for unconditional return.
Rewrite it to . This rewriting is performed by a utility program. FIG. 3(B) is an explanatory diagram showing the structure of the load module thus obtained. When the program is executed in the load module () in Fig. 2, when the processing progresses from the first instruction 7 of the main routine 1 to the machine language 5a that calls the subroutine 2, the subroutine 2 is called and the first instruction 8 is processed. will move. Here, since the instruction 8 at the beginning of this subroutine 2 has been rewritten to "RETURN" as described above, subroutine 2 is not executed and the processing is unconditionally returned to main routine 1, and the machine that calls subroutine 2 Processing starts from the instruction 10 following word 5a, and ends after processing the last instruction 11 of main routine 1. If you need to output the debug print again while debugging,
In the step 5T10, a utility program is used to execute the instruction 8 at the beginning of the subroutine 2 as "
Rewrite from “RETURN” to “NOP”.
なお、上記実施例ではデバッグプリント出力の使用/不
使用(要否)を変更する場合について説明したが、デバ
ッグプリントに限らず、その他の特殊処理の使用/不使
用の変更に用いてもよい。In the above embodiment, a case has been described in which the use/non-use (necessity) of debug print output is changed, but the present invention is not limited to debug print, and may be used to change use/non-use of other special processing.
また、上記実施例ではFORTRANで記述されたプロ
グラムをデバッグするものを示したが、他の高級言語で
記述されたプログラムのデバッグに適用してもよく、上
記実施例と同様の効果を奏する。Further, although the above embodiment shows a case where a program written in FORTRAN is debugged, the present invention may be applied to debugging a program written in another high-level language, and the same effects as in the above embodiment can be obtained.
以上のように、この発明によれば、特殊処理をサブルー
チン化してコンパイルし、当該特殊処理の不使用時には
前記サブルーチンの先頭の命令をユーティリティプログ
ラムによって無条件リターンに書き換えるように構成し
たので、特殊処理の使用/不使用の変更時に、約30〜
40分もかかる再コンパイル・リンクを行う必要性がな
くなシ、サブルーチンの先頭の命令の書き換えのための
1〜2分程度の処理時間が加わるだけとなるため、デバ
ッグに必要な時間が大幅に短縮されてデバッグ効率が向
上する効果がある。As described above, according to the present invention, special processing is compiled into a subroutine, and when the special processing is not used, the first instruction of the subroutine is rewritten to an unconditional return by the utility program. Approximately 30~ when changing the use/non-use of
There is no need to recompile and link, which takes up to 40 minutes, and the processing time required for rewriting the first instruction of the subroutine is only about 1 to 2 minutes, so the time required for debugging is significantly reduced. This has the effect of shortening the time and improving debugging efficiency.
第1図はこの発明の一実施例によるプログラムデバッグ
方式を示すソース形式図、第2図はそのデバッグ手順を
示すフローチャート、第3図はそのロードモジュールの
構成を示す説明図、第4図は従来のプログラムデバッグ
方式を示すソース形式図、第5図はそのデバッグ手順を
示すフローチャート、第6図はそのロードモジュールの
構成ヲ示す説明図である。
1はメインルーチン、2はサブルーチン、6は特殊処理
(デバッグプリント出力)の命令、8はサブルーチンの
先頭の命令。
なお、図中、同一符号は同一、又は相当部分を示す。FIG. 1 is a source format diagram showing a program debugging method according to an embodiment of the present invention, FIG. 2 is a flowchart showing the debugging procedure, FIG. 3 is an explanatory diagram showing the configuration of the load module, and FIG. 4 is a conventional FIG. 5 is a flowchart showing the debugging procedure, and FIG. 6 is an explanatory diagram showing the configuration of the load module. 1 is the main routine, 2 is the subroutine, 6 is the special processing (debug print output) instruction, and 8 is the first instruction of the subroutine. In addition, in the figures, the same reference numerals indicate the same or equivalent parts.
Claims (1)
述されたプログラムのプログラムデバッグ方式において
、デバッグプリント出力等の特殊処理を前記サブルーチ
ン化してコンパイルし、前記特殊処理の使用/不使用に
対応して前記サブルーチンの先頭の命令をユーティリテ
ィプログラムにて書き換え、前記特殊処理不使用時には
前記サブルーチンの先頭の命令を無条件リターンとする
ことを特徴とするプログラムデバッグ方式。In a program debugging method for a program consisting of a main routine and a subroutine and written in a high-level language, special processing such as debug printout is compiled into the subroutine, and the subroutine is changed depending on whether the special processing is used or not. A program debugging method characterized in that the first instruction is rewritten by a utility program, and when the special processing is not used, the first instruction of the subroutine is set as an unconditional return.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63037928A JPH01211135A (en) | 1988-02-19 | 1988-02-19 | Program debugging system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63037928A JPH01211135A (en) | 1988-02-19 | 1988-02-19 | Program debugging system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH01211135A true JPH01211135A (en) | 1989-08-24 |
Family
ID=12511218
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63037928A Pending JPH01211135A (en) | 1988-02-19 | 1988-02-19 | Program debugging system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH01211135A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006338271A (en) * | 2005-06-01 | 2006-12-14 | Nec Electronics Corp | Test system and test method |
-
1988
- 1988-02-19 JP JP63037928A patent/JPH01211135A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006338271A (en) * | 2005-06-01 | 2006-12-14 | Nec Electronics Corp | Test system and test method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2811990B2 (en) | Program processing device and program processing method | |
US20030115576A1 (en) | Breakpoint safety net | |
JP2004164554A (en) | Device and method for executing and monitoring program | |
JP2001184218A (en) | Optimization method in compile of mpi program | |
JPH01211135A (en) | Program debugging system | |
JPH11110256A (en) | Device and method for debugging program, and computer readable recording medium recorded with the method for the same | |
JP3372387B2 (en) | Program inspection method | |
JPS5930145A (en) | Reexecution processing system by dynamic program correction | |
JP3903514B2 (en) | Optimized compiler for undefined variable detection | |
JP3587644B2 (en) | Method of creating test program for semiconductor device | |
JPH03290739A (en) | Dynamic analysis system for program | |
JPH0358232A (en) | Preprocessor calling system | |
Meinicke et al. | Tool Support for Product-Line Maintenance | |
JP2002278790A (en) | Method for acquiring debug information | |
JPH0126091B2 (en) | ||
JPH05341982A (en) | Program development supporting device | |
JPH02100732A (en) | Program grammar checking system | |
JPS62108338A (en) | Program testing device | |
JPS6292032A (en) | Test method for program | |
JPS63205740A (en) | Program executing trace processing system | |
JPS61264441A (en) | Compiling system | |
JP2001014185A (en) | Compiling and debugging method | |
JPS63313235A (en) | Operation system | |
JPH04241042A (en) | Program correction system | |
Weber | Implementation issues: session summary |