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

Step execution system for high-level language program

Info

Publication number
JPS61213936A
JPS61213936A JP60054050A JP5405085A JPS61213936A JP S61213936 A JPS61213936 A JP S61213936A JP 60054050 A JP60054050 A JP 60054050A JP 5405085 A JP5405085 A JP 5405085A JP S61213936 A JPS61213936 A JP S61213936A
Authority
JP
Japan
Prior art keywords
statement
sentence
program
step execution
level 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.)
Pending
Application number
JP60054050A
Other languages
Japanese (ja)
Inventor
Yoshinori Takahashi
義則 高橋
Fumisada Yamazaki
山崎 文貞
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 JP60054050A priority Critical patent/JPS61213936A/en
Publication of JPS61213936A publication Critical patent/JPS61213936A/en
Pending 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 improve the efficiency of debugging by analyzing the statement structure of a high-level language program and storing start positions of statements, etc., and controlling the execution and stop of the program while regarding the start positions as break points. CONSTITUTION:A CPU analyzes the statement structure of the source program in high-level language which is stored in a memory, and store its compiled machine word program in the memory and also generates a statement number table 20 and a statement structure table 30 in the memory. When a command for step execution up to right before a statement in the statement at a stop position is supplied while the program is stopped, a stop position statement number (i) in the source program is checked on the basis of the value of a program counter and the statement number table to take the statement number (j) of the statement in the statement corresponding to the statement number (i) out of the statement structure table 30. The program is executed until the start address of the machine word program which has the statement number (j), then stopped, and debugging result information is displayed on a display device.

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.

〈発明の概要〉 首級言語プログラムの文構造を解析し1文の開始位置、
ある文に含まれる文の開始位置、ある文の次に続く文の
開始位置、ある文を包含している文の開始位置を検出し
て記憶しておき、これら開始位置を任意にブレークポイ
ントとしてステップ実行を制御する。
<Summary of the invention> Analyzes the sentence structure of a primary language program and determines the starting position of one sentence,
Detect and memorize the start position of a sentence included in a certain sentence, the start position of a sentence following a certain sentence, and the start position of a sentence that includes a certain sentence, and use these start positions as breakpoints. Control step execution.

〈発明の背景〉 高級言語で記述されたプログラムはコンパイラにより予
め機械語プログラムに翻訳され、計算機で実行される。
<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, one execution of a high-level language is often translated into multiple machine languages.

計算機システムのデバッグを行なう上で、プログラム実
行動作を原始プログラムの高級言語レベルの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実行文のステップ実行を制御するために、機械語レ
ベルのステップ実行を何回も繰返さなければならない。
However, the step execution method in conventional debugging devices is at the machine language level, and an interrupt occurs and stops for each machine language. Therefore, in order to control step execution of one executable statement at the target high-level language level, step execution at the 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.

〈発明の構成と効果〉 上記の目的を達成するために、この発明に係るステップ
実行方式は、まず高級言語プログラムの文構造を解析し
、文の開始位置、ある文に含まれる文の開始位置、ある
文の次に続く文の開始位置。
<Structure and Effects of the Invention> In order to achieve the above object, the step execution method according to the present invention first analyzes the sentence structure of a high-level language program and determines the starting position of a sentence and the starting position of sentences included in a certain sentence. , the starting position of the sentence following a certain sentence.

ある文を包含している文の開始位置を検出して記憶して
おき、指示に応じて上記各文の開始位置をブレークポイ
ントとしてプログラムの実行/停止を制御することを特
徴とする。
It is characterized by detecting and storing the start positions of sentences that include a certain sentence, and controlling execution/stop of the program using the start positions of each of the sentences as breakpoints according to instructions.

このステップ実行方式によれば、ある文の内部に含まれ
る文の直前までのステップ実行2次に続く文の直前まで
のステップ実行、ある文を包含している文の直前または
末尾までのステップ実行を、とくにブレークポイントを
意識することなく半は自動的に行なえるようになり、デ
バッグの能率向上に大いに寄与する。
According to this step execution method, step execution is performed immediately before the statement contained within a certain statement, step execution is performed immediately before the next statement, and step execution is performed immediately before or to the end of the statement that contains the statement. can be done semi-automatically without having to be particularly aware of breakpoints, which greatly contributes to improving debugging efficiency.

〈実施例〉 第1図はこの発明を適用したデバッグ装置のブロック図
である。1はデバッグ処理を実行するCPUである。2
はデバッグ対象となるプログラムが格納されるメモリで
ある。3および4はマンマシンインターフェイスとして
のキー人力装置および表示装置である。5はデバッグ書
モニタ用メモリで、コンパイルされた機械語プログラム
やデバッグに必要なデータを保存するためのメモリであ
る。以下に説明する第2図、第3図のテーブルもデバッ
グ・モニタ用メモリ5に作成される。
<Embodiment> FIG. 1 is a block diagram of a debugging device to which the present invention is applied. 1 is a CPU that executes debug processing. 2
is the memory in which the program to be debugged is stored. 3 and 4 are key human power devices and display devices as man-machine interfaces. Reference numeral 5 denotes a debug document monitor memory, which is a memory for storing compiled machine language programs and data necessary for debugging. Tables shown in FIGS. 2 and 3, which will be explained below, are also created in the debug monitor memory 5.

デバッグに際しまず、CPU1はメモリ2に格納された
高級言語によるソースプログラムをコンパイルするとと
もにソースプログラムの文構造を解析し、コンパイルし
た機械語プログラムをメモリ5に格納するとともに第2
図の文番号テーブル20と第3図の文構造テーブル30
とをメモリ5に作成する。
When debugging, the CPU 1 first compiles a source program in a high-level language stored in the memory 2, analyzes the sentence structure of the source program, stores the compiled machine language program in the memory 5, and
The sentence number table 20 in the figure and the sentence structure table 30 in Figure 3
and is created in memory 5.

高級言語で記述されたプログラムの実行は文により行な
われ1文はひと才とまりの実行単位を表わす。高級言語
においては文は再帰的な定義であり1文のなかに文を含
む構造となる。つまり、“繰返し実行を指示する文や条
件判定を行なう文などは1文を用いて定義される。才た
、文として定義される複文では文の並びで構成される。
A program written in a high-level language is executed using statements, and one statement represents a single execution unit. In high-level languages, sentences are recursively defined and have a structure that includes sentences within one sentence. In other words, a statement that instructs repeated execution or a statement that makes a conditional judgment is defined using one sentence.A complex sentence defined as a simple sentence is composed of a sequence of statements.

第4図に文構造の一例を示している。このプログラムは
文1〜文12からなる。このうち文1について見ると、
文1は文2と文4と文7を含んでいる。さらに文2は文
3を含んでおり、文4は文5を含んでいる。この文5は
さらに文6を含んでいる。また例えば、文4について見
ると1文4は文1に包含されて、いる。
Figure 4 shows an example of a sentence structure. This program consists of statements 1 to 12. Looking at sentence 1,
Sentence 1 includes Sentence 2, Sentence 4, and Sentence 7. Further, sentence 2 includes sentence 3, and sentence 4 includes sentence 5. This sentence 5 further includes sentence 6. For example, looking at sentence 4, sentence 4 is included in sentence 1.

第2図の文番号テーブル20には、ソースプログラムの
各文番号と、機械語プログラムにおける各文に対応した
機械語命令群の開始アドレスおよび終了アドレスとを対
応づけて格約する。
In the statement number table 20 of FIG. 2, each statement number of the source program is associated with the start address and end address of a group of machine language instructions corresponding to each statement in the machine language program.

第3図の文構造テーブル30には、ソースプログラムの
各文番号ごとに、内部に含む文の文番号と、次に続く文
の文番号と、当該文を包含している文の文番号と、コン
トロール情報とを格納する。
For each statement number in the source program, the statement structure table 30 in FIG. , and control information.

コントロール情報としては、上記の文番号情報が複数個
ある場合の区分や、文の区文などを示す情報を格納し、
特殊な場合の対応に用いる。
As control information, information indicating the classification when there are multiple sentence number information, the division sentence of the sentence, etc. is stored,
Used for special cases.

第4図の例について、文4を主体として文構造テーブル
30の内容を説明すると、文4の内部に含む文とは文5
のことであり、文4の次に続く文とは文7のことであり
、文4を包含している文とは文1のことである。
Regarding the example in FIG. 4, the contents of the sentence structure table 30 will be explained with sentence 4 as the main body.The sentences contained within sentence 4 are the sentences contained in sentence 5.
The sentence following sentence 4 is sentence 7, and the sentence that includes sentence 4 is sentence 1.

この発明によれば、次の4種類のステップ実行を、キー
人力装置3からの指示で任意に行なわせることができる
According to this invention, the following four types of steps can be executed arbitrarily by instructions from the key human power device 3.

a・・・停止位置の文の内部に含んだ文の直前までのス
テップ実行 b・・・停止位置の文の次の文の直前までのステップ実
行 C・・・停止位置の文を包含している文の末尾までのス
テップ実行 d・・・停止位置の文を包含している文の直前までのス
テップ実行 第4図中には、文4の直前(先頭)を停止位置とした場
合の、上記4種類のステップ実行の行き先を矢印a、b
、c、dで示している。
a...Step execution up to just before the statement included inside the statement at the stop position B...Step execution up to just before the next sentence of the statement at the stop position C...Including the statement at the stop position Step execution to the end of the sentence containing the sentence d...Step execution to the point immediately before the sentence that includes the sentence at the stop position Figure 4 shows the following steps when the stop position is immediately before (the beginning) of sentence 4. Arrows a and b indicate the destination of the above four types of step execution.
, c, and d.

CPUIのプログラムカウンタ1の値は機械語プログラ
ム上の位置を示すが、そのカウンタ値がソースプログラ
ム上のどの文番号に該当するかは(ソースプログラム上
の位置)、カウンタ値と上記文番号テーブル20とを比
較対照すれば分る。
The value of program counter 1 of the CPUI indicates the position in the machine language program, but which statement number in the source program the counter value corresponds to (position in the source program) is determined by the counter value and the statement number table 20 above. You can understand by comparing and contrasting.

通常、ステップ実行はプログラムの停止状態で行なう。Normally, step execution is performed when the program is stopped.

停止状態にて例えば上記aのステップ実行の指令がキー
人力装置3より与えられると、CPUIは、プログラム
カウンタの値と文番号テーブル20と゛から、ソースプ
ログラム上の停止位置文番号を調べる。その文番号をl
とする。次に文構造テーブル30の文番号iの項目を調
べ、文番号iの文の内部に金談れる文の文番号を取出す
When, for example, a command to execute step a above is given from the key human power device 3 in the stopped state, the CPUI checks the stop position statement number on the source program from the value of the program counter and the statement number table 20. The sentence number is l
shall be. Next, the item of sentence number i in the sentence structure table 30 is checked, and the sentence number of the sentence that can be discussed inside the sentence of sentence number i is extracted.

その文番号をjとする。次に書び文番号テーブル20に
戻り、文番号jの機械語プログラム上の開始アドレスを
調べる。そのアドレスを8jとする。
Let the sentence number be j. Next, return to the written statement number table 20 and check the start address of statement number j on the machine language program. Let that address be 8j.

アドレス8jが分ったならば、機#i西西口ログラムア
ドレスSjまで実時間で実行して停止し、デバッグ結果
情報を表示装置4に出力する。上記b j ’#dのス
テップ実行の処理も上記と同様である。
Once the address 8j is known, the program is executed in real time up to the machine #i west exit program address Sj and then stopped, and the debug result information is output to the display device 4. The step execution process of b j '#d is also the same as above.

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

第1図は本発明が適用されるデバッグ装置のブロック図
、第2図は本発明のステップ実行のために作成された文
番号テーブルを示す図、第3図は同じく文構造テーブル
を示す図、第4図は文構造の一例を示す図である。 20・・・文番号テーブル、30・・・文構造テーブル
FIG. 1 is a block diagram of a debugging device to which the present invention is applied, FIG. 2 is a diagram showing a statement number table created for step execution of the present invention, and FIG. 3 is a diagram also showing a statement structure table. FIG. 4 is a diagram showing an example of a sentence structure. 20...Sentence number table, 30...Sentence structure table.

Claims (1)

【特許請求の範囲】[Claims] (1)高級言語で記述されたプログラムのデバッグを行
なう装置において、上記プログラムの文構造を解析し、
文の開始位置、ある文に含まれる文の開始位置、ある文
の次に続く文の開始位置、ある文を包含している文の開
始位置を検出して記憶しておき、指示に応じて上記各文
の開始位置をブレークポイントとしてプログラムの実行
/停止を制御することを特徴とする高級言語プログラム
のステップ実行方式。
(1) In a device for debugging a program written in a high-level language, the sentence structure of the program is analyzed,
It detects and memorizes the start position of a sentence, the start position of a sentence included in a certain sentence, the start position of a sentence following a certain sentence, and the start position of a sentence that includes a certain sentence, and then A step execution method for a high-level language program, characterized in that execution/stop of the program is controlled using the start position of each of the above statements as a breakpoint.
JP60054050A 1985-03-18 1985-03-18 Step execution system for high-level language program Pending JPS61213936A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60054050A JPS61213936A (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
JP60054050A JPS61213936A (en) 1985-03-18 1985-03-18 Step execution system for high-level language program

Publications (1)

Publication Number Publication Date
JPS61213936A true JPS61213936A (en) 1986-09-22

Family

ID=12959780

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JPS61213936A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0236488A (en) * 1988-07-26 1990-02-06 Sharp Corp Execution detection system for data flow computer
JPH0262639A (en) * 1988-08-30 1990-03-02 Fujitsu Ltd Interruption system for language debugger
JPH04263339A (en) * 1991-02-18 1992-09-18 Fujitsu Ltd Interruption position retrieving system
JPH0749799A (en) * 1990-04-02 1995-02-21 Siemens Ag Apparatus and method for automation

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57153343A (en) * 1981-03-18 1982-09-21 Hitachi Ltd Compile method for architecture program
JPS59202546A (en) * 1983-05-02 1984-11-16 Omron Tateisi Electronics Co Debugging device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57153343A (en) * 1981-03-18 1982-09-21 Hitachi Ltd Compile method for architecture program
JPS59202546A (en) * 1983-05-02 1984-11-16 Omron Tateisi Electronics Co Debugging device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0236488A (en) * 1988-07-26 1990-02-06 Sharp Corp Execution detection system for data flow computer
JPH0262639A (en) * 1988-08-30 1990-03-02 Fujitsu Ltd Interruption system for language debugger
JPH0749799A (en) * 1990-04-02 1995-02-21 Siemens Ag Apparatus and method for automation
JPH04263339A (en) * 1991-02-18 1992-09-18 Fujitsu Ltd Interruption position retrieving system

Similar Documents

Publication Publication Date Title
US6550056B1 (en) Source level debugger for debugging source programs
US6961924B2 (en) Displaying variable usage while debugging
US6964036B2 (en) Descriptive variables while debugging
US7552425B2 (en) Implementing enhanced compiled breakpoint analysis
US6981248B2 (en) Conditional breakpoint encountered indication
US9361205B2 (en) Code coverage framework
JPS61213936A (en) Step execution system for high-level language program
KR20010085997A (en) Thread-oriented debugging
US6611924B1 (en) Reducing code size of debug output statements
JP4055197B2 (en) Device for analyzing procedures included in the program
JP2570593B2 (en) Debug device
JP2659366B2 (en) Debugging method and device
JPH0465729A (en) Symbolic debugger
JPH0262639A (en) Interruption system for language debugger
JPS5894041A (en) Debug backup device for high-class language
JPH05250221A (en) Simulator execution system
JP2728504B2 (en) Input statement checker
JPS63223931A (en) Logic diagram execution route output processing system
JPH04236635A (en) Identification name retrieval processing system
JPH03175539A (en) Debugging microprocessor
JPH07281924A (en) Trace device and emulator using the trace device
JPH01274253A (en) Software break system
JPH05334135A (en) Error information display system for abnormal end of program
JPH05342052A (en) Debugging system
JPH0795288B2 (en) Microcomputer