JPS5968067A - Specifying system for number of run steps - Google Patents

Specifying system for number of run steps

Info

Publication number
JPS5968067A
JPS5968067A JP57179512A JP17951282A JPS5968067A JP S5968067 A JPS5968067 A JP S5968067A JP 57179512 A JP57179512 A JP 57179512A JP 17951282 A JP17951282 A JP 17951282A JP S5968067 A JPS5968067 A JP S5968067A
Authority
JP
Japan
Prior art keywords
program
address
steps
executed
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP57179512A
Other languages
Japanese (ja)
Inventor
Yutaka Tanaka
裕 田中
Hiroshi Kawamoto
川本 博
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.)
Fujitsu Dai Ichi Communications Software Ltd
Fujitsu Ltd
Original Assignee
Fujitsu Dai Ichi Communications Software Ltd
Fujitsu 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 Fujitsu Dai Ichi Communications Software Ltd, Fujitsu Ltd filed Critical Fujitsu Dai Ichi Communications Software Ltd
Priority to JP57179512A priority Critical patent/JPS5968067A/en
Publication of JPS5968067A publication Critical patent/JPS5968067A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To improve debugging effect by storing a processing program which controls the number of execution steps of an online program being debugged as a counter in specific addresses. CONSTITUTION:The execution of the start origin program S at a start origin control part 2 is started, the number (n) of steps to be debugged at a point after the execution is set in a counter CNT for the number of steps, and the trace specifying flag TRC of a control register SCR is turned on at a point B. Then, a branch instruction to the 1st execution address of a test program T is executed at a point C. Consequently, the instruction counter part iC of a program status word PSW indicates an address N and an instruction in an address N is read to an instruction register iR and executed. At this time, an interruption is caused to test the TRC. Consequently, when the TNC is on, the current contents of the PSW are saved in a specific address L of a main storage device 1. Then, an interruption processing program is executed successively to decrease the (n) in the CNT by one, and the program is executed continuously until the (n) attains to zero.

Description

【発明の詳細な説明】 発明の技術分野 本発明は走行ステップ数指定処理方式に係り。[Detailed description of the invention] Technical field of invention The present invention relates to a running step number designation processing method.

特にプログラムの実行後における走行ステップ数を指定
して、デバッグ中のプログラムを実行し。
In particular, specify the number of steps to run after running the program and run the program being debugged.

その走行ステップ数の実行後にデバッグ情報を収集でき
るようにすることを可能としたものである。
This makes it possible to collect debugging information after the number of running steps has been executed.

従来技術と問題点 新らしく作成したプログラムが正常に動作するかどうか
をチェックするため、そのプログラムを動作させてデバ
ッグ情報を収集し、動作状態がチェックされる。作成さ
れたプログラムは通常モジュールにわかれており、その
モジュール毎にデバッグを行うが、トラブルが発生した
ときそのチェックのためにモジュールの終りでは表<、
そのプログラムの途中まででダイナミックに変化した情
報を読出したいことがある。
Prior Art and Problems In order to check whether a newly created program operates normally, the program is operated, debugging information is collected, and the operating state is checked. The created program is usually divided into modules, and debugging is performed for each module, but in order to check when a problem occurs, a table is displayed at the end of the module.
There are times when it is desired to read out information that has changed dynamically up to the middle of the program.

従来、このようにデバッグ中のプログラムの一部のみを
実行させる方法として、■指定された番地の命令が実行
される直前あるいは直後に実行を停止するフェッチアド
レス・ストップによる方式と、■指定された番地の内容
が変化したとき、すなわち該当番地へ書込みが行われた
ときに実行を停止するストアアドレス・ストップによる
方式とがあった。
Conventionally, the methods of executing only a part of the program being debugged are: ■ fetch address stop method, which stops execution immediately before or after the instruction at the specified address is executed; There is a store address stop method that stops execution when the contents of an address change, that is, when a write is performed to the address.

しかし、前記■は実行開始後に命令が実行されるべき特
定番地を実行開始前に指定して、命令カウンタが該当特
定番地に達したときに実行を停止しようとするものであ
るが、被試験プログラムの実行開始後の走行ルートがデ
ータ設定条件などにより明確でない場合、停止すべき番
地の選定が容易でなく、実行開始後に指定した番地の命
令が実行されないルートを走行する場合が発生し、その
場合に実行途中でのダイナミックに変化するデータの出
力結果を得ることができず、デバッグ効率が悪いという
欠点がある。
However, the above method (■) specifies the specific address at which the instruction is to be executed after the start of execution, and stops execution when the instruction counter reaches the specific address, but the program under test If the running route after the start of execution is not clear due to data setting conditions, etc., it is not easy to select the address at which to stop, and the command at the specified address may be run on a route where the command at the specified address is not executed after the start of execution. This method has the disadvantage that it is not possible to obtain output results from data that changes dynamically during execution, and debugging efficiency is poor.

また前記■は、実行開始後に書込みが行われるべき特定
番地を実行開始前に指定し、該当特定番地に書込みによ
るアクセスがあったときに実行を停止しようとするもの
であり、前記■と同様に。
In addition, the method (■) above specifies a specific address to which writing is to be performed after the start of execution before the start of execution, and attempts to stop execution when there is a write access to the specific address, similar to the above (■). .

書込みが行われるべき番地の選択が容易でないという欠
点がある。
There is a drawback that it is not easy to select the address to which writing is to be performed.

発明の目的 本発明の目的は、これらの欠点を改善するために、中央
処理装置におけるトレース機能を利用して、デバッグ中
のオンラインプログラムの実行ステップ数をカウンタと
して管理する処理プログラムを特定番地に配置しておき
、実行ステップ数を指定してデバッグ中のプログラムを
実行させる仁とを可能にした走行ステップ数指定処理方
式を提供することを目的とする。
Purpose of the Invention The purpose of the present invention is to improve these drawbacks by placing a processing program at a specific address that manages the number of execution steps of the online program being debugged as a counter by utilizing the trace function in the central processing unit. The purpose of the present invention is to provide a processing method for specifying the number of steps to run, which makes it possible to specify the number of steps to execute and execute a program being debugged.

発明の構成 この目的を達成するために1本発明の走行ステップ数指
定処理方式では、1命令実行毎に主記憶装置の特定番地
へ割込むトレース機能と、該トレース機能が有効である
か無効であるかの状態を保持するトレース指定フラグを
アクセスする中央処理装置を有するオンラインソフトウ
ェアのデバッグ処理において、ステップ数をカウントす
るカウンタと2割込み処理プログラムの先頭アドレスを
保持する特定データ保持手段を有し、プログラムの一部
分のみを実行させようとするとき、前記トレース指定フ
ラグを有効状態にし、かつ実行後の走行ステップ数をカ
ウンタとして記憶させ、1命令実行毎に前記主記憶装置
の特定番地へ割込みが発生した際、特定番地の割込み処
理において、前記走行ステップ数のカウンタを1ずつ減
算する処理を繰り返し、カウンタが零になったときで実
行を停止することにより、デバッグ中のプログラムを必
要ステップ数分のみ実行するようにしたことを特徴とす
る。
Structure of the Invention In order to achieve this object, the processing method for specifying the number of running steps of the present invention includes a trace function that interrupts a specific address in the main memory every time one instruction is executed, and a trace function that determines whether the trace function is valid or invalid. In the debugging process of online software having a central processing unit that accesses a trace designation flag that holds a certain state, the present invention has a counter that counts the number of steps and a specific data holding means that holds the start address of the interrupt processing program, When attempting to execute only part of a program, the trace designation flag is enabled, and the number of steps run after execution is stored as a counter, and an interrupt is generated at a specific address in the main memory every time one instruction is executed. When this occurs, in the interrupt processing at a specific address, the process of decrementing the running step count counter one by one is repeated, and execution is stopped when the counter reaches zero, thereby reducing the program being debugged to the required number of steps. The feature is that it is executed.

発明の実施例 本発明の一実施例を第1図にもとづき詳述する。Examples of the invention An embodiment of the present invention will be described in detail based on FIG.

第1図において1は主記憶装置、2は起動元制御部、i
Rは命令レジスタ、SCRは制御レジスタ、pswはグ
ログ2ムーステータス牽ワード。
In FIG. 1, 1 is the main memory, 2 is the activation source control unit, i
R is an instruction register, SCR is a control register, and psw is a log 2 mo status driver word.

SRは特定レジスタ、CNTはステップ数カウンタであ
る。
SR is a specific register, and CNT is a step number counter.

命令レジスタiHには次に実行されるべき命令が格納さ
れている主記憶装置1のアドレスが記入されており、制
御レジスタ8CRは割込の有無を示すデータがセットさ
れるレジスタであって、トレース指定フラグTRCがオ
ンのときその時点のPSWの内容を主記憶装置の特定番
地(この実施例ではアドレスL)に退避させるトレース
1込み制御が指定される。
The instruction register iH stores the address of the main memory 1 where the next instruction to be executed is stored, and the control register 8CR is a register in which data indicating the presence or absence of an interrupt is set. When the designation flag TRC is on, trace 1 inclusion control is designated to save the contents of PSW at that point in time to a specific address (address L in this embodiment) in the main storage device.

プログラム・ステータス・ワードP8WKil:命令カ
ウンタ部iCが設けられ2次に実行されるべき命令が格
納されている番地が記入されている。
Program status word P8WKil: An address where an instruction counter section iC is provided and an instruction to be executed secondarily is stored is written therein.

そしてこの番地を+1するため+1カウンタCが付加さ
れている。
A +1 counter C is added to increment this address by 1.

特定レジスタSRには割込処理プログラム<I>の先頭
アドレスMが記入されている。
The starting address M of the interrupt processing program <I> is written in the specific register SR.

ステップ数カウンタCNTは、デバッグ情報が収集され
るべき位置の試験プログラム<T>のステップ数が記入
されており、nステップ目ノテバツグ情報が必要のとき
nがセットされるととKなる。
The step number counter CNT is filled with the number of steps of the test program <T> at which debugging information is to be collected, and becomes K when n is set when notebug information of the nth step is required.

次に第1図の動作について説明する。Next, the operation shown in FIG. 1 will be explained.

(1)  まず、特定レジスタSRに割込処理プログラ
ム<I>の先頭アドレスMを記入し、PAWの命令カウ
ンタ部iCには起動元制御部における試験プログラム<
T>を起動する起動元プログラム<S>の先頭アドレス
を記入する。
(1) First, write the start address M of the interrupt processing program <I> in the specific register SR, and write the start address M of the interrupt processing program <I> in the instruction counter section iC of the PAW.
Enter the start address of the starting program <S> that starts T>.

(2)  これにより起動元グログ2ム<S>が実行を
開始しA点において実行後にデバッグしたいステップ数
nをステップ数カウンタCNTにセットし。
(2) As a result, the startup source log 2<S> starts execution and sets the number of steps n to be debugged after execution at point A in the step number counter CNT.

B点において制御レジスタSCRのトレース指定フラグ
TRCをオンにする。そして割込みマスクを解除し、0
点において試験プログラム<T>の最初の実行番地への
分岐命令を実行する。この結果PSWの命令カウンタ部
iCはアドレスNを指示し、命令レジスタiHにはN番
地の命令N■が読出され実行される。
At point B, the trace designation flag TRC of the control register SCR is turned on. Then, cancel the interrupt mask and
A branch instruction to the first execution address of the test program <T> is executed at the point. As a result, the instruction counter section iC of the PSW indicates address N, and the instruction N2 at address N is read out to the instruction register iH and executed.

(3)  これによりPSWの命令カウンタ部ICは次
の命令を実行すべく+1され、N+1となる。
(3) As a result, the instruction counter IC of the PSW is incremented by 1 to execute the next instruction, and becomes N+1.

(4)  このとき割込みが発生し、トレース割込みで
あることが認識されると、制御レジスタ8CRのトレー
ス指定フラグTRCの検証を行う。
(4) If an interrupt occurs at this time and is recognized as a trace interrupt, the trace designation flag TRC in the control register 8CR is verified.

(5)  その結果トレース指定フラグTRCがオン(
有効)であるとその時点のPSWの内容(すなわちこの
ときiCはN+1である)が主記憶装置1の特定番地り
に退避される。
(5) As a result, the trace designation flag TRC is turned on (
(valid), the contents of the PSW at that time (i.e., iC is N+1 at this time) are saved to a specific address in the main storage device 1.

(6)  そしてPAWのiCには今度は特定レジスタ
8RK指示されている割込処理プログラム<I>の先頭
アドレスMが格納される。
(6) Then, the start address M of the interrupt processing program <I> specified by the specific register 8RK is stored in the iC of the PAW.

(7)  これにともない命令レジスタiRにはアドレ
スMの命令M■が読出され実行される。このときPSW
の命令カウンタ部iCはカウンタCKより+1されてN
+1となる。これによりアドレスM+1の命令M■が命
令レジスタiRに読出され実行され、pswのICが次
の実行命令の番地を示すという動作が繰返される。そし
てステップ数をカウントするための割込処理プログラム
が順次実行され、走行ステップ数カウンタCNTのnが
−1される。
(7) Accordingly, the instruction M■ at address M is read out from the instruction register iR and executed. At this time, PSW
The instruction counter unit iC is incremented by 1 from the counter CK and becomes N
It becomes +1. As a result, the instruction M2 at address M+1 is read into the instruction register iR and executed, and the operation in which the psw IC indicates the address of the next execution instruction is repeated. Then, the interrupt processing program for counting the number of steps is sequentially executed, and n of the traveling step number counter CNT is decremented by 1.

(8)  このようにしてステップ数カウンタCNTが
−1された結果の(n−1)がチェックされ、これが零
でないことが判明すると、PSWのiCには主記憶装置
1の特定番地りに退避されていた内容すなわちN+1が
復旧される。
(8) In this way, the step number counter CNT is decremented by 1 and (n-1) is checked, and if it is found not to be zero, it is saved in the iC of the PSW to a specific address in the main memory 1. The original content, ie, N+1, is restored.

(9)  これにより命令レジスタiRにはアドレスN
+1の命令N■が読出され、実行される。
(9) As a result, the address N is stored in the instruction register iR.
+1 instruction N■ is read and executed.

Ol  以下、前記アドレスNの命令N■の実行後と同
様の動作が繰返され、アドレスN+2 、 N+s・・
・・・・の命令が、走行ステップ数カウンタCNTが零
になるまで(すなわちnステップ分)実行される。
Ol From then on, the same operation as after execution of the instruction N■ at address N is repeated, and addresses N+2, N+s...
The commands . . . are executed until the running step number counter CNT becomes zero (that is, for n steps).

αυ このようにして走行ステップ数カウンタCNTが
零になると2割込処理プログラム<I>はトレース指定
フラグTRCをオフにし、起動元制御部2の起動元プロ
グラム0点に復帰する。これにより起動元制御部2では
試験プログラム<T>がnステップ実行された時点にお
けるデバッグ情報を収集することができる。
αυ In this way, when the traveling step number counter CNT becomes zero, the 2-interrupt processing program <I> turns off the trace designation flag TRC, and returns to the 0 point of the starting program of the starting source control section 2. This allows the activation source control unit 2 to collect debug information at the time when the test program <T> has been executed n steps.

なお前記トレース指定フラグTRCがオフ(無効)の場
合は、上記の(5)〜(8)゛の動作は行われない。
Note that when the trace designation flag TRC is off (invalid), the above operations (5) to (8) are not performed.

第2図に本発明の他の実施例を示す。FIG. 2 shows another embodiment of the invention.

この第2図の実施例が第1図のものと異なるのは、第1
図の起動元制御部における起動元プログラムにおいて、
走行ステップ数カウンタCNTのステップ数nのセット
と制御レジスタ8CRのトレース指定フラグTRCをオ
ンにする等の制御を行うものではなく、試験プログラム
<T>の内部K(−1,0として示すステップに)あら
かじめ第1の実施例におけるような走行ステップ数カウ
ンタCNTのステップ数を設定したり、トレース指定フ
ラグTRCをオンにする命令を挿入することと、データ
採集部5を設けて、試験プログラムをnステップ実行後
にデータ採集部3を起動制御する点である。勿論このデ
ータ採集部3の代りにデータ採集プログラムを設け、こ
れを起動するようにしてもよい。
The difference between this embodiment in FIG. 2 and that in FIG. 1 is that the embodiment in FIG.
In the startup source program in the startup source control section in the figure,
It does not perform controls such as setting the number of steps n in the running step number counter CNT and turning on the trace designation flag TRC in the control register 8CR, but instead sets the number of steps n in the running step number counter CNT and turns on the trace designation flag TRC in the control register 8CR. ) By setting the step number of the traveling step number counter CNT in advance and inserting an instruction to turn on the trace designation flag TRC as in the first embodiment, and by providing the data collection unit 5, the test program is The point is that the data collection unit 3 is activated and controlled after the step is executed. Of course, a data collection program may be provided in place of the data collection section 3 and started.

この第2図の実施例では、試験プログラムの複数部分を
部分的に実行し各々の途中結果を必要とするときに、試
験プログラムの複数部分に上記の数命令を挿入し、さら
にデータ採集後試験プpグラムの次の実行番地へ復帰す
るという操作により。
In the embodiment shown in FIG. 2, when multiple parts of the test program are partially executed and intermediate results of each part are required, the above-mentioned instructions are inserted into the multiple parts of the test program, and furthermore, after data collection, the test By the operation of returning to the next execution address of the program.

1回の試験で複数結果を出力することができ、デバッグ
効果を高めることが可能となる。
Multiple results can be output in one test, making it possible to increase debugging effectiveness.

発明の効果 本発明によれば、デバッグ中のオンラインプ四グラムを
一実行ステップ数を指定して実行することができるので
、走行ルートが予想できないプログラム等に関して2部
分的な実行を行ない、データを採取することが可能であ
り、デバッグ効果を高めることができる。
Effects of the Invention According to the present invention, it is possible to execute an online program during debugging by specifying the number of execution steps, so that a program whose running route cannot be predicted can be partially executed and the data can be saved. The debugging effect can be improved.

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

第1図は本発明の一実施例構成図、第2図は本発明の他
の実施例構成図である。 図中、1は主記憶装置、2は起動元制御部、6はデータ
採集部である。 特許出願人 富士通株式会社(外1名)代理人弁理士 
山 谷 晧 榮
FIG. 1 is a block diagram of one embodiment of the present invention, and FIG. 2 is a block diagram of another embodiment of the present invention. In the figure, 1 is a main storage device, 2 is an activation source control unit, and 6 is a data collection unit. Patent applicant Fujitsu Limited (1 other person) Representative patent attorney
Akira Yamatani

Claims (1)

【特許請求の範囲】[Claims] 1命令実行毎に主記憶装置の特定番地へ割込むトレース
機能と、該トレース機能が有効であるか無効であるかの
状態を保持するトレース指定フラグをアクセスする中央
処理装置を有するオンラインソフトウェアのデバッグ処
理において、ステップ数をカウントするカウンタと2割
込み処理プログラムの先頭アドレスを保持する特定デー
タ保持手段を有し、プログラムの一部分のみを実行させ
ようとするとき、前記トレース指定フラグを有効状態に
し、かつ実行後の走行ステップ数をカウンタとして記憶
させ、1命令実行毎に前記主記憶装置の特定番地へ割込
みが発生した際、特定番地の割込み処理において、前記
走行ステップ数のカウンタを1ずつ減算する処理を繰り
返し、カウンタが零になったときで実行を停止すること
によシ、プログ2ムを必要ステップ数分のみ実行するよ
うにしたことを特徴とする走行ステップ数指定処理方式
Debugging online software that has a trace function that interrupts a specific address in the main memory every time an instruction is executed, and a central processing unit that accesses a trace designation flag that maintains whether the trace function is enabled or disabled. In the process, the trace designation flag is set to a valid state, and the trace designation flag is set to a valid state when the program includes a counter for counting the number of steps and a specific data holding means for holding the start address of the two-interrupt processing program. Processing in which the number of running steps after execution is stored as a counter, and when an interrupt occurs at a specific address in the main storage device each time one instruction is executed, the counter for the number of running steps is subtracted by 1 in interrupt processing at the specific address. The method of specifying the number of running steps is characterized in that the program 2 is executed only for the required number of steps by repeating the steps 2 and 2 and stopping the execution when the counter reaches zero.
JP57179512A 1982-10-13 1982-10-13 Specifying system for number of run steps Pending JPS5968067A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP57179512A JPS5968067A (en) 1982-10-13 1982-10-13 Specifying system for number of run steps

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP57179512A JPS5968067A (en) 1982-10-13 1982-10-13 Specifying system for number of run steps

Publications (1)

Publication Number Publication Date
JPS5968067A true JPS5968067A (en) 1984-04-17

Family

ID=16067088

Family Applications (1)

Application Number Title Priority Date Filing Date
JP57179512A Pending JPS5968067A (en) 1982-10-13 1982-10-13 Specifying system for number of run steps

Country Status (1)

Country Link
JP (1) JPS5968067A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400172A (en) * 2020-03-03 2020-07-10 北京声智科技有限公司 Program debugging method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400172A (en) * 2020-03-03 2020-07-10 北京声智科技有限公司 Program debugging method and device

Similar Documents

Publication Publication Date Title
US4095268A (en) System for stopping and restarting the operation of a data processor
JPH03204737A (en) Debug circuit of signal processing processor
JPH10214203A (en) Information processor
JPS5968067A (en) Specifying system for number of run steps
JPH0789328B2 (en) Data processing device
JPH0581070A (en) Programmable controller and user program execution method in programmable controller
JPS6148743B2 (en)
JPH0581087A (en) Processor monitoring system
JPS60124746A (en) Data processing unit
JP2002278774A (en) Method and device for generating instruction word in controlling function unit in processor
JPH04167146A (en) Address tracing system for information processor
JPS61160154A (en) Supporting device of program development
JPS62125437A (en) Control method for additional processor
JPH0447350A (en) Main storage read/response control
JPH08320813A (en) Program simulator device and program debugging method
JPH04328644A (en) Debug back-up device
JPS6142301B2 (en)
JPH10240569A (en) Tracing device for computer
KR100280404B1 (en) How to Support Multiple Interrupt Service Routines in DSP
JPS59153247A (en) Debugging device
JPH0795288B2 (en) Microcomputer
JPH05204710A (en) Event tracer
JPH07281924A (en) Trace device and emulator using the trace device
JPS59202550A (en) Debugging device
JPH02300943A (en) Debug support system