JPH05250221A - Simulator execution system - Google Patents

Simulator execution system

Info

Publication number
JPH05250221A
JPH05250221A JP4051165A JP5116592A JPH05250221A JP H05250221 A JPH05250221 A JP H05250221A JP 4051165 A JP4051165 A JP 4051165A JP 5116592 A JP5116592 A JP 5116592A JP H05250221 A JPH05250221 A JP H05250221A
Authority
JP
Japan
Prior art keywords
stack
program
unit
execution
instruction
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
JP4051165A
Other languages
Japanese (ja)
Inventor
Michiko Ishida
享子 石田
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP4051165A priority Critical patent/JPH05250221A/en
Publication of JPH05250221A publication Critical patent/JPH05250221A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To easily confirm a stack size in a program execution state and also to accurately set the stack size. CONSTITUTION:An input part 103 is provided to input the information produced by a language processing program from an input file 102 together with a simulation executing part 107 which simulates the instruction corresponding to the input of the information, an analyzing part 105 which analyzes the contents of the character strings inputted from a monitor control console 104 and set on a start row, and a control/display part 106 which controls and displays the execution of a program carried out at the part 107. Furthermore the part 107 includes a stack information detecting part 109 which detects and outputs the memory area information used by a stack in a program execution state, a stack designated value holding part 110 which holds the designated value of a stack pointer, a stack value holding part 111 which holds the stack pointer value in an instruction execution state, and a memory/register contents holding part 112 which holds the value of the stack pointer.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はシミュレータ実行方式に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a simulator execution method.

【0002】[0002]

【従来の技術】一般に、プログラムの開発においては、
プログラムの作成、実行および実行準備として、エディ
タ、アセンブラ、コンパイラおよびリンカ等が使用され
る。エディタは、プログラムを利用者の指定に従って編
集するツールであり、アセンブラおよびコンパイラは、
プログラミング言語で記述されたプログラムを計算機向
きの言語に翻訳するプログラムである。また、リンカ
は、アセンブラおよびコンパイラにより翻訳された複数
の情報を結合するプログラムである。しかしながら、こ
れらを使用して作成されたプログラムには、通常誤りが
生じるために、この誤りを検出(以下、デバッグと云
う)しなければならない。デバッグの方法としては、机
上デバッグとマシン・デバッグがある。前者の場合は、
プログラムの流れ図およびプログラム・リストにより、
各命令および流れ図の各段階の動作を検査してゆく方法
であり、後者の場合は、実際にプログラムを実行させて
変数の状態などを調べてゆく方法である。このマシン・
デバッグの代表的な手段には、インサーキット・エミュ
レータまたはシミュレータがあるが、最終的には、実機
によりデバッグしなければならない。シミュレータと
は、ホスト・コンピュータ上で目的のCPUまたはI/
Oの動作をソフトウェア的に疑似実行して、プログラム
の動作をチェックするためのソフトウェア・ツールであ
る。このシミュレータの一般的な機能としては、指定さ
れたアドレスからプログラムを実行させる機能、前以っ
て設定された条件が満たされた時にプログラムの実行を
停止させるブレークポイント、記憶装置に記憶されてい
る内容をディスプレイに表示させるダンプ、およびプロ
グラムの実行によるプログラム・カウンタ、スタック・
ポインタのアドレス値およびレジスタの内容等をディス
プレイに表示するトレース等を含む幾つかの機能があ
る。
2. Description of the Related Art Generally, in developing a program,
An editor, an assembler, a compiler, a linker, and the like are used for creating, executing, and preparing for execution of a program. The editor is a tool that edits the program according to the user's specifications, and the assembler and compiler are
It is a program that translates a program written in a programming language into a language suitable for a computer. The linker is a program that combines pieces of information translated by the assembler and the compiler. However, since an error usually occurs in a program created using these, this error must be detected (hereinafter referred to as debugging). Desktop debugging and machine debugging are available as debugging methods. In the former case,
Program flow chart and program listing
This is a method of inspecting the operation of each instruction and each step of the flow chart. In the latter case, it is a method of actually executing a program to check the state of variables. This machine
An in-circuit emulator or a simulator is a typical means for debugging, but in the end, it must be debugged by an actual machine. The simulator is the target CPU or I / O on the host computer.
It is a software tool for checking the operation of a program by simulating the operation of O as software. As a general function of this simulator, the function to execute the program from the specified address, the breakpoint to stop the execution of the program when the condition set in advance is satisfied, and it is stored in the storage device. Dump to display the contents on the display, and program counter, stack
There are several functions, including traces that display pointer address values and register contents on a display.

【0003】このシミュレータを使用してデバッグをす
る際には、プログラムの実行時のメモリ領域の利用に影
響を及ぼすような設計上の問題から、計算機が暴走する
ような事態が往々にして生じる。プログラムを実行する
ためのメモリ領域には、大きく分けて、静的メモリ領域
と動的メモリ領域とがあり、静的メモリ領域には、プロ
グラムの利用者がプログラム中に定義したデータ構造、
変数および定数等が割当てられており、動的メモリ領域
には、プログラム中の手続きを連係する情報のために必
要な領域、式の評価および引数の転送に一時的に必要と
する領域として使用される。この動的メモリ領域への割
当てには、一般的にヒープ割当てと、スタック割当てが
あり、プログラム実行時にサイズが変更される。従っ
て、プログラムの実行時において、スタック領域として
設定された以外の領域で、スタックを使用しようとする
場合には、スタック・オーバー・フローとなり暴走して
しまう場合がある。このような場合には、プログラム利
用者は、スタック・サイズの設定を変更したり、プログ
ラムの各所にデータを表示するチェック・ルーチンを記
述したり、または根気よくプログラムを実行してはトレ
ースを行い、その出力結果よりスタック・ポインタおよ
び各レジスタの内容を一つ一つ確認することにより対処
しているのが現状である。
When debugging is performed using this simulator, a computer often runs out of control due to a design problem that affects the utilization of a memory area during execution of a program. The memory area for executing a program is roughly divided into a static memory area and a dynamic memory area, and the static memory area has a data structure defined in the program by the user of the program,
Variables and constants are allocated, and the dynamic memory area is used as an area required for information relating to procedures in a program, and an area temporarily required for expression evaluation and argument transfer. It Allocation to the dynamic memory area generally includes heap allocation and stack allocation, and the size is changed when the program is executed. Therefore, when the stack is used in an area other than the area set as the stack area during the execution of the program, a stack overflow may occur, causing a runaway. In such cases, the program user can change the stack size setting, write a check routine that displays data in various places in the program, or patiently execute the program and perform tracing. The current situation is to check the contents of the stack pointer and each register one by one from the output result.

【0004】近年、プログラムの複雑化に伴ない、機械
語よりも高水準の言語の使用頻度が高まってきている。
高水準言語は、特定のコンピュータに依存されず、人間
の言語に近いという利点はあるが、機械語と比較する
と、ソースプログラム中で細かいメモリの管理ができな
いという欠点がある。このために、プログラムの開発時
において、プログラム実行時のスタックの使用するメモ
リ領域を予想することが困難であり、特に割込み処理を
考慮する場合には容易ではない。
In recent years, the use of languages at a higher level than machine languages has increased with the complexity of programs.
High-level languages have the advantage that they are not dependent on any particular computer and are close to human languages, but they have the disadvantage of being incapable of fine memory management in source programs as compared to machine languages. For this reason, it is difficult to predict the memory area used by the stack during program development during program development, and this is not easy, especially when interrupt processing is taken into consideration.

【0005】上述したプログラム暴走時の対処方法の
内、スタック・サイズの設定を変更する場合には、実行
時に最もスタックを使用した時のメモリ領域を判別する
ことができないために、対応策としては、予めスタック
・サイズを大まかに設定しているのが実情である。ま
た、根気よくトレースを続けてデータの確認を行うなど
の対処方法においては、プログラムを根気よく実行して
は、実行された命令数だけトレースを繰返して、スタッ
ク・ポインタおよび各レジスタの動作確認を行っている
ために、多大の手間と時間とを必要としている。
When changing the stack size setting among the above-mentioned measures against program runaway, the memory area when the stack is most used cannot be discriminated at the time of execution. Actually, the stack size is roughly set in advance. In addition, in a coping method such as patiently tracing and checking the data, execute the program patiently and repeat the trace for the number of executed instructions to check the operation of the stack pointer and each register. It takes a lot of time and effort to do so.

【0006】[0006]

【発明が解決しようとする課題】上述した従来のシミュ
レータの実行方式においては、シミュレータによるトレ
ースの出力結果より、実行時におけるスタック・サイズ
を確認する場合には、プログラムを根気よく実行して
は、実行された命令数だけトレースを行い、その出力結
果よりスタック・ポインタおよび各レジスタの内容を一
つ一つ確認するという操作を必要とし、多大の手間と時
間とを要するという欠点がある。
In the above-mentioned conventional simulator execution method, in order to confirm the stack size at the time of execution from the output result of the trace by the simulator, the program should be patiently executed. It is necessary to perform an operation of tracing the number of executed instructions and checking the contents of the stack pointer and each register one by one from the output result, which is disadvantageous in that much labor and time are required.

【0007】[0007]

【課題を解決するための手段】本発明のシミュレータの
実行方式は、所定のファイルより言語処理プログラムに
より作成された情報を入力するファイル情報入力部と、
前記情報の入力に対応する命令をシミュレートするシミ
ュレート実行部と、所定の監視制御用のコンソールから
入力される起動行上の文字列の内容を解析する解析部
と、前記解析部による文字列解析結果を受けて、前記シ
ミュレート実行部におけるプログラムの実行を制御する
とともに、シミュレート実行状態を含む情報を表示する
制御/表示部と、を少くとも備えて形成されるシミュレ
ータ実行方式において、前記シミュレート実行部におけ
るプログラム実行時に、スタックの使用するメモリ領域
情報を検出して出力するスタック情報検出部と、スタッ
ク・ポインタの指定値を保持するスタック指定値保持部
と、命令実行時におけるスタック・ポインタ値を保持す
るスタック値保持部とを、命令実行手段として前記シミ
ュレート実行部に備えて構成される。
A simulator execution method according to the present invention comprises a file information input section for inputting information created by a language processing program from a predetermined file,
A simulation execution unit that simulates an instruction corresponding to the input of the information, an analysis unit that analyzes the content of a character string on a startup line that is input from a predetermined monitoring and control console, and a character string by the analysis unit In the simulator execution method, which is formed by receiving at least an analysis result, controlling execution of a program in the simulation execution unit, and at least a control / display unit for displaying information including a simulation execution state, The stack information detection unit that detects and outputs the memory area information used by the stack when the simulation execution unit executes the program, the stack specified value holding unit that holds the specified value of the stack pointer, and the stack A stack value holding unit that holds a pointer value is provided in the simulation executing unit as an instruction executing unit. Composed of Te.

【0008】[0008]

【実施例】次に、本発明について図面を参照して説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.

【0009】図1は本発明の第1の実施例を示すシステ
ム構成図である。図1に示されるように、本実施例は、
入力部103、解析部105、制御/表示部106およ
びシミュレート実行部107を含むシミュレータ・プロ
グラム実行手段101と、入力ファイル102と、コン
ソール104とを備えて構成される。
FIG. 1 is a system configuration diagram showing a first embodiment of the present invention. As shown in FIG. 1, in this embodiment,
A simulator / program executing means 101 including an input unit 103, an analyzing unit 105, a control / display unit 106, and a simulation executing unit 107, an input file 102, and a console 104 are provided.

【0010】シミュレータ・プログラム実行手段101
は、上述のように、入力ファイル102のファイル情報
を入力する入力部103と、コンソール104より入力
される起動行状の文字列を解析する解析部105と、解
析部105において解析された結果によりシミュレート
実行部107を制御する制御/表示部106と、入力部
103を介して入力されるファイル情報に対して命令を
シミュレートするシミュレート実行部107とにより形
成されており、このシミュレート実行部107には、命
令を実行する命令実行部108と、メモリとレジスタの
内容を保持するメモリ/レジスタ内容保持部112とが
含まれている。そして、更に、命令実行部108には、
スタックの使用するメモリ情報を検出するスタック情報
検出部109と、スタック指定値保持部110と、スタ
ック値保持部111とが含まれている。
Simulator program executing means 101
As described above, the input unit 103 for inputting the file information of the input file 102, the analysis unit 105 for analyzing the character string in the activation line input from the console 104, and the simulation result by the analysis unit 105 The execution unit 107 is formed by a control / display unit 106 for controlling the execution unit 107 and a simulation execution unit 107 for simulating an instruction for file information input via the input unit 103. 107 includes an instruction execution unit 108 that executes instructions, and a memory / register content holding unit 112 that holds the contents of memory and registers. Further, the instruction execution unit 108 further includes
A stack information detection unit 109 that detects memory information used by the stack, a stack designated value holding unit 110, and a stack value holding unit 111 are included.

【0011】また、図2は、本実施例におけるシミュレ
ータ・プログラム実行手段109に含まれるスタック情
報検出部109における処理手順を示すフローチャート
である。入力ファイル102よりシミュレータ・プログ
ラム実行手段109に入力されるファイル情報は、コン
ソール104にプログラムの実行を指示する起動行が入
力される場合には、次の手順において処理される。
FIG. 2 is a flow chart showing the processing procedure in the stack information detecting section 109 included in the simulator / program executing means 109 in this embodiment. The file information input from the input file 102 to the simulator / program executing means 109 is processed in the following procedure when a startup line instructing execution of the program is input to the console 104.

【0012】なお、本実施例においては、スタック・ポ
インタの値は、アドレス値の大きいメモリ領域から割当
てられるものとする。また、図2のフローチャートにお
ける「はじめ」と「おわり」は、シミュレーションのコ
ンマンド入力待ち状態に相当している。
In this embodiment, the value of the stack pointer is assigned from the memory area having a large address value. Moreover, "beginning" and "end" in the flowchart of FIG. 2 correspond to the command input waiting state of the simulation.

【0013】先ず、初期化処理ステップ201におい
て、変数SP MINにスタック・ポインタの初期値を
設定する。初期化処理ステップ202においては、入力
ファイル102より入力されたファイル情報から得られ
るスタック・サイズを、初期化処理ステップ201にお
いて設定されたSP MINの値から差引き、その値を
変数SP SIZEに設定する。読込み処理ステップ2
03においては、入力された前記ファイル情報より1命
令を読込む。終了判定処理ステップ204においては、
読込み処理ステップ203において読込まれた命令が、
図1のコンソール104において実行を指示された命令
であるか否かを判定する。この終了判定処理ステップ2
04において、もしもコンソール104より実行するこ
とを指示された命令である場合には、命令実行処理ステ
ップ206に移行し、またコンソール104より実行す
ることを指示された命令でない場合には、コンソール1
04によるプログラムの実行は終了したものと判定さ
れ、最小スタック・ポインタ値出力処理ステップ205
に移行する。
First, in the initialization processing step 201, the initial value of the stack pointer is set in the variable SP MIN. In the initialization processing step 202, the stack size obtained from the file information input from the input file 102 is subtracted from the value of SP MIN set in the initialization processing step 201, and the value is set in the variable SP SIZE. To do. Read processing step 2
In 03, one command is read from the input file information. In the end determination processing step 204,
The instruction read in the read processing step 203 is
It is determined whether or not the instruction is an instruction to be executed in the console 104 of FIG. This end determination processing step 2
In 04, if it is the instruction instructed to be executed by the console 104, the process proceeds to the instruction execution processing step 206, and if it is not the instruction instructed to be executed by the console 104, the console 1 is executed.
It is determined that the execution of the program by 04 has ended, and the minimum stack pointer value output processing step 205
Move to.

【0014】最小スタック・ポインタ値出力処理ステッ
プ205においては、SP MINの値をコンソール1
04に出力し、シミュレータをコマンド入力待ちの状態
に設定する。ここにおいて表示されるSP MINは、
プログラム実行時にスタックが使用するメモリ領域の最
小アドレス値を表わしている。
In the minimum stack pointer value output processing step 205, the value of SP MIN is set to the console 1
It outputs to 04 and sets the simulator to the state of waiting for command input. The SP MIN displayed here is
It represents the minimum address value of the memory area used by the stack during program execution.

【0015】他方、命令実行処理ステップ206におい
ては、読込み処理ステップ203において読込まれた命
令を実行し、その結果をメモリおよびレジスタに保存す
る。この命令実行処理ステップ206における処理は、
図1の命令実行部108とメモリ/レジスタ内容保持部
110において実行される。
On the other hand, in the instruction execution processing step 206, the instruction read in the reading processing step 203 is executed, and the result is stored in the memory and the register. The processing in this instruction execution processing step 206 is
It is executed by the instruction execution unit 108 and the memory / register content holding unit 110 of FIG.

【0016】命令判定処理ステップ207においては、
読込み処理ステップ203において読込まれた命令が、
スタックを操作する命令か否かの判定を行う。もしも、
読込み処理ステップ203において読込まれた命令が、
スタックを操作する命令である場合には、スタック・ポ
インタ・エラー判定処理ステップ208に移行し、そう
でない場合には、読込まれた命令がスタックを操作する
命令でないと判定されて、読込み処理ステップ203に
戻る。
In the command decision processing step 207,
The instruction read in the read processing step 203 is
It is determined whether the instruction is a stack operation instruction. If,
The instruction read in the read processing step 203 is
If it is an instruction to operate the stack, the process proceeds to the stack pointer error determination processing step 208. If not, it is determined that the read instruction is not an instruction to operate the stack, and the read processing step 203. Return to.

【0017】スタック・ポインタ・エラー判定処理ステ
ップ208においては、スタック・ポインタの値が、初
期化処理ステップ202において設定されたSP SI
ZEよりも小さいか否かを判定する。もしも、スタック
・ポインタの値がSP SIZEよりも小さい場合に
は、設定されているスタックの領域内にスタック・ポイ
ンタの値が存在するものと判定されて、最小スタック・
ポインタ判定処理ステップ211に移行する。また、そ
うでない場合には、設定されているスタックの領域外に
スタック・ポンイタの値が存在するものと判定されて、
エラー・メッセージ出力処理ステップ209に移行す
る。エラー・メッセージ出力処理ステップ209におい
ては、図1のコンソール104に、スタックがオーバー
フローを起したことを示すメッセージを出力する。シミ
ュレータ停止処理ステップ210においては、前記メッ
セージを受けて、シミュレータをコマンド入力待ち状態
に設定し処理を終了する。
In the stack pointer error judgment processing step 208, the value of the stack pointer is the SP SI set in the initialization processing step 202.
It is determined whether it is smaller than ZE. If the stack pointer value is smaller than SP SIZE, it is determined that the stack pointer value exists within the set stack area, and the minimum stack
The process proceeds to pointer determination processing step 211. If not, it is determined that the value of the stack pointer exists outside the set stack area,
The process proceeds to error message output processing step 209. In the error message output processing step 209, a message indicating that the stack has overflowed is output to the console 104 of FIG. In the simulator stop processing step 210, upon receiving the message, the simulator is set to the command input waiting state and the processing ends.

【0018】一方、最小スタック・ポインタ判定処理ス
テップ211においては、スタック・ポインタの値がS
P MINより小さいか否かを判定し、もしも、スタッ
ク・ポインタの値がSP MINより小さい値である場
合には、現在のスタック・ポインタの値が、現時点にお
ける最小スタック・ポンイタの値になるものと判定され
て、最小スタック・ポンイタ保存処理ステップ212に
移行する。また、そうでない場合には、現在のスタック
・ポンイタの値を保存する必要がないものと判断され
て、読込み処理ステップ203に戻る。なお、スタック
・ポインタの値がSP MINより小さい値である場合
には、最小スタック・ポンイタ保存処理ステップ212
において、SP MINに現在のスタック・ポインタの
値を代入して、読込み処理ステップ203に戻る。
On the other hand, in the minimum stack pointer determination processing step 211, the value of the stack pointer is S.
It is determined whether or not it is smaller than P MIN, and if the value of the stack pointer is smaller than SP MIN, the value of the current stack pointer becomes the value of the smallest stack pointer at the present time. Is determined, the process proceeds to the minimum stack pointer storage processing step 212. Otherwise, it is determined that it is not necessary to save the current stack pointer value, and the process returns to the read processing step 203. If the value of the stack pointer is smaller than SP MIN, the minimum stack pointer save processing step 212
In, the current stack pointer value is assigned to SP MIN, and the flow returns to the read processing step 203.

【0019】以上説明したように、コンソール104よ
りプログラムの実行が指示された場合には、SP MI
Nを検出してコンソール104に出力する。ここにおい
て検出されたSP MINの値は、プログラムの実行時
にスタックが使用するメモリ領域の最小スタック・ポイ
ンタ値を表わしている。更に、プログラム実行中におい
て、スタックが設定されているスタック領域以外を使用
しようとする場合には、スタック・ポインタ・エラー判
定処理ステップ208による判定により、エラー・メッ
セージ出力処理ステップ209と、シミュレータ停止処
理ステップ210に移行して、コンソール104にスタ
ック・オーバーフローのエラー・メッセージを出力し、
シミュレータをコマンド入力待ち状態に設定する。
As described above, when the program execution is instructed from the console 104, the SP MI
N is detected and output to the console 104. The value of SP MIN detected here represents the minimum stack pointer value of the memory area used by the stack when the program is executed. Furthermore, when trying to use a stack area other than the stack area where the stack is set during program execution, the error / message output processing step 209 and the simulator stop processing are determined by the determination by the stack pointer error determination processing step 208. Go to step 210, output a stack overflow error message to the console 104,
Set the simulator to the command input waiting state.

【0020】次に本発明の第2の実施例について説明す
る。本実施例のシステム構成は、図1に示される第1の
実施例の場合と同一である。本実施例と第1の実施例と
の相違点は、第1の実施例においては、入力ファイル1
02から命令を読込んだ後に命令を実行しているのに対
して、本実施例においては、読込まれた命令をスタック
操作命令であるか否かを判定した後に命令を実行してい
ることである。
Next, a second embodiment of the present invention will be described. The system configuration of this embodiment is the same as that of the first embodiment shown in FIG. The difference between this embodiment and the first embodiment is that in the first embodiment, the input file 1
In contrast to executing the instruction after reading the instruction from 02, in the present embodiment, the instruction is executed after determining whether or not the read instruction is a stack operation instruction. is there.

【0021】図3は、本実施例におけるシミュレータ・
プログラム実行手段109に含まれるスタック情報検出
部109における処理手順を示すフローチャートであ
る。入力ファイル102よりシミュレータ・プログラム
実行手段109に入力されるファイル情報は、コンソー
ル104にプログラムの実行を指示する起動行が入力さ
れる場合には、次の手順において処理される。
FIG. 3 shows a simulator according to the present embodiment.
9 is a flowchart showing a processing procedure in a stack information detection unit 109 included in the program execution means 109. The file information input from the input file 102 to the simulator / program executing means 109 is processed in the following procedure when a startup line instructing execution of the program is input to the console 104.

【0022】なお、本実施例においては、前述の第1の
実施例の場合と同様に、スタック・ポインタの値は、ア
ドレス値の大きいメモリ領域から割当てられるものとす
る。また、図3のフローチャートにおける「はじめ」と
「おわり」は、シミュレーションのコンマンド入力待ち
状態に相当している。
In the present embodiment, the stack pointer value is assigned from a memory area having a large address value, as in the case of the first embodiment. Further, “beginning” and “end” in the flowchart of FIG. 3 correspond to the command input waiting state of the simulation.

【0023】本実施例のフローチャートにおける処理ス
テップ301から処理ステップ305までの処理手順
は、第1の実施例における処理ステップ201から処理
ステップ205までの処理手順と同様に行われる。ま
た、本実施例における処理ステップ309から処理ステ
ップ311までの処理手順についても、第1の実施例に
おける処理ステップ208から処理ステップ210まで
の処理手順と同様に行われる。従って、これらの処理手
順については、その説明を省略する。
The processing procedure from processing step 301 to processing step 305 in the flow chart of this embodiment is the same as the processing procedure from processing step 201 to processing step 205 in the first embodiment. Further, the processing procedure from processing step 309 to processing step 311 in the present embodiment is performed in the same manner as the processing procedure from processing step 208 to processing step 210 in the first embodiment. Therefore, the description of these processing procedures will be omitted.

【0024】命令判定処理ステップ306および307
においては、読込み処理ステップ303において読込ま
れた命令が、それぞれCALL命令であるか否か、およ
びPUSH命令であるか否かを判定する。もしも、命令
判定処理ステップ306においてCALL命令であると
判定され、命令判定処理ステップ307においてPUS
H命令であると判定された場合には、これらの命令は、
共にスタックを操作する命令であるため、処理手順とし
てはスタック・ポインタ・エラー判定処理ステップ30
9に移行する。また、これらの命令判定処理において、
それぞれCALL命令ならびにPUSH命令でない場合
には、命令判定処理ステップ308に移行する。
Instruction determination processing steps 306 and 307
In step 1, it is determined whether the instructions read in the read processing step 303 are CALL instructions and PUSH instructions, respectively. If it is determined to be a CALL instruction in the instruction determination processing step 306, the PUS is determined in the instruction determination processing step 307.
If determined to be H instructions, these instructions
Since both are instructions for operating the stack, the processing procedure is the stack pointer error determination processing step 30.
Move to 9. In addition, in these instruction determination processing,
If they are neither the CALL instruction nor the PUSH instruction, the process proceeds to the instruction determination processing step 308.

【0025】命令判定処理ステップ308においては、
命令処理ステップ306および307の場合と同様に、
読込み処理ステップ303において読込まれた命令が、
POP命令であるか否かを判定し、もしも、POP命令
であると判定された場合には、スタックを操作する命令
であるため、スタック・ポインタ・エラー判定処理30
9に移行する。また、そうでない場合には、命令実行処
理ステップ314に移行する。命令実行処理ステップ3
14においては、第1の実施例の場合の命令実行処理ス
テップ206と同様の処理を行い、処理終了後、読込み
処理ステップ303に戻って次の1命令を読込む。
In the command decision processing step 308,
As with instruction processing steps 306 and 307,
The command read in the read processing step 303 is
It is determined whether it is a POP instruction. If it is determined that it is a POP instruction, it is an instruction to operate the stack, so the stack pointer error determination processing 30
Move to 9. If not, the process proceeds to the instruction execution processing step 314. Instruction execution processing step 3
In 14, the same processing as the instruction execution processing step 206 in the case of the first embodiment is performed, and after the processing is completed, the processing returns to the reading processing step 303 to read the next one instruction.

【0026】他方、スタック・ポインタ・エラー判定処
理ステップ309および最小スタック・ポインタ判定処
理312においては、前述の第1の実施例における処理
ステップ208および211と同様の処理が行われる
が、最小スタック・ポインタ判定処理312において、
スタック・ポインタの値がSP MINの値よりも小さ
いと判定された場合には、最小スタック・ポインタ保存
処理ステップ313に移し、そうでない場合には命令実
行処理ステップ314移行する。最小スタック・ポイン
タ保存処理ステップ313における処理内容は、第1の
実施例における処理ステップ212と同様であり、処理
終了後、命令実行処理ステップ314に移行する。命令
実行処理ステップ314においては、当該命令が実行さ
れてメモリ/レジスタの内容が保存され、その処理終了
後に処理ステップ303に戻って、1命令を読込む。
On the other hand, in the stack pointer error determination processing step 309 and the minimum stack pointer determination processing 312, the same processing as the processing steps 208 and 211 in the above-mentioned first embodiment is performed, but the minimum stack In the pointer determination processing 312,
If it is determined that the value of the stack pointer is smaller than the value of SP MIN, the processing moves to the minimum stack pointer saving processing step 313, and if not, the processing moves to the instruction execution processing step 314. The processing content in the minimum stack pointer storage processing step 313 is the same as the processing step 212 in the first embodiment, and after the processing is completed, the processing moves to the instruction execution processing step 314. In the instruction execution processing step 314, the instruction is executed to save the contents of the memory / register, and after the processing is completed, the processing returns to the processing step 303 to read one instruction.

【0027】[0027]

【発明の効果】以上説明したように、本発明は、プログ
ラムの実行時に、最もスタックを使用した時のメモリ領
域のアドレス値を検出して出力することにより、プログ
ラム実行時におけるスタック・サイズを一目にて確認す
ることが可能となり、当該スタック・サイズの確認に要
する手間および時間を排除することかできるとともに、
スタック・サイズの設定を正確に行うことができるとい
う効果がある。
As described above, the present invention detects the address value of the memory area when the stack is used most at the time of executing the program and outputs it, thereby making it possible to determine the stack size at the time of executing the program. It is possible to confirm with, and it is possible to eliminate the trouble and time required to confirm the stack size, and
There is an effect that the stack size can be set accurately.

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

【図1】本発明の一実施例を示すシステム構成図図であ
る。
FIG. 1 is a system configuration diagram showing an embodiment of the present invention.

【図2】本発明の第1の実施例における処理手順のフロ
ーチャートを示す図である。
FIG. 2 is a diagram showing a flowchart of a processing procedure in the first embodiment of the present invention.

【図3】本発明の第2の実施例における処理手順のフロ
ーチャートを示す図である。
FIG. 3 is a diagram showing a flowchart of a processing procedure in the second embodiment of the present invention.

【符号の説明】[Explanation of symbols]

101 シミュレータ・プログラム実行手段 102 入力コンソール 103 入力部 104 コンソール 105 解析部 106 制御/表示部 107 シミュレート実行部 108 命令実行部 109 スタック情報検出部 110 スタック指定値保持部 111 スタック値保持部 112 メモリ/レジスタ内容保持部 201〜212、301〜314 処理ステップ 101 Simulator / Program Execution Means 102 Input Console 103 Input Unit 104 Console 105 Analysis Unit 106 Control / Display Unit 107 Simulation Execution Unit 108 Instruction Execution Unit 109 Stack Information Detection Unit 110 Stack Specified Value Holding Unit 111 Stack Value Holding Unit 112 Memory / Register content holding unit 201 to 212, 301 to 314 Processing step

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 所定のファイルより言語処理プログラム
により作成された情報を入力するファイル情報入力部
と、前記情報の入力に対応する命令をシミュレートする
シミュレート実行部と、所定の監視制御用のコンソール
から入力される起動行上の文字列の内容を解析する解析
部と、前記解析部による文字列解析結果を受けて、前記
シミュレート実行部におけるプログラムの実行を制御す
るとともに、シミュレート実行状態を含む情報を表示す
る制御/表示部と、を少くとも備えて形成されるシミュ
レータ実行方式において、 前記シミュレート実行部におけるプログラム実行時に、
スタックの使用するメモリ領域情報を検出して出力する
スタック情報検出部と、 スタック・ポインタの指定値を保持するスタック指定値
保持部と、 命令実行時におけるスタック・ポインタ値を保持するス
タック値保持部と、 を、命令実行手段として前記シミュレート実行部に備え
ることを特徴とするシミュレータ実行方式。
1. A file information input unit for inputting information created by a language processing program from a predetermined file, a simulation execution unit for simulating an instruction corresponding to the input of the information, and a predetermined monitor control unit. An analysis unit that analyzes the content of the character string on the startup line input from the console, receives the character string analysis result by the analysis unit, controls the execution of the program in the simulation execution unit, and executes the simulation execution state. In a simulator execution method formed by at least a control / display unit that displays information including, a program execution in the simulation execution unit,
A stack information detection unit that detects and outputs the memory area information used by the stack, a stack designated value holding unit that holds the designated value of the stack pointer, and a stack value holding unit that holds the stack pointer value during instruction execution. And a simulator execution method comprising:
JP4051165A 1992-03-10 1992-03-10 Simulator execution system Pending JPH05250221A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4051165A JPH05250221A (en) 1992-03-10 1992-03-10 Simulator execution system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4051165A JPH05250221A (en) 1992-03-10 1992-03-10 Simulator execution system

Publications (1)

Publication Number Publication Date
JPH05250221A true JPH05250221A (en) 1993-09-28

Family

ID=12879215

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4051165A Pending JPH05250221A (en) 1992-03-10 1992-03-10 Simulator execution system

Country Status (1)

Country Link
JP (1) JPH05250221A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07105019A (en) * 1993-10-07 1995-04-21 Nec Corp Instruction simulator processing system
JPH07129429A (en) * 1993-10-28 1995-05-19 Toppan Printing Co Ltd Output error predicting device and code optimizing device for printer page describing language
JPH08263447A (en) * 1994-12-20 1996-10-11 Sun Microsyst Inc Decentralized computer system and its operating method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03278135A (en) * 1990-03-20 1991-12-09 Mitsubishi Electric Corp Stack tracing device
JPH047755A (en) * 1990-04-26 1992-01-13 Matsushita Electric Ind Co Ltd One-chip microcomputer

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03278135A (en) * 1990-03-20 1991-12-09 Mitsubishi Electric Corp Stack tracing device
JPH047755A (en) * 1990-04-26 1992-01-13 Matsushita Electric Ind Co Ltd One-chip microcomputer

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07105019A (en) * 1993-10-07 1995-04-21 Nec Corp Instruction simulator processing system
JPH07129429A (en) * 1993-10-28 1995-05-19 Toppan Printing Co Ltd Output error predicting device and code optimizing device for printer page describing language
JPH08263447A (en) * 1994-12-20 1996-10-11 Sun Microsyst Inc Decentralized computer system and its operating method

Similar Documents

Publication Publication Date Title
US6286132B1 (en) Debugging support apparatus, a parallel execution information generation device, a computer-readable recording medium storing a debugging support program, and a computer-readable recording medium storing a parallel execution information generation program
EP0785510B1 (en) Program debugging system for debugging a program having a graphical user interface
US5987250A (en) Transparent instrumentation for computer program behavior analysis
JPH05505695A (en) An improved software debugging system and method specifically for debugging code within a multi-architecture environment.
JPH0748182B2 (en) Program error detection method
US20030177471A1 (en) System and method for graphically developing a program
US6611924B1 (en) Reducing code size of debug output statements
JPH05250221A (en) Simulator execution system
JPH02275539A (en) Debugging system
JP2803090B2 (en) MPU simulation method and MPU simulator
JPH08263130A (en) Simulation system
JP3745968B2 (en) Test system, test method, test program, and computer-readable recording medium recording the test program
JPH07253909A (en) Microprogram verifying method
JPH07219980A (en) Test execution system
US7627859B2 (en) Method for configuring non-script language library files to be run as scripts
JPS6292034A (en) Program debugging device
JP3165105B2 (en) Program tracer, compiler and linker
Gladstone Comparing Microcomputer Development System Capabilities
JPH03294934A (en) Debugger for high level program lenguage
JP2002366378A (en) Method and device for debugging program and storage medium
JP2000122895A (en) Method and device for analyzing stack size
JP2002189613A (en) Software development assisting device, software development assisting method, and computer-readable storage medium recording software development assisting program
JPS6292032A (en) Test method for program
JPH06289919A (en) Man-machine interface device for nc device
JPH08185342A (en) Program evaluating device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19980203