JPS61180344A - Step execution system for high level language - Google Patents

Step execution system for high level language

Info

Publication number
JPS61180344A
JPS61180344A JP60019868A JP1986885A JPS61180344A JP S61180344 A JPS61180344 A JP S61180344A JP 60019868 A JP60019868 A JP 60019868A JP 1986885 A JP1986885 A JP 1986885A JP S61180344 A JPS61180344 A JP S61180344A
Authority
JP
Japan
Prior art keywords
return
function
point
level language
execution system
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
JP60019868A
Other languages
Japanese (ja)
Inventor
Fumisada Yamazaki
山崎 文貞
Yoshinori Takahashi
義則 高橋
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 JP60019868A priority Critical patent/JPS61180344A/en
Publication of JPS61180344A publication Critical patent/JPS61180344A/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 carry out effectively a debug for each function by setting the step return within a step execution system of a high level language and executing it to release a breakpoint after generation of a break. CONSTITUTION:When an operator gives a command to a RAM2 for return to a point (a) of a caller, a CPU1 obtains the size of a local variable area related to the function which is presently stopped. Then the CPU1 obtains a return address with a stack storing the return address of the function from the value of the present stack pointer and the size of said variable area and extracts it. The step return is set to the extracted return address as a breakpoint and executed. In this case, the process of execution returns to the point (a) by the step return via the procedures (4) and (5). The program processing is broken automatically when the process is returned to the point (a).

Description

【発明の詳細な説明】 く産業上の利用分野〉 本発明は、プログラミング言語、特に日常使われる数式
や記号に近い形で書く高級言語のステップ実行システム
に関する。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to a step execution system for programming languages, particularly high-level languages written in a form similar to mathematical formulas and symbols used in everyday life.

〈発明の概要〉 本発明は、高級言語で書かれたプログラムをデバッグす
る高級言語のステップ実行システムに、ステップリター
ンという新たな概念を取入れ、このコマンドが入力され
れば、呼出し元に戻った場合、自動的にブレイクがかか
るようにして、デバッグ作業の効率向上全図ったもので
ある。
<Summary of the Invention> The present invention incorporates a new concept of step return into a high-level language step execution system for debugging programs written in a high-level language. The system is designed to automatically break the system to improve the efficiency of debugging.

〈従来の技術〉 一般に、高級言語で書かれたプログラムをデバッグ(d
ebug )する場合、文(行)単位のステップ実行が
できるものもあるが、多くは関数単位で行われているの
が現状である。
<Prior art> In general, programs written in high-level languages are debugged (d
ebug), there are some that allow step execution on a statement (line) basis, but most of them are currently executed on a function-by-function basis.

ところで、成る関数単位のデバッグが完了した後、プロ
グラム処理を呼出し元へ戻す場合、従来′は、呼出し元
で新たにブレイクポイントラ設定するか、あるいはその
ま\ステップ実行を継続して行かなければならなか、つ
た。
By the way, in the past, when you want to return program processing to the caller after debugging a function unit, you either have to set a new breakpointer in the caller, or you have to continue step execution. Naranaka, ivy.

プログラムをデバッグする時のデバッグ作業工数が多く
、効率的なデバッグを実施することができなかった。
Debugging a program requires a lot of man-hours, making it impossible to debug efficiently.

そこで、本発明は、上述した問題点に鑑み、関数単位の
デバッグを効率的に実施することのできQ る高級言語のステップ実行Mk提供することを目的とし
ている。
SUMMARY OF THE INVENTION In view of the above-mentioned problems, it is an object of the present invention to provide a step execution Mk for a high-level language that can efficiently debug function units.

く問題点を解決するための手段〉 前記の目的を達成するために、本発明は、高級言語で書
かれたプログラム金デバッグするステップ実行システム
であって、関数のリターンアドレスにブレイクポイント
としてのステップリターンを設定して実行させ、ブレイ
ク発生後にブレイクポイントラ解除することを特徴とす
る。
Means for Solving the Problems> To achieve the above object, the present invention provides a step execution system for debugging a program written in a high-level language, in which a step is set as a breakpoint at the return address of a function. The feature is that a return is set and executed, and a break point is canceled after a break occurs.

〈実施例〉 以下、図面?参照しながら本発明の一実施例を説明する
<Example> Below are the drawings? An embodiment of the present invention will be described with reference to the following.

第1図は本発明が適用される高級言語のステップ実行シ
ステムの概略的ブロック図である。第1図において、1
は命令を解読し、命令にしたがって演′!X動作、記憶
動作、入出力動作、制御動作を行うマイクロプロセッサ
(CPU)、2tifバツクの対象となる被デバツグプ
ログラムが格納されているメモリ(RAM)、3はデバ
ッグプログラムが格納されているメモリ(ROM)、4
はオペレータがデバッグ時に利用するデバッグ用情報表
示装置(CRT )であり、5はキー人力装置(キーボ
ード)であって、これらは、それぞれ図示しない制御信
号バス、アドレスバス、双方向データバスに接続されて
いる。
FIG. 1 is a schematic block diagram of a high-level language step execution system to which the present invention is applied. In Figure 1, 1
deciphers the command and performs according to the command! A microprocessor (CPU) that performs X operations, storage operations, input/output operations, and control operations, 2 memory (RAM) that stores the debugged program that is the target of tif backing, and 3 the memory that stores the debug program. (ROM), 4
5 is a debug information display device (CRT) used by the operator during debugging, and 5 is a key input device (keyboard), which are connected to a control signal bus, an address bus, and a bidirectional data bus (not shown), respectively. ing.

第2図は第1図のメモリ2に格納されている被デバツグ
プログラムの構成図である。この被デバツグプログラム
は2つの関数main(主プログラム)とfuncti
on A(副プログラム)から構成されている。副プロ
グラムは後述の新たな概念であるステップリターンを備
えて成り、呼出し命令(call )によって起動実行
される。また、主プログラムの0点は呼出し元を示し、
この0点で副プログラムつま9、関数func、 (A
) k呼出している。尚、矢印■〜■は実行順序を示す
FIG. 2 is a configuration diagram of the program to be debugged stored in the memory 2 of FIG. 1. This program to be debugged has two functions, main (main program) and function
on A (subprogram). The subprogram includes a step return, which is a new concept described later, and is started and executed by a call instruction (call). Also, the 0 point in the main program indicates the caller,
At this 0 point, subprogram 9, function func, (A
) k is calling. Note that arrows ■ to ■ indicate the order of execution.

関数func、(A)が呼出された時、所謂割込みが発
生した時のスタックメモリマツプを第3図に示す。
FIG. 3 shows a stack memory map when a so-called interrupt occurs when the function func (A) is called.

第3図において、6は関数func、(A)内で使用さ
れる局所変数(各ブロック(手続き)内で宣言される)
エリア、7は戻シ番地を格納するリターンアドレスエリ
ア、8は関数func、(A)の引数エリア、9はスタ
ックポインタである。このスタックポインタ9でスタッ
クメモリのアドレスが操作される。
In Figure 3, 6 is the function func, a local variable used within (A) (declared within each block (procedure))
Area 7 is a return address area for storing a return address, 8 is a function func, an argument area for (A), and 9 is a stack pointer. This stack pointer 9 is used to manipulate the address of the stack memory.

第4図は2つの関数mainとfunc、(A)に必要
な局所変数エリアのサイズNと各関数の配置アドレス(
先頭番地と最終番地)の具体的データの一例を示す構成
図である。これらの局所変数エリアサイズNと配置アド
レスは、第1図のメモリ2に格納される被デバツグプロ
グラムをコンパイルする際に設定され、コンパイラが出
力するものである。
Figure 4 shows the two functions main and func, the size N of the local variable area required for (A), and the location address of each function (
FIG. 3 is a configuration diagram showing an example of specific data of the first address and the last address. These local variable area size N and location address are set when compiling the program to be debugged stored in the memory 2 of FIG. 1, and are output by the compiler.

次に、上述した高級言語のステップ実行システム全周い
て関数func・(A)の0点(実行順序■)から関数
mainの0点(呼出し元)へ戻る動作について説明す
る。
Next, the operation of returning from point 0 (execution order ■) of function func.(A) to point 0 (caller) of function main through the entire step execution system of the high-level language described above will be described.

先ず、オペレータが呼出し元(0点)へ戻れというコマ
ンド要求をキーボード5t−介してデバッグプログラム
(メモリ3)に与える。この指令を受けたCPULは制
御信号にしたがってデバッグプログラム(メモリ3)か
らデータを読出し、現在のプログラムカウンタの値と被
デバツグプログラム(メモリ2)の第4図に示すデータ
とから、割込みによって現在ストップしている関数に関
する局所変数エリア6のサイズNt求める。
First, the operator issues a command request to return to the calling source (point 0) to the debug program (memory 3) via the keyboard 5t. Upon receiving this command, the CPU reads data from the debug program (memory 3) in accordance with the control signal, and uses the current program counter value and the data shown in Figure 4 of the debugged program (memory 2) to determine the current The size Nt of the local variable area 6 related to the stopped function is determined.

次いで、CPU1は、現在のスタックポインタ9の値と
先に求めた局所変数エリア6のサイズNとから、当該関
数のリターンアドレスが格納されているスタック内の当
該リターンアドレスを求め、これを取出す。そして、取
出されたリターンアドレス(戻9番地)にブレイクポイ
ント(breakpaint )としてのステップリタ
ーンを設定して実行させる。この時の実行過程は、ステ
ップリターンによシ実行順序■及び■の手順を経て呼出
し元である0点に戻る。そしてとの0点に戻った時点で
プログラム処理は自動的にブレイクする。
Next, the CPU 1 determines the return address in the stack in which the return address of the function is stored from the current value of the stack pointer 9 and the previously determined size N of the local variable area 6, and retrieves it. Then, a step return is set as a breakpoint (breakpaint) at the retrieved return address (return address 9) and executed. The execution process at this time returns to point 0, which is the calling source, through the steps of the execution order (1) and (2) by step return. Then, when the point returns to 0, the program processing automatically breaks.

この時、CPU1は現在実行中の命令の番地の次の番地
を保持しているプログラムカウンタの値と、先のリター
ンアドレスとを比較することで、0点(呼出し元)であ
ることの確認を行い、この確認後、前記ブレイクポイン
トラ自動的に解除する。従って、デバッグ対象関数に関
する呼出し関数内のステップリターンまでの実行は、ブ
レイクポイントを設定することなく行うことができる。
At this time, CPU1 compares the value of the program counter holding the address next to the address of the currently executed instruction with the previous return address to confirm that the point is 0 (caller). After confirming this, the break pointer is automatically canceled. Therefore, execution up to a step return in the calling function related to the function to be debugged can be performed without setting a breakpoint.

〈発明の効果〉 以上詳述したように、本発明は高級言語のステップ実行
システム内に、ステップリターンという新比な概念き取
込み、このコマンド要求に基づき、プログラム処理が呼
出し元に戻った時、その処理が自動的にブレイクするよ
うにしたものであるから、従来のように、呼出し元に戻
る場合、オペレータがいちいち呼出し元を確認し、しか
る後、ブレイクポイン)を設定して実行させるといった
作業が不要となり、プログラムのデバッグ時における作
業工数を著しく低減せしめ得て、デバッグの効率向上に
役立つ効果が大きい。延いては、プログラムの生産性の
向上を図ることもできる。
<Effects of the Invention> As detailed above, the present invention incorporates a new concept of step return into a high-level language step execution system, and when program processing returns to the calling source based on this command request, Since the process automatically breaks, unlike conventional methods, when returning to the caller, the operator has to check the caller one by one, then set a breakpoint and execute the process. is no longer necessary, and the number of man-hours required when debugging a program can be significantly reduced, which is highly effective in improving debugging efficiency. Furthermore, it is possible to improve the productivity of the program.

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

第1図は本発明が適用される高級言語のステップ実行シ
ステムの概略的ブロック図、第2図は被デバツグプログ
ラムの構成図、第3図はスタックポインタで指定された
スタックメモリの構成図、第4図はコンパイラが出力す
る処理対象としてのデータの一例金示す構成図である。 1・・・CPU(マイクロプロセッサ)、2・・・メモ
リ(RAM)、3・・・メモリ(ROM)、4・・デノ
くラグ月情報表示装置(cRT)、5・・・キー人力装
置、916.スタックポインタ、N・・・局所変数エリ
アサイズ。
FIG. 1 is a schematic block diagram of a high-level language step execution system to which the present invention is applied, FIG. 2 is a configuration diagram of a program to be debugged, and FIG. 3 is a configuration diagram of a stack memory specified by a stack pointer. FIG. 4 is a configuration diagram showing an example of data to be processed output by the compiler. 1...CPU (microprocessor), 2...Memory (RAM), 3...Memory (ROM), 4...Denokulug month information display device (cRT), 5...Key human power device , 916. Stack pointer, N...Local variable area size.

Claims (1)

【特許請求の範囲】[Claims] 高級言語で書かれたプログラムをデバッグするステップ
実行システムであつて、関数のリターンアドレスにブレ
イクポイントとしてのステップリターンを設定して実行
させ、ブレイク発生後にブレイクポイントを解除するこ
とを特徴とする高級言語のステップ実行システム。
A step execution system for debugging programs written in a high-level language, which is characterized by setting a step return as a breakpoint at the return address of a function, executing it, and canceling the breakpoint after a break occurs. step execution system.
JP60019868A 1985-02-06 1985-02-06 Step execution system for high level language Pending JPS61180344A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60019868A JPS61180344A (en) 1985-02-06 1985-02-06 Step execution system for high level language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60019868A JPS61180344A (en) 1985-02-06 1985-02-06 Step execution system for high level language

Publications (1)

Publication Number Publication Date
JPS61180344A true JPS61180344A (en) 1986-08-13

Family

ID=12011194

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60019868A Pending JPS61180344A (en) 1985-02-06 1985-02-06 Step execution system for high level language

Country Status (1)

Country Link
JP (1) JPS61180344A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0310339A (en) * 1989-06-07 1991-01-17 Yokogawa Electric Corp Debugging method with functional step function
JPH03129439A (en) * 1989-07-05 1991-06-03 Nec Corp Debugging system
JPH0756766A (en) * 1993-08-10 1995-03-03 Nec Corp Tracing device

Citations (1)

* 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

Patent Citations (1)

* 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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0310339A (en) * 1989-06-07 1991-01-17 Yokogawa Electric Corp Debugging method with functional step function
JPH03129439A (en) * 1989-07-05 1991-06-03 Nec Corp Debugging system
JPH0756766A (en) * 1993-08-10 1995-03-03 Nec Corp Tracing device

Similar Documents

Publication Publication Date Title
JPS61180344A (en) Step execution system for high level language
JPH0581070A (en) Programmable controller and user program execution method in programmable controller
JPS61180342A (en) Step execution system for high level language
JP2659366B2 (en) Debugging method and device
JP2001166966A (en) Method for managing execution environment of program to be tested in debugger
JPH0465729A (en) Symbolic debugger
JPH0262639A (en) Interruption system for language debugger
JPS5835648A (en) Program execution controlling system
JPH01152505A (en) Program debugging system for pc
JPH04333146A (en) Program execution control system for debugging
JPH02284236A (en) Program debugging processor
JP2695497B2 (en) Suspension notification device for statements that share instructions
JPS63163543A (en) Information processor
JPS638946A (en) Program debug supporting system
JPH0772874B2 (en) Interrupt receiving device
JP3075359B2 (en) Program debugging start processing method
JPS6214240A (en) Program inspecting system
JPH03175539A (en) Debugging microprocessor
JPH06214828A (en) Interactive debug controller
JP2006350676A (en) Program debugging method of built-in system
JPH0795288B2 (en) Microcomputer
JPH05233365A (en) Optimized code debugging system
JPH05342052A (en) Debugging system
JPH0695910A (en) Interactive debugging control system for abnormality processing
JPS61286936A (en) Step operation control system