JP2727996B2 - Program execution monitoring method and program execution monitoring system - Google Patents

Program execution monitoring method and program execution monitoring system

Info

Publication number
JP2727996B2
JP2727996B2 JP7002264A JP226495A JP2727996B2 JP 2727996 B2 JP2727996 B2 JP 2727996B2 JP 7002264 A JP7002264 A JP 7002264A JP 226495 A JP226495 A JP 226495A JP 2727996 B2 JP2727996 B2 JP 2727996B2
Authority
JP
Japan
Prior art keywords
branch
program
information
instruction
storage unit
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.)
Expired - Fee Related
Application number
JP7002264A
Other languages
Japanese (ja)
Other versions
JPH08190498A (en
Inventor
悦男 高橋
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
Nippon Electric Co Ltd
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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP7002264A priority Critical patent/JP2727996B2/en
Publication of JPH08190498A publication Critical patent/JPH08190498A/en
Application granted granted Critical
Publication of JP2727996B2 publication Critical patent/JP2727996B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、プログラム実行監視方
法に関し、特にプログラム中のループ部分における無限
ループ状態を監視するプログラム実行監視方法およびプ
ログラム実行監視システムに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program execution monitoring method, and more particularly to a program execution monitoring method and a program execution monitoring system for monitoring an infinite loop state in a loop portion in a program.

【0002】[0002]

【従来の技術】従来この種の技術では、たとえば第一の
従来技術として特開昭57−90767号公報に記載の
技術では、プログラムの任意の個所にブレークポイント
を設け、このブレークポイントを通過する回数が予め設
定した所定数に達した場合に、そのプログラムが無限ル
ープに陥っていると判断している。
2. Description of the Related Art Conventionally, in this type of technology, for example, in the technology described in Japanese Patent Application Laid-Open No. 57-90767 as a first prior art, a breakpoint is provided at an arbitrary position in a program and the program passes through the breakpoint. When the number of times reaches a predetermined number, it is determined that the program is in an infinite loop.

【0003】また、第二の従来技術として特開平2−1
05233号公報に記載の技術では、分岐命令が出現す
る度に割込みルーチンを起動し、その分岐命令による分
岐と直前に発生した分岐とが同一の番地間で行われてい
るときには、ループ回数を1つカウントアップし、この
ループ回数が予め定められた制限値を越えた場合に、そ
のプログラムが無限ループに陥っていると判断してい
る。
A second prior art is disclosed in Japanese Patent Laid-Open No.
In the technique described in Japanese Patent Application Laid-Open No. 05233, an interrupt routine is started each time a branch instruction appears, and when the branch by the branch instruction and the immediately preceding branch are performed between the same addresses, the number of loops is reduced by one. When the number of loops exceeds a predetermined limit value, it is determined that the program is in an infinite loop.

【0004】[0004]

【発明が解決しようとする課題】上述の第一の従来技術
では、ループの可能性のある個所にブレークポイントを
設定し、このブレークポイントを通過する回数の制限値
を予め設定しているが、プログラムが大規模になってく
ると、この設定自体が容易ではなくなってくる。また、
ループか否かの判定はそのプログラムに入力したデータ
によっても異なることが多く、あらゆるデータに対応す
る制限値を予めプログラム中に設定しておくことは困難
である。さらに、この第一従来技術では、ブレークポイ
ントを設定しない場所でのループに対しては対処出来な
い。すなわち、ループは予想できないところに発生する
から発見困難なのであって、予めループの発生する個所
を特定できないことが多いのが現実である。
In the above-mentioned first prior art, a breakpoint is set at a place where a loop may occur, and a limit value of the number of times of passing through the breakpoint is set in advance. As the program gets larger, this setting itself becomes less easy. Also,
The determination as to whether or not a loop often depends on the data input to the program, and it is difficult to set in advance the limit values corresponding to all data in the program. Further, the first prior art cannot deal with a loop in a place where a breakpoint is not set. In other words, it is difficult to find a loop because it occurs in an unpredictable place, and in reality, it is often impossible to identify in advance the location where the loop occurs.

【0005】また、上述の第二の実施例では、ブレーク
ポイントの設定は不要であるが、無限ループか否かの判
断をするための制限値を予め設定する必要がある点では
第一の実施例と同様の問題を有している。また、第二の
従来技術では分岐前アドレスと分岐後アドレスとの対を
1対のみしか保持しておらず、このため複数の分岐によ
って無限ループが形成されている場合にはこれを検出す
ることができない。たとえば、A番地からB番地に対し
て分岐した後ある処理をして、その後C番地からA番地
に分岐する場合には、A番地からB番地に対する分岐の
次にC番地からA番地への分岐が発生した時点でループ
から離脱したものと判断されてしまい、無限ループ状態
が検出できない。
In the above-described second embodiment, it is not necessary to set a breakpoint, but it is necessary to set a limit value for judging whether or not the loop is an infinite loop in the first embodiment. It has the same problem as the example. Further, in the second prior art, only one pair of a pre-branch address and a post-branch address is held. Therefore, when an infinite loop is formed by a plurality of branches, this is detected. Can not. For example, if a certain process is performed after branching from address A to address B and then branching from address C to address A, a branch from address A to address B is followed by a branch from address C to address A. Is determined to have left the loop at the time when the error occurs, and an infinite loop state cannot be detected.

【0006】本発明の目的は、プログラム実行監視方法
において、ブレークポイントの設定や無限ループか否か
の判断のための制限値の設定を不要とすることにある。
It is an object of the present invention to eliminate the need for setting a breakpoint and setting a limit value for determining whether or not an infinite loop exists in a program execution monitoring method.

【0007】また、本発明の他の目的は、複数の分岐命
令によって無限ループが形成されている場合であって
も、プログラムの実行状態を監視できるようにすること
にある。
Another object of the present invention is to make it possible to monitor the execution state of a program even when an infinite loop is formed by a plurality of branch instructions.

【0008】[0008]

【課題を解決するための手段】上記課題を解決するため
に本発明のプログラム実行監視方法は、プログラム実行
中に発生した分岐に関する履歴情報を記憶しておき、プ
ログラム実行終了後その履歴情報を解析することにより
無限ループの発生個所を特定する。
In order to solve the above-mentioned problems, a program execution monitoring method according to the present invention stores history information on a branch that occurred during execution of a program, and analyzes the history information after the execution of the program. By doing so, the place where the infinite loop occurs is specified.

【0009】また、本発明の他のプログラム実行監視方
法は、プログラムを実行する処理装置と、プログラム実
行中に発生した分岐の履歴を記憶する分岐履歴記憶部を
含む記憶装置と、外部からデータを入力するための入力
装置と、データを表示するための表示装置とを有するプ
ログラム実行監視システムにおいて、プログラム実行中
に分岐の発生を検出した旨の割込みを発生するステップ
と、分岐を発生した分岐命令に関する情報が前記分岐履
歴記憶部に既に登録されているか否かを検索するステッ
プと、該当する分岐命令の情報が前記分岐履歴記憶部に
既に登録されていればその分岐命令の分岐回数を増加さ
せ、該当する分岐命令の情報が前記分岐履歴記憶部に既
に登録されていなければその分岐命令に関する情報を前
記分岐履歴記憶部に登録するステップと、プログラムの
実行を再開させるステップと、プログラム終了後に前記
入力手段からの指示に従って前記分岐履歴記憶部に記憶
されている情報を編集して前記表示手段に表示するステ
ップとを含む。
According to another program execution monitoring method of the present invention, there is provided a processing device for executing a program, a storage device including a branch history storage unit for storing a history of branches generated during execution of the program, and a method for externally storing data. In a program execution monitoring system having an input device for inputting and a display device for displaying data, a step of generating an interrupt indicating that a branch has been detected during program execution, and a branch instruction that has generated the branch Retrieving whether or not information relating to the branch instruction is already registered in the branch history storage unit; and, if the information of the corresponding branch instruction is already registered in the branch history storage unit, increasing the number of branches of the branch instruction. If the information of the corresponding branch instruction is not already registered in the branch history storage unit, the information on the branch instruction is stored in the branch history storage unit. Comprising a step of registering, the steps of resuming execution of the program, and displaying on said display means to edit the information stored in the branch history storage unit in accordance with an instruction from the input means to the end of the program.

【0010】また、本発明のプログラム実行監視システ
ムは、プログラムを実行するプログラム実行手段と、こ
のプログラム実行手段で分岐の発生を検出した旨の割込
みを受け付ける割込み受付け手段と、分岐を発生した分
岐命令に関する情報が前記分岐履歴記憶部にすでに登録
されているか否かを検索し、すでに登録されていればそ
の分岐回数を増加させる検索手段と、分岐を発生した分
岐命令に関する情報が前記分岐履歴記憶部に登録されて
いない場合にその情報を前記分岐履歴記憶部に新規に登
録する登録手段と、プログラム実行の再開指示を前記プ
ログラム実行手段に通知する割込み終了手段と、プログ
ラム終了後、前記分岐履歴記憶部に記憶されている内容
を編集して表示手段に表示する編集手段とを含む。
The program execution monitoring system according to the present invention comprises a program executing means for executing a program, an interrupt receiving means for receiving an interrupt indicating that a branch has been detected by the program executing means, and a branch instruction for generating the branch. Search means for searching whether or not information relating to a branch instruction is already registered in the branch history storage unit, and if the information is already registered, a search means for increasing the number of times of branching; A registration unit for newly registering the information in the branch history storage unit when it is not registered in the branch history storage unit; an interruption ending unit for notifying the program execution unit of a program execution restart instruction; Editing means for editing the content stored in the section and displaying it on the display means.

【0011】また、本発明の他のプログラム実行監視方
法およびプログラム実行監視システムにおいて、前記分
岐命令に関する情報は分岐先アドレスを含み、前記表示
手段は分岐先アドレス毎の分岐回数を表示する。
In another program execution monitoring method and a program execution monitoring system according to the present invention, the information on the branch instruction includes a branch destination address, and the display means displays the number of branches for each branch destination address.

【0012】また、本発明の他のプログラム実行監視方
法およびプログラム実行監視システムにおいて、前記分
岐命令に関する情報は分岐先アドレスおよび分岐命令ア
ドレスを含み、前記表示手段は各分岐命令毎に分岐先ア
ドレスに対する分岐回数を表示する。
Further, in another program execution monitoring method and program execution monitoring system according to the present invention, the information on the branch instruction includes a branch destination address and a branch instruction address, and the display means displays the branch destination address for each branch instruction. Displays the number of branches.

【0013】また、本発明の他のプログラム実行監視方
法およびプログラム実行監視システムにおいて、前記分
岐命令に関する情報は分岐先アドレスおよび分岐命令種
別識別コードを含み、前記表示手段は分岐命令の種別毎
に分岐先アドレスに対する分岐回数を表示する。
In another program execution monitoring method and program execution monitoring system according to the present invention, the information on the branch instruction includes a branch destination address and a branch instruction type identification code, and the display means branches for each type of the branch instruction. Displays the number of branches for the destination address.

【0014】[0014]

【実施例】次に本発明のプログラム実行監視方法の一実
施例について図面を参照して詳細に説明する。
Next, an embodiment of a program execution monitoring method according to the present invention will be described in detail with reference to the drawings.

【0015】図1を参照すると、本発明の一実施例であ
るプログラム実行監視方法は、データを処理する処理装
置100と、データを記憶する記憶装置200と、ユー
ザが入力のために使用するキーボード300と、図形や
テキストを表示するディスプレイ装置400とを有する
プログラム実行監視システムにおいて実現される。
Referring to FIG. 1, a program execution monitoring method according to an embodiment of the present invention includes a processing device 100 for processing data, a storage device 200 for storing data, and a keyboard used by a user for inputting. The present invention is realized in a program execution monitoring system having a display device 300 for displaying figures and texts.

【0016】記憶装置200は、処理装置100で発生
した分岐の履歴を記憶する分岐履歴記憶部210を含ん
でいる。
The storage device 200 includes a branch history storage unit 210 that stores a history of branches that have occurred in the processing device 100.

【0017】処理装置100は、プログラムを実行する
プログラム実行手段110と、このプログラム実行手段
110で分岐の発生を検出した旨の割込みを受け付ける
割込み受付け手段120と、発生した分岐が分岐履歴記
憶部210にすでに登録されているか否かを検索する検
索手段130と、発生した分岐が分岐履歴記憶部210
に登録されていなければ新規に登録する登録手段140
と、プログラムを再開すべく割込みの終了をプログラム
実行手段110に通知する割込み終了手段150と、分
岐履歴記憶部210に記憶されている内容を編集してデ
ィスプレイ装置400に表示する編集手段160とを有
している。
The processing device 100 includes a program execution unit 110 for executing a program, an interrupt reception unit 120 for receiving an interrupt indicating that a branch has been detected by the program execution unit 110, and a branch history storage unit 210 for storing the generated branch. A search unit 130 for searching whether or not a registered branch is already registered in the branch history storage unit 210
Registration means 140 for newly registering if not registered in
And an interrupt ending means 150 for notifying the program executing means 110 of the end of the interrupt to restart the program, and an editing means 160 for editing the contents stored in the branch history storage unit 210 and displaying the contents on the display device 400. Have.

【0018】プログラム実行手段110は、通常はプロ
グラム中の各命令を順番に実行していく。プログラム実
行手段110は、プログラム実行中に分岐命令による分
岐の発生を検出すると、割込みを発生し、プログラムの
実行を一時中断する。この割込みは、割込み受付け手段
120により受け付けられ、一連の割込み処理が終了す
るまでプログラムは実行されない。プログラムの再開の
指示は、割込み終了手段150によって行われる。ここ
で、一連の割込み処理とは、上述の割込み受付け手段1
20、検索手段130、登録手段140、および、割込
み終了手段150をいう。
The program execution means 110 normally executes each instruction in the program in order. When detecting the occurrence of a branch due to a branch instruction during the execution of a program, the program execution means 110 generates an interrupt and temporarily suspends the execution of the program. This interrupt is received by the interrupt receiving means 120, and the program is not executed until a series of interrupt processing ends. The instruction to restart the program is issued by the interrupt ending means 150. Here, a series of interrupt processing means the interrupt receiving means 1 described above.
20, the search means 130, the registration means 140, and the interruption end means 150.

【0019】割り込み受付手段120は、プログラム実
行手段110における分岐検出割込みを受け付ける。そ
して、分岐情報として、図2に図示するように、割込み
を発生した分岐命令の命令アドレス203、命令コード
202、および、分岐先アドレス201を受け取り、検
索手段130にこれら分岐情報を与える。分岐先アドレ
ス201や分岐命令アドレス203は、論理アドレスで
あっても物理アドレスであってもかまわない。命令コー
ド202は、分岐命令の種類を判別するためのものであ
り、プログラム中の各命令コードの部分をそのまま持っ
てきてもよいし、また、判別さえできれば圧縮した形で
あっても構わない。
The interrupt receiving means 120 receives a branch detection interrupt in the program executing means 110. Then, as shown in FIG. 2, an instruction address 203, an instruction code 202, and a branch destination address 201 of the branch instruction that caused the interrupt are received as branch information, and the branch information is provided to the search unit 130. The branch destination address 201 and the branch instruction address 203 may be logical addresses or physical addresses. The instruction code 202 is for determining the type of the branch instruction, and may take the part of each instruction code in the program as it is, or may be in a compressed form as long as it can be determined.

【0020】検索手段130は、割り込み受付手段12
0から与えられた分岐情報が記憶装置200内の分岐履
歴記憶部210に既に登録されたものであるか否かを検
索する。図3を参照すると、記憶装置200内の分岐履
歴記憶部210は、複数のエントリを有し、各エントリ
には、過去に分岐を発生した分岐命令の分岐先アドレス
211、命令コード212、分岐命令アドレス213、
および、分岐回数214を有している。このうち、分岐
先アドレス211、命令コード212、および、分岐命
令アドレス213は、分岐情報の分岐先アドレス20
1、命令コード202、および、分岐命令アドレス20
3にそれぞれ対応する。分岐回数214は、該当する分
岐が過去に何回発生したかを計数するものである。
The search means 130 is provided by the interrupt receiving means 12
A search is performed to determine whether the branch information given from 0 is already registered in the branch history storage unit 210 in the storage device 200. Referring to FIG. 3, the branch history storage unit 210 in the storage device 200 has a plurality of entries, and each entry includes a branch destination address 211, an instruction code 212, and a branch instruction Address 213,
And the number of branches 214. Among them, the branch destination address 211, the instruction code 212, and the branch instruction address 213 are the branch destination address 20 of the branch information.
1, instruction code 202 and branch instruction address 20
3 respectively. The number of branches 214 counts how many times the corresponding branch has occurred in the past.

【0021】検索手段130は、分岐履歴記憶部210
の各エントリを検索して、割り込み受付手段120から
与えられた分岐情報に合致するエントリがないかを調べ
る。この際、比較対象となるのは、分岐先アドレス21
1、命令コード212、および、分岐命令アドレス21
3である。検索の手法としては、先頭のエントリから順
次一致比較をとる手法や、分岐先アドレス211の一部
をキーとしてハッシングを行う手法等が考えられる。
The search means 130 includes a branch history storage unit 210
Are searched for an entry that matches the branch information provided by the interrupt receiving means 120. At this time, the comparison target is the branch destination address 21
1, instruction code 212, and branch instruction address 21
3. As a search method, a method of sequentially performing a match comparison from the first entry, a method of performing hashing using a part of the branch destination address 211 as a key, and the like can be considered.

【0022】検索手段130は、分岐履歴記憶部210
に分岐情報と合致するエントリを検出すると、そのエン
トリの分岐回数214の値を1つカウントアップする。
The search means 130 includes a branch history storage section 210
When an entry that matches the branch information is detected, the value of the branch count 214 of that entry is incremented by one.

【0023】登録手段140は、検索手段130によっ
て該当するエントリが検索されなかった場合に、その分
岐情報を新たに分岐履歴記憶部210に登録する。これ
により、分岐情報の分岐先アドレス201、命令コード
202、および、分岐命令アドレス203は、新たなエ
ントリの分岐先アドレス211、命令コード212、お
よび、分岐命令アドレス213にそれぞれ記憶される。
また、分岐回数214は「1」に設定される。
The registration unit 140 newly registers the branch information in the branch history storage unit 210 when the corresponding entry is not searched by the search unit 130. As a result, the branch destination address 201, the instruction code 202, and the branch instruction address 203 of the branch information are stored in the branch destination address 211, the instruction code 212, and the branch instruction address 213 of the new entry, respectively.
The number of times of branch 214 is set to “1”.

【0024】登録手段140が新たなエントリを確保す
る場合、空きエントリがあれば、空きエントリ中の一つ
のエントリを任意に選択して使用する。プログラム中に
出現する分岐命令の数よりもある程度多いエントリを用
意しておけば、先頭エントリから順次登録していく手法
で対処できる。また、全てのエントリが使用されてしま
った場合には、たとえばキャッシュメモリのように、一
般にLRU法とよばれる、「最近使われなかったエント
リを新たなエントリとして使用する」手法を用いること
が考えられる。
When the registration means 140 secures a new entry, if there is an empty entry, one of the empty entries is arbitrarily selected and used. If a certain number of entries are prepared more than the number of branch instructions appearing in the program, it can be dealt with by a method of sequentially registering from the first entry. When all the entries have been used, it is conceivable to use a technique called “use a recently unused entry as a new entry”, which is generally called an LRU method, such as a cache memory. Can be

【0025】上記検索手段130と登録手段140が終
了すると、割込終了手段150は、プログラム実行手段
110に対してプログラム実行の再開を指示する。
When the search means 130 and the registration means 140 have been completed, the interruption ending means 150 instructs the program execution means 110 to resume the execution of the program.

【0026】編集手段160は、プログラム実行手段1
10でプログラムの実行が終了後、キーボードによるユ
ーザからの指示に従い、分岐履歴記憶部210の内容を
編集して、その結果をディスプレイ装置400に表示す
る。この編集処理においては、たとえば、分岐先アドレ
ス毎に分岐回数を示すようにすれば、どの命令に対する
分岐が数多く発生したかを容易に認識することができ、
無限ループ発生の原因を知ることができる。
The editing means 160 includes the program executing means 1
After the execution of the program in 10 is completed, the contents of the branch history storage unit 210 are edited according to the instruction from the user using the keyboard, and the result is displayed on the display device 400. In this editing process, for example, if the number of branches is indicated for each branch destination address, it is possible to easily recognize which instruction has caused many branches.
You can know the cause of the infinite loop.

【0027】なお、キーボード300は、マウスやタッ
チパネル等の他の入力手段であってもよいことはいうま
でもない。また、ディスプレイ装置400は、プリンタ
装置等の他の出力手段であってもよいことはいうまでも
ない。
It is needless to say that the keyboard 300 may be another input means such as a mouse or a touch panel. Needless to say, the display device 400 may be another output unit such as a printer device.

【0028】次に本発明の上記一実施例の動作について
説明する。
Next, the operation of the embodiment of the present invention will be described.

【0029】プログラム実行手段110において分岐検
出割込みが発生すると、割込み受付け手段120で割込
みが受け付けられる。図4を参照すると、割込みルーチ
ンにおいて、検索処理が行われる(ステップ131)。
すなわち、上述のように検索手段130によって、割り
込み受付手段120から与えられた分岐情報が分岐履歴
記憶部210に既に登録されているか否か、つまり分岐
情報の内容と一致するエントリが存在するか否か、を検
索する。
When a branch detection interrupt occurs in the program executing means 110, the interrupt is accepted by the interrupt accepting means 120. Referring to FIG. 4, a search process is performed in an interrupt routine (step 131).
That is, as described above, the search unit 130 determines whether or not the branch information provided from the interrupt receiving unit 120 has already been registered in the branch history storage unit 210, that is, whether or not there is an entry that matches the content of the branch information. Or search.

【0030】この結果、一致するエントリを検出する
と、そのエントリの分岐回数214の値を1つ増加させ
る(ステップ133)。逆に、一致するエントリが検出
されなかった場合には、その分岐情報について登録処理
を行う(ステップ141)。この登録処理は、上述のよ
うに登録手段140によって、その分岐情報を新たに分
岐履歴記憶部210に登録することで実現される。
As a result, when a matching entry is detected, the value of the branch count 214 of the entry is increased by one (step 133). Conversely, if no matching entry is detected, registration processing is performed on the branch information (step 141). This registration process is realized by newly registering the branch information in the branch history storage unit 210 by the registration unit 140 as described above.

【0031】ステップ133またはステップ141の処
理が終了すると、割込み終了手段150によって、プロ
グラム実行再開の指示がプログラム実行手段110に対
して行われる。
When the processing in step 133 or step 141 is completed, the interrupt ending means 150 instructs the program execution means 110 to resume the program execution.

【0032】このようにして、プログラムの実行が進行
し、その後正常終了するか、または、人手による強制終
了あるいは所定の時間を超過して異常終了した時点で、
分岐履歴記憶部210には当該プログラムの分岐履歴が
記憶されていることになる。ユーザがキーボード300
によって、分岐履歴の表示を指示すると、編集手段16
0は分岐履歴記憶部210の内容を編集し、その結果を
ディスプレイ装置400に表示する。すなわち、図5を
参照すると、編集手段160による編集処理がステップ
161にて行われ、その後、ディスプレイ装置400へ
の表示がステップ162で行われる。
In this way, when the execution of the program progresses and then ends normally, or when the program is manually terminated or abnormally terminated after exceeding a predetermined time,
The branch history storage unit 210 stores the branch history of the program. The user enters the keyboard 300
When the instruction to display the branch history is issued by the
0 edits the contents of the branch history storage unit 210 and displays the result on the display device 400. That is, referring to FIG. 5, the editing processing by the editing means 160 is performed in step 161, and then the display on the display device 400 is performed in step 162.

【0033】図6を参照すると、本発明の対象となるプ
ログラムの一例では、最内ループとしてxからcへの分
岐があり、さらに、その外側のループとしてyからbへ
の分岐、そして、最外ループとしてzからaへの分岐が
生起し得るものとする。
Referring to FIG. 6, in an example of a program to be subjected to the present invention, there is a branch from x to c as an innermost loop, a branch from y to b as an outer loop, and a branch from y to b. It is assumed that a branch from z to a can occur as an outer loop.

【0034】図7を参照すると、上記図6のプログラム
を実行した場合の分岐履歴の表示の一例では、横軸方向
が分岐先アドレスであり、縦軸方向が該当するアドレス
への分岐回数を示している。図7の結果によると、bに
対する分岐が飛び抜けて多いことを示している。これに
より、ユーザは、プログラムが正常に終了しない理由と
して、bへの分岐に関して無限ループが発生しているの
ではないかという予測をたてることができる。
Referring to FIG. 7, in the example of the display of the branch history when the program of FIG. 6 is executed, the horizontal axis direction is the branch destination address, and the vertical axis direction indicates the number of branches to the corresponding address. ing. The results in FIG. 7 show that the number of branches for b is extremely large. As a result, the user can make a prediction that an infinite loop is generated for the branch to b as a reason why the program does not end normally.

【0035】また、ユーザはさらにキーボード300に
より、分岐先アドレスが「b」のものに関して、その分
岐を発生した分岐命令の命令アドレスを表示するように
指示することができる。これにより、横軸方向が分岐命
令アドレスであって、縦軸方向がその分岐命令から分岐
先アドレス「b」への分岐回数を表す画面表示が得られ
る。この結果、分岐命令アドレス「y」からの分岐回数
が飛び抜けて多い場合には、分岐命令アドレス「y」か
ら分岐先アドレス「b」の間で無限ループを形成してい
る可能性が高いと、判断することができる。
Further, the user can further instruct the keyboard 300 to display the instruction address of the branch instruction which caused the branch for the branch destination address "b". As a result, a screen display is obtained in which the horizontal axis represents the branch instruction address and the vertical axis represents the number of branches from the branch instruction to the branch destination address “b”. As a result, if the number of branches from the branch instruction address “y” is extremely large, it is highly possible that an infinite loop is formed between the branch instruction address “y” and the branch destination address “b”. You can judge.

【0036】また、分岐命令にはいくつか種類があり、
たとえば、ある変数の値によって分岐するか否かを決定
する条件分岐命令や、無条件に分岐する無条件分岐命
令、さらには所定のカウンタ値に従ってループを形成す
る回数指定分岐命令等がある。ユーザは、これら分岐命
令の種類を指定することによって、無限ループの解析に
役立てることもできる。
There are several types of branch instructions.
For example, there are a conditional branch instruction that determines whether or not to branch according to the value of a certain variable, an unconditional branch instruction that branches unconditionally, and a branch instruction that specifies the number of times to form a loop according to a predetermined counter value. By designating the types of these branch instructions, the user can also help analyze an infinite loop.

【0037】このように、本発明の一実施例であるプロ
グラム実行監視方法によれば、プログラム実行手段11
0において分岐の発生を検出すると割込みを発生し、分
岐履歴記憶部210に対して過去に発生した分岐の履歴
を記憶していくことによって、ブレークポイントの設定
や無限ループか否かの判断のための制限値の設定を不要
とし、複数の分岐命令によって無限ループが形成されて
いる場合であっても、プログラムの実行状態を監視する
ことができる。
As described above, according to the program execution monitoring method of one embodiment of the present invention, the program execution means 11
When the occurrence of a branch is detected at 0, an interrupt is generated, and the history of the branch that occurred in the past is stored in the branch history storage unit 210 to set a breakpoint or determine whether or not the loop is an infinite loop. And the execution state of the program can be monitored even when an infinite loop is formed by a plurality of branch instructions.

【0038】なお、上記一実施例では、分岐情報および
分岐履歴として、分岐先アドレス、命令コード、分岐命
令アドレスを使用しているが、これらは、必ずしも同時
に使用する必要はない。分岐先アドレスさえ記憶してお
けば、プログラムの実行状態を知ることができるからで
ある。上記実施例で分岐命令アドレスを使用したのは、
分岐元と分岐先を対にした特定の分岐パターンについて
細かく解析するためである。したがって、そのような要
求がない場合にはこの分岐命令アドレスは不要である。
また、上記実施例で命令コードを使用したのは、分岐命
令の種類毎の異なった性質の動作を解析するためであ
る。したがって、そのような要求がない場合にはこの命
令コードは不要である。
In the above embodiment, the branch destination address, the instruction code, and the branch instruction address are used as the branch information and the branch history, but they need not always be used simultaneously. This is because the execution state of the program can be known only by storing the branch destination address. The reason for using the branch instruction address in the above embodiment is that
This is for detailed analysis of a specific branch pattern in which a branch source and a branch destination are paired. Therefore, if there is no such request, this branch instruction address is unnecessary.
The reason why the instruction code is used in the above embodiment is to analyze operations having different properties for each type of branch instruction. Therefore, if there is no such request, this instruction code is unnecessary.

【0039】[0039]

【発明の効果】以上の説明で明らかなように、本発明に
よると、ブレークポイントの設定や無限ループか否かの
判断のための制限値の設定を不要とし、複数の分岐命令
によって無限ループが形成されている場合であっても、
プログラムの実行状態を監視することができる。
As is apparent from the above description, according to the present invention, it is not necessary to set a breakpoint or to set a limit value for judging whether or not an infinite loop exists. Even if it is formed,
The execution status of the program can be monitored.

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

【図1】本発明のプログラム実行監視方法の一実施例の
機能構成を示す図である。
FIG. 1 is a diagram showing a functional configuration of an embodiment of a program execution monitoring method according to the present invention.

【図2】本発明の一実施例における分岐命令に関する情
報を示す図である。
FIG. 2 is a diagram showing information on a branch instruction in one embodiment of the present invention.

【図3】本発明の一実施例における分岐履歴記憶部の内
容を示す図である。
FIG. 3 is a diagram showing the contents of a branch history storage unit in one embodiment of the present invention.

【図4】本発明の一実施例のプログラム実行監視方法の
検索登録手順を示す図である。
FIG. 4 is a diagram showing a search registration procedure of the program execution monitoring method according to one embodiment of the present invention.

【図5】本発明の一実施例のプログラム実行監視方法の
編集表示手順を示す図である。
FIG. 5 is a diagram showing an edit display procedure of the program execution monitoring method according to one embodiment of the present invention.

【図6】本発明の対象となるプログラムの一例を示す図
である。
FIG. 6 is a diagram illustrating an example of a program that is an object of the present invention.

【図7】本発明の一実施例におけるディスプレイ装置上
の表示例を示す図である。
FIG. 7 is a diagram showing a display example on a display device according to an embodiment of the present invention.

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

100 処理装置 110 プログラム実行手段 120 割り込み受付手段 130 検索手段 140 登録手段 150 割込終了手段 160 編集手段 200 記憶装置 210 分岐履歴記憶部 300 キーボード 400 ディスプレイ装置 REFERENCE SIGNS LIST 100 processing device 110 program executing means 120 interrupt accepting means 130 searching means 140 registering means 150 interrupt ending means 160 editing means 200 storage device 210 branch history storage unit 300 keyboard 400 display device

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 プログラムを実行する処理装置と、プロ
グラム実行中に発生した分岐の履歴を記憶する分岐履歴
記憶部を含む記憶装置と、外部からデータを入力するた
めの入力装置と、データを表示するための表示装置とを
有するプログラム実行監視システムにおいて、 プログラム実行中に分岐の発生を検出した旨の割込みを
発生するステップと、 分岐を発生した分岐命令に関する情報が前記分岐履歴記
憶部に既に登録されているか否かを検索するステップ
と、 該当する分岐命令の情報が前記分岐履歴記憶部に既に登
録されていればその分岐命令の分岐回数を増加させ、該
当する分岐命令の情報が前記分岐履歴記憶部に既に登録
されていなければその分岐命令に関する情報を前記分岐
履歴記憶部に登録するステップと、 プログラムの実行を再開させるステップと、 プログラム終了後に前記入力手段からの指示に従って前
記分岐履歴記憶部に記憶されている情報を編集して前記
表示手段に表示するステップとを含むことを特徴とする
プログラム実行監視方法。
1. A processing device for executing a program, a storage device including a branch history storage unit for storing a history of branches generated during execution of the program, an input device for externally inputting data, and displaying data Generating an interrupt indicating that a branch has been detected during execution of a program, and information relating to the branch instruction that caused the branch has already been registered in the branch history storage unit. And if the information of the corresponding branch instruction is already registered in the branch history storage unit, increase the number of times of the branch instruction, and store the information of the corresponding branch instruction in the branch history. Registering information on the branch instruction in the branch history storage unit if the information is not already registered in the storage unit; Steps and the program execution monitoring method characterized by editing the information stored in the branch history storage section according to an instruction from said input means after the end of the program and displaying on said display means for opening.
【請求項2】 前記分岐命令に関する情報は分岐先アド
レスを含み、 前記表示手段は分岐先アドレス毎の分岐回数を表示する
ことを特徴とする請求項1記載のプログラム実行監視方
法。
2. The program execution monitoring method according to claim 1, wherein the information on the branch instruction includes a branch destination address, and the display unit displays the number of branches for each branch destination address.
【請求項3】 前記分岐命令に関する情報は分岐先アド
レスおよび分岐命令アドレスを含み、 前記表示手段は各分岐命令毎に分岐先アドレスに対する
分岐回数を表示することを特徴とする請求項1記載のプ
ログラム実行監視方法。
3. The program according to claim 1, wherein the information on the branch instruction includes a branch destination address and a branch instruction address, and the display unit displays, for each branch instruction, the number of branches for the branch destination address. Execution monitoring method.
【請求項4】 前記分岐命令に関する情報は分岐先アド
レスおよび分岐命令種別識別コードを含み、 前記表示手段は分岐命令の種別毎に分岐先アドレスに対
する分岐回数を表示することを特徴とする請求項1記載
のプログラム実行監視方法。
4. The information on the branch instruction includes a branch destination address and a branch instruction type identification code, and the display unit displays the number of branches for the branch destination address for each type of the branch instruction. The described program execution monitoring method.
【請求項5】 プログラムを実行するプログラム実行手
段と、 このプログラム実行手段で分岐の発生を検出した旨の割
込みを受け付ける割込み受付け手段と、 分岐を発生した分岐命令に関する情報が前記分岐履歴記
憶部にすでに登録されているか否かを検索し、すでに登
録されていればその分岐回数を増加させる検索手段と、 分岐を発生した分岐命令に関する情報が前記分岐履歴記
憶部に登録されていない場合にその情報を前記分岐履歴
記憶部に新規に登録する登録手段と、 プログラム実行の再開指示を前記プログラム実行手段に
通知する割込み終了手段と、 プログラム終了後、前記分岐履歴記憶部に記憶されてい
る内容を編集して表示手段に表示する編集手段とを含む
ことを特徴とするプログラム実行監視システム。
5. A program executing means for executing a program, an interrupt receiving means for receiving an interrupt indicating that a branch has been detected by the program executing means, and information on a branch instruction which caused the branch is stored in the branch history storage unit. A search means for searching whether or not the information has already been registered, and increasing the number of times of the branch if the information has been already registered; and information about the branch instruction which caused the branch when the information has not been registered in the branch history storage unit. Registration means for newly registering the program in the branch history storage unit; interrupt ending means for notifying the program execution means of a program execution restart instruction; and editing the contents stored in the branch history storage unit after the program ends. A program execution monitoring system, comprising: an editing unit for displaying on a display unit.
JP7002264A 1995-01-10 1995-01-10 Program execution monitoring method and program execution monitoring system Expired - Fee Related JP2727996B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7002264A JP2727996B2 (en) 1995-01-10 1995-01-10 Program execution monitoring method and program execution monitoring system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7002264A JP2727996B2 (en) 1995-01-10 1995-01-10 Program execution monitoring method and program execution monitoring system

Publications (2)

Publication Number Publication Date
JPH08190498A JPH08190498A (en) 1996-07-23
JP2727996B2 true JP2727996B2 (en) 1998-03-18

Family

ID=11524522

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7002264A Expired - Fee Related JP2727996B2 (en) 1995-01-10 1995-01-10 Program execution monitoring method and program execution monitoring system

Country Status (1)

Country Link
JP (1) JP2727996B2 (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62111334A (en) * 1985-11-11 1987-05-22 Hitachi Electronics Eng Co Ltd Compressing device for recording information in computer program tracer
JPS62200437A (en) * 1986-02-28 1987-09-04 Mitsubishi Electric Corp Inclusion degree measuring instrument
JPS63103336A (en) * 1986-10-20 1988-05-09 Mitsubishi Electric Corp Debug back-up device
JPS6410347A (en) * 1987-07-03 1989-01-13 Nec Corp Program debug system
JPH0831054B2 (en) * 1988-10-12 1996-03-27 日本電気株式会社 History information storage method
JPH0442330A (en) * 1990-06-08 1992-02-12 Nec Corp Debugging system using branching history table
JPH0512061A (en) * 1991-07-08 1993-01-22 Nec Eng Ltd Address trace storage device
JPH064345A (en) * 1992-06-09 1994-01-14 Nec Corp History information storage system

Also Published As

Publication number Publication date
JPH08190498A (en) 1996-07-23

Similar Documents

Publication Publication Date Title
US4476525A (en) Pipeline-controlled data processing system capable of performing a plurality of instructions simultaneously
JP2746549B2 (en) Computer system and operation method thereof
JP2727996B2 (en) Program execution monitoring method and program execution monitoring system
US7885806B2 (en) Simulation method and simulation system of instruction scheduling
US8090990B2 (en) Abnormal pattern detection program for function call in source program
JPH04286001A (en) Programming method and device for programmable controller
JPH1091475A (en) Fault restoration device, fault restoration method and program medium for fault restoration
JP3035108B2 (en) Parallel processing unit
JP2001290531A (en) Plant operation supporting device
JPH09212387A (en) Program development supporting device
JPH07152578A (en) Detection of maximum stack usage quantity
JP2003208333A (en) Trace information searching device and method therefor
JP2616613B2 (en) Programmable controller
JP2977951B2 (en) Arithmetic unit
JP3213792B2 (en) Logic simulation verification method
JPH08179966A (en) Program test device
JPH04145544A (en) Debugging device
JP2653880B2 (en) Program content analyzer
JPH03292545A (en) Detection/recovery device for program loop
JPH04213727A (en) Information processor
JP2002116926A (en) Program processor and program processing method
JP3012618B1 (en) Debugging method of inspected program and its debugging method
JPH04308994A (en) Electronic register
JP3493110B2 (en) High-speed branch processing unit
JPH06332757A (en) Error check method with learning function

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19971111

LAPS Cancellation because of no payment of annual fees