JPH0410098B2 - - Google Patents

Info

Publication number
JPH0410098B2
JPH0410098B2 JP57051099A JP5109982A JPH0410098B2 JP H0410098 B2 JPH0410098 B2 JP H0410098B2 JP 57051099 A JP57051099 A JP 57051099A JP 5109982 A JP5109982 A JP 5109982A JP H0410098 B2 JPH0410098 B2 JP H0410098B2
Authority
JP
Japan
Prior art keywords
program
execution
state data
structured
execution state
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 - Lifetime
Application number
JP57051099A
Other languages
Japanese (ja)
Other versions
JPS58169262A (en
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 filed Critical
Priority to JP57051099A priority Critical patent/JPS58169262A/en
Publication of JPS58169262A publication Critical patent/JPS58169262A/en
Publication of JPH0410098B2 publication Critical patent/JPH0410098B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment

Description

【発明の詳細な説明】 (発明の分野) 本発明は、構造化されたプログラムの実行状態
データを採取するための方法および装置に関す
る。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a method and apparatus for collecting execution state data of a structured program.

(従来技術の記述) 電子計算機によつてデータ処理を行うために
は、その処理を実行させるためのプログラムは必
須である。このプログラムの開発においては、プ
ログラム自体の信頼性が高いことが要求される。
この信頼性に対する尺度として、プログラムのテ
ストの結果が主要な評価基準となる場合がある。
プログラムのテストにおいては、テストデータが
多いことだけでなく、如何にそのプログラムの実
行可能なパスを漏れなく実行でき得るか、また考
え得るあらゆる状況に対して正確にデータ処理を
実行でき得るかということが大切である。このよ
うなプログラムのテストに際しては、プログラム
の実行パスの解析を行う手段が重要である。ま
た、プログラムのデバツグにおいては、プログラ
ム不具合の原因究明の方法としてプログラムの実
行パスの追跡(トレース)を行うが、この場合に
も実行状態追跡の手段が重要である。
(Description of Prior Art) In order to perform data processing using an electronic computer, a program for executing the processing is essential. In developing this program, it is required that the program itself be highly reliable.
As a measure of this reliability, the results of the program's tests may be the primary evaluation criterion.
When testing a program, it is important not only to have a large amount of test data, but also to be able to execute all executable paths of the program, and to accurately process data in all possible situations. That is important. When testing such a program, it is important to have a means for analyzing the execution path of the program. Furthermore, when debugging a program, the execution path of the program is traced as a method of investigating the cause of a program malfunction, and in this case as well, a means of tracing the execution state is important.

一方、近年、計算機プログラミングの手法とし
て、データ処理の1つの単位をブロツク化し、そ
のようなブロツクを複数個組合せてプログラムを
作成するストラクチヤードプログラミングによる
構造化プログラムが知られている。例えば、
USP.4240137号公報には、このようなストラクチ
ヤードプログラミングを行うための演算制御方法
および装置が開示されている。
On the other hand, in recent years, structured programs have become known as a computer programming method, in which one unit of data processing is divided into blocks and a program is created by combining a plurality of such blocks. for example,
USP.4240137 discloses an arithmetic control method and apparatus for performing such structured programming.

(発明の目的) この発明の目的は、構造化プログラムの実行パ
スの履歴を示す全実行状態データを効率的に採取
するための方法を提供することにある。
(Object of the Invention) An object of the present invention is to provide a method for efficiently collecting all execution state data indicating the history of the execution path of a structured program.

この発明の他の目的は、構造化プログラムの実
行中に、構造化形式を構成する各プログラム・ブ
ロツクの実行状態データを採取し、プログラムの
実行履歴をプログラム・ブロツク番号で収集する
構造化プログラム処理装置を提供することにあ
る。
Another object of the present invention is to provide structured program processing that collects execution status data of each program block constituting a structured format during execution of a structured program, and collects program execution history by program block number. The goal is to provide equipment.

(発明の要旨) 本発明は、構造化プログラムの実行において
は、構造化形式を構成するプログラム・ブロツク
のいずれかの入口と出口を必ず通過するというブ
ロツク構造の性質に着目し、各プログラム・ブロ
ツクの入口または出口に、プログラムの実行状態
データを採取する割込み命令を設けることでプロ
グラム全体の実行経路を把握するようにしたとこ
ろに特徴がある。
(Summary of the Invention) The present invention focuses on the property of the block structure that when executing a structured program, the program block that makes up the structured format always passes through the entrance and exit of each program block. The feature is that the execution path of the entire program can be grasped by providing an interrupt instruction to collect program execution status data at the entrance or exit of the program.

さらに、オブジエクトプログラムに挿入した前
記割込み命令のオペランドにプログラム・ブロツ
ク番号を含ませ、実行状態データをこのブロツク
番号で収集し、ソース・レベルの把握を可能にし
たものである。
Furthermore, a program block number is included in the operand of the interrupt instruction inserted into the object program, and execution state data is collected using this block number, making it possible to grasp the source level.

(実施例の説明) 以下、この発明を詳細に説明する。(Explanation of Examples) This invention will be explained in detail below.

まず、第1図のA,B、およびCは、夫々ブロ
ツク化されたプログラムのフローチヤート例を示
している。このようなブロツクを組合せて、構造
化プログラムに基づくソース・プログラムが構成
される。
First, A, B, and C in FIG. 1 each show an example of a flowchart of a blocked program. A source program based on a structured program is constructed by combining such blocks.

この構造化プログラムにおけるプログラム・ブ
ロツク(以下、単にブロツク)の構造は、つぎの
ような構成ないし性質を有している。
The structure of a program block (hereinafter simply referred to as a block) in this structured program has the following configuration or properties.

●1個のブロツクの処理の流れは、1入口、1出
口となる。
●The processing flow for one block is one inlet and one outlet.

●ブロツク内にブロツクを含む入れ子(ネスト)
構造を構成できる。
●Nesting that includes blocks within blocks
You can compose structures.

●最小単位のブロツクは、分岐や飛び出しを含ま
ない実行文の集合である。
●The smallest unit block is a set of executable statements that do not include branches or jumps.

●上位のブロツクに含まれる分岐や飛び出し先
は、当該ブロツクの入口と出口の範囲内にあ
る。
● Branches and jump destinations included in higher-level blocks are within the range of the entrance and exit of the block.

構造化プログラムを作成するには、構造化言語
が使用される。構造化言語における各ブロツクへ
の入口を表わすステートメント(PL/1、
PASCAL等の言語における“BEGIN”、
“PROCEDURE”等の命令語に相当するものや、
通常の実行文がそれに該当する場合もある)をエ
ントリー文(ENTRY文)と呼び、それに対応す
る各ブロツクの出口を示すステ−トメント
(“END”等もしくは通常の実行文でも、前後の
文脈によつてブロツクの出口を示すステートメン
トになりうる)をエグジツト文(EXIT文)と呼
ぶことにすれば、構造化されたプログラムの構造
は、第2図Aのような形で表わされる。このソー
ス・プログラムの構造(第2図A)に対して、実
行可能なオブジエクト・プログラムは同図Bの如
く表わされる。このようなプログラムの実行状態
データを採取するには、採取のためのブレーク・
ポイントをこの中に設定する必要がある。その設
定のためには、分岐命令(“JUMP”命令)等を
ブレーク・ポイント(B1〜Bo)として選択し、
プローブを設定することが考えられる。これは、
第3図A,Bに示される。しかし、このようにし
たのでは、プログラム実行時に、各JUMP命令毎
に実行状態データ採取のための一連の処理を行う
ことになり、本来の処理に対するオーバーヘツド
が極めて大きくなる。また、そのデータを用いて
の実行状態の解析も困難となる。ところで、上記
した構造化プログラムのブロツク構造の性質によ
れば、ブロツクが実行される度に、そのブロツク
の入口と出口を必ず通過する。したがつて、各ブ
ロツクの入口または出口の実行パスを監視すれ
ば、プログラム全体の実行経路の把握が可能にな
る。そこで、ブロツクの入口または出口をブレー
ク・ポイントに選び、ここにプローブを設定す
る。
Structured languages are used to create structured programs. A statement that represents the entrance to each block in a structured language (PL/1,
“BEGIN” in languages such as PASCAL,
Those equivalent to command words such as “PROCEDURE”,
An ordinary executable statement may correspond to this) is called an entry statement, and a statement indicating the exit of each corresponding block (such as “END” or even an ordinary executable statement, depending on the context) If we call a statement (which can therefore be a statement indicating the exit of a block) an exit statement, the structure of a structured program can be expressed in the form shown in Figure 2A. With respect to the structure of this source program (FIG. 2A), an executable object program is expressed as shown in FIG. 2B. To collect execution status data of such a program, use the break code for collection.
You need to set the point inside this. To set it, select a branch instruction (“JUMP” instruction) etc. as a break point (B 1 to B o ),
One possibility is to set up a probe. this is,
This is shown in FIGS. 3A and 3B. However, in this case, when a program is executed, a series of processing for collecting execution state data is performed for each JUMP instruction, resulting in an extremely large overhead compared to the original processing. Furthermore, it becomes difficult to analyze the execution state using the data. By the way, according to the properties of the block structure of the structured program described above, each time a block is executed, the program always passes through the entrance and exit of that block. Therefore, by monitoring the execution path at the entrance or exit of each block, it becomes possible to grasp the execution path of the entire program. Therefore, select the entrance or exit of the block as a break point and set a probe there.

しかしながら、オブジエクト・プログラムの中
から、ソース・プログラムのブロツク構造におけ
る始端(または終端)をみつけだすことは極めて
難しい。
However, it is extremely difficult to find the start (or end) of the block structure of a source program from within an object program.

本発明の実施例においては、オブジエクト・プ
ログラムの中から、ソース・プログラムのブロツ
ク構造を捜すことの困難さを解消するため、ソー
ス・プログラムをコンパイラによつてオブジエク
ト・プログラムにコンパイルするときに、
ENTRY文またはEXIT文が現われたならば、自
動的にそのポイントをブレーク・ポイントと認識
し、そのポイントにプローブを設定する。すなわ
ち、第4図に概略を示すように、構造化プログラ
ムとして記述されたソース・プログラム(第4図
A)をコンパイルするに際し、各ブロツクの切れ
目(ブレーク・ポイント)にプローブを設定し、
埋め込む(第4図B)。ここで、プローブとは、
オブジエクト・プログラム(第4図B)実行時
に、各ブロツクのブレークポイントであることを
認識させるための割込みを発生させる機械語コー
ド、もしくは機械命令をいう。
In an embodiment of the present invention, in order to solve the difficulty of searching for the block structure of a source program in an object program, when a source program is compiled into an object program by a compiler,
When an ENTRY or EXIT statement appears, that point is automatically recognized as a break point and a probe is set at that point. That is, as schematically shown in Figure 4, when compiling a source program written as a structured program (Figure 4A), probes are set at breaks (break points) in each block,
Embed (Figure 4B). Here, the probe is
A machine code or machine instruction that generates an interrupt to recognize a breakpoint of each block when an object program (FIG. 4B) is executed.

第5図には、機械命令である機械語コードの例
が示される。第5図のAは、一般の機械命令のフ
オーマツトを示す。OPCODE部(0〜7bit)に
は、オペレーシヨンを指定する命令コードが設定
され、R、A部には、第1、第2オペランドが設
定される。このオペランドとしては、アドレスも
しくは2進データが設定される。第5図のBは、
LOAD命令を示したもので、R部にはレジスタ
指定、A部はLOAD命令を実行する対象となる
アドレス(displacement)指定がなされる。第
5図のCは、上述したプローブ命令のフオーマツ
トを示す。オペレーシヨンコード部には
“PROBE”という専用の命令コードを持ち、オ
ペランドとしてソースプログラムの各ブロツクを
識別するブロツク識別番号BNを有する。この
PROBE命令は、コンパイル装置でのコンパイル
時にコンパイラによつてオブジエクト・プログラ
ムに埋込まれる。
FIG. 5 shows an example of machine language code, which is a machine instruction. A in FIG. 5 shows the format of a general machine instruction. An instruction code specifying an operation is set in the OPCODE section (0 to 7 bits), and first and second operands are set in the R and A sections. An address or binary data is set as this operand. B in Figure 5 is
This shows the LOAD instruction, where the R section specifies a register, and the A section specifies the address (displacement) to be executed for the LOAD instruction. FIG. 5C shows the format of the probe command described above. The operation code section has a dedicated instruction code called "PROBE" and a block identification number BN for identifying each block of the source program as an operand. this
The PROBE instruction is embedded into the object program by the compiler during compilation on the compiling device.

第6図は、本発明の一実施例を示す全体ブロツ
ク図である。この図において、1は補助メモリで
あり、ここには構造化プログラムとして作成され
たソース・プログラムが記憶されている。2はコ
ンパイル装置であり、ソースプログラムを読み込
んで、それを処理装置4が実行可能なオブジエク
ト・プログラムにコンパイルする。3は主記憶装
置であり、コンパイル装置2によつてコンパイル
されたオブジエクト・プログラムが記憶される。
このオブジエクト・プログラム中には、ソース・
プログラムの各ブロツクのブレーク・ポイント毎
にPROBE命令が埋め込まれている。4は処理装
置全体を示し、5〜7の各機器で構成される。5
はプログラムの状態を示すフラグ(プログラム・
ステータス・ワード;PSW)を記憶するフラ
グ・レジスタであり、6は命令実行ユニツトであ
る。7は割込制御情報記憶部である。8は、プロ
グラム実行状態を格納するデータ格納テーブルで
ある。コンパイル装置2によつてコンパイルされ
たオブジエクト・プログラムは、主記憶装置3に
ロードされる。そして、命令実行ユニツト6によ
り、このプログラムが実行される。この実行によ
り、PROBE命令が現われると、PROBE命令の
オペランドにあるブロツク識別情報を割込制御情
報記憶部7に格納し、プログラム実行状態データ
を収集するデータ収集プログラム(予め主記憶装
置3に記憶されている。)の先頭へジヤンプする。
このデータ収集プログラムは、命令実行ユニツト
6により実行され、すでに記憶部7に格納してい
たブロツク識別情報をデータ格納テーブル8に格
納する。この格納の終了により、PROBE命令に
基づく処理は終了し、オブジエクト・プログラム
の次のステツプの処理が開始される。このような
プログラム実行状態データの収集は、PROBE命
令が現われる毎にくり返される。したがつて、オ
ブジエクト・プログラムの一連の実行が終了した
とき、その実行状態データは、データ格納テーブ
ル8に格納されており、これによつて実行パスの
履歴や解析が可能となる。
FIG. 6 is an overall block diagram showing one embodiment of the present invention. In this figure, 1 is an auxiliary memory in which a source program created as a structured program is stored. A compiling device 2 reads a source program and compiles it into an object program executable by the processing device 4. 3 is a main storage device in which object programs compiled by the compiling device 2 are stored.
During this object program, the source
A PROBE instruction is embedded at each break point in each block of the program. Reference numeral 4 indicates the entire processing device, which is composed of each of devices 5 to 7. 5
is a flag indicating the state of the program (program
A flag register stores a status word (PSW), and 6 is an instruction execution unit. 7 is an interrupt control information storage section. 8 is a data storage table that stores the program execution status. The object program compiled by the compiling device 2 is loaded into the main storage device 3. This program is then executed by the instruction execution unit 6. As a result of this execution, when the PROBE instruction appears, the data collection program (previously stored in the main storage device 3) stores the block identification information in the operand of the PROBE instruction in the interrupt control information storage section 7 and collects program execution status data. ) Jump to the beginning of the file.
This data collection program is executed by the instruction execution unit 6 and stores the block identification information already stored in the storage section 7 into the data storage table 8. Upon completion of this storage, processing based on the PROBE instruction is completed, and processing of the next step of the object program is started. Such collection of program execution state data is repeated every time a PROBE command appears. Therefore, when a series of executions of an object program is completed, the execution state data is stored in the data storage table 8, thereby making it possible to history and analyze the execution path.

第6図の実施例の詳細について、更に第7図〜
第14図を用いて説明する。
For details of the embodiment shown in Fig. 6, further details are given in Figs.
This will be explained using FIG. 14.

まず、第6図におけるコンパイル装置2の処理
フローを第7図に示す。構造化プログラムとして
作成されたソース・プログラムは、補助メモリ1
からコンパイル装置2にロードされる。コンパイ
ル装置2では、まず、ソース・プログラムについ
て、その字句解析を行い(F1)、この字句解釈に
よつて判別された各ブロツクのEXIT文(あるい
はENTRY文)の位置にブレーク・ポイントを検
出するためのPROBE命令(第5図のCで示した
命令)を埋め込む(F2)。この後、通常のコンパ
イラの処理である構文解釈F3の処理と、それに
基づいて実行可能なオブジエクト・プログラム3
4にコンパイルするオブジエクト生成F4の処理
が行われる。30〜33は、コンパイル装置2の
コンパイルの途中で生成されるプログラムや対応
表を示している。この実施例におけるコンパイル
において、特徴的な点は、ブレークポイントとな
るEXIT文の位置の検出と、その位置にPROBE
命令を埋め込むための処理F2が加わつている点
である。この処理F2の詳細は、第8図a,bに
示される。第8図Aには、第7図の処理F2の詳
細な処理フローが示される。このフローチヤート
に示したように、この例では、プツシユ・ダウ
ン・スタツク(コンパイル装置2に内蔵されてい
る。)を使用して、ENTRY文で始まりEXIT文
で終了する各ブロツクにおいて、EXIT文を検出
し、そこにPROBE命令を挿入する。すなわち、
F201〜F204の処理ステツプにおいて、そのステ
ートメントがENTRY文かEXIT文かあるいはそ
うでないものかを判断し、ENTRY文のときは
F205、F206の処理を行つて、再びF202のステツ
プに戻る。EXIT文のとき(すなわち、プログラ
ムブロツクのブレークポイント)、F207、F208の
ステツプで、第8図Bに示すような、対応表を作
成し、ステツプF208ではその対応表に基づき、
そのオペランドにブロツク識別番号(BN)を含
むPROBE命令を作成する。そして、ステツプ
F210では、このPROBE命令をEXIT文の後に埋
め込む処理を行う。
First, FIG. 7 shows the processing flow of the compiling device 2 in FIG. 6. A source program created as a structured program is stored in auxiliary memory 1.
is loaded into the compiling device 2 from Compiling device 2 first performs lexical analysis of the source program (F1), and detects a break point at the EXIT statement (or ENTRY statement) position of each block determined by this lexical interpretation. The PROBE instruction (instruction shown by C in FIG. 5) is embedded (F2). After this, the process of syntax interpretation F3, which is the normal compiler process, and the object program 3 that can be executed based on it.
Processing of object generation F4 to be compiled into 4 is performed. 30 to 33 indicate programs and correspondence tables generated during compilation by the compiling device 2. The special feature of the compilation in this example is the detection of the position of the EXIT statement that serves as a breakpoint, and the detection of the PROBE statement at that position.
The difference is that a process F2 for embedding instructions is added. Details of this process F2 are shown in FIGS. 8a and 8b. FIG. 8A shows a detailed process flow of process F2 in FIG. 7. As shown in this flowchart, this example uses a push down stack (built into compiler 2) to write an EXIT statement in each block that starts with an ENTRY statement and ends with an EXIT statement. Detect and insert a PROBE instruction there. That is,
In processing steps F201 to F204, it is determined whether the statement is an ENTRY statement, an EXIT statement, or something else, and if it is an ENTRY statement,
After processing F205 and F206, return to step F202. At the time of an EXIT statement (i.e., a breakpoint in a program block), in steps F207 and F208, a correspondence table as shown in Figure 8B is created, and in step F208, based on the correspondence table,
Create a PROBE instruction that includes a block identification number (BN) in its operand. And step
F210 performs processing to embed this PROBE command after the EXIT statement.

このように、コンパイル装置2によつて、ソー
ス・プログラム(構造化形式で記述されている。)
を実行可能なオブジエクト・プログラムにコンパ
イルするとき、プローブがブレーク・ポイントに
挿入される。このような処理の施されたオブジエ
クト・プログラムはメインメモリ3に記憶され
る。
In this way, the source program (written in a structured format) is compiled by the compiling device 2.
When compiling into an executable object program, probes are inserted at breakpoints. The object program subjected to such processing is stored in the main memory 3.

次に、第6図における処理装置4の詳細につい
て説明する。第9図および第10図には、この詳
細なブロツク図が示されている。第9図および第
10図において、処理装置4は、5,7,9〜2
5の各機器で構成される。5はフラグレジスタ、
7は割込制御情報記憶部である。9はインストラ
クシヨンレジスタ(IR)であり、実行すべき命
令語がメインメモリ3より読み出される。10は
メモリ・アドレス・レジスタ(MADR)であり、
インストラクシヨンレジスタ9に読出すべき命令
語の記憶されているアドレスをレジストする。1
1はPhase Control回路である。12はマイク
ロ・プログラム・アドレス・レジスタであり、イ
ンストラクシヨンレジスタ9に読出された命令語
のオペレーシヨンコード(OPCODE)の内容が
レジストされる。13はマイクロ・プログラム・
メモリ(MPM)であり、マイクロ命令を記憶し
ており、レジスタ12の内容に応じたアドレスの
命令を出力する。14はマイクロ・インストラク
シヨン・レジスタ(MIR)であり、MPM13か
ら出力されたマイクロ命令をレジストする。マイ
クロ命令は、アドレス部と制御部とに分れてお
り、アドレス部は次のマイクロ命令のアドレスを
指示するため、MPAR12に与えられる。制御
部は論理演算ユニツト(Arithmetic Logic
Unit:ALU)23に送られる。15は第1セレ
クタであり、IR9に読出された命令語のR部
(レジスタ指定)の出力によつて、レジスタ18
〜20のうちのいずれかを出力する。16は
ADDERであり、IR9に読出された命令語のA部
(命令実行する対象のアドレス指定)の出力とセ
レクタ15によつてセレクトされたレジスタの内
容との加算を行う。17は第2セレクタであり、
MIR14のアドレス部のうちの第1アドレス部
(Addr1)あるいは第2アドレス部(Addr2)の
いずれかの内容をMPAR12に出力させる。こ
のセレクト信号は、ALU23から与えられる。
18〜20はレジスタ、21はプログラムを実行
させるためのアドレス信号を発生するプログラム
カウンタである。22は、ワ−クレジスタを示
す。23は、MIR14の内容に応じて演算処理
を行うALUである。24はアキユムレ−タであ
り、25はコンデイシヨン・コ−ド・レジスタ
(Condifion Code Regisfer)である。
Next, details of the processing device 4 in FIG. 6 will be explained. A detailed block diagram of this is shown in FIGS. 9 and 10. 9 and 10, the processing device 4 includes 5, 7, 9 to 2
It consists of 5 devices. 5 is a flag register,
7 is an interrupt control information storage section. Reference numeral 9 denotes an instruction register (IR), from which an instruction word to be executed is read from the main memory 3. 10 is a memory address register (MADR),
The address where the instruction word to be read is stored is registered in the instruction register 9. 1
1 is a phase control circuit. 12 is a micro program address register in which the contents of the operation code (OPCODE) of the instruction word read into the instruction register 9 are registered. 13 is a micro program.
A memory (MPM) that stores microinstructions and outputs instructions at addresses according to the contents of the register 12. 14 is a micro-instruction register (MIR), which registers micro-instructions output from MPM 13; The microinstruction is divided into an address part and a control part, and the address part is given to the MPAR 12 to indicate the address of the next microinstruction. The control section is a logical operation unit (Arithmetic Logic unit).
Unit: ALU) 23. 15 is a first selector, and register 18 is selected by the output of the R part (register specification) of the instruction word read to IR9.
Output any one of ~20. 16 is
ADDER performs addition of the output of part A of the instruction word read into the IR 9 (designating the address of the instruction to be executed) and the contents of the register selected by the selector 15. 17 is the second selector,
The contents of either the first address part (Addr1) or the second address part (Addr2) of the address part of the MIR 14 are output to the MPAR 12. This select signal is given from the ALU 23.
18 to 20 are registers, and 21 is a program counter that generates an address signal for executing a program. 22 indicates a work register. 23 is an ALU that performs arithmetic processing according to the contents of the MIR 14. 24 is an accumulator, and 25 is a condition code register.

第9図はLOAD命令を実行する処理装置4の
機能的構成であり、第10図はオブジエクト・プ
ログラムに含まれるPROBE命令を実行する処理
装置4の機械的構成である。第9図は、第10図
の構成との対比を明確にする目的で開示されてい
る。
FIG. 9 shows the functional configuration of the processing device 4 that executes the LOAD instruction, and FIG. 10 shows the mechanical configuration of the processing device 4 that executes the PROBE instruction included in the object program. FIG. 9 is disclosed for the purpose of clarifying the contrast with the configuration of FIG. 10.

第9図の動作について説明する。プログラム・
カウンタ21によつて示される命令実行アドレス
は、メモリ・アドレス・レジスタ10にレジスト
される。このアドレスによつて、メインメモリ3
は該当するアドレスの情報(命令語)をインスト
ラクシヨン・レジスタ(IR)9に出力する。こ
の場合、命令語はLOAD命令の場合を考える。
IR9のOPCODE部は、MPAR12にレジストさ
れ、この情報がマイクロプログラムを記憶してい
るMPM13のアドレスとなつて、そのアドレス
に対応したマイクロ命令がMIR14に出力され
る。MIR14に読出されたマイクロ命令のアド
レス部は、セレクタ17を介してMPAR12に
与えられ、次のマイクロ命令の読出しのために利
用される。マイクロ命令のコントロール部は、
ALU23に送られる。一方、IR9にレジストさ
れた命令語のR部のデータは、セレクタ15に与
えられ、レジスタ18〜20のいずれかの内容を
アダー16に与える。アダー16は、このセレク
タを通過したデータとIR9にレジストされた命
令語のA部のデータとを加算し、取り出すべき情
報の記憶されているメインメモリ3内のアドレス
を求める。この加算値(アドレス)は、MADR
10に与えられ、メインメモリ3内の該当アドレ
スのデータがワークレジスタ(WR)22にレジ
ストされる。ALU23は、MIR14にレジスト
されたマイクロ命令のコントロール部の情報によ
つて、WK22にレジストされている情報をアキ
ユムレータ24に格納する。また、データの状態
に従つて、コンデイシヨン・コード・レジスタ2
5にその状態コードが与えられる。これによつつ
て、PSW5の中のコンデイシヨン・コードが設
定される。これらの動作は、いくつかのマイクロ
命令により実行される。
The operation shown in FIG. 9 will be explained. program·
The instruction execution address indicated by counter 21 is registered in memory address register 10. By this address, main memory 3
outputs the information (instruction word) of the corresponding address to the instruction register (IR) 9. In this case, consider the case where the instruction word is the LOAD instruction.
The OPCODE section of the IR9 is registered in the MPAR12, and this information becomes the address of the MPM13 storing the microprogram, and a microinstruction corresponding to that address is output to the MIR14. The address part of the microinstruction read out to the MIR 14 is given to the MPAR 12 via the selector 17, and is used for reading out the next microinstruction. The microinstruction control section is
Sent to ALU23. On the other hand, the data in the R portion of the instruction word registered in IR9 is given to selector 15, and the contents of any one of registers 18 to 20 are given to adder 16. The adder 16 adds the data that has passed through this selector and the data in part A of the instruction word registered in the IR 9 to find the address in the main memory 3 where the information to be retrieved is stored. This added value (address) is MADR
10, and the data at the corresponding address in the main memory 3 is registered in the work register (WR) 22. The ALU 23 stores the information registered in the WK 22 in the accumulator 24 based on the information of the control section of the microinstruction registered in the MIR 14. Also, according to the data state, condition code register 2
5 is given its status code. Accordingly, the condition code in PSW5 is set. These operations are performed by several microinstructions.

第9図では、通常の処理の代表的な例である
LOAD命令の実行について説明した。通常の処
理は、ほぼ第9図の如く実行される。
Figure 9 shows a typical example of normal processing.
Explained the execution of the LOAD command. Normal processing is executed approximately as shown in FIG.

次に、本発明において、新たに設けられた
PROBE命令の実行において、第10図により説
明する。まず、IR9に命令語がレジストされる
点は、第9図の場合と同様である。IR9に読出
された命令語(この場合、PROBE命令)の
OPCODEがMPAR12に読出され、そのデータ
に対応するMPM13のアドレスに記憶されてい
るマイクロ命令がMIR14に読出されることも
第9図の場合と同様である。MIR14に読出さ
れたマイクロ命令により、ALU23は、まずフ
ラグレジスタ5内のPSW(プログラム・ステータ
ス・ワード)の中のPROBE命令実行フラグPを
取出し、Pが“1”か、“0”かを判断する。こ
こでは、フラグがセツトされないとき、すなわち
P=0のとき、PROBE命令実行、フラグのセツ
トされたとき、すなわちP=1のときPROBE命
令不実行とする。取出したフラグPがP=1であ
れば、ALU23は、MIR14に読出されたマイ
クロ命令の第2アドレス部Addr.2を選択する信
号を出力する。第2アドレス部の選択のとき、
PROBE命令の実行は終了する。P=0であれ
ば、ALU23はマイクロ命令の第1アドレス部
を選択する信号をセレクタ17に出力する。
Next, in the present invention, the newly provided
The execution of the PROBE instruction will be explained with reference to FIG. First, the point that the command word is registered in IR9 is the same as in the case of FIG. The instruction word read out to IR9 (in this case, the PROBE instruction)
Similarly to the case of FIG. 9, the OPCODE is read to the MPAR 12, and the microinstruction stored at the address of the MPM 13 corresponding to the data is read to the MIR 14. Based on the microinstruction read to the MIR 14, the ALU 23 first retrieves the PROBE instruction execution flag P from the PSW (program status word) in the flag register 5, and determines whether P is "1" or "0". do. Here, when the flag is not set, ie, P=0, the PROBE instruction is executed, and when the flag is set, ie, P=1, the PROBE instruction is not executed. If the retrieved flag P is P=1, the ALU 23 outputs a signal to select the second address section Addr.2 of the microinstruction read out to the MIR 14. When selecting the second address part,
Execution of the PROBE instruction ends. If P=0, the ALU 23 outputs a signal for selecting the first address portion of the microinstruction to the selector 17.

ここで、プログラム・ステータス・ワード
(PSW)について説明する。PSWは、第11図
Aとして示したように、割込みマスクビツト
(MASK)、プログラム識別番号(PN)、PROBE
命令抑止指示フラグ(P)、5つのコンデイシヨ
ン・コード(C、O、N、Z、およびE)、およ
び制御フラグフイールドによつて構成される。
Here, the program status word (PSW) will be explained. As shown in Figure 11A, the PSW includes interrupt mask bits (MASK), program identification number (PN), and PROBE.
It consists of an instruction inhibition flag (P), five condition codes (C, O, N, Z, and E), and a control flag field.

さて、P=0のとき、第1アドレス部が選択さ
れ、これによつてPROBE命令に基づく実行状態
採取動作が開始される。すなわち、IR9に読出
されたPROBE命令中のブロツク識別番号BNと、
PSW(フラグレジスタ5にセツトされている。)
中のプログラム識別番号PNとがALU23によつ
て併合される。この併合された情報は、プログラ
ム実行パス履歴情報(実行状態情報)PBNとし
て割込制御情報エリア7に設定される。この
PBNは、その具体例が第11図Bに示されてい
る。ALU23は、更に、マイクロ命令により、
プログラム実行状態収集を行うデータ収集プログ
ラム(メインメモリ3内に記憶されている。)に
起動をかけるために、そのプログラムが記憶され
ている先頭アドレスをPC21に設定する。
Now, when P=0, the first address part is selected, thereby starting the execution state collection operation based on the PROBE command. That is, the block identification number BN in the PROBE command read out to IR9,
PSW (set in flag register 5)
The program identification number PN therein is merged by the ALU 23. This merged information is set in the interrupt control information area 7 as program execution path history information (execution state information) PBN. this
A specific example of PBN is shown in FIG. 11B. ALU23 further uses micro instructions to
In order to start a data collection program (stored in the main memory 3) that collects program execution status, the top address where the program is stored is set in the PC 21.

ここまでのマイクロ命令による処理手順は、第
12図にフローチヤートとして示される。
The processing procedure using the microinstructions up to this point is shown as a flowchart in FIG.

プログラム実行状態を収集する収集プログラム
は、順次メインメモリ3より読出され、第13図
にフローチヤートとして示される処理手順が実行
される。つまり、プログラム実行状態データ格納
テーブル8に、PROBE命令の実行によつて割込
制御情報エリア7に格納されたPBNを格納する。
この格納テーブル8の詳細は、第14図に示され
る。第14図において、26は管理部であり、2
7はテーブルである。テーブル27は、26の
HEADポインターと、TAELポインターとによ
つて、フアーストイン・フアーストアウトとなる
ように、つまり実行順に配列されるようにPBN
を格納する。
A collection program for collecting program execution states is sequentially read from the main memory 3, and the processing procedure shown as a flowchart in FIG. 13 is executed. That is, the PBN stored in the interrupt control information area 7 by the execution of the PROBE instruction is stored in the program execution status data storage table 8.
Details of this storage table 8 are shown in FIG. In FIG. 14, 26 is the management department;
7 is a table. Table 27 has 26
The PBN is arranged first-in first-out, that is, in the order of execution, using the HEAD pointer and TAEL pointer.
Store.

このようにして、プログラム実行状態に関する
データが収集できる。
In this way, data regarding the program execution status can be collected.

以上説明した構成により採取(収集)された実
行状態データ(実行パス履歴データ)を解析すれ
は、どのプログラムの、どこのブロツクが実行さ
れたかが判別できる。また、時系列的に採取され
たデータを解析すれば、各ブロツクの実行順序、
実行パスを知ることができる。更に、オンライン
でオブジエクト・プログラムを実行する場合、
PSWのフラグPに1を設定すれば、PROBE命令
をスキツプさせて、実行オーバヘツドをなくすこ
とができる。Pに0を設定すれば、オンラインで
の実行状態を得ることができることは言うまでも
ない。これらのデータは、オブジエクト・プログ
ラムの実行において、何等かの異常の際の原因究
明に役立ち、プログラムの改造を容易にする。
By analyzing the execution status data (execution path history data) collected using the configuration described above, it is possible to determine which block of which program has been executed. In addition, by analyzing data collected chronologically, it is possible to determine the execution order of each block.
You can know the execution path. Furthermore, when running an object program online,
By setting flag P of PSW to 1, the PROBE instruction can be skipped and execution overhead can be eliminated. Needless to say, if P is set to 0, an online execution state can be obtained. These data are useful for investigating the cause of any abnormality in the execution of an object program, and facilitate modification of the program.

(発明の効果) 以上説明した本発明によれば、構造化プログラ
ムの実行パスデータを正確かつ効率的に採取でき
る効果がある。さらに、採取データはソースプロ
グラムのブロツク番号を収集するので、ソースプ
ログラム・レベルでの実行履歴が明らかにでき、
プログラムの評価や事故原因の究明を容易にする
効果がある。
(Effects of the Invention) According to the present invention described above, there is an effect that execution path data of a structured program can be collected accurately and efficiently. Furthermore, since the collected data collects the block number of the source program, the execution history at the source program level can be clarified.
This has the effect of making it easier to evaluate programs and investigate the causes of accidents.

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

第1図A〜Cは、構造化定理に基づきブロツク
化されたプログラムのフローチヤート例を示す図
である。第2図A,B、第3図A,B、第4図
A,Bは本発明を説明するための図であり、Aは
ソース・プログラムをBはそのオブジエクト・プ
ログラム例を示す。第5図A〜Cは命令語フオー
マツトを示す図である。第6図は本発明の最適な
実施例を示す図であり、全体構成を示した図であ
る。第7図はコンパイラの動作フローチヤートで
ある。第8図AはPROBE命令を埋め込むための
処理フローチヤートであり、第8図Bはその過程
で作成される対応表を示す図である。第9図およ
び第10図は処理装置内の機能的構造を示すブロ
ツク図である。第11図Aはプログラム・ステー
タス・ワード(PSW)のフオーマツトを示し、
第11図Bはプログラム実行状態情報(PBW)
のフオーマツトを示す図である。第12図は
PROBE命令に基づくマイクロ命令の動作フロー
図である。第13図はデータ収集プログラムの動
作フロー図である。第14図は格納テーブルを示
す図である。 1……補助メモリ、2……コンパイル装置、3
……主記憶装置(メインメモリ)、4……処理装
置、5……フラグ・レジスタ、6……命令実行ユ
ニツト、7……割込制御情報記憶部、8……デー
タ格納テーブル。
FIGS. 1A to 1C are diagrams showing an example of a flowchart of a program that is divided into blocks based on the structuring theorem. 2A and 2B, 3A and 3B, and 4A and 4B are diagrams for explaining the present invention, where A shows a source program and B shows an example of an object program thereof. FIGS. 5A to 5C are diagrams showing instruction word formats. FIG. 6 is a diagram showing an optimal embodiment of the present invention, and is a diagram showing the overall configuration. FIG. 7 is an operation flowchart of the compiler. FIG. 8A is a processing flowchart for embedding a PROBE command, and FIG. 8B is a diagram showing a correspondence table created in the process. 9 and 10 are block diagrams showing the functional structure within the processing device. Figure 11A shows the format of the program status word (PSW),
Figure 11B is program execution status information (PBW)
FIG. Figure 12 is
FIG. 3 is an operation flow diagram of microinstructions based on the PROBE instruction. FIG. 13 is an operational flow diagram of the data collection program. FIG. 14 is a diagram showing a storage table. 1... Auxiliary memory, 2... Compilation device, 3
. . . Main memory, 4 . . . Processing device, 5 . . . Flag register, 6 . . . Instruction execution unit, 7 .

Claims (1)

【特許請求の範囲】 1 複数のプログラム・ブロツクを連接する構造
化形式で記述された構造化プログラムの実行パス
を示す実行状態データ収集方法において、 ソースプログラムのコンパイル時に、構造化形
式を構成する前記プログラム・ブロツクの入口ま
たは出口を示すソースプログラム上の文の位置を
検出し、対応するオブジエクトプログラム上の位
置に、前記実行状態データを採取する実行状態デ
ータ採取プログラムを起動する命令語を挿入し、 前記オブジエクトプログラムの実行中に、前記
命令語が読み出されると前記オブジエクトプログ
ラムの実行にたいして割込みを発生させると共
に、前記実行状態データ採取プログラムを起動し
て前記実行状態データを収集することを特徴とす
る構造化プログラムの実行状態データ収集方法。 2 特許請求の範囲第1項の記載において、前記
命令語はそのオペランド部に、前記ソースプログ
ラム上で前記プログラム・ブロツクを識別するた
めのプログラム・ブロツク番号を有することを特
徴とする構造化プログラムの実行状態データ収集
方法。 3 特許請求の範囲第2項の記載において、前記
実行状態データは、前記プログラム・ブロツク番
号と前記オブジエクトプログラムのプログラム番
号を有することを特徴とする構造化プログラムの
実行状態データ収集方法。 4 複数のプログラム・ブロツクを連接する構造
化形式で記述された構造化プログラムを実行する
処理装置において、 前記プログラム・ブロツクの入口または出口を
示すソースプログラム上の文の位置に対応し、構
造化形式を構成する前記プログラム・ブロツクの
実行パスを示す実行状態データを採取する実行状
態データ採取プログラムを起動する命令語をもつ
オブジエクトプログラムと、前記命令語のオペラ
ンド部に含まれる前記プログラム・ブロツクを識
別するためのプログラム・ブロツク番号を採取す
る前記実行状態データ採取プログラムとを記憶す
る第1の記憶手段と、 前記第1の記憶手段から読み出して前記オブジ
エクトプログラムを実行し、実行中に前記命令語
が読み出されると、前記オブジエクトプログラム
の実行にたいして割込みを発生させると共に、前
記実行状態データ採取プログラムを起動して前記
実行状態データを採取する中央処理装置と、 採取された前記プログラム・ブロツク番号を時
系列に収集して記憶する第2の記憶手段と、を有
することを特徴とする構造化プログラム処理装
置。
[Scope of Claims] 1. In a method for collecting execution state data indicating the execution path of a structured program written in a structured format in which a plurality of program blocks are connected, when a source program is compiled, the Detects the position of a statement in the source program that indicates the entrance or exit of a program block, and inserts a command word to start an execution state data collection program that collects the execution state data at the corresponding position in the object program. , when the instruction word is read during the execution of the object program, an interrupt is generated for the execution of the object program, and the execution state data collection program is started to collect the execution state data. A method for collecting execution status data for structured programs. 2. The structured program according to claim 1, wherein the instruction word has a program block number in its operand part for identifying the program block on the source program. Execution state data collection method. 3. A structured program execution state data collection method as set forth in claim 2, wherein the execution state data includes the program block number and the program number of the object program. 4. In a processing device that executes a structured program written in a structured format that concatenates a plurality of program blocks, a structured program that corresponds to the position of a statement in the source program that indicates the entry or exit of the program block, identify an object program having an instruction word that starts an execution state data collection program that collects execution state data indicating the execution path of the program blocks constituting the program block, and the program block included in the operand part of the instruction word. a first storage means for storing the execution status data collection program for collecting program block numbers for executing the object program; is read out, a central processing unit generates an interrupt for the execution of the object program, starts the execution state data collection program to collect the execution state data, and times the collected program block number. A structured program processing device comprising: second storage means for collecting and storing data in series.
JP57051099A 1982-03-31 1982-03-31 Method and device for collecting data on execution state of structured program Granted JPS58169262A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP57051099A JPS58169262A (en) 1982-03-31 1982-03-31 Method and device for collecting data on execution state of structured program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP57051099A JPS58169262A (en) 1982-03-31 1982-03-31 Method and device for collecting data on execution state of structured program

Publications (2)

Publication Number Publication Date
JPS58169262A JPS58169262A (en) 1983-10-05
JPH0410098B2 true JPH0410098B2 (en) 1992-02-24

Family

ID=12877359

Family Applications (1)

Application Number Title Priority Date Filing Date
JP57051099A Granted JPS58169262A (en) 1982-03-31 1982-03-31 Method and device for collecting data on execution state of structured program

Country Status (1)

Country Link
JP (1) JPS58169262A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6362048A (en) * 1986-09-02 1988-03-18 Nec Corp System for registering execution history of microprogram
JPS63148342A (en) * 1986-12-12 1988-06-21 Nec Corp System for counting loop execution time

Also Published As

Publication number Publication date
JPS58169262A (en) 1983-10-05

Similar Documents

Publication Publication Date Title
US5142679A (en) Method and apparatus for collecting execution status data of structured program
KR950006619B1 (en) Improved error reporting for translated code execution
US5987250A (en) Transparent instrumentation for computer program behavior analysis
US8266608B2 (en) Post-compile instrumentation of object code for generating execution trace data
EP1012722B1 (en) Accurate profile and timing information for multitasking systems
US9152531B2 (en) Post-compile instrumentation of object code for generating execution trace data
CA2332650C (en) Software analysis system having an apparatus for selectively collecting analysis data from a target system executing software instrumented with tag statements and method for use thereof
US5854924A (en) Static debugging tool and method
US6430741B1 (en) System and method for data coverage analysis of a computer program
US6186677B1 (en) Byte code instrumentation
US5987249A (en) IR code instrumentation
US4742466A (en) System for measuring path coverage represented by the degree of passage of execution paths in a program
US5987248A (en) Debugging information display device
CN113742119A (en) Call stack backtracking method and device of embedded system and computer equipment
US20030177471A1 (en) System and method for graphically developing a program
JPH0410098B2 (en)
EP0526055B1 (en) Monitoring execution of a computer program to provide profile analysis
Chong Automatically Inferring Image Bases of ARM32 Binaries
JP2658065B2 (en) How to evaluate the program
Grätsch et al. Firmware monitoring—History and perspective
US5901300A (en) Control store address stop
JPH05250221A (en) Simulator execution system
JPH06259209A (en) Process executing condition display device
JP2662533B2 (en) Logic analyzer
JP2002091797A (en) Test coverage mark system