JPH07120301B2 - Task debugging method - Google Patents
Task debugging methodInfo
- Publication number
- JPH07120301B2 JPH07120301B2 JP63043743A JP4374388A JPH07120301B2 JP H07120301 B2 JPH07120301 B2 JP H07120301B2 JP 63043743 A JP63043743 A JP 63043743A JP 4374388 A JP4374388 A JP 4374388A JP H07120301 B2 JPH07120301 B2 JP H07120301B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- state
- tasks
- debugger
- wait
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は多重プログラミング用オペレーティングシステ
ムに関し、特にタスクのデバッグ方法に関する。The present invention relates to an operating system for multiple programming, and more particularly to a task debugging method.
情報処理装置においてその情報の処理は通常、プログラ
ムによって行われる。プログラムは情報を逐次に処理す
る。しかし、一般にプログラムは全ての処理が互に関係
しあい、逐次に処理される必要があるわけではない。プ
ログラムを各処理ごとのモジュールに分割し、それぞれ
を並行動作させて処理を行えば、処理速度は向上する。
このような考え方を『並行プログラミング』といい、各
処理に対応するプログラム・モジュールを『タスク』と
いう。これらのタスクは、オペレーティングシステム
(以下OSと略す)によって管理される。OSは、タスクの
状態等を考慮してタスクを選択しCPUを割当ててゆく。
タスクはそれぞれ並行して動作し、互に同期をとりデー
タを通信しながら処理を行って行く。Processing of the information in the information processing apparatus is usually performed by a program. The program processes the information serially. However, in general, programs do not need to be sequentially processed because all processes are related to each other. The processing speed can be improved by dividing the program into modules for each processing and operating them in parallel.
Such an idea is called "concurrent programming", and the program module corresponding to each process is called "task". These tasks are managed by an operating system (hereinafter abbreviated as OS). The OS selects the task in consideration of the task status and allocates the CPU.
Tasks operate in parallel and perform processing while synchronizing with each other and communicating data.
今、次のようなOSを考える。Now consider the following OS.
OSのもとで動作するタスクは、第6図に示した状態遷移
を行うものとする。各状態は、次のような意味を持って
いる。It is assumed that the task operating under the OS performs the state transition shown in FIG. Each state has the following meanings.
run…OSによってSPUが割当てられている状態。run ... SPU is assigned by the OS.
ready…全ての条件がそろい、処理の実行が可能な状
態。ready ... A condition in which all conditions are met and processing can be executed.
wait…条件が成立するのを持っている状態。wait ... A condition in which the condition is met.
OSは、タスクをタスク・コントロール・ブロック(task
Control Block以下TCBと略す)によって管理する。TCB
には、OSがタスクを管理する上で必要な、優先順位、タ
スクの状態等の情報が格納されている。あるタスクが他
のタスクに対する操作をOSに要求する(システムコール
の発行)場合は、タスクを指定する値としてTCBアドレ
スを指定する。優先順位とは、OSがタスクを選択す基準
として各タスクに与えられているものである。OSは、
『ready』状態のタスクの中から一つを選択し、CPUを割
当てる。OSは『ready』状態のタスクのうち最も優先順
位の高いタスクにCPUを割当てる。The OS uses the task control block (task
Control Block (hereinafter abbreviated as TCB)). TCB
The OS stores information such as priority order and task status necessary for the OS to manage tasks. When a task requests the OS to operate on another task (issue a system call), specify the TCB address as the value that specifies the task. The priority order is given to each task as a standard for the OS to select the task. OS is
Select one of the tasks in "ready" state and allocate the CPU. The OS allocates the CPU to the task with the highest priority among the tasks in the “ready” state.
次に、このようなOSの管理化にあるタスクの動作を、第
7図を参照しながら説明する。簡単のために、タスクの
数は2つとしそれぞれ『タスクA』、『タスクB』と呼
ぶ。タスクの優先順位は、 タスクA>タスクB の関係にある。これらのタスクの処理は、セマフォによ
り互いに排除しあいながらI/Oの入出力を行うものとす
る。セマフォとは、オランダのDijkstraによって考案さ
れたタスク間の同期をとるための機構である。主にOSが
持つ資源のアクセスに関するタスク間の排他制御に用い
られる。本OSにおいては、OSの資源であるI/Oをアクセ
スする際の排他制御に用いている。Next, the operation of the task for managing the OS will be described with reference to FIG. For the sake of simplicity, the number of tasks is two and they are called “task A” and “task B”, respectively. The priority of tasks is such that task A> task B. The processing of these tasks is performed by inputting / outputting I / O while mutually excluding each other by a semaphore. A semaphore is a mechanism for synchronizing tasks devised by Dijkstra in the Netherlands. Mainly used for exclusive control between tasks related to resource access of OS. In this OS, it is used for exclusive control when accessing I / O which is a resource of the OS.
セマフォは、タスクからは直接操作することはできな
い。タスクがセマフォを操作するには、システムコール
の形でOSに要求を出す。Semaphores cannot be operated directly from tasks. To operate a semaphore, a task makes a request to the OS in the form of a system call.
まず、セマフォを要求するシステムコールは『wai-se
m』である。このシステムコールにより、タスクはセマ
フォを獲得することができる。もし、セマフォが他のタ
スクに獲得されている場合は、このシステムコールを発
行したタスクは、第6図の状態遷移図に従い、『run』
状態から『wait』状態へ遷移する。First, the system call that requests a semaphore is "wai-se
m ’. This system call allows the task to acquire the semaphore. If the semaphore is acquired by another task, the task that issued this system call "run" according to the state transition diagram in Fig. 6.
Transition from state to "wait" state.
セマフォを返すシステムコールは『sig-sem』である。
このシステムコールによりタスクは、獲得しているセマ
フォをOSに返す。この時、セマフォを獲得できずに『wa
it』状態になっているタスクがあれば、この時点でセマ
フォを獲得でき、『ready』状態へと遷移する。The system call that returns a semaphore is "sig-sem".
This system call causes the task to return the acquired semaphore to the OS. At this time, swa
If there is a task in the "it" state, the semaphore can be acquired at this point, and the task transits to the "ready" state.
はじめに、2つのタスクA,Bは『ready』状態にある。優
先順位はタスクAの方が高いため、OSはタスクAにCPU
を割当てる(第7図の)。タスクAは、I/O入出力の
ため『wai-sem』システムコールによってセマフォを獲
得する。セマフォを獲得したタスクAは、I/Oとの同期
をとるために『wai-tsk』システムコールによって一定
時間『wait』状態に入る(第7図の)。タスクAが
『wait』状態に入ったことにより、OSはタスクBにCPU
を割当てる。タスクBは、タスクAと同様にI/Oの入出
力を行うために『wai-sem』システムコールを発行す
る。しかし、セマフォは、すでにタスクAが獲得してい
るために、タスクBは『wait』状態に遷移する(第7図
の)。2つのタスクA,Bが共に『wait』状態に入った
ことにより、CPUはタスクが割当てられていない状態に
入る(第7図の)。First, two tasks A and B are in "ready" state. Since task A has a higher priority, OS assigns CPU to task A
Is assigned (in FIG. 7). Task A acquires a semaphore by the "wai-sem" system call for I / O input / output. Task A, which has acquired the semaphore, enters the "wait" state for a certain period of time by the "wai-tsk" system call in order to synchronize with I / O (Fig. 7). When task A enters the "wait" state, the OS sends CPU to task B
Assign The task B issues the "wai-sem" system call to input / output the I / O similarly to the task A. However, since the semaphore has already been acquired by task A, task B transitions to the "wait" state (Fig. 7). Since both tasks A and B have entered the "wait" state, the CPU enters the state where no tasks have been assigned (Fig. 7).
指定時間が経過するとタスクAは、『wait』状態から
『ready』状態へ遷移し、I/O処理を再開する(第7図の
)。I/O処理が完了すると、タスクAは『sig-sem』シ
ステムコールによって、獲得していたセマフォをOSへ返
す。返されたセマフォは、セマフォが獲得できずに『wa
it』状態に遷移したタスクBに与えられる。この時点で
タスクBは、『ready』状態へ遷移する(第7図の
)。しかし、タスクBはタスクAが『ready』状態で
あるため、CPUは割当てられない。タスクAでの処理が
進み、他の要因でタスクAが『wait』状態に遷移する
と、タスクBのCPUが割当てられる(第7図の)。When the designated time has elapsed, the task A transits from the "wait" state to the "ready" state and restarts the I / O processing (Fig. 7). When the I / O processing is completed, task A returns the acquired semaphore to the OS by the "sig-sem" system call. The semaphore returned is "wa
It is given to task B that has transitioned to the "it" state. At this point, task B transitions to the "ready" state (Fig. 7). However, since task A is in “ready” state, task B cannot be assigned a CPU. When the processing in task A progresses and task A transitions to the "wait" state due to other factors, the CPU of task B is assigned (Fig. 7).
以上のように、2つのタスクA,Bは互いに排除しあいな
がら処理を行う。As described above, the two tasks A and B perform processing while excluding each other.
次に、上記のタスクA,Bを同じOS上でタスクとして実現
されているデバッガによってデバッグをすることを考え
てみる。デバッグの方法は、予め指定してある地点にタ
スクが到達すると『wait』状態にあるデバッガが起動さ
れ(『ready』状態に遷移させられる)、タスクを停止
させる(『wait』状態に遷移させる)方法を取る。この
ような地点を『ブレークポイント』という。Next, consider debugging the above tasks A and B with a debugger implemented as a task on the same OS. The method of debugging is that when a task reaches a point specified in advance, the debugger in the "wait" state is activated (transition to the "ready" state) and the task is stopped (transition to the "wait" state). Take the way. Such points are called "breakpoints".
今、タスクAをセマフォを獲得する前にブレークポイン
トを設定する。その時のタスクの動作を第8図を参照し
ながら説明する。簡単のために、第8図では、デバッガ
の動作は省略してある。デバッガとタスクA、タスクB
の優先順位の関係は、次の通りである。Now set a breakpoint on task A before getting the semaphore. The operation of the task at that time will be described with reference to FIG. For simplicity, the operation of the debugger is omitted in FIG. Debugger and task A, task B
The relationship of the priority of is as follows.
デバッガ>タスクA>タスクB 先程と同様、2つのタスクA,Bは『ready』状態にある。
デバッガは、コマンドが入力されるまで『wait』状態で
ある。『ready』状態のタスクのうち、優先順位はタス
クAの方が高いため、OSはタスクAにCPUを割当てる
(第8図の)。タスクAがブレークポイントに達する
と、デバッガが起動される。デバッガは、タスクAを
『wait』状態に遷移させる。タスクAが『wait』状態に
遷移したことにより、OSはタスクBにCPUを割当てる
(第8図の)。即ち、デバッガは、タスクAをwait状
態に遷移させた後、wait状態となる。タスクBは、I/O
入出力のため『wai-sem』システムコールを発行する。
タスクAはセマフォを獲得する前に『wait』状態に遷移
したため、タスクBはセマフォを獲得することができる
(第8図の)。セマフォを獲得したタスクBは、I/O
との同期をとるために『wai-tsk』システムコールによ
って『wait』状態に入る(第8図の)。この時、実行
継続のため、『wait』状態に遷移していたタスクAは、
デバッガによって『ready』状態に戻されたとする。タ
スクBは『wait』状態であるから、OSはタスクAにCPU
を割当てる(第8図の)。即ち、デバッガは、タスク
Aをready状態に遷移させた後、wait状態となる。タス
クAは『wai-sem』システムコールによってセマフォを
獲得しようとする。しかし、すでにタスクBがセマフォ
を獲得しているため、再び『wait』状態に遷移する(第
8図の)。Debugger> Task A> Task B As before, the two tasks A and B are in the “ready” state.
The debugger is in a "wait" state until a command is entered. Of the tasks in the “ready” state, task A has a higher priority, so the OS allocates a CPU to task A (see FIG. 8). When task A reaches the breakpoint, the debugger is launched. The debugger shifts task A to the "wait" state. Due to the transition of task A to the "wait" state, the OS allocates CPU to task B (Fig. 8). That is, the debugger enters the wait state after changing the task A to the wait state. Task B is I / O
Issue "wai-sem" system call for input / output.
Since the task A transits to the “wait” state before acquiring the semaphore, the task B can acquire the semaphore (see FIG. 8). Task B that acquired the semaphore is I / O
It enters the "wait" state by the "wai-tsk" system call to synchronize with (Fig. 8). At this time, task A, which has transitioned to the "wait" state to continue execution,
It is assumed that the debugger has returned to the "ready" state. Since task B is in the "wait" state, the OS sends task A a CPU
Is assigned (in FIG. 8). That is, the debugger enters the wait state after transitioning the task A to the ready state. Task A tries to acquire a semaphore by the "wai-sem" system call. However, since task B has already acquired the semaphore, it transits to the "wait" state again (Fig. 8).
以上の動作説明で明らかなように、デバッグのためにタ
スクAを停止させた(『wait』状態にした)ことによ
り、タスクBがタスクAよりも先に処理を行うことにな
る。デバッグは本来、対象となるシステムに対して影響
を与えてはならないものである。しかし、従来の方法で
は、タスクの同期関係、実行順序というマルチタスク処
理において最低限守らなければならないことが崩れてい
る。このために、停止させたタスクの動作を継続する
と、他のタスクによって本来獲得できるはずの資源等が
ない等の状態になり、タスクの正常な処理が行われなく
なったりする。また、タスクBがセマフォを獲得した
後、タスクAから起動されるのを待つような構成になっ
ていると、タスクAはセマフォが返却されるのを待ち、
タスクBはセマフォを持ったままタスクAからの起動を
待つというような状態に入ってしまう。このような状態
を『デッドロック』いい、2つのタスクは無限の待ち状
態に入ってしまう。As is clear from the above description of the operation, by stopping the task A (putting it in the “wait” state) for debugging, the task B executes the processing before the task A. Debugging should not affect the target system by nature. However, in the conventional method, the minimum relationship that must be observed in the multitask processing such as the task synchronization relationship and the execution order is broken. For this reason, if the stopped task continues to operate, a state in which there is no resource or the like that should be originally acquired by another task may occur, and normal processing of the task may not be performed. Further, if the configuration is such that after the task B acquires the semaphore and is started by the task A, the task A waits for the semaphore to be returned,
Task B enters a state of waiting for activation from task A while holding the semaphore. Such a state is called "deadlock", and two tasks enter an infinite waiting state.
本発明のタスクデバッグ方法は、オペレーティングシス
テム上で動作するタスクの中から複数個のタスクを指定
し、これら指定された複数個のタスクを登録しておき、
デバッグのために登録されている任意のタスクが停止さ
せられた時、登録されている他のタスク全てを同時に停
止させる。The task debugging method of the present invention specifies a plurality of tasks from among tasks operating on an operating system, and registers the specified plurality of tasks in advance.
When any task registered for debugging is stopped, all other registered tasks are stopped at the same time.
したがって、タスクの同期関係を維持することが可能に
なり、ブレークポイントで停止したタスクを再開した場
合、それ以後の処理も正常に行なわれる。Therefore, it becomes possible to maintain the task synchronization relationship, and when the task stopped at the breakpoint is restarted, the subsequent processing is also performed normally.
次に、本発明の実施例について図面を参照して説明す
る。Next, embodiments of the present invention will be described with reference to the drawings.
第1図は本発明のタスクデバッグ方法の第1の実施例
で、タスクAがブレークポイントに達した場合のデバッ
ガの処理のフローチャート、第2図は第1の実施例にお
けるグループ登録テーブル21とTCB22,23を示す図、第5
図はタスクA,Bの動作を示すタイムチャートである。FIG. 1 is a first embodiment of the task debugging method of the present invention, and is a flowchart of the processing of the debugger when task A reaches a breakpoint, and FIG. 2 is a group registration table 21 and TCB22 in the first embodiment. , 23, 23
The figure is a time chart showing the operations of tasks A and B.
タスクの数、状態、ブレークポイントの位置等の条件
は、従来例の説明で用いたものと同じとする。今、ブレ
ークポイント到達時に停止させるタスク・グループにタ
スクAとタスクBが指定されたものとする。The conditions such as the number of tasks, the state, and the position of the break point are the same as those used in the description of the conventional example. Now, it is assumed that task A and task B are designated as the task group to be stopped when the breakpoint is reached.
第2図中、22.23はそれぞれタスクA,BのTCBであり、エ
リア26,28にはそれぞれTCB22,23の次にリンクされてい
るTCBのアドレスが格納され、エリア27,29にはそれぞれ
TCB22,23の一つ前にリンクされているTCBのアドレスが
格納され、グループ登録テーブル21にはデバッガ内にあ
って指定されたタスク(この場合、タスクA,B)のTCBの
アドレスが登録される。In FIG. 2, 22.23 is the TCBs of tasks A and B, areas 26 and 28 store the addresses of the TCBs linked next to TCBs 22 and 23, and areas 27 and 29 respectively.
The address of the TCB linked immediately before TCB22, 23 is stored, and the TCB address of the task (task A, B in this case) specified in the debugger is registered in the group registration table 21. It
次に、本実施例の動作を説明する。Next, the operation of this embodiment will be described.
まず、デバッガは、テーブル21にタスクAとタスクBの
TCBをリンクする。リンクは次のように行われる。First, the debugger shows in Table 21 that Task A and Task B
Link the TCB. The link is done as follows.
まず、格納エリア26にタスクBのTCBアドレスを、格納
エリア29にタスクAのTCBアドレスを格納する。格納エ
リア27と28には『0』を格納する。次に、タスクAのTC
Bアドレスを格納エリア24に、タスクBのTCBアドレスを
格納エリア25に格納する。以上のようにして、指定タス
クA,BのTCBリンクを形成し、デバッガは『wait』状態に
遷移する。First, the TCB address of task B is stored in the storage area 26, and the TCB address of task A is stored in the storage area 29. “0” is stored in the storage areas 27 and 28. Next, TC of task A
The B address is stored in the storage area 24, and the TCB address of task B is stored in the storage area 25. As described above, the TCB links of the specified tasks A and B are formed, and the debugger transits to the "wait" state.
デバッガが『wait』状態に遷移したことにより、OSはタ
スクAにCPUを割当てる(第5図の)。タスクAがブ
レークポイントに達すると、デバッガが起動され。デバ
ッガはグループ登録テーブル21のアドレスを得(ステッ
プ11)、グループ登録テーブル21の格納エリア24からリ
ンクの先頭のTCBアドレスを得る(ステップ12)。この
アドレスはタスクAのものである。先ず、デバッガはタ
スクAを『wait』状態に遷移させる(ステップ13,1
4)。次に、格納エリア26を調べて、次にリンクされて
いるTCBのアドレスを得、0でないかどうかチェックす
る(ステップ15,16)。この場合、格納エリア26にはタ
スクBのTCBアドレスが格納されており、0ではないの
でデバッガはタスクBを『wait』状態に遷移させる(ス
テップ14,第5図の)。次に、TCB23の格納エリア28を
調べて、次にリンクされているTCBのアドレスを得、0
でないかどうかチェックする(ステップ15,16)。この
場合、格納エリア28には『0』が格納されているので、
デバッガはリンクを最後までたどったことになり、デバ
ッガは『wait』状態に入る(ステップ17)。The OS assigns a CPU to task A when the debugger enters the "wait" state (see FIG. 5). When task A reaches the breakpoint, the debugger is launched. The debugger obtains the address of the group registration table 21 (step 11) and the TCB address of the head of the link from the storage area 24 of the group registration table 21 (step 12). This address belongs to task A. First, the debugger shifts task A to the "wait" state (steps 13,1).
Four). Next, the storage area 26 is examined to obtain the address of the next TCB linked, and it is checked whether it is not 0 (steps 15 and 16). In this case, since the TCB address of task B is stored in the storage area 26 and is not 0, the debugger shifts task B to the "wait" state (step 14, FIG. 5). Next, the storage area 28 of the TCB 23 is checked to obtain the address of the next linked TCB, and 0
Check if it is not (steps 15 and 16). In this case, since "0" is stored in the storage area 28,
The debugger has followed the link to the end and the debugger enters the "wait" state (step 17).
3つのタスク(デバッガ、タスクA、タスクB)が共に
『wait』状態に入ったことにより、CPUはタスクが割当
てられていない状態に入る(第5図の)。Since all three tasks (debugger, task A, task B) have entered the "wait" state, the CPU enters the state where no tasks have been allocated (Fig. 5).
ここで、実行継続の操作が行われたとする。デバッガは
ブレークポイントに達して『wait』状態に遷移させられ
たタスクAと、グループ指定によって『wait』状態に遷
移させられていたタスクBを『ready』状態に戻す(第
5図の)。デバッガは、上記の操作を行った後『wai
t』状態に入る。『ready』状態の2つのタスクA,Bのう
ち、タスクAの優先順位がタスクBのそれよりも高いた
め、OSはタスクAにCPUを割当てる(第5図の)。Here, it is assumed that the operation of continuing the execution is performed. The debugger returns to the "ready" state the task A that has reached the breakpoint and has been transitioned to the "wait" state, and the task B that has been transitioned to the "wait" state by the group designation (Fig. 5). After performing the above operation, the debugger
t'state is entered. Of the two tasks A and B in the “ready” state, the priority of task A is higher than that of task B, so the OS allocates CPU to task A (see FIG. 5).
以上のようにしてタスクAは、処理を再開する。Task A resumes processing as described above.
第3図は本発明のタスクデバッグ方法の第2の実施例
で、タスクAがブレークポイントに達した場合のデバッ
ガの処理のフローチャート、第4図は第1の実施例にお
けるブレークポイントテーブル41、TCB登録テーブル42
を示す図である。FIG. 3 is a second embodiment of the task debugging method of the present invention, and is a flowchart of the processing of the debugger when task A reaches a breakpoint, and FIG. 4 is the breakpoint table 41, TCB in the first embodiment. Registration table 42
FIG.
なお、タスクの数,状態,ブレークポイントの位置の条
件は従来例の説明で用いたものと同じとする。タスクA,
Bの動作説明として第5図を用いる。The conditions of the number of tasks, the state, and the position of the breakpoint are the same as those used in the description of the conventional example. Task A,
FIG. 5 is used to explain the operation of B.
第4図中、TCB登録テーブル42のエリア45にはタスクの
登録数,エリア46,47にはTCBアドレスが格納され、ブレ
ークポイント格納テーブル41のエリア43にはブレークポ
イントアドレスが格納され、エリア44にはTCB登録テー
ブル42のアドレスが格納される。In FIG. 4, the number of registered tasks is stored in the area 45 of the TCB registration table 42, the TCB address is stored in the areas 46 and 47, the breakpoint address is stored in the area 43 of the breakpoint storage table 41, and the area 44 is stored. The address of the TCB registration table 42 is stored in.
次に、本実施例の動作を説明する。Next, the operation of this embodiment will be described.
ブレークポイントがセットされると、デバッガはブレー
クポイントアドレスをブレーポイント格納テーブル41の
格納エリア43に格納する。また、ブレークポイント到達
時に停止させるタスク・グループが指定されると、デバ
ッガはTCB登録テーブル42の格納エリア45に登録するタ
スク数(=2)を、格納エリア46と47にそれぞれタスク
AとタスクBのTCBアドレスを格納する。そして、グレ
ークポイント格納テーブル41の格納エリア44にTCB登録
テーブル42のアドレスを格納する。この処理の後、デバ
ッガは『wait』状態に遷移する。When the breakpoint is set, the debugger stores the breakpoint address in the storage area 43 of the breakpoint storage table 41. When the task group to be stopped when the breakpoint is reached is specified, the debugger sets the number of tasks (= 2) to be registered in the storage area 45 of the TCB registration table 42 to task A and task B in storage areas 46 and 47, respectively. Stores the TCB address of. Then, the address of the TCB registration table 42 is stored in the storage area 44 of the gray point storage table 41. After this processing, the debugger transits to the "wait" state.
デバッガが『wait』状態に遷移したことにより、OSはタ
スクAにCPUを割当てる(第5図の)。タスクAがブ
レークポイントに達すると、デバッガが起動される。デ
バッガは、格納エリア44からTCB登録テーブル42のアド
レスを得(ステップ31)、格納エリア45からタスクの登
録数(=2)を得る(ステップ32)。次に、TCB登録テ
ーブル42のエリア46からタスクAのTCBアドレスを得
(ステップ34)、タスクAを『wait』状態に遷移させる
(ステップ35、第5図の)。次に、登録数を1デクリ
メントし(ステップ36)、TCB登録テーブル42のエリア4
7からタスクBのTCBのアドレスを得(ステップ34)、タ
スクBを『wait』状態に遷移させる(ステップ35,第5
図の)。次に、登録数を1デクリメントすると(ステ
ップ36)、登録数が0になるので、デバッガは『wait』
状態に入る(ステップ33,37)。The OS assigns a CPU to task A when the debugger enters the "wait" state (see FIG. 5). When task A reaches the breakpoint, the debugger is launched. The debugger obtains the address of the TCB registration table 42 from the storage area 44 (step 31) and the number of registered tasks (= 2) from the storage area 45 (step 32). Next, the TCB address of the task A is obtained from the area 46 of the TCB registration table 42 (step 34), and the task A is transited to the "wait" state (step 35, FIG. 5). Next, the number of registrations is decremented by 1 (step 36), and the TCB registration table 42 area 4
The TCB address of the task B is obtained from 7 (step 34), and the task B is transited to the "wait" state (step 35, fifth).
(In the figure). Next, when the number of registrations is decremented by 1 (step 36), the number of registrations becomes 0, so the debugger "waits".
Enter the state (steps 33 and 37).
3つのタスク(デバッガ、タスクA、タスクB)が共に
『wait』状態に入ったことにより、CPUはタスクが割当
てられていない状態に入る(第5図の)。Since all three tasks (debugger, task A, task B) have entered the "wait" state, the CPU enters the state where no tasks have been allocated (Fig. 5).
ここで、実行継続の操作が行われたとする。デバッガは
ブレークポイントに達して『wait』状態に遷移させられ
たタスクAと、グループ指定によって『wait』状態に遷
移させられていたタスクBを『ready』状態に戻す(第
5図の)。デバッガは、上記の操作を行った後『wai
t』状態に入る。『ready』状態の2つのタスクA,Bのう
ち、タスクAの優先順位がタスクBのそれよりも高いた
め、OSはタスクAにCPUを割当てる(第5図の)。Here, it is assumed that the operation of continuing the execution is performed. The debugger returns to the "ready" state the task A that has reached the breakpoint and has been transitioned to the "wait" state, and the task B that has been transitioned to the "wait" state by the group designation (Fig. 5). After performing the above operation, the debugger
t'state is entered. Of the two tasks A and B in the “ready” state, the priority of task A is higher than that of task B, so the OS allocates CPU to task A (see FIG. 5).
以上のようにしてタスクAは処理を再開する。Task A resumes processing as described above.
以上説明したように本発明は、ブレークポイントによっ
てあるタスクが停止した時、予め指定されているブレー
クポイントを設定されたタスクに関係あるタスクを同時
に停止させることにより、従来の方法では不可能だった
タスクの同期関係を維持することが可能となり、ブレー
クポイントで停止したタスクを再開した場合、それ以降
の処理も正常に行われ、また、タスク間の同期関係を維
持するためにシステム全体を停止させる方法と異なり、
ブレークポイントを設定したタスクの処理と全く関係な
い処理を行っているタスクに影響を与えることが無く、
さらに、指定するタスクのグループを複数個可能にする
と、複数のブレークポイントが設定されている場合、そ
れぞれのブレークポイント付近で関係するタスクを細か
く指定でき、デバッグの効率を上げることができる効果
がある。As described above, according to the present invention, when a certain task is stopped by a breakpoint, the tasks related to the task to which a predetermined breakpoint is set are stopped at the same time, which is impossible with the conventional method. It becomes possible to maintain the task synchronous relationship, and when the task stopped at the breakpoint is restarted, the subsequent processing is also performed normally, and the entire system is stopped to maintain the task synchronous relationship. Unlike the method
It does not affect the task that is performing the processing that has nothing to do with the processing of the task that set the breakpoint,
Furthermore, if you enable multiple groups of specified tasks, if multiple breakpoints are set, you can specify the related tasks in the vicinity of each breakpoint in detail, which has the effect of improving debugging efficiency. .
第1図は本発明のタスクデバッグ方法の第1の実施例
で、タスクAがブレークポイントに達した場合のデバッ
ガの処理のフローチャート、第2図は第1の実施例にお
けるグループ登録テーブル21とTCB22,23を示す図、第3
図は本発明のタスクデバッグ方法の第2の実施例で、タ
スクAがブレークポイントに達した場合のデバッガの処
理のフローチャート、第4図は第1の実施例におけるブ
レークポイント格納テーブル41、TCB登録テーブル42を
示す図、第5図は第1,第2の実施例におけるタスクA,B
の動作を示す図、第6図はオペレーティングシステム上
のタスクの状態遷移を示す図、第7図は通常の場合の2
タスクの動作を示す図、第8図は従来のデバッグ方法を
用いた場合の2タスクの動作を示す図である。 11〜17,31〜37……ステップ、21……グループ登録テー
ブル、22,23……TCB、24〜29……エリア、41……ブレー
クポイント格納テーブル、42……TCB登録テーブル、43
〜47……エリア。FIG. 1 is a first embodiment of the task debugging method of the present invention, and is a flowchart of the processing of the debugger when task A reaches a breakpoint, and FIG. 2 is a group registration table 21 and TCB22 in the first embodiment. , 23,3
The figure is a second embodiment of the task debugging method of the present invention, and is a flowchart of the processing of the debugger when task A reaches a breakpoint, and FIG. 4 is the breakpoint storage table 41 and TCB registration in the first embodiment. FIG. 5 shows the table 42, and FIG. 5 shows tasks A and B in the first and second embodiments.
6 shows the operation of the operating system, FIG. 6 shows the state transitions of tasks on the operating system, and FIG.
FIG. 8 is a diagram showing the operation of a task, and FIG. 8 is a diagram showing the operation of two tasks when the conventional debugging method is used. 11 to 17, 31 to 37 …… Step, 21 …… Group registration table, 22,23 …… TCB, 24-29 …… Area, 41 …… Breakpoint storage table, 42 …… TCB registration table, 43
~ 47 …… Area.
Claims (1)
ステムにおけるタスクデバッグ方法において、前記オペ
レーティングシステム上で動作するタスクの中から複数
個のタスクを指定し、これら指定された複数個のタスク
を登録しておき、デバッグのために登録されている任意
のタスクが停止させられた時、登録されている他のタス
ク全てを同時に停止させることを特徴とする、タスクデ
バッグ方法。1. A method of debugging a task in an operating system for multiple programming, wherein a plurality of tasks are designated from among the tasks operating on the operating system, and the designated plurality of tasks are registered and debugged. A task debugging method characterized in that when any task registered for is stopped, all other registered tasks are stopped at the same time.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63043743A JPH07120301B2 (en) | 1988-02-25 | 1988-02-25 | Task debugging method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63043743A JPH07120301B2 (en) | 1988-02-25 | 1988-02-25 | Task debugging method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH01217525A JPH01217525A (en) | 1989-08-31 |
| JPH07120301B2 true JPH07120301B2 (en) | 1995-12-20 |
Family
ID=12672245
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63043743A Expired - Fee Related JPH07120301B2 (en) | 1988-02-25 | 1988-02-25 | Task debugging method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07120301B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2856681B2 (en) * | 1994-01-27 | 1999-02-10 | インターナショナル・ビジネス・マシーンズ・コーポレイション | Method and system for handling external events |
-
1988
- 1988-02-25 JP JP63043743A patent/JPH07120301B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH01217525A (en) | 1989-08-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6675191B1 (en) | Method of starting execution of threads simultaneously at a plurality of processors and device therefor | |
| US6463532B1 (en) | System and method for effectuating distributed consensus among members of a processor set in a multiprocessor computing system through the use of shared storage resources | |
| US7080377B2 (en) | Method for effective utilizing of shared resources in computerized system | |
| EP0221274A2 (en) | Method for ensuring switchover in a restartable data base system | |
| US5748959A (en) | Method of conducting asynchronous distributed collective operations | |
| JPH0644235B2 (en) | How to operate a computer system | |
| JPH04229355A (en) | Data access method and data processing system | |
| US6507809B1 (en) | Method and system for simulating performance of a computer system | |
| JP3113841B2 (en) | Parallel transaction processing system | |
| US20210303403A1 (en) | Transaction processing method, apparatus, and electronic device for blockchain | |
| US8225320B2 (en) | Processing data using continuous processing task and binary routine | |
| AU603876B2 (en) | Multiple i/o bus virtual broadcast of programmed i/o instructions | |
| US11106395B2 (en) | Application execution apparatus and application execution method | |
| US8117626B2 (en) | Asynchronous remote procedure calling method and computer product in shared-memory multiprocessor | |
| CN112363816B (en) | Deterministic scheduling method, system and medium for embedded multi-core operating system | |
| JPH07120301B2 (en) | Task debugging method | |
| JPH07120302B2 (en) | Task debug method | |
| JP3006676B2 (en) | Multiprocessor | |
| JPH07281915A (en) | Integrated circuit module synchronous dual system information processing device | |
| JPH1049397A (en) | Control method for test program execution | |
| CN118672203B (en) | PLCopen motion control function block interaction method and system based on shared memory | |
| CN117687805B (en) | Multithreading data synchronization method and system applied to PLC and device | |
| KR100678249B1 (en) | Apparatus and method for managing IP tasks and memory | |
| JPS62219058A (en) | Exclusive control system for shared memory | |
| CN120144255A (en) | A multi-task scheduling method and PLC controller |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |