JPS63289654A - Program branching instruction monitoring system - Google Patents

Program branching instruction monitoring system

Info

Publication number
JPS63289654A
JPS63289654A JP62125060A JP12506087A JPS63289654A JP S63289654 A JPS63289654 A JP S63289654A JP 62125060 A JP62125060 A JP 62125060A JP 12506087 A JP12506087 A JP 12506087A JP S63289654 A JPS63289654 A JP S63289654A
Authority
JP
Japan
Prior art keywords
program
branch instruction
under test
mode
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
JP62125060A
Other languages
Japanese (ja)
Inventor
Toshiki Kiyono
清野 俊樹
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 JP62125060A priority Critical patent/JPS63289654A/en
Publication of JPS63289654A publication Critical patent/JPS63289654A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To uselessly and efficiently allow the titled system to follow the flow of program logic by providing the system with a branching instruction trace trapping device for collecting the operation information of an executed branching instruction at the time of executing the branching instruction. CONSTITUTION:At the time of generating a branching instruction tracing trap, the branching instruction trace trapping device 6 interrupts the execution of a program 8 to be tested and saves operation information such as the execution address of the program 8, the contents of various registers, etc., to a task control block 10, for the program. Then, the device 6 reads a monitoring program address previously stored in a block 10, generates a traveling instruction including the address of the block 10 to a monitoring program 7 in accordance with the address and transfers its control to the program 7. Operating information necessary for recognizing the contents of execution is collected from the operating information in the block 10 and the contents of the program 8 and saved in an information saving area 11 and the completion of the branching instruction trace trapping is informed to the device 6 by a return instruction.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はプログラム分岐命令モニタ方式に関し、特にプ
ログラムの開発、評価時等にプログラムロジックの流れ
を効率的に追うことができるプログラム分岐命令モニタ
方式に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a program branch instruction monitoring method, and particularly to a program branch instruction monitoring method that can efficiently follow the flow of program logic during program development, evaluation, etc. Regarding.

〔従来の技術〕[Conventional technology]

プログラムの開発、評価時等にプログラムロジックの流
れを追う場合、従来は、実行プログラムの原始プログラ
ム内に、必要に応じてデバッグ行と呼ばれる評価用命令
或いはロジックを組込み、それをコンパイル等すること
により特殊な評価用プログラムを作成し、上記特殊な評
価用プログラムを実行させることによりプログラムロジ
ックの流れを追うか、または、実行された全命令に対し
てトレーストラップを発生させ、実行された全命令をト
レースすることによりプログラムロジノクの流れを追う
方式がとられている。
Conventionally, when following the flow of program logic during program development and evaluation, it has been done by incorporating evaluation instructions or logic called debug lines as necessary into the source program of the executable program, and compiling it. You can create a special evaluation program and run the special evaluation program to trace the flow of the program logic, or you can generate a trace trap for all executed instructions and trace all executed instructions. A method is used to follow the flow of program logic by tracing.

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

しかし、デバッグ行を原始プログラム内に組込む従来方
式では、実際の実行プログラムと異なる特殊な評価用プ
ログラムを作成しなければならない問題があると共に、
デバッグ行を組込んだ部分についてしかトレースが行な
われないため、デバッグ行が組込まれていない分岐命令
があると、分岐命令によるロジックの流れを完全には把
握することができず、プログラムロジックの流れをおお
まかにしか知ることができない。そのため、実際に通過
したロジックの細部を推定により求めなければならない
場合が生じる問題があった。
However, the conventional method of incorporating debug lines into the source program has the problem of having to create a special evaluation program that is different from the actual execution program.
Since tracing is only performed on parts that include debug lines, if there is a branch instruction that does not include a debug line, the logic flow due to the branch instruction cannot be completely understood, and the program logic flow can only be roughly known. Therefore, there was a problem in that the details of the logic that actually passed had to be determined by estimation.

また、実行された命令を全てトレースする従来方式では
、プログラムロジックの流れのチェックに不要な情報ま
でトレースしてしまい、その情報量があまりにも膨大な
ものとなるため、CPU負荷が大きくなると共に情報解
析に要する工数が大きくなってしまう問題があった。
In addition, with the conventional method of tracing all executed instructions, information that is unnecessary for checking the flow of program logic is traced, and the amount of information becomes too large, which increases the CPU load and the information There was a problem in that the number of man-hours required for analysis increased.

本発明は前述の如き問題点を解決したものであり、その
目的は、特殊な評価用プログラムを作成することなしに
、効率的にプログラムロジックの流れを追うことができ
るようにすることにある。
The present invention solves the above-mentioned problems, and its purpose is to make it possible to efficiently follow the flow of program logic without creating a special evaluation program.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は前述の如き問題点を解決するため、中央処理装
置及び主記憶装置を含むコンピュータシステムに於いて
、 前記主記憶装置に、 被試験プログラムと、 該被試験プログラムの動作情報を収集するモニタプログ
ラムとを格納し、 前記中央処理装置に、 分岐命令トレーストラップ手段と、 前記被試験プログラムの走行モードを分岐命令トレース
トラップモードにするか否かが設定されるモードレジス
タとを設け、 前記分岐命令トレーストラップ手段は前記モードレジス
タに前記被試験プログラムの走行モードを分岐命令トレ
ーストラップモードにすることが設定され、且つ前記被
試験プログラムの実行された命令が分岐命令である場合
、トレーストラップを発生させて前記モニタプログラム
に制御を渡し、前記実行した分岐命令に関する情報を収
集させる。
In order to solve the above-mentioned problems, the present invention provides a computer system including a central processing unit and a main storage device, which includes a program under test and a monitor that collects operation information of the program under test, in the main storage device. A program is stored in the central processing unit, and the central processing unit is provided with: a branch instruction trace trap means; and a mode register in which it is set whether or not to set the running mode of the program under test to a branch instruction trace trap mode, and the branch instruction The trace trap means generates a trace trap when the mode register is set to set the running mode of the program under test to a branch instruction trace trap mode, and when the executed instruction of the program under test is a branch instruction. control is passed to the monitor program to collect information regarding the executed branch instruction.

〔作 用〕[For production]

分岐命令トレーストラップ手段は、モードレジスタに被
試験プログラムの走行モードを分岐命令トレーストラッ
プモードにすることが設定されていない場合は、被試験
プログラムの実行された命令が分岐命令であってもトレ
ーストラップを発生せず、従って各命令が順次実行され
る。また、モードレジスタに被試験プログラムの走行モ
ードを分岐命令トレーストラップモードにすることが設
定されている場合は、分岐命令が実行される毎にトレー
ストラップを発生させ、モニタプログラムに制御を渡す
。モニタプログラムは制御が渡されると、被試験プログ
ラムの動作情報を収集する。
If the mode register does not set the running mode of the program under test to branch instruction trace trap mode, the branch instruction trace trap means will trace trap even if the executed instruction of the program under test is a branch instruction. Therefore, each instruction is executed sequentially. Furthermore, if the mode register is set to set the running mode of the program under test to branch instruction trace trap mode, a trace trap is generated every time a branch instruction is executed, and control is passed to the monitor program. When the monitor program is given control, it collects operational information of the program under test.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明方式を実施するコンピュータシステムの
一例を示すブロック図であり、コンピュータシステム1
は中央処理装置2と、主記憶装置3とを含んでいる。中
央処理装置2はモードレジスタ4と、モード設定手段5
と、分岐命令判断手段9を有する分岐命令トレーストラ
ップ手段6とを含み、主記憶装置3はモニタプログラム
7と、被試験プログラム8と、タスクコントロールブロ
ック10と、情報セーブエリア11とを含んでいる。
FIG. 1 is a block diagram showing an example of a computer system implementing the method of the present invention.
includes a central processing unit 2 and a main storage device 3. The central processing unit 2 has a mode register 4 and a mode setting means 5.
and a branch instruction trace trap unit 6 having a branch instruction determination unit 9, and the main storage device 3 includes a monitor program 7, a program under test 8, a task control block 10, and an information save area 11. .

尚、分岐命令判断手段9は実行された命令が分岐命令で
あるか否かを判断するものである。
Note that the branch instruction determining means 9 determines whether or not the executed instruction is a branch instruction.

中央処理装置2は例えば図示を省略した入力装置等から
被試験プログラム8中の分岐命令(コール命令、リター
ン命令を含む)をトレースすることが指示されると、主
記憶装置3内に存在するモニタプログラム7を起動し、
モニタプログラム7は起動がかけられることにより、中
央処理装置2内のモード設定手段5に対して変更指示を
出力する。モード設定手段5はモニタプログラム7から
変更指示が加えられると、モードレジスタ4の左端のビ
ットに設けられている分岐命令トレースモ−ドフラグ3
0を“1”にすることにより、被試験プログラム8の走
行モードを分岐命令トレースモードにする。
When the central processing unit 2 is instructed to trace branch instructions (including call instructions and return instructions) in the program under test 8 from, for example, an input device (not shown), the central processing unit 2 traces a branch instruction (including a call instruction and a return instruction) in the program under test 8 . Start program 7,
When the monitor program 7 is activated, it outputs a change instruction to the mode setting means 5 in the central processing unit 2. When the mode setting means 5 receives a change instruction from the monitor program 7, the mode setting means 5 sets the branch instruction trace mode flag 3 provided in the leftmost bit of the mode register 4.
By setting 0 to "1", the running mode of the program under test 8 is set to branch instruction trace mode.

第2図は分岐命令判断手段9を含む分岐命令トレースト
ラップ手段6の処理例を示すフローチャートである。分
岐命令トレーストラップ手段6は主記憶装置3内の被試
験プログラム8より命令を1つ取出しくステップS1)
、実行すると(ステップS2)、モードレジスタ4の分
岐命令トレースモードフラグ30を参照して被試験プロ
グラム8の走行モードを分岐命令トレースモードにする
ことが指示されているか否かを判断する(ステップS3
)。
FIG. 2 is a flowchart showing an example of processing of the branch instruction trace trap unit 6 including the branch instruction determination unit 9. The branch instruction trace trap means 6 retrieves one instruction from the program under test 8 in the main memory 3 (step S1).
, when executed (step S2), the branch instruction trace mode flag 30 of the mode register 4 is referenced to determine whether or not it is instructed to set the running mode of the program under test 8 to the branch instruction trace mode (step S3).
).

ステップS3に於いて被試験プログラム8の走行モード
を分岐命令トレーストラップモードにすることが指示さ
れていないと判断した場合は、分岐命令トレーストラッ
プ手段6はステップS1の処理に戻って次の命令を被試
験プログラム8から取出し、分岐命令トレーストラップ
モードにすることが指示されていると判断した場合は、
分岐命令判断手段9の判断結果に基づいて、ステップS
2で実行した命令が分岐命令であるか否かを判断する 
(ステップS4)。
If it is determined in step S3 that there is no instruction to change the running mode of the program under test 8 to the branch instruction trace trap mode, the branch instruction trace trap means 6 returns to the process of step S1 and executes the next instruction. If it is determined that it is instructed to extract the program under test 8 and set it to branch instruction trace trap mode,
Based on the judgment result of the branch instruction judgment means 9, step S
Determine whether the instruction executed in step 2 is a branch instruction
(Step S4).

ステップS4に於いて、分岐命令でないと判断した場合
は、分岐命令トレーストラップ手段6はステップS1の
処理に戻って次の命令を被試験プログラム8から取出し
、分岐命令であると判断した場合は、分岐命令トレース
トラップを発生させる(ステップS5)。
In step S4, if it is determined that it is not a branch instruction, the branch instruction trace trap means 6 returns to the process of step S1 and extracts the next instruction from the program under test 8; if it is determined that it is a branch instruction, A branch instruction trace trap is generated (step S5).

第3図は分岐命令トレーストラップ発生時の動作を説明
−するための図であり、以下同図を参照して分岐命令ト
レーストラップ発生時の動作を説明する。
FIG. 3 is a diagram for explaining the operation when a branch instruction trace trap occurs, and the operation when a branch instruction trace trap occurs will be explained below with reference to the same figure.

分岐命令トレーストラップ手段6は分岐命令トレースト
ラップ発生時、被試験プログラム8の実行を中断し、そ
の時の被試験プログラム8の実行アドレス、各種レジス
タの内容等の動作情報を被試験プログラム8用のタスク
コントロールブロック10に退避させる。
When a branch instruction trace trap occurs, the branch instruction trace trap means 6 interrupts the execution of the program under test 8 and transfers operational information such as the execution address of the program under test 8 and the contents of various registers to a task for the program under test 8. It is evacuated to the control block 10.

動作情報をタスクコントロールブロック10に退避させ
ると、分岐命令トレーストラップ手段6はタスクコント
ロールブロック10に予め格納しておいたモニタプログ
ラムアドレス(モニタプログラム7の所定アドレス)を
読込み、このモニタプログラムアドレスに従ってモニタ
プログラム7に対してタスクコントロールブロックlO
のアドレスを含む走行指示を発行し、制御をモニタプロ
グラム7に渡す。
When the operation information is saved to the task control block 10, the branch instruction trace trap means 6 reads the monitor program address (predetermined address of the monitor program 7) stored in advance in the task control block 10, and executes the monitor according to this monitor program address. Task control block lO for program 7
A running instruction including the address of is issued, and control is passed to the monitor program 7.

モニタプログラム7は制御が渡されると、タスクコント
ロールブロック10内に格納されている動作情報及び必
要に応じて被試験プログラム8の内容から少なくともス
テップS2で実行した分岐命令がどのアドレスの命令で
、どのアドレス(分岐先アドレス)に向けて、どのよう
に実行されたか(条件分岐か無条件分岐か)を知るため
に必要となる動作情報を収集して情報セーブエリア11
にセーブし、その後リターン命令を発行することにより
、分岐命令トレーストランプ手段6に対して分岐命令ト
レーストラップの完了を通知する。また、分岐命令トレ
ーストラップ手段6はモニタプログラム7から分岐命令
トレーストラップの完了が通知されると、タスクコント
ロールブロック10に格納されている退避情報に基づい
て被試験プログラム8の実行を再開し、第2図のステッ
プS1の処理を行なう。
When control is passed to the monitor program 7, the monitor program 7 determines at least which address the branch instruction executed in step S2 is and which address it is based on the operation information stored in the task control block 10 and the contents of the program under test 8 as necessary. The information save area 11 collects the operation information necessary to know how it was executed (conditional branch or unconditional branch) toward the address (branch destination address).
The completion of the branch instruction trace trap is notified to the branch instruction trace trap means 6 by saving the branch instruction trace trap and then issuing a return instruction. Further, when the branch instruction trace trap unit 6 is notified of the completion of the branch instruction trace trap from the monitor program 7, it restarts the execution of the program under test 8 based on the save information stored in the task control block 10. The process of step S1 in FIG. 2 is performed.

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

以上説明したように、本発明は、モードレジスタに被試
験プログラムの走行モードを分岐命令トレーストラップ
モードにすることが設定され、且つ分岐命令が実行され
た場合、モニタプログラムに制御を渡し、上記実行され
た分岐命令についての動作情報を収集させる分岐命令ト
レーストラップ手段を設けたものであり、分岐命令に関
してのみ、情報収集することが可能になるので、無駄な
く、効率的に、しかも詳細にプログラムロジ、りの流れ
を追うことが可能になる効果がある。また、本発明によ
れば、被試験プログラムと実際の実行プログラムとは同
一のもので良いので、特殊な評価用プログラムが不要と
なる効果もある。
As explained above, in the present invention, when the running mode of the program under test is set to the branch instruction trace trap mode in the mode register and the branch instruction is executed, control is passed to the monitor program and the above-mentioned execution is executed. This system is equipped with a branch instruction trace trap means that collects operation information about branch instructions that have been executed.Since it is possible to collect information only about branch instructions, it is possible to analyze program logic efficiently and in detail without wasting any waste. This has the effect of making it possible to follow the flow of events. Further, according to the present invention, since the program under test and the actual execution program may be the same, there is an advantage that a special evaluation program is not required.

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

第1図は本発明の実施例のブロック図、第2図は分岐命
令トレーストラップ手段6の処理例を示すフローチャー
ト及び、 第3図は第1図の動作説明図である。 図に於いて、1・・・コンピュータシステム、2・・・
中央処理装置、3・・・主記憶装置、4・・・モードレ
ジスタ、5・・・モード設定手段、6・・・分岐命令ト
レーストラップ手段、7・・・モニタプログラム、8・
・・被試験プログラム、9・・・分岐命令判断手段、1
0・・・タスクコントロールブロック、11・・・情報
セーブエリア。
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a flowchart showing an example of processing of the branch instruction trace trap means 6, and FIG. 3 is an explanatory diagram of the operation of FIG. 1. In the diagram, 1... computer system, 2...
Central processing unit, 3... Main storage device, 4... Mode register, 5... Mode setting means, 6... Branch instruction trace trap means, 7... Monitor program, 8.
...Program under test, 9...Branch instruction determination means, 1
0...Task control block, 11...Information save area.

Claims (1)

【特許請求の範囲】 中央処理装置及び主記憶装置を含むコンピュータシステ
ムに於いて、 前記主記憶装置に、 被試験プログラムと、 該被試験プログラムの動作情報を収集するモニタプログ
ラムとを格納し、 前記中央処理装置に、 分岐命令トレーストラップ手段と、 前記被試験プログラムの走行モードを分岐命令トレース
トラップモードにするか否かが設定されるモードレジス
タとを設け、 前記分岐命令トレーストラップ手段は前記モードレジス
タに前記被試験プログラムの走行モードを分岐命令トレ
ーストラップモードにすることが設定され、且つ前記被
試験プログラムの実行された命令が分岐命令である場合
、トレーストラップを発生させて前記モニタプログラム
に制御を渡し、前記実行した分岐命令に関する情報を収
集させることを特徴とするプログラム分岐命令モニタ方
式。
[Scope of Claims] A computer system including a central processing unit and a main storage device, wherein the main storage device stores a program under test and a monitor program that collects operational information of the program under test; The central processing unit is provided with a branch instruction trace trap means and a mode register in which it is set whether or not to set the running mode of the program under test to a branch instruction trace trap mode, and the branch instruction trace trap means is arranged in the mode register. When the running mode of the program under test is set to branch instruction trace trap mode, and the executed instruction of the program under test is a branch instruction, a trace trap is generated to control the monitor program. A program branch instruction monitoring method characterized in that information regarding the executed branch instruction is collected.
JP62125060A 1987-05-22 1987-05-22 Program branching instruction monitoring system Pending JPS63289654A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62125060A JPS63289654A (en) 1987-05-22 1987-05-22 Program branching instruction monitoring system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62125060A JPS63289654A (en) 1987-05-22 1987-05-22 Program branching instruction monitoring system

Publications (1)

Publication Number Publication Date
JPS63289654A true JPS63289654A (en) 1988-11-28

Family

ID=14900826

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62125060A Pending JPS63289654A (en) 1987-05-22 1987-05-22 Program branching instruction monitoring system

Country Status (1)

Country Link
JP (1) JPS63289654A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06161822A (en) * 1992-11-20 1994-06-10 Mitsubishi Electric Corp Microprocessor
JPH08272647A (en) * 1995-03-30 1996-10-18 Nec Corp Software evaluating device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06161822A (en) * 1992-11-20 1994-06-10 Mitsubishi Electric Corp Microprocessor
JPH08272647A (en) * 1995-03-30 1996-10-18 Nec Corp Software evaluating device

Similar Documents

Publication Publication Date Title
JPH04148242A (en) Trace processing method for load module execution
JPH0748182B2 (en) Program error detection method
JPS63289654A (en) Program branching instruction monitoring system
US20030018957A1 (en) Debugger monitor with anticipatory highlights
JPH0934754A (en) Instrument and method for measuring performance of program
JPH03113648A (en) Program debug system
JP2626131B2 (en) Multitask program debugging method
JPH0283749A (en) Internal interruption control system for microprocessor
JPH0750445B2 (en) Program debugging method
JPS6388650A (en) Program path monitoring system
JPH04256036A (en) Program analysis system
JPH05127945A (en) Program execution situation analysis system
JPS616722A (en) Method for calculating execution cost of sentence
JPH05324402A (en) Test state measuring system for program
JPH08137714A (en) Debugging method and debugging system for multitask program
JPS58169262A (en) Method and device for collecting data on execution state of structured program
JPH0410139A (en) Dynamic bug detecting system using knowledge base
JPH0468446A (en) Debugging supporting device
JPH01166228A (en) Automatic detection debug system for unpassed check point
JPH03268034A (en) Program execution monitoring method
JPH01205348A (en) Program debugging system
JPH04124737A (en) Data dependence analyzing system
JPH05143388A (en) Suspending system for parallel processing program
JPH0394340A (en) Control conversion tracing system at the time of cpu runaway
JPH01298444A (en) Program execution control system