JPS6277657A - Collection system for execution history information of user program - Google Patents

Collection system for execution history information of user program

Info

Publication number
JPS6277657A
JPS6277657A JP60218928A JP21892885A JPS6277657A JP S6277657 A JPS6277657 A JP S6277657A JP 60218928 A JP60218928 A JP 60218928A JP 21892885 A JP21892885 A JP 21892885A JP S6277657 A JPS6277657 A JP S6277657A
Authority
JP
Japan
Prior art keywords
history information
instruction
user program
execution history
interrupt
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
JP60218928A
Other languages
Japanese (ja)
Inventor
Yoichi Sato
洋一 佐藤
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 JP60218928A priority Critical patent/JPS6277657A/en
Publication of JPS6277657A publication Critical patent/JPS6277657A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To generate a flexible interruption program by including an interruption flag in an instruction. CONSTITUTION:A loading module for a user program stored in an auxiliary memory device 7 is loaded in a main memory device 8, the interruption flag 33 included in the instruction is set selectively in the generation of this loading module according to an execution history information collection instruction. Then if the interruption flag 33 in the instruction and an interruption permit register 6 are both set when the user program is executed, an interruption is initiated to save the contents of a specific register in the specific area of the main memory device 8. The saved contents of this register are collected and stored as execution history information and then the control is returned to a user program.

Description

【発明の詳細な説明】 発明の目的 産業上の利用分野 本発明は、電子計算機システムで実行される利用者プロ
グラムのデバッグなどに使用される実行履歴情報収集方
式に関し、特に実行履歴情報を命令単位の詳細さで収集
できる実行履歴情報収集方式に関する。
DETAILED DESCRIPTION OF THE INVENTION Object of the Invention Industrial Application Field The present invention relates to an execution history information collection method used for debugging a user program executed in a computer system, and in particular, to a system for collecting execution history information on an instruction-by-instruction basis. This paper relates to a method for collecting execution history information that can be collected with great detail.

従来の技術 電子計算機システムで実行される利用者プログラムでは
、デバッグなどの目的からその実行履歴情報を収集する
ことが必要になる。
BACKGROUND OF THE INVENTION For user programs executed on conventional electronic computer systems, it is necessary to collect execution history information for purposes such as debugging.

従来、このような実行履歴情報を収集する方式として、
原始プログラム中の要所要所に実行履歴情報収集用の命
令が挿入されるように原始プログラムを変更する方式が
知られている。
Conventionally, the method for collecting such execution history information is
A method is known in which a source program is modified so that instructions for collecting execution history information are inserted at key points in the source program.

他の方式として、プログラムの実行時に制御が渡ると予
想される領域中の命令を履歴情報収集用の命令に書換え
て履歴情報を収集したのち元の命令に戻す方式が知られ
ている。
Another known method is to rewrite an instruction in an area where control is expected to be passed during program execution to an instruction for collecting history information, collect the history information, and then return to the original instruction.

更に他の方式として、利用者プログラムの命令を取り込
んでこれをシュミレートするようなモ二タブログラムを
リンク処理時に一緒にリンクする方式も知られている。
Furthermore, as another method, a method is known in which a monitor program that captures and simulates instructions of a user program is linked together during link processing.

発明が解決しようとする問題点 上記従来方式のうち原始プログラムを変更する方式では
、デバッグ終了後は原始プログラムから履歴情報収集用
の命令を取り除くために再コンパイル処理を行う必要が
あり、手間がかかるという問題がある。
Problems to be Solved by the Invention Among the conventional methods mentioned above, in the method of changing the source program, it is necessary to perform recompilation processing to remove the instructions for collecting history information from the source program after debugging, which is time-consuming. There is a problem.

また、本来の命令を履歴情報収集用の命令に書替える方
式では、制御が渡ると予測した領域にプログラム実行中
の制御の乱れによって制御が渡らなくなると、肝心な履
歴情報が収集できなくなるという問題がある。
In addition, with the method of rewriting the original instructions to instructions for collecting history information, there is a problem that if control is not transferred to an area where control is predicted to be transferred due to a control disorder during program execution, important history information cannot be collected. There is.

さらに、シュミレート用のモニタプログラムをリンクす
る方式では、デバッグ終了後にこれをリンク対象から除
外するために再リンク処理が必要になり、手間がかかる
という問題がある。
Furthermore, in the method of linking a monitor program for simulation, re-linking processing is required to exclude it from linking targets after debugging is completed, which is a problem in that it is time-consuming.

発明の構成 問題点を解決するための手段 上記従来技術の問題点を解決する本発明の実行履歴情報
収集方式は、利用者プログラムのロードモジュールを主
記憶装置にロードする際又はこのロードモジュールの作
成の際に命令中に含ませた割込みフラグを実行履歴情報
収集指示に従い選択的にセントさせ、利用者プログラム
の実行に際し命令中の割込みフラグと割込み許可レジス
タが共にセットされている場合には割込みを発生させて
主記憶装置の所定領域に所定のレジスタの内容を退避さ
せ、退避されたレジスタの内容を実行履歴情報として収
集、保存したのちに利用者プログラムへ制御を戻すよう
に構成されている。
Configuration of the Invention Means for Solving the Problems The execution history information collection method of the present invention which solves the problems of the prior art described above has an execution history information collection method that solves the above-mentioned problems of the prior art. At this time, the interrupt flag included in the instruction is selectively sent according to the execution history information collection instruction, and when the user program is executed, if the interrupt flag in the instruction and the interrupt enable register are both set, the interrupt is disabled. The content of the saved register is collected and saved as execution history information, and then control is returned to the user program.

以下、本発明の作用を実施例と共に詳細に説明する。Hereinafter, the operation of the present invention will be explained in detail together with examples.

実施例 第1図を参照すると、本発明の一実施例に係わる実行履
歴情報収集方式は、利用者プログラムのロードモジュー
ルのロード段階1と、利用者プログラムの実行段階2と
、実行履歴情報収集のための割込み段階3.収集/印字
段階4及び復帰段階5と、割込み許可レジスタ6と、利
用者プログラムのロードモジュールが格納される補助記
憶装置7と、利用者プログラムのロードモジュールがロ
ードきれる主記憶袋W8と、印字出力装置9とから構成
されている。           −まず利用者は、
収集/印字段階4で実行させる実行履歴情報収集/印字
プログラムのロードモジュールを、補助記憶装置7に格
納する。
Embodiment Referring to FIG. 1, an execution history information collection method according to an embodiment of the present invention includes a loading stage 1 of a load module of a user program, an execution stage 2 of a user program, and an execution history information collection method. Interrupt stage 3. A collection/printing stage 4 and a return stage 5, an interrupt permission register 6, an auxiliary storage device 7 in which a user program load module is stored, a main memory bag W8 into which the user program load module can be fully loaded, and a printout. It is composed of a device 9. -First of all, the user
A load module for the execution history information collection/printing program to be executed in the collection/printing stage 4 is stored in the auxiliary storage device 7.

次に利用者は、ロードモジュール7内の利用者プログラ
ムを主記憶装置8にロードさせるため、第2図のフロー
チャートに例示するロード段階1をローダに実行させる
Next, the user causes the loader to execute load step 1 illustrated in the flowchart of FIG. 2 in order to load the user program in the load module 7 into the main storage device 8.

ロード段階1が開始されると、まず、最初のステップ1
1において、実行履歴情報の収集の指定の有無が判定さ
れる。デバッグのためのテストラン時などにおいて実行
履歴情報の収集が指定されていれば、次のステップ12
において、補助記憶装置7に格納されている実行履歴情
報収集/印字プログラムのロードモジュールが主記憶装
置8の所定領域にロードされる。一方、デバッグの完了
後などにおいて実行履歴情報の収集が指定されていなけ
れば、上記ステップ12はスキップされる。
When load phase 1 is started, first step 1
1, it is determined whether collection of execution history information is specified. If collection of execution history information is specified during a test run for debugging, etc., proceed to step 12.
At this point, the execution history information collection/printing program load module stored in the auxiliary storage device 7 is loaded into a predetermined area of the main storage device 8 . On the other hand, if collection of execution history information is not specified after debugging is completed, step 12 is skipped.

次のステップ13において、補助記憶装置7に格納され
ている利用者プログラムのロードモジュールが、主記憶
袋W8にロードされる。ステップ14において、実行履
歴情報の収集の指定の有無が再度判定され、これが指定
されていれば、ステップ15において主記憶装置7内の
利用者プログラムのロードモジュールの最初の命令が読
出される。
In the next step 13, the user program load module stored in the auxiliary storage device 7 is loaded into the main storage bag W8. In step 14, it is determined again whether collection of execution history information has been specified, and if this has been specified, then in step 15, the first instruction of the load module of the user program in the main storage device 7 is read out.

ロードモジュール中の命令は、1オペランドの命令につ
いて第3図に例示するように、オペランドのアドレス部
31、命令コード32、割込みフラグ33、インデック
スレジスタ指定部34及びペースレジスタ指定部35か
ら構成されている。
The instructions in the load module are composed of an operand address section 31, an instruction code 32, an interrupt flag 33, an index register specification section 34, and a pace register specification section 35, as illustrated in FIG. 3 for a one-operand instruction. There is.

次のステップ16において、主記憶装置8から読出され
た最初の命令中の割込みフラグ33がオンにセットされ
る。ステップ17において、利用者プログラム中の最終
命令について、その読出しと割込みフラグのセントが終
了したか否かが判定される。終了していない場合には、
ステップ15と16に戻り、次の命令の読出しとその命
令についての割込みフラグのセントが繰り返される。ス
テップ17で利用者プログラム中の最終命令についての
v1込みフラグのセントの終了が判定されるとロード段
階1の処理が終了する。
In the next step 16, the interrupt flag 33 in the first instruction read from the main memory 8 is set on. In step 17, it is determined whether or not the last instruction in the user program has been read and the interrupt flag has been set. If it is not finished,
Returning to steps 15 and 16, the reading of the next instruction and the setting of the interrupt flag for that instruction are repeated. When it is determined in step 17 that the v1 inclusion flag for the last instruction in the user program has ended, the processing of load stage 1 ends.

次に、制御は主記憶装置8内にロードされている利用プ
ログラムの実行手段2へと移行し、利用プログラム中の
命令が主記憶装置8から順次読出されて実行される。各
命令の実行に先立って、その命令中の割込みフラグ33
と、割込み許可レジスタ6のオン/オフが検査される。
Next, control is transferred to the usage program execution means 2 loaded into the main storage device 8, and the instructions in the usage program are sequentially read from the main storage device 8 and executed. Prior to execution of each instruction, the interrupt flag 33 in that instruction
Then, ON/OFF of the interrupt permission register 6 is checked.

この割込み許可レジスタ6は、実行履歴情報の収集処理
に専用のものとして設置されており、利用者プログラム
の実行開始に先立ってオンに初期設定されている。
This interrupt permission register 6 is installed exclusively for the processing of collecting execution history information, and is initially set to ON prior to the start of execution of the user program.

デバッグ終了後の実行時などにおいて、命令中の割込み
フラグ33又は割込み許可レジスタ6のいずれかがオフ
であれば、割込み段階3を経ることなく、次の命令が実
行される。これに対して、デバッグ中などにおいて、命
令中の割込みフラグ33と割込み許可レジスタ6が共に
オンであれば、第4図のフローチャートに示すような割
込み段階3、収集/印字段階4及び復帰段階5が順を追
って実行される。
During execution after debugging, if either the interrupt flag 33 or the interrupt enable register 6 in the instruction is off, the next instruction is executed without going through the interrupt stage 3. On the other hand, if the interrupt flag 33 and the interrupt enable register 6 in the instruction are both on during debugging, etc., the interrupt stage 3, the collection/print stage 4, and the return stage 5 as shown in the flowchart of FIG. are executed in sequence.

最初の割込み段階3が開始されると、ステップ21にお
いて命令中の割込みフラグ33と割込み許可レジスタ6
がリセットされたのち、次のステップ22において、中
央処理装置内のプログラム・カウンタを含む所定のレジ
スタの内容が、主記憶装置8の所定の領域に退避される
When the first interrupt stage 3 is started, in step 21 the interrupt flag 33 in the instruction and the interrupt enable register 6 are
After being reset, in the next step 22, the contents of a predetermined register including a program counter in the central processing unit are saved to a predetermined area of the main storage device 8.

この後、主記憶装置8内の実行履歴情報収集/印字プロ
グラム従って実行される収集/印字段階4に制御が渡さ
れる。すなわち、ステップ23において、退避されでい
る所定のレジスタの内容が主記憶装置8から読出され、
利用者が指定した形式に編集されたのち実行履歴情報と
して印字出力装置9に出力される。
After this, control is passed to the collection/printing stage 4, which is executed according to the execution history information collection/printing program in the main memory 8. That is, in step 23, the contents of the predetermined register that have been saved are read out from the main storage device 8,
After being edited into a format specified by the user, it is output to the printout device 9 as execution history information.

続いて制御は復帰段階5に移行し、ステップ24におい
て、主記憶装置8に退避されていたレジスタの内容が中
央処理装置内の対応のレジスタに復帰させられる。続い
て、ステップ25で割込み許可レジスタ6がセットされ
たのち、最後のステップ26において、利用者プログラ
ム中の割込みを発生させた命令に制御が渡され、実行さ
れる。
Control then passes to a restore step 5, where in step 24 the contents of the registers saved in the main memory 8 are restored to the corresponding registers in the central processing unit. Subsequently, in step 25, the interrupt permission register 6 is set, and then in the final step 26, control is passed to the instruction that generated the interrupt in the user program and executed.

以上、利用者プログラム中の全命令に割込みフラグをセ
ットする構成を例示したが、これを分岐関係の命令など
特定の命令群に限定すること、により実行履歴情報の収
集範囲を適宜な大きさに絞ることもできる。
Above, we have illustrated a configuration in which interrupt flags are set for all instructions in a user program, but by limiting this to a specific group of instructions such as branch-related instructions, the collection range of execution history information can be made to an appropriate size. You can also narrow it down.

また、実行履歴情報を印字装置に編集・出力する代りに
、そ′のまま一旦主記憶装置に保存しておき、これを利
用者プログラムの実行の終了後に編集・出力する構成と
してもよい。
Further, instead of editing and outputting the execution history information to the printing device, it may be configured to temporarily store it as is in the main storage device and edit and output it after the execution of the user program is completed.

また、命令中の割込みフラグのセントをローダではなく
、アセンブラやコンパイラに行わせてもよい。
Alternatively, the assembler or compiler may be used instead of the loader to set the interrupt flag in the instruction.

発明の効果 以上詳細に説明したように、本発明の方式は、機械語命
令単位で実行履歴情報の収集を指定することができるた
め、利用者プログラムの実行中に制御が乱れて異常終了
したときでも、実行履歴情報の保存結果とリンクマツプ
情報およびオブジェクトモジュール・リストに基づき制
御が乱れた点を容易に探索できる。
Effects of the Invention As explained in detail above, the method of the present invention allows the collection of execution history information to be specified for each machine language instruction. However, it is possible to easily find the point where control has been disrupted based on the saved results of execution history information, link map information, and object module list.

また、デバッグ終了後においては、ロード段階において
実行履歴情報の収集を指定しないことにより、原始プロ
グラムの再コンパイル、再リンクの処理を行うことなく
デバッグ済みの利用者プログラムをそのまま実行するこ
とができる。
Furthermore, after debugging is completed, by not specifying collection of execution history information at the loading stage, the debugged user program can be executed as is without recompiling or relinking the source program.

なお、命令語中の割込みフラグのセットをローダではな
く、アセンブラやコンパイラに行わせた場合には、割込
み許可レジスタをオフに初期設定するだけで、デバッグ
済みの利用者プログラムをコンパイルし直すことなくそ
のまま利用することができる。
Note that if you have the assembler or compiler set the interrupt flag in the instruction word instead of the loader, you can simply initialize the interrupt enable register to OFF without having to recompile the debugged user program. It can be used as is.

特に、命令中に割込みフラグを含ませたことにより利用
者がこのフラグのセット/リセットを容易に操作でき、
また、割込み後の処理もソフトウェア的に指定できるの
で、融通性のある。割込みプログラムを作成できるとい
う利点もある。
In particular, by including an interrupt flag in the instruction, the user can easily set/reset this flag.
Furthermore, processing after an interrupt can be specified by software, providing flexibility. Another advantage is that interrupt programs can be created.

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

第1図は本発明の一実施例に係わる実行履歴情報収集方
式の全体構成図、第2図は第1図中のロード段階1の手
順を示すフローチャート、第3図は上記実施例における
命令形式を1オペランド命令の場合について例示する概
念図、第4図は第1図中の割込み段階3.収集/印字段
階4及び復帰段階の手順を示すフローチャートである。 1・・利用者プログラムのロード段階、2・・利用者プ
ログラムの実行手段、3・・割込み段階、4・・実行履
歴情報の収集/印字段階、5・・利用者プログラムへの
復帰段階、6・・割込み許可レジスタ、7・・補助記憶
装置、8・・主記憶装置、9・・印字出力装置。
FIG. 1 is an overall configuration diagram of an execution history information collection method according to an embodiment of the present invention, FIG. 2 is a flowchart showing the procedure of load stage 1 in FIG. 1, and FIG. 3 is an instruction format in the above embodiment. FIG. 4 is a conceptual diagram illustrating the case of a one-operand instruction. 3 is a flowchart showing the procedure of collection/printing stage 4 and return stage. 1. User program loading stage, 2. User program execution means, 3. Interruption stage, 4. Execution history information collection/printing stage, 5. Returning to user program stage, 6 ...Interrupt permission register, 7.. Auxiliary storage device, 8.. Main storage device, 9.. Print output device.

Claims (1)

【特許請求の範囲】 利用者プログラムのロードモジュールを主記憶装置にロ
ードする際又はこのロードモジュールの作成の際に、命
令中に含ませた割込みフラグを実行履歴情報収集指示に
従い選択的にセットさせ、主記憶装置上にロードされた
利用者プログラムの実行に際し前記命令中の割込みフラ
グと割込み許可レジスタが共にセットされている場合に
は割込みを発生させて主記憶装置上の所定の領域に所定
のレジスタの内容を退避させ、 この割込みによって退避されたレジスタの内容を実行履
歴情報として収集、保存したのちに利用者プログラムへ
制御を戻すことを特徴とする利用者プログラムの実行履
歴情報収集方式。
[Claims] When loading a load module of a user program into the main storage device or when creating this load module, an interrupt flag included in an instruction is selectively set according to an execution history information collection instruction. When the user program loaded onto the main memory is executed, if both the interrupt flag and the interrupt enable register in the instruction are set, an interrupt is generated and a predetermined data is stored in a predetermined area on the main memory. A method for collecting execution history information of a user program, characterized in that the contents of the register are saved, the contents of the register saved by this interrupt are collected and saved as execution history information, and then control is returned to the user program.
JP60218928A 1985-09-30 1985-09-30 Collection system for execution history information of user program Pending JPS6277657A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60218928A JPS6277657A (en) 1985-09-30 1985-09-30 Collection system for execution history information of user program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60218928A JPS6277657A (en) 1985-09-30 1985-09-30 Collection system for execution history information of user program

Publications (1)

Publication Number Publication Date
JPS6277657A true JPS6277657A (en) 1987-04-09

Family

ID=16727513

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60218928A Pending JPS6277657A (en) 1985-09-30 1985-09-30 Collection system for execution history information of user program

Country Status (1)

Country Link
JP (1) JPS6277657A (en)

Similar Documents

Publication Publication Date Title
JPH09179752A (en) Debugging method and device for rom cartridge
EP0111952B1 (en) Verification of a processor architecture having a partial instruction set
US6643800B1 (en) Method and apparatus for testing microarchitectural features by using tests written in microcode
JP2919302B2 (en) CPU simulation method
KR0125605B1 (en) Method and device for verifying operation of machine language program
JPH08314760A (en) Program development supporting device
JPS6277657A (en) Collection system for execution history information of user program
JP3461185B2 (en) Method and apparatus for registering source code line number to load module
JPH09288595A (en) Arithmetic processing unit
JP4149047B2 (en) Simulator
JP3077627B2 (en) Debugging method and recording medium for recording debug program
JP2663895B2 (en) CPU simulator
JP2570119B2 (en) Software simulator
JP3179353B2 (en) Program test automation system
JPH08320813A (en) Program simulator device and program debugging method
JPH10222361A (en) Rom program monitor device in processor of computer or the like
JPS6261130A (en) Automatic graphic display system for test coverage
JP2590159B2 (en) Environment setting method for integration test
JPS6214240A (en) Program inspecting system
JPH11175352A (en) Extension instruction set emulator
JPH01155448A (en) System for preventing multiple output of diagnostic information with same cause
JPS63131238A (en) Logic simulator
JPH03225533A (en) Copy-on-write reverse execution check system
JPH04324525A (en) Program transplantation supporting device
JPS62235652A (en) Debugging method for program