JPS61213935A - Step execution system for high-level language program - Google Patents

Step execution system for high-level language program

Info

Publication number
JPS61213935A
JPS61213935A JP60054049A JP5404985A JPS61213935A JP S61213935 A JPS61213935 A JP S61213935A JP 60054049 A JP60054049 A JP 60054049A JP 5404985 A JP5404985 A JP 5404985A JP S61213935 A JPS61213935 A JP S61213935A
Authority
JP
Japan
Prior art keywords
line number
program
level
language
machine language
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.)
Granted
Application number
JP60054049A
Other languages
Japanese (ja)
Other versions
JPH0510692B2 (en
Inventor
Kiyoshi Kodama
児玉 清
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.)
Omron Corp
Original Assignee
Omron Tateisi Electronics Co
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 Omron Tateisi Electronics Co filed Critical Omron Tateisi Electronics Co
Priority to JP60054049A priority Critical patent/JPS61213935A/en
Publication of JPS61213935A publication Critical patent/JPS61213935A/en
Publication of JPH0510692B2 publication Critical patent/JPH0510692B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To execute a program, step by step, at a source language level by receiving a debugging test indication represented by the line number of source language level and converting it into the address of machine word level, and trapping errors. CONSTITUTION:When a debugging test tool 56 operates and a machine word program 55 is loaded in a main storage for the debugging test, a line number table and a variable/function table 200 are generated in the main storage on the basis of line number information 55a and variable/function information 55b added to the machine word program 55. An indication for step execution of high-level language level is sent to a debugging test tool 56 after said tables are generated. On receiving the step execution indication, the debugging test tool 56 compares the current value of a program counter with addresses 16 in the line number table 100 to find the line number 15 of a stop position. A line number 17 to be executed next is taken out on the basis of the obtained line number 15. Further, an address corresponding to the line number 17 to be executed next is found and a trap instruction is set.

Description

【発明の詳細な説明】 〈発明の分野〉 この発明は計算機システムのデバッグ技術に関し、特に
、プログラムの高級言語レベルでのステップ実行方式に
関する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a debugging technique for a computer system, and particularly to a step execution method at a high-level language level of a program.

〈発明の概要〉 高級言語で記述された原始プログラムを機械語プログラ
ムに翻訳(コンパイル)して実行する計算機システムに
おいて、上記プログラムの原始言語レベルの用語と機械
語レベルの用語との対応関係を示す変換テーブルを作成
しておき、デバッグ・テスト時にこの変換テーブルを用
いることにより、原始言語レベルの行番号によるデバッ
グ・テスト指示を受けて、それを機械語レベルのアドレ
スに変換してトラッピングを行ない、プログラムを原始
言語レベルでステップ実行させる。
<Summary of the Invention> In a computer system in which a source program written in a high-level language is translated (compiled) into a machine language program and executed, the correspondence between terms at the source language level and terms at the machine language level of the program is shown. By creating a conversion table and using this conversion table during debugging and testing, it receives debugging and testing instructions using source language level line numbers, converts them to machine language level addresses, and performs trapping. Step through a program at the source language level.

〈発明の背景〉 高級言語で記述されたプログラムはコンパイラにより予
め機械語プログラムに翻訳され、計算機で実行される。
<Background of the Invention> A program written in a high-level language is translated into a machine language program by a compiler in advance, and then executed by a computer.

周知のように、高級言語の1実行分は多くの場合、複数
個の機械暗に翻訳される。
As is well known, a single run of a high-level language is often translated into multiple machine translations.

計算機システムのデバッグを行なう上で、プログラム実
行動作を原始プログラムの高級言語レベルの1実行文ご
とに停止させ、プログラム内の各変数の変化を調べる、
といったステップ実行による動作チェックが重要な操作
である。
When debugging a computer system, it is necessary to stop program execution at each high-level language level executable statement of the source program and examine changes in each variable within the program.
Checking the operation by step execution is an important operation.

ところが従来のデバッグ装置におけるステップ実行方式
は機械暗レベルであって、1機械語ごとに割込みが発生
して停止する。したがって、目的とする高級言語レベル
の1実行文のステップ実行を制御するために1機械語レ
ベルのステップ実行を何回も繰返さなければならない。
However, the step execution method in conventional debugging devices is at a machine black level, and an interrupt is generated for each machine word and the process is stopped. Therefore, in order to control step execution of one executable statement at the target high-level language level, step execution at one machine language level must be repeated many times.

そのために余分な処理時間を消費し、このことがデバッ
グの能率向上を阻害していた。
This consumes extra processing time, which hinders improvements in debugging efficiency.

〈発明の目的〉 この発明の目的は、高級言語レベルでのステップ実行を
直接的に効率よく行なえるようにすることにある。
<Object of the Invention> An object of the invention is to enable direct and efficient step execution at a high-level language level.

〈発明の構成と効果〉 上記の目的を達成するために、この発明に係るステップ
実行方式は、高級言語で記述された原始プログラムを計
算機の機械暗に翻訳し、当該計算様の主記憶上での動作
に適した形に連係編集して当該計算機の記憶装置に格納
する手段と、この翻訳に伴って上記プログラムの原始速
鎖レベルの用語と機械暗レベルの用語との対応関係を示
す変換テーブルを作成して尚該計算壁の記憶装置に格納
する手段と、プログラムのデバッグ・テストを行なうた
めのデバッグ機能部と、このデバッグ機能部に伝達され
た原始言語レベルの行番号によるデバッグ・テスト指示
を受け、上記変換テーブルを用いて上記行番号に対応し
た機械語レベルのアドレスを求める手段と、その求めて
アドレス上の元の機械語を保存してから、そのアドレス
にトラップを設定する手段と、設定されたトラップを解
除し、保存しておいた上記機械語を復旧する手段と、デ
バッグ・テスト中のプログラムの進行を把握し、  j
 − 現状の行番号から次に実行すべき行番号を取出す手段と
を備えたことを特徴とする。
<Structure and Effects of the Invention> In order to achieve the above object, the step execution method according to the present invention implicitly translates a source program written in a high-level language into the computer's main memory. means for link-editing the program into a form suitable for its operation and storing it in the computer's storage device; and, along with this translation, a conversion table showing the correspondence between the terms at the primitive speed chain level and the terms at the machine dark level of the program. means for creating and storing it in the storage device of the calculation wall, a debug function unit for debugging and testing the program, and debug test instructions based on line numbers at the source language level transmitted to the debug function unit. means to obtain a machine language level address corresponding to the above line number using the above conversion table, and a means to obtain and save the original machine language at the address and then set a trap at that address. , a means to release the set traps, restore the saved machine language, and understand the progress of the program during debugging and testing.
- Means for extracting the line number to be executed next from the current line number.

このステップ実行方式によれば、高級言語レベルの行番
号を指示して、原始プログラムの1実行文ごとのステッ
プ実行を直接的に効率よく行なうことができ、デバッグ
の能率向上に大いに寄与する。
According to this step execution method, it is possible to directly and efficiently perform step execution of each executable statement of a source program by specifying a line number at a high-level language level, which greatly contributes to improving the efficiency of debugging.

〈実施例〉 第1図はこの発明の一実施例を示すフローチャートであ
る。翻訳ステップ(A)では、高級言語で記述された原
始プログラム51(全体は7〜8個で構成される)を翻
訳プログラム52で処理し、翻訳単位でとの機械語プロ
グラム53を得る。従来と異なり、この機械語プラグラ
ム53に付帯して、原始プログラム51の行番号情報5
3aおよび変数/関数情報53bが出力される。
<Embodiment> FIG. 1 is a flowchart showing an embodiment of the present invention. In the translation step (A), a source program 51 written in a high-level language (total consists of 7 to 8 programs) is processed by a translation program 52 to obtain a machine language program 53 in units of translation. Unlike in the past, line number information 5 of the source program 51 is attached to this machine language program 53.
3a and variable/function information 53b are output.

次のステップ(ハ)では、翻訳単位ごとの機械語プログ
ラム53の全体を連係編集プログラム54で処理し、実
行単位としてまとまった機械語プログラム55を得る。
In the next step (c), the entire machine language program 53 for each translation unit is processed by the link editing program 54 to obtain a machine language program 55 organized as an execution unit.

この機械語プログラム55が計= 4− 算機の主記憶上で実行される形のもので、当該計算機の
記憶装置に格納される。第2図に示すように、高級言語
による原始プログラム51が機械語プログラム55に翻
訳されると、原始プラグラム51の1実行文は複数個の
機械語命令になる。
This machine language program 55 is executed on the main memory of the computer and is stored in the storage device of the computer. As shown in FIG. 2, when a source program 51 written in a high-level language is translated into a machine language program 55, one executable statement of the source program 51 becomes a plurality of machine language instructions.

実行単位にまとまった機械語プログラム55を得る際に
、上述の翻訳単位ごとの行番号情報53aと変数/関数
情報53bもプログラム55の付帯情報55a 、 5
5bとしてまとめられる。
When obtaining the machine language program 55 organized into execution units, the line number information 53a and variable/function information 53b for each translation unit described above are also added to the incidental information 55a, 5 of the program 55.
It is summarized as 5b.

次にデバッグ・テストステップについて説明する。第1
図の56は機械語プログラム55がプログラマの所望の
機能、性能を発揮するか否かを確認するプログラムで、
一般にデパック・テストツールと称されている。57は
デバッグ・テストツール56に対して与えるデバッグ・
テスト指示であり、58は機械言語プログラム55およ
びデ□バッグ・テストツール56からのデバッグ・テス
ト結果の情報である。
Next, the debugging/testing steps will be explained. 1st
56 in the figure is a program for checking whether the machine language program 55 exhibits the functions and performance desired by the programmer.
It is generally called the Depak Test Tool. 57 is a debug/testing tool 56.
58 is information on debug test results from the machine language program 55 and the debug test tool 56.

デバッグ・テストツール56が作動し、機械暗プログラ
ム55がデバッグ・テストされるために主記憶上に取出
されると、まず、機械語プログラム55に付帯した行番
号情報55aと変数/関数情報55bに基づいて、第3
図に示す行番号テーブル100と変数/関数テーブル2
00が主記憶上に作成される。
When the debugging/testing tool 56 is activated and the machine implicit program 55 is retrieved to the main memory for debugging/testing, the line number information 55a and variable/function information 55b attached to the machine language program 55 are first stored. Based on the third
Line number table 100 and variable/function table 2 shown in the figure
00 is created on main memory.

行番号テーブル100には、原始プログラム51の行番
号15と、行番号15に対応した機械語プログラム55
のアドレス16と、次に実行する実行文の行番号17と
、機械語保存エリア18とが1つのまとまりとして、通
常はプログラムの関数単位に整頓され、記憶される。
The line number table 100 includes line number 15 of the source program 51 and the machine language program 55 corresponding to line number 15.
address 16, line number 17 of the next executable statement to be executed, and machine language storage area 18 are usually organized and stored in units of functions of the program as one unit.

変数/関数テーブル200には、関数名19と、す 関数のエンドデアドレスや変数の所在を示すアドレス2
0と、関数の戻り値の型や変数の型2工と、変数のサイ
ズ22と、変数名23などが含まれる。
The variable/function table 200 includes a function name 19 and an address 2 indicating the end address of the function and the location of the variable.
0, the return value type of the function, the variable type 2, the variable size 22, and the variable name 23.

才た行番号テーブル100のポインター4は、変数/関
数テーブル200の関数茗19と関連をとるための情報
である。このポインター4によって、行番号テーブル1
00と変数/関数テーブル200とが関連づけられてい
る。この関連があることで、数に含まれているかを知る
ことができる。
The pointer 4 of the line number table 100 is information for establishing a relationship with the function line 19 of the variable/function table 200. By this pointer 4, row number table 1
00 and a variable/function table 200 are associated with each other. This relationship allows us to know whether something is included in the number.

上記の両テーブル100 、200の作成が終了してか
ら、デバッグ・テストツール56に対して、尚級官語レ
ベルのステップ実行の指示が発せられる。
After the creation of both the tables 100 and 200 described above is completed, an instruction to perform step execution at the advanced official language level is issued to the debugging/testing tool 56.

このステップ実行の指示を受けて、デバッグ・テストツ
ール56は、現在のプログラムカウンタの値と行番号テ
ーブル100のアドレス16とを比較し、停止位置の行
番号15を求める。求めた行番号15から次に実行する
行番号17を取出す。
Upon receiving this step execution instruction, the debug/test tool 56 compares the current program counter value with the address 16 of the line number table 100 to determine the line number 15 at the stop position. The line number 17 to be executed next is extracted from the obtained line number 15.

さらに、次に実行する行番号17に対応するアドレスを
求め、主記憶上のアドレスに割込みを発生するためのト
ラップ命÷をセットする。ただし、トラップ命令をセッ
トする前に、そのアドレスにあったもとの機械語命令を
テーブル100の機械語保存エリア18に保存しておく
Furthermore, the address corresponding to line number 17 to be executed next is determined, and a trap instruction ÷ for generating an interrupt is set at the address on the main memory. However, before setting the trap instruction, the original machine language instruction at that address is saved in the machine language storage area 18 of the table 100.

その後デバッグ・テストツール56は機械語プログラム
55を実行させる。機械語プログラムはセットされた上
記トラップ命命に出合う才で実時間で実行される。トラ
ップ命令に出合うと、トラップ命令と入れ変えに保存エ
リア18に退避しておいて機械語命令を主記憶上のもと
のアドレスに戻す。そしてステップ実行′の完了をデバ
ッグ・テスト結果58として報告する。
Thereafter, the debug/test tool 56 executes the machine language program 55. The machine language program is executed in real time upon encountering the set trap instructions. When a trap instruction is encountered, it is saved to the storage area 18 in place of the trap instruction, and the machine language instruction is returned to its original address on the main memory. Then, the completion of step execution' is reported as a debug test result 58.

上記の説明で明かなように、複数個の機械語命令ごとに
停止させることなく、高級言語の1実行文だけをステッ
プ実行させることができる。上記の処理を順次繰返すこ
とによって、実行時のメモリ容量の増加をきたすことな
く、直接的で高速な高級言語レベルのステップ実行を実
現することができる。
As is clear from the above description, only one executable statement in a high-level language can be executed step by step without stopping each machine language instruction. By sequentially repeating the above processing, direct and high-speed step execution at a high-level language level can be realized without increasing the memory capacity during execution.

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

第1図は本発明を適用したデバッグ・テスト作業の流れ
を示すフローチャート、第2図は高級言語プログラムと
機械語プログラムの対応関係を示す図、第3図は本発明
のステップ実行のために作成される行番号テーブルと変
数/関数テーブルを示す図である。 100・・・行番号テーブル、200・・・変数/関数
テーブル、56・・・デバッグ−テストツール。 第1図 第2図 第3図
Figure 1 is a flowchart showing the flow of debugging and testing work to which the present invention is applied, Figure 2 is a diagram showing the correspondence between high-level language programs and machine language programs, and Figure 3 was created for step execution of the present invention. FIG. 3 is a diagram showing a line number table and a variable/function table. 100...Line number table, 200...Variable/function table, 56...Debug-test tool. Figure 1 Figure 2 Figure 3

Claims (1)

【特許請求の範囲】[Claims] (1)高級言語で記述された原始プログラムを計算機の
機械語に翻訳し、当該計算機の主記憶上での動作に適し
た形に連係編集して当該計算機の記憶装置に格納する手
段と、この翻訳に伴つて上記プログラムの原始原語レベ
ルの用語と機械語レベルの用語との対応関係を示す変換
テーブルを作成して当該計算機の記憶装置に格納する手
段と、プログラムのデバッグ・テストを行なうためのデ
バッグ機能部と、このデバッグ機能部に伝達された原始
言語レベルの行番号によるデバッグ・テスト指示を受け
、上記変換テーブルを用いて上記行番号に対応した機械
語レベルのアドレスを求める手段と、その求めてアドレ
ス上の元の機械語を保存してから、そのアドレスにトラ
ップを設定する手段と、設定されたトラップを解除し、
保存しておいた上記機械語を復旧する手段と、デバッグ
・テスト中のプログラムの進行を把握し、現状の行番号
から次に実行すべき行番号を取出す手段とを備えた高級
言語プログラムのステップ実行方式。
(1) A means for translating a source program written in a high-level language into machine language for a computer, link-editing it into a form suitable for operation on the main memory of the computer, and storing it in the storage device of the computer; A means for creating a conversion table indicating the correspondence between the terms at the source language level and the terms at the machine language level of the program in conjunction with the translation and storing it in the storage device of the computer, and a means for debugging and testing the program. a debug function unit; a means for receiving a debug test instruction based on a source language level line number transmitted to the debug function unit and using the conversion table to obtain a machine language level address corresponding to the line number; A means to save the original machine code on an address and then set a trap on that address and remove the set trap,
Steps of a high-level language program that includes a means for restoring the saved machine language and a means for grasping the progress of the program during debugging and testing and extracting the next line number to be executed from the current line number. Execution method.
JP60054049A 1985-03-18 1985-03-18 Step execution system for high-level language program Granted JPS61213935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60054049A JPS61213935A (en) 1985-03-18 1985-03-18 Step execution system for high-level language program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60054049A JPS61213935A (en) 1985-03-18 1985-03-18 Step execution system for high-level language program

Publications (2)

Publication Number Publication Date
JPS61213935A true JPS61213935A (en) 1986-09-22
JPH0510692B2 JPH0510692B2 (en) 1993-02-10

Family

ID=12959750

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60054049A Granted JPS61213935A (en) 1985-03-18 1985-03-18 Step execution system for high-level language program

Country Status (1)

Country Link
JP (1) JPS61213935A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63223931A (en) * 1987-03-13 1988-09-19 Fujitsu Ltd Logic diagram execution route output processing system
JPS63223928A (en) * 1987-03-13 1988-09-19 Fujitsu Ltd Logic diagram debug processing system
JPH0734178B2 (en) * 1991-03-07 1995-04-12 ディジタル イクイプメント コーポレイション Effective error reporting for executing conversion code
JP2013025559A (en) * 2011-07-21 2013-02-04 Mitsubishi Electric Corp Program trace management device, program trace management method and program

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5723154A (en) * 1980-07-17 1982-02-06 Mitsubishi Electric Corp Test debugging device for program
JPS57100544A (en) * 1980-12-15 1982-06-22 Mitsubishi Electric Corp Debug device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5723154A (en) * 1980-07-17 1982-02-06 Mitsubishi Electric Corp Test debugging device for program
JPS57100544A (en) * 1980-12-15 1982-06-22 Mitsubishi Electric Corp Debug device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63223931A (en) * 1987-03-13 1988-09-19 Fujitsu Ltd Logic diagram execution route output processing system
JPS63223928A (en) * 1987-03-13 1988-09-19 Fujitsu Ltd Logic diagram debug processing system
JPH0734178B2 (en) * 1991-03-07 1995-04-12 ディジタル イクイプメント コーポレイション Effective error reporting for executing conversion code
JP2013025559A (en) * 2011-07-21 2013-02-04 Mitsubishi Electric Corp Program trace management device, program trace management method and program

Also Published As

Publication number Publication date
JPH0510692B2 (en) 1993-02-10

Similar Documents

Publication Publication Date Title
US6219832B1 (en) System and method of using annotations to optimize dynamically translated code in the presence of signals
US6973644B2 (en) Program interpreter
US8448152B2 (en) High-level language, architecture-independent probe program compiler
US6467082B1 (en) Methods and apparatus for simulating external linkage points and control transfers in source translation systems
US20040054991A1 (en) Debugging tool and method for tracking code execution paths
JPH10111818A (en) Method and system for burst profiling
JPH10301807A (en) High speed trap for evaluation of computer software
JPH11338699A (en) Program processing method, method for detecting depth of frame related to designated method, detection method and computer
JPS61213935A (en) Step execution system for high-level language program
US20230101154A1 (en) Resumable instruction generation
Berglund et al. Method summaries for JPF
JP2811804B2 (en) Variable output range specification method
JP2842571B2 (en) Procedure call method
JPS6331811B2 (en)
JPH08320813A (en) Program simulator device and program debugging method
JPH0695890A (en) Name replacement system in compiler
Majzik Software monitoring and debugging using compressed signature sequences
JP2697230B2 (en) Debug support device
JP2503632B2 (en) Target program generation method
JPS6365542A (en) Debugging system
JPH05204705A (en) Processing method for detecting undefined parameter
JPH06274351A (en) Optimizing system for compiler
JPH10207738A (en) Language processing system
Malone Implementation of a retrospective tracing facility
JPH07319730A (en) Test debugging method

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term