JPS6393044A - Program translation/compiling connection system - Google Patents

Program translation/compiling connection system

Info

Publication number
JPS6393044A
JPS6393044A JP61239571A JP23957186A JPS6393044A JP S6393044 A JPS6393044 A JP S6393044A JP 61239571 A JP61239571 A JP 61239571A JP 23957186 A JP23957186 A JP 23957186A JP S6393044 A JPS6393044 A JP S6393044A
Authority
JP
Japan
Prior art keywords
program
arguments
subroutine
called
actual
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
JP61239571A
Other languages
Japanese (ja)
Inventor
Mutsuko Ichiki
市來 睦子
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP61239571A priority Critical patent/JPS6393044A/en
Publication of JPS6393044A publication Critical patent/JPS6393044A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To prevent abnormal actions in case of a program executing and to improve the debugging efficiency by storing the number of both read and dummy arguments of a subroutine into an object module when a program is translated and performing comparison between the numbers of real and dummy arguments when a program is compiled and connected. CONSTITUTION:A main program A10 and subroutines B20, C30 and D40 are provided to a program object module. Then the number of arguments of routines A-D are stored in the areas 10b, 11b, 12...30b, 31b and 40b of the program A and routines B-D respectively. While the head addressed called within a module of a program itself and the head addresses corresponding to called routines A-D are stored in other areas 10a, 12a...30a and 40a as the number of real arguments. In a compiling/connecting mode the comparison is performed between numbers of real and dummy arguments among modules. Thus it is possible to prevent abnormal actions in a program executing mode.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、高位言語で記述されたプログラムのデバッ
グ効率向上の為の技術に関するものである0 〔従来の技術〕 第2図、第3図、第4図は、従来のプログラム翻訳(コ
ンパイル)時の外部手続き(fブルーチン)参照に関す
るものである。第2図、第4図はFORTRANで記述
されたプログラム例、第3図は、プログラムオブジェク
トモジュール図で、メインプログラムA (10)、 
?ブルーチンB (20) 、 C(30)、 D (
40)を表わしたものである。
[Detailed Description of the Invention] [Field of Industrial Application] This invention relates to a technology for improving the efficiency of debugging programs written in a high-level language. [Prior Art] Figs. 2 and 3 , FIG. 4 relates to a conventional reference to an external procedure (f broutine) during program translation (compilation). Figures 2 and 4 are program examples written in FORTRAN, and Figure 3 is a program object module diagram, with main program A (10),
? Brutin B (20), C (30), D (
40).

第2図において、 (IL (2L (3)は命令文で
ある。
In FIG. 2, (IL (2L) (3) is an imperative sentence.

第3図において、 (loa)+ (20a)、 (3
0a)、 (40a) Ld、プログラム自身のオブジ
ェクトモジュール内先頭相対アドレス(以下、先頭アド
レスと呼ぶ。)。
In Figure 3, (loa) + (20a), (3
0a), (40a) Ld, the start relative address within the object module of the program itself (hereinafter referred to as the start address).

(Lla) 、 (12a) 、 (31a)は、それ
ぞれプログラム内でコールしているサブルーチンの先頭
アドレスである。
(Lla), (12a), and (31a) are the start addresses of subroutines called within the program, respectively.

次に、動作につい′て説明する。Next, the operation will be explained.

マス、プログラムがコンパイルされるときの引数に関す
る動作について述べる。プログラムがコンパイルされる
と、プログラム自身の、先頭アドレス、又プログラム内
でサブルーチンがコールされると、それに対応した先頭
アドレスが、オブジェクトモジュール内に記述される。
This section describes the behavior regarding arguments when a program is compiled. When a program is compiled, the start address of the program itself, and when a subroutine is called within the program, the corresponding start address is written in the object module.

(第2図において%MA工HAがコンパイルされると、
Aの先頭アドレスが第3図(10a)に、?ブルーチン
B、Cがコ−ルされると、それぞれの先頭アドレスが第
3図(lla) s (12a)に記述される。)?ブ
ルーチンの中でさらにテブル−チンがコールされる場合
も、同様に、自分自身の先頭アドレスと、サブルーチン
の先頭アドレスがオブジェクトモジュール内に記述され
る。(MA工NAのサブルーチンCの中でサブルーチン
Dがコール(第2図+ (3) )されると、93図(
30a)にCの先頭アドレスが(31a)に、Dの先頭
アドレスが記述される。) 次に、エラーチェックについて説明する。同一モジュー
ル内で、複数回、同じサブルーチンがコールされるとき
、前回のサブルーチント比べて、実引数の個数、及いは
、型が一致しない場合は、コンパイルエラーとみなし、
その旨を、プログラマに通知する。(第4図MA工N 
APRにお^てサブルーチンSOB t (st)がコ
ール(5)されると、前回コール(4)シた。同じサブ
ルーチンSUB 1 (81,82)と、実引数の個数
が等しくない為、コンパイルエラーとなる。又、サブル
ーチンSUB 2 (c2)iEコール(7)されると
、前回コール(6)シた。同じサグルーチンSUB 2
 (C1)と実引数の型が異なる( C1:REAL。
(In Figure 2, when %MA-HA is compiled,
The first address of A is shown in FIG. 3 (10a), ? When routines B and C are called, their respective start addresses are written in (12a) in FIG. )? When a routine is further called within a routine, its own start address and the start address of the subroutine are similarly written in the object module. (When subroutine D is called in subroutine C of MA Engineering NA (Fig. 2 + (3)), Fig. 93 (
The start address of C is written in 30a), and the start address of D is written in (31a). ) Next, error checking will be explained. When the same subroutine is called multiple times within the same module, if the number or types of actual arguments do not match compared to the previous subroutine, it will be considered a compilation error.
Notify the programmer accordingly. (Fig. 4 MA work N
When the subroutine SOB t (st) is called (5) in APR, it is the same as the previous call (4). A compilation error occurs because the number of actual arguments is not equal to that of the same subroutine SUB 1 (81, 82). Also, when the subroutine SUB 2 (c2) iE is called (7), the previous call (6) is executed. Same sag routine SUB 2
The type of the actual argument is different from (C1) (C1: REAL.

cz: INTEGER書4)ため、コンパイルエラー
となる。
cz: INTEGER 4), resulting in a compilation error.

以上の様に、コンパイルされたオブジェクトモジュール
は、それぞれ編集結合されて実行可能なロードモジュー
ルとなる。
As described above, the compiled object modules are edited and combined to become an executable load module.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来のプログラム翻訳、Ii集結合方式は、以上の様に
構成されているので、同一モジュール内で複数回、同じ
サブルーチンがコールされるときは、前回のサブルーチ
ンと実引致の個数、型をチェックするだけで、テブル−
チンそのものの引数の個数、型が正しいかどうかけチェ
ックしない。
The conventional program translation, Ii set combination method is configured as described above, so when the same subroutine is called multiple times in the same module, the number and type of actual invocations are checked with the previous subroutine. Just a table
It does not check whether the number and type of arguments of the function itself are correct.

又、プログラムの中で、あるサブルーチンが一度だけコ
ールされた時も同様に、そのサブルーチンの実引数の個
数、型が正しいかどうかチェックしない。(第4図にお
いてサブルーチンSUB 3 (DI、 D2 )がコ
ールされる(8)とき、実引数の個数が2、実開WKD
I、 D2の型xxTzaEn’)gが正しいかどうか
は、確定でない。) このように、モジュール間の実引数、仮引数の個数が一
致しない場合でも、その不一致は検出されずに、リンク
されるため、実引数以外のエリアをアクセスするなどの
原因によシ、プログラム実行時に、一般に、異常動作を
おこし、デバッグ効率が低くなる、などの問題があった
Similarly, when a subroutine is called only once in a program, no checks are made to see if the number and type of actual arguments of that subroutine are correct. (In FIG. 4, when the subroutine SUB 3 (DI, D2) is called (8), the number of actual arguments is 2, and the actual open WKD
It is not certain whether the type xxTzaEn')g of I, D2 is correct. ) In this way, even if the numbers of actual and formal arguments between modules do not match, the mismatch will not be detected and will be linked. During execution, there are generally problems such as abnormal behavior and reduced debugging efficiency.

この発明は、上記の様な問題点を解決するために、なさ
れたもので、モジュール間の実引数、仮引数の個数をチ
ェックすることが可能なプログラム翻訳2編集結合方式
を得ることを目的としている。
This invention was made in order to solve the above-mentioned problems, and its purpose is to obtain a program translation 2-edit combination method that can check the number of actual arguments and formal arguments between modules. There is.

〔問題点を解決するための手段J この発明に係わる、プログラム翻訳1編集結合方式は、
リンク時にそなえて、オブジェクトモジュール内に、f
ブルーチン引数の個数を格納するエリアを投けたもので
ある。
[Means for solving the problem J The program translation 1 editing combination method according to this invention is as follows:
At the time of linking, in the object module, f
This is an area that stores the number of routine arguments.

〔作用〕[Effect]

この発明におけるプログラム翻訳tJi集結合方式は、
従来の翻訳2編集結合方式に加え、プログラム翻訳時に
、実引数、仮引数の個数を格納エリアに格納し、プログ
ラム廁集結合時に、サブルーチンコール側の実引数の個
数と、対応するサブルーチンの仮引数の個数を比較し、
異なるときは、その旨をプログラマに通知する。
The program translation tJi collection combination method in this invention is as follows:
In addition to the conventional translation 2-edit combination method, when a program is translated, the number of actual arguments and formal arguments is stored in the storage area, and when the program is compiled, the number of actual arguments on the subroutine call side and the formal arguments of the corresponding subroutine are stored. Compare the number of
If different, notify the programmer accordingly.

〔実施例j 以下、この発明の一実施例を図について説明する。第1
図はプログラムオブジェクトモジュール図で、メインプ
ログラムA(10)、サブルーチンB(20)、  C
(30)、 D (40)を表わしたもの、第2図は、
 E’0RTRANで記述されたプログラム例である。
[Embodiment j Hereinafter, one embodiment of the present invention will be described with reference to the drawings. 1st
The figure is a program object module diagram, with main program A (10), subroutines B (20), and C.
(30), D (40) is shown in Figure 2.
This is an example of a program written in E'0RTRAN.

第1図において、(LOb)、 (llb) 、 (1
2b)、 (20b)、 (30b)、 (31b) 
、 (40b)はサブルーチンの引数の個数を格納する
エリア、その他は第3図と同じものを表わす。
In Figure 1, (LOb), (llb), (1
2b), (20b), (30b), (31b)
, (40b) is an area for storing the number of arguments of the subroutine, and the other parts are the same as in FIG.

第2図において(1)、 (2)、 (3)は命令文で
ある。
In Figure 2, (1), (2), and (3) are imperative sentences.

第2図、メインプログラムAがコンパイルされると、人
の先頭アドレスが第1図(loa)に格納される。次に
サブルーチンB (Bl、B2)、  C(CL、C2
)がコールされる(第2図(1)+ (2) )と、そ
れぞれの先頭アドレスが第1図(lla) + (12
a)に実引数の個数、即ち、2,2が(Llb)、 (
12b)K格納される。すブルーチンB(BL)がコン
パイルされると、Bの先頭アドレスが第1図、 (20
a)に、仮引数の個数、即ち、lが(20b)に格納さ
れる。サブルーチンCのコンパイル時にも同様K (3
0a)、 (3ob)にCの先頭アドレス、仮引数の個
数が格納される。サブルーチンC内でサブルーチンDが
コールされる(@2図(3))場合も同様にDの先頭ア
ドレスが(31a)に、実引数の個数が(31b)に格
納される。
When the main program A in FIG. 2 is compiled, the head address of the person is stored in FIG. 1 (LOA). Next, subroutines B (Bl, B2), C (CL, C2
) is called ((1) + (2) in Figure 2), each start address becomes (lla) + (12) in Figure 1.
The number of actual arguments in a), that is, 2,2 is (Llb), (
12b) K is stored. When broutine B (BL) is compiled, the start address of B is shown in Figure 1 (20
In a), the number of formal arguments, ie, l, is stored in (20b). Similarly, when compiling subroutine C, K (3
The start address of C and the number of formal arguments are stored in 0a) and (3ob). When subroutine D is called within subroutine C (@2 (3)), the start address of D is similarly stored in (31a) and the number of actual arguments is stored in (31b).

次に編集結合時の処理について述べる。Next, processing during editing and combining will be described.

メインプログラムAがリンクされると、まず、サブルー
チンCとサブルーチンDの結合のため(第1図、(31
b))に格納され九サブルーチンDの実引数の個数と(
40b)に格納されたサブルーチンDの仮引数の個数を
比較する。(この場合、(31b)= 1 。
When main program A is linked, first, subroutine C and subroutine D are linked (Fig. 1, (31)
b) The number of actual arguments of the nine subroutine D stored in ) and (
The number of formal arguments of subroutine D stored in 40b) is compared. (In this case, (31b)=1.

(40b)= 1で等しい。)メインプログラムAとサ
ブルーチンB、Cを結合するときも同様に行なう。
(40b) = 1 and are equal. ) The same procedure is used when connecting main program A and subroutines B and C.

この場合、サブルーチンBKついて、実引数の個数は、
第1図、  (llb)=2 、仮引数の個&は(20
b)=1で等しくない為、その旨をプログラマに通知し
、処理を終了する。
In this case, the number of actual arguments for subroutine BK is
Figure 1, (llb)=2, the number of formal arguments & is (20
b) = 1, so they are not equal, so the programmer is notified of this and the process is terminated.

〔発明の効果〕〔Effect of the invention〕

以上の様に、この発明によれば、プログラム翻訳時にサ
ブルーチンの実引致、仮引数の個数をオブジェクトモジ
ュール内に格納し、プログツム編集結合時に、モジュー
ル間の実引数と仮引数の個数の比較を行なうので、プロ
グラム実行時の異常動作を未然に防ぐことができ、プロ
グラムのデバッグが効率良く、かつ高速に行なえるとい
う効果がある。
As described above, according to the present invention, the actual invocation of a subroutine and the number of formal arguments are stored in the object module during program translation, and the numbers of actual arguments and formal arguments between modules are compared when the program is edited and combined. Therefore, abnormal operations can be prevented during program execution, and the program can be debugged efficiently and at high speed.

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

第1図は、この発明の一実施例によるプログラムオブジ
ェクトモジュール図でメインプログラムA (10a)
、サブルーチンB (20)、  c (30)、  
D (40)を表わしたもの、第2図はFOR丁RAM
で記述されたプログラム例(メインプログラムA、サブ
ルーチンB、C,D)、第3図は従来方式によるプログ
ラムオブジェクトモジュール図、第4図はFORTRA
Nで記述されたプログラム例(メインプログラムAPR
)である。 第1図、第3図において、 (10a)はメインプログラムAの先頭アドレス、(1
0b)はメインプログラム人の引数の個数、(Lla)
はメインプログラムAでコールされるサブルーチンBの
先頭アドレス、 (llb)iiメインプログラムAで
コールされるサブルーチンBの実引数の個数、(12a
)はメインプログラムAでコールされるサブルーチンC
の先頭アドレス、(12b)ViメインプログラムAで
コールされるサブルーチンCの実引数の個数、(20a
)はサブルーチンBの先頭アドレス、 (20b)はサ
ブルーチンBの仮引数の個数、(30a)はサブルーチ
ンCの先頭アドレス、 (30b)はサブルーチンCの
仮引数の個& 、 (31a)はテブル−チンCでコー
ルされるサブルーチンDの先頭アドレス、(31b)は
サブルーチンCでコールされるサブルーチンDの実引数
の個& 、 (40a)はサブルーチンDの先頭アドレ
ス、(40b)はサブルーチンDの仮引数の個数、であ
る。 第2図(υ、(2)けメインプログラムAの命令文、(
3)はサブルーチンCの命令文、 184図において(4)〜(8)はメインプログラムA
PRの命令文である。 なお図中同一符号は同−又は相当部分を示す。 代 理 人  大  岩   増  雄第1図 第2図 AIN A SustzourlNs  B(Br)SLIBROu
丁INE    C(CI 、(”2)、fUBl;?
0LITINE  D(DI)TOP ND @3図 40 : +7Fルー÷ンD 第4図 /1’1AIN    APR REAL      CI INTEQER’に4   C2、DI 、 D2δT
OP ND
FIG. 1 is a program object module diagram of a main program A (10a) according to an embodiment of the present invention.
, subroutine B (20), c (30),
D (40), Figure 2 is FORDRAM
An example of a program written in (main program A, subroutines B, C, D), Figure 3 is a program object module diagram using the conventional method, and Figure 4 is a FORTRA program example.
Example of a program written in N (main program APR
). In Figures 1 and 3, (10a) is the start address of main program A, (1
0b) is the number of arguments of the main programmer, (Lla)
is the start address of subroutine B called by main program A, (llb)ii the number of actual arguments of subroutine B called by main program A, (12a
) is subroutine C called by main program A.
start address, (12b) the number of actual arguments of subroutine C called by Vi main program A, (20a
) is the start address of subroutine B, (20b) is the number of formal arguments of subroutine B, (30a) is the start address of subroutine C, (30b) is the number of formal arguments of subroutine C, and (31a) is the number of formal arguments of subroutine C. The start address of subroutine D called by C, (31b) is the number of actual arguments of subroutine D called by subroutine C, (40a) is the start address of subroutine D, and (40b) is the number of formal arguments of subroutine D. The number is. Figure 2 (υ, (2)) Instruction statement of main program A, (
3) is the instruction statement of subroutine C, and in Figure 184, (4) to (8) are the main program A.
This is a PR imperative. Note that the same reference numerals in the figures indicate the same or equivalent parts. Agent Masuo OiwaFigure 1Figure 2AIN A SustzourlNs B(Br)SLIBRou
Ding INE C(CI, (“2), fUBl;?
0LITINE D(DI)TOP ND @3 Figure 40: +7F run D Figure 4/1'1AIN APR REAL CI INTEQER' to 4 C2, DI, D2δT
OPND

Claims (1)

【特許請求の範囲】[Claims] 高位言語、例えばFORTRAN記述されたプログラム
翻訳、編集結合方式において、オブジェクトモジュール
内に実引数と仮引数の個数を格納するエリアを設け、プ
ログラム翻訳時に実引数、仮引数の個数を格納し、編集
結合時にモジュール間の実引数、仮引数の個数を比較し
、不一致を検出してエラー情報を出力することを特徴と
するプログラム翻訳、編集結合方式。
In the translation and editing combination method of programs written in a high-level language, such as FORTRAN, an area for storing the number of actual arguments and formal parameters is provided in the object module, and the number of actual arguments and formal parameters is stored during program translation, and the editing combination is performed. A program translation and editing combination method characterized by comparing the numbers of actual arguments and formal arguments between modules, detecting discrepancies, and outputting error information.
JP61239571A 1986-10-07 1986-10-07 Program translation/compiling connection system Pending JPS6393044A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61239571A JPS6393044A (en) 1986-10-07 1986-10-07 Program translation/compiling connection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61239571A JPS6393044A (en) 1986-10-07 1986-10-07 Program translation/compiling connection system

Publications (1)

Publication Number Publication Date
JPS6393044A true JPS6393044A (en) 1988-04-23

Family

ID=17046777

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61239571A Pending JPS6393044A (en) 1986-10-07 1986-10-07 Program translation/compiling connection system

Country Status (1)

Country Link
JP (1) JPS6393044A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02110738A (en) * 1988-10-20 1990-04-23 Nec Corp Erroneous input detecting system
JPH02240729A (en) * 1989-03-14 1990-09-25 Nec Corp Static check system for transfer of parameter of inter-program connection function

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02110738A (en) * 1988-10-20 1990-04-23 Nec Corp Erroneous input detecting system
JPH02240729A (en) * 1989-03-14 1990-09-25 Nec Corp Static check system for transfer of parameter of inter-program connection function

Similar Documents

Publication Publication Date Title
WO1992015946A1 (en) System and method for preserving source instruction atomicity in translated program code
JPS6393044A (en) Program translation/compiling connection system
KR0125605B1 (en) Method and device for verifying operation of machine language program
US6178547B1 (en) Method and apparatus for generating non-redundant symbolic debug information in computer programs
JPH0736734A (en) Method for checking argument value
Berglund et al. Method summaries for JPF
JPS63147232A (en) Inspection system for matchability
Illmann Data Flow Analysis of the University of Victoria Earth System Climate Model
KR100216533B1 (en) The event history recording method for the deterministic replay of concurrent chill program
JPS62293305A (en) Software developing device for fa controller
JPH01205348A (en) Program debugging system
JPS6398031A (en) Check system for suffix value
Fares et al. Design of a BPEL verification tool
JP2807162B2 (en) Program translator
JP3942546B2 (en) Processing program
JPH03100837A (en) Detection system for shared data access
JPH05324402A (en) Test state measuring system for program
JPH03290739A (en) Dynamic analysis system for program
JPS6365542A (en) Debugging system
JPS63178341A (en) Program debugging system
JPH01137336A (en) System for checking external procedure interface
JPH0358232A (en) Preprocessor calling system
JPS62109135A (en) Program producing method
JPH01258029A (en) Data processor
JPH03235128A (en) In-line development processing method for taking over working directory