JPH04321139A - Debug back-up device - Google Patents

Debug back-up device

Info

Publication number
JPH04321139A
JPH04321139A JP3090165A JP9016591A JPH04321139A JP H04321139 A JPH04321139 A JP H04321139A JP 3090165 A JP3090165 A JP 3090165A JP 9016591 A JP9016591 A JP 9016591A JP H04321139 A JPH04321139 A JP H04321139A
Authority
JP
Japan
Prior art keywords
task
program
instruction
execution
executed
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
JP3090165A
Other languages
Japanese (ja)
Inventor
Osamu Yamamoto
治 山本
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP3090165A priority Critical patent/JPH04321139A/en
Publication of JPH04321139A publication Critical patent/JPH04321139A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To accurately break the execution of each task working in a multi- task OS by using a means which breaks the execution of a program in terms of hardware with no reliance on a task context. CONSTITUTION:A CPU 11 is provided with a hardware break point register 12 serving as a breaking means which breaks the execution of a program in terms of hardware, a software tarp generating means 13 which shifts the control to a processing routine registered previously when a certain instruction is carried out, and a program counter 14 which stores the address value of the program under execution. The execution of a task is broken when the instruction contained in the task is rewritten into a TRAP instruction. Furthermore the original instruction that is broken with rewrite into the TRAP instruction is executed again after the register 12 is set to the address of the original instruction.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、マイクロプロセッサ等
のハードウェアを動作させるために必要なソフトウェア
の開発に際して、ソフトウェアのデバッグを支援するデ
バッグ支援装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debugging support device for supporting debugging of software when developing software necessary to operate hardware such as a microprocessor.

【0002】0002

【従来の技術】マイクロプロセッサ等のハードウェアを
動作させるためにはソフトウェア、所謂プログラムが必
要である。このプログラムを開発する際には、開発され
たプログラムあるいは開発途上のプログラムをハードウ
ェア上で実際に実行させてプログラムの開発意図通りに
ハードウェアが動作するか否かを確かめることにより、
プログラムの不具合を探索して修正する必要がある。
2. Description of the Related Art In order to operate hardware such as a microprocessor, software, a so-called program, is required. When developing this program, we actually run the developed program or the program under development on the hardware and check whether the hardware operates as intended by the program.
It is necessary to find and correct program defects.

【0003】このようなプログラムの不具合を探索して
修正する作業をデバッグと称する。このプログラムのデ
バッグに際しては、プログラムをあるアドレスまで実行
した後に一旦プログラムの実行をブレーク (中断) 
し、その時点のメモリ,レジスタ等の内容がプログラム
のそれまでに実行された部分に対応した正しい値である
か否かを調べ、正しくない場合にはどの時点からそうで
あるのかを調べることにより、プログラムが正常に動作
しなくなったアドレスを知ることが非常に有効である。
[0003] The work of searching for and correcting problems in a program is called debugging. When debugging this program, break (interrupt) the program execution once after executing the program up to a certain address.
Then, by checking whether the contents of memory, registers, etc. at that point are the correct values corresponding to the parts of the program that have been executed up to that point, and if they are not correct, by checking from what point they are correct. , it is very useful to know the address where the program no longer works properly.

【0004】上述のようなハードウェア的にプログラム
の実行をブレークする手段としてブレークポイントレジ
スタが知られている。このブレークポイントレジスタは
CPUに備えられ、これにセットされている命令を実行
することにより予め登録されている処理ルーチンへ制御
が移るようになっている。この予め登録されている処理
ルーチンへ制御が移ることをトラップが発生すると称す
る。
A breakpoint register is known as a means for breaking the execution of a program using hardware as described above. This breakpoint register is provided in the CPU, and by executing an instruction set in the breakpoint register, control is transferred to a pre-registered processing routine. The transfer of control to this pre-registered processing routine is called the occurrence of a trap.

【0005】なお、ブレークポイントレジスタを利用す
る場合には、その数だけしか同時にブレークポイントを
セットできないという問題がある。そこで、トラップを
発生させる命令とデバッグ対象のプログラム (被デバ
ッグプログラム) の命令とを書換えてプログラムの実
行をブレークする手法が知られている。このような手法
はソフトウェア的なブレークと称される。この手法では
、命令を書換えるのみでブレークを発生させることが出
来るので、プログラムの実行をブレークするアドレス及
びその数を任意に設定することが可能になる。
[0005] When using breakpoint registers, there is a problem in that only that many breakpoints can be set at the same time. Therefore, a known method is to rewrite the instruction that generates the trap and the instruction of the program to be debugged (debugged program) to break the execution of the program. Such a method is called a software break. With this method, a break can be generated simply by rewriting an instruction, so it is possible to arbitrarily set the addresses and number of addresses at which program execution is to be broken.

【0006】以下に、上述したようなソフトウェア的に
プログラムの実行をブレークする従来の手法について具
体的に説明する。
[0006] The conventional method of breaking the execution of a program using software as described above will be specifically explained below.

【0007】図13は従来のデバッグ支援装置のソフト
ウェア構成を示す模式図である。
FIG. 13 is a schematic diagram showing the software configuration of a conventional debugging support device.

【0008】図13において、参照符号1はこれからデ
バッグを受ける被デバッグプログラムを、3はデバッグ
を行うためのシステムプログラムであるデバッガをそれ
ぞれ示している。
In FIG. 13, reference numeral 1 indicates a debugged program to be debugged, and 3 indicates a debugger which is a system program for debugging.

【0009】図14は従来のデバッグ支援装置のハード
ウェア構成を示すブロック図である。
FIG. 14 is a block diagram showing the hardware configuration of a conventional debugging support device.

【0010】図14において、参照符号5はデータを入
力するためのキーボード、6はデータを表示するための
ディスプレイ(CRT) 、7はデータ及びプログラム
を格納しておくための外部記憶装置である磁気ディスク
、8は内部バス、9はこのデバッグ支援装置を制御する
ためのプログラム及びデータを格納するリードオンリメ
モリ(ROM) 、10は被デバッグプログラム等を格
納するランダムアクセスメモリ(RAM) 、11は中
央処理装置(CPU) である。
In FIG. 14, reference numeral 5 is a keyboard for inputting data, 6 is a display (CRT) for displaying data, and 7 is a magnetic storage device for storing data and programs. 8 is an internal bus, 9 is a read-only memory (ROM) that stores programs and data for controlling this debug support device, 10 is a random access memory (RAM) that stores programs to be debugged, etc., 11 is a central bus. It is a processing unit (CPU).

【0011】CPU 11には、プログラムを1命令実
行する都度、予め登録されている処理ルーチンへ制御を
移すトレーストラップ発生手段16、ある命令が実行さ
れた場合に予め登録されている処理ルーチンへ制御を移
すソフトウェアトラップ発生手段13、現在実行してい
るプログラムのアドレス (PC値) が格納されてい
るプログラムカウンタ(PC)14が備えられている。
The CPU 11 includes a trace trap generating means 16 that transfers control to a pre-registered processing routine each time one instruction of the program is executed, and a trace trap generating means 16 that transfers control to a pre-registered processing routine when a certain instruction is executed. The program counter (PC) 14 stores the address (PC value) of the program currently being executed.

【0012】次に上述のような構成の従来のデバッグ支
援装置の動作を説明する。
Next, the operation of the conventional debugging support device configured as described above will be explained.

【0013】図15は、被デバッグプログラム1にブレ
ークポイントをセットして実行し、そのブレークポイン
トでプログラムの実行が一旦ブレークし、その時点のメ
モリ及びレジスタの内容がチェックされた後、ブレーク
したアドレスから再びプログラムの実行が開始される場
合のCPU 11の処理内容を示すフローチャートであ
り、図16乃至図21はその各時点における被デバッグ
プログラム1の状態を示す模式図である。
FIG. 15 shows a program to be debugged 1 set with a breakpoint and executed, the execution of the program once breaking at that breakpoint, the contents of memory and registers at that point being checked, and then the address at which the break occurred. 16 to 21 are schematic diagrams showing the state of the program to be debugged 1 at each point in time.

【0014】ここでは例えば、デバッグ支援装置を利用
して被デバッグプログラム1にブレークポイントをセッ
トし、被デバッグプログラム1の先頭アドレスからアド
レスの順にブレークポイントまでプログラムを実行し、
ブレークポイントにおいてプログラムの実行がブレーク
された時点のレジスタ及びメモリの内容をチェックした
後、再びブレークポイントのアドレスから被デバッグプ
ログラムを実行させる場合について考える。
Here, for example, a breakpoint is set in the program to be debugged 1 using a debugging support device, and the program is executed in the order of addresses from the start address of the program to be debugged 1 up to the breakpoint.
Consider a case where the contents of registers and memory at the time when program execution is broken at a breakpoint are checked, and then the program to be debugged is executed again from the address of the breakpoint.

【0015】図16は被デバッグプログラム1の初期状
態を示す模式図である。この初期状態では、PC値は被
デバッグプログラム1の先頭アドレスを指しており、プ
ログラムはブレークポイントBPがセットされている”
MOV R1, R2”命令まで実行されてブレークし
、その時点のメモリ及びレジスタの内容がチェックされ
てデバッグが行われる。
FIG. 16 is a schematic diagram showing the initial state of the program to be debugged 1. As shown in FIG. In this initial state, the PC value points to the start address of debugged program 1, and the program has breakpoint BP set.
MOV R1, R2'' instructions are executed and a break occurs, and the contents of the memory and registers at that point are checked and debugging is performed.

【0016】まず、図16に示す如く、デバッガ3が出
力するコマンドによりブレークポイントBPが”MOV
 R1, R2”命令のアドレスにセットされる (ス
テップS1)。ブレークポイントBPがセットされると
、デバッガ3は図17に示す如く、ブレークポイントB
Pがセットされているアドレスの命令”MOV R1,
 R2”をTRAP命令に書換える (ステップS2)
。このTRAP命令は、それが実行されるとソフトウェ
アトラップを発生する命令である。
First, as shown in FIG. 16, the breakpoint BP is set to "MOV" by the command output by the debugger 3.
R1, R2" instruction address (step S1). When the breakpoint BP is set, the debugger 3 sets the breakpoint B as shown in FIG.
The instruction at the address where P is set “MOV R1,
Rewrite “R2” to a TRAP instruction (Step S2)
. This TRAP instruction is an instruction that generates a software trap when executed.

【0017】次に、デバッガ3が出力するコマンドによ
り被デバッグプログラム1が実行される (ステップS
3)。被デバッグプログラム1には上述の如く既にTR
AP命令がセットされているため、図18に示す如く、
PC値がブレークポイントBPにまで達すると、被デバ
ッグプログラム1のTRAP命令が実行されてトラップ
が発生してプログラムの実行がブレークされ、デバッガ
3に制御が戻る (ステップS4)。
Next, the program to be debugged 1 is executed by the command output by the debugger 3 (step S
3). As mentioned above, the program to be debugged 1 already has a TR.
Since the AP command is set, as shown in Figure 18,
When the PC value reaches the break point BP, the TRAP instruction of the program to be debugged 1 is executed, a trap is generated, the program execution is broken, and control is returned to the debugger 3 (step S4).

【0018】ここで、デバッガ3が出力するコマンドに
よりメモリ及びレジスタの内容がチェックされた後、デ
バッガ3が出力するコマンドによりブレークポイントB
Pのアドレス、即ち現在のPC値のアドレスからプログ
ラムが再実行される (ステップS5)。この際、先に
TRAP命令に書換えられた命令”MOV R1, R
2”を実行する必要があるので、図19に示す如く、デ
バッガ3はTRAP命令を”MOV R1, R2”命
令に書換え (ステップS6)、トレーストラップ発生
手段16によりトレーストラップを発生して”MOV 
R1, R2”命令を実行する (ステップS7) 。
Here, after the contents of the memory and registers are checked by the command output by the debugger 3, breakpoint B is set by the command output by the debugger 3.
The program is re-executed from the address of P, that is, the address of the current PC value (step S5). At this time, the instruction “MOV R1, R
2", as shown in FIG. 19, the debugger 3 rewrites the TRAP instruction to the "MOV R1, R2" instruction (step S6), generates a trace trap by the trace trap generating means 16, and executes the "MOV R1, R2" instruction.
R1, R2'' instructions are executed (step S7).

【0019】即ち、一時的にブレークポイントBPを外
してトレーストラップをセットすることにより、ステッ
プS2における命令の書換えにより一旦破壊された被デ
バッグプログラム1の命令、具体的には”MOV R1
,R2”命令がこの時点で実行される。
That is, by temporarily removing the breakpoint BP and setting a trace trap, the instruction of the program to be debugged 1 that was once destroyed by the rewriting of the instruction in step S2, specifically, "MOV R1" is removed.
, R2'' instruction is executed at this point.

【0020】トレーストラップがかかっているので”M
OV R1, R2”命令が実行された後、図20に示
す如く、トラップが発生してデバッガ3に制御が戻され
る (ステップS8)。この後、デバッガ3は再びブレ
ークポイントBPをセットするために、図21に示す如
く、”MOV R1, R2”命令をTRAP命令に書
換える (ステップS9)。そしてこの後、TRAP命
令の次のアドレスからプログラムが再実行される (ス
テップS20)。
[0020] Since the trace strap is attached, "M"
After the "OV R1, R2" instruction is executed, a trap occurs and control is returned to the debugger 3 (step S8), as shown in FIG. , as shown in FIG. 21, the "MOV R1, R2" instruction is rewritten to a TRAP instruction (step S9). After this, the program is re-executed from the address next to the TRAP instruction (step S20).

【0021】ここで、ステップS2, S6, S7,
 S8, S9,S10における各処理はデバッガ3の
内部で実行されているため、デバッグ支援装置を使用し
ているユーザには見えない。ユーザから見れば、上述の
各処理は被デバッグプログラム1にブレークポイントB
Pをセットした上で実行し、ブレークポイントBPでプ
ログラムの実行が中断し、その時点でレジスタ及びメモ
リの内容をチェックした後、中断したアドレスから再び
被デバッグプログラムを実行させたことになる。
[0021] Here, steps S2, S6, S7,
Each process in S8, S9, and S10 is executed inside the debugger 3, so it is invisible to the user using the debugging support device. From the user's perspective, each of the above processes sets breakpoint B in debugged program 1.
P is set, the program execution is interrupted at the breakpoint BP, and after checking the contents of the register and memory at that point, the program to be debugged is executed again from the address where it was interrupted.

【0022】上述したような方法で被デバッグプログラ
ム1の実行をブレークすると、ブレークポイントの属性
及びブレークポイントをセットしたアドレスの命令コー
ド (ここでは、”MOV R1, R2”) などを
セーブするメモリさえ確保できれば、ブレークポイント
を幾つでもセットすることが可能なデバッグ支援装置を
実現できる。
[0022] When the execution of the program to be debugged 1 is broken using the method described above, even the memory for saving the attributes of the breakpoint and the instruction code of the address where the breakpoint was set (in this case, "MOV R1, R2") is saved. If this can be secured, a debugging support device that can set any number of breakpoints can be realized.

【0023】[0023]

【発明が解決しようとする課題】ところで、個々に独立
したプログラム (タスク) に処理時間を効率的に割
当ててそのプログラムを時分割で実行させることが可能
なマルチタスクオペレーティングシステム (マルチタ
スクOS) が近年広く普及しているが、上述のような
従来のデバッグ支援装置ではこのマルチタスクOS上で
動作するタスク群の実行を正確にブレークすることがで
きないという問題がある。
[Problem to be Solved by the Invention] By the way, there is a multitasking operating system (multitasking OS) that can efficiently allocate processing time to individual independent programs (tasks) and execute the programs in a time-sharing manner. Although it has become widespread in recent years, the conventional debugging support device as described above has a problem in that it cannot accurately break the execution of a group of tasks running on this multitasking OS.

【0024】以下に図1, 図3, 図22乃至図28
を参照してこの問題について説明する。
1, FIG. 3, FIG. 22 to FIG. 28 below.
Please refer to the following for an explanation of this issue.

【0025】図1はマルチタスクオペレーティングシス
テム上で動作するタスク群をデバッグするデバッグ支援
装置のソフトウェア構成を示す模式的ブロック図である
FIG. 1 is a schematic block diagram showing the software configuration of a debugging support device for debugging a group of tasks running on a multitasking operating system.

【0026】図1において、参照符号2は各タスクT1
, T2, T3で共通に使用するプログラムであるタ
スク共通ルーチン、3はデバッグを行うためのシステム
プログラムであるデバッガ、4は個々に独立したプログ
ラム (タスク) に処理時間を効率的に割当ててその
プログラムを時分割実行するマルチタスクオペレーティ
ングシステム(マルチタスクOS) である。
In FIG. 1, reference numeral 2 indicates each task T1.
, T2, and T3 use common task routines, 3 is a debugger that is a system program for debugging, and 4 is a program that efficiently allocates processing time to each independent program (task). It is a multitasking operating system (multitasking OS) that executes tasks in a time-sharing manner.

【0027】図3は、図1に示したタスク群がマルチタ
スクOS4により時分割実行される場合の各タスクT1
, T2, T3の実行状態を示すタイミングチャート
である。
FIG. 3 shows each task T1 when the task group shown in FIG. 1 is time-divisionally executed by the multitasking OS 4.
, T2, and T3 are timing charts showing execution states.

【0028】図22は図1に示すタスクT1, T2,
 T3の実行を従来のデバッグ支援装置でブレークする
場合のCPU 11による処理内容を示すフローチャー
トである。
FIG. 22 shows tasks T1, T2, and T2 shown in FIG.
12 is a flowchart showing the processing content of the CPU 11 when the execution of T3 is broken by a conventional debugging support device.

【0029】図23乃至図28はその各時点におけるタ
スク共通ルーチン2の状態を示す模式図である。
FIGS. 23 to 28 are schematic diagrams showing the state of the task common routine 2 at each point in time.

【0030】マルチタスクOS4は各タスクの実行優先
度及び各タスクの実行可能状態に応じてタスクの実行を
切替える。例えば、あるタスクの実行が不可能になると
マルチタスクOS4は他の実行可能なタスクの中で実行
優先度の高いタスクを選択して実行する。
[0030] The multitasking OS 4 switches the execution of tasks according to the execution priority of each task and the executable state of each task. For example, when a certain task becomes impossible to execute, the multitasking OS 4 selects and executes a task with a higher execution priority among other executable tasks.

【0031】ここで、たとえば各タスクの実行優先度を
第1タスクT1が一番高く、第2タスクT2がその次に
高く、第3タスクT3が3つのタスクの中では一番低く
、この3つのタスクがすべて実行可能な状態である場合
にはマルチタスクOS4は第1タスクT1を実行すると
仮定する。
Here, for example, the execution priority of each task is set such that the first task T1 has the highest execution priority, the second task T2 has the next highest priority, and the third task T3 has the lowest execution priority among the three tasks. It is assumed that the multitasking OS 4 executes the first task T1 when all three tasks are executable.

【0032】また例えば、タスク共通ルーチン2は磁気
ディスクに対する入出力を実行するプログラムであり、
第1タスクT1, 第2タスクT2,第3タスクT3が
この順にタスク共通ルーチン2を利用して磁気ディスク
7に対して入出力要求を出力する場合を考えると、各タ
スクは図3に示すような順序で実行される。
[0032] For example, task common routine 2 is a program that executes input/output to a magnetic disk,
Considering the case where the first task T1, the second task T2, and the third task T3 use the task common routine 2 in this order to output input/output requests to the magnetic disk 7, each task is configured as shown in FIG. executed in the same order.

【0033】図3において、先ず第1タスクT1が実行
され、第1タスクT1からタスク共通ルーチン2が呼出
される。タスク共通ルーチン2が実行されている間に、
第1タスクT1が入出力の完了待ち状態になって第2タ
スクT2に実行が切替わる。第2タスクT2から再びタ
スク共通ルーチン2が呼出される。第2タスクT2がタ
スク共通ルーチン2を実行している間に、第2タスクT
2が入出力の完了待ち状態になって第3タスクT3に実
行が切替わる。次に第3タスクT3からタスク共通ルー
チン2が呼出される。第3タスクT3が共通ルーチン2
を実行している間に、第3タスクT3が入出力の完了待
ち状態になるかまたは入出力が完了したために第1タス
クT1が実行可能状態になって第1タスクT1に実行が
切替わる。
In FIG. 3, the first task T1 is first executed, and the task common routine 2 is called from the first task T1. While task common routine 2 is being executed,
The first task T1 enters a state of waiting for completion of input/output, and execution switches to the second task T2. The task common routine 2 is called again from the second task T2. While the second task T2 is executing the task common routine 2, the second task T2
2 enters a state of waiting for input/output completion, and execution switches to the third task T3. Next, the task common routine 2 is called from the third task T3. Third task T3 is common routine 2
While this is being executed, the third task T3 enters a waiting state for input/output completion, or the first task T1 enters an executable state because the input/output is completed, and execution switches to the first task T1.

【0034】従来のデバッグ支援装置を使用してタスク
共通ルーチン2にブレークポイントをセットしてタスク
の実行をブレークし、ブレークしたアドレスからプログ
ラムを再び実行した場合のCPU 11の処理内容を図
22乃至図28を参照して説明する。
FIGS. 22 to 22 show the processing contents of the CPU 11 when a conventional debugging support device is used to set a breakpoint in the task common routine 2 to break the execution of the task, and then execute the program again from the address where the break occurred. This will be explained with reference to FIG.

【0035】図23はタスク共通ルーチン2の初期状態
を示す模式図であり、タスク共通ルーチン2の”MOV
 R1, R2”命令までプログラムが実行された後に
一旦ブレークし、その時点のメモリ及びレジスタの内容
がチェックされ、デバッグが行われる。
FIG. 23 is a schematic diagram showing the initial state of the task common routine 2.
After the program is executed up to the "R1, R2" instructions, there is a break, the contents of the memory and registers at that point are checked, and debugging is performed.

【0036】まず、図23に示す如く、デバッガ3が出
力するコマンドによりブレークポイントBPが”MOV
 R1, R2”命令のアドレスにセットされる (ス
テップS11)。ブレークポイントBPがセットされる
と、デバッガ3は図24に示す如く、ブレークポイント
BPがセットされているアドレスの命令”MOV R1
, R2”をTRAP命令に書換える (ステップS1
2)。このTRAP命令は、それが実行されるとソフト
ウェアトラップを発生する命令である。
First, as shown in FIG. 23, the breakpoint BP is set to "MOV" by the command output by the debugger 3.
R1, R2" instructions (step S11). When the breakpoint BP is set, the debugger 3 sets the instruction "MOV R1" at the address where the breakpoint BP is set, as shown in FIG.
, R2'' is rewritten to a TRAP instruction (Step S1
2). This TRAP instruction is an instruction that generates a software trap when executed.

【0037】次にデバッガ3が出力するコマンドにより
第1タスクT1が実行される (ステップS13)。タ
スク共通ルーチン2には上述の如く既にTRAP命令が
セットされているため、図25に示す如く、第1タスク
T1はタスク共通ルーチン2のTRAP命令が実行され
た時点でトラップが発生してブレークされ、デバッガ3
に制御が戻る (ステップS14)。
Next, the first task T1 is executed according to the command output by the debugger 3 (step S13). Since the TRAP instruction has already been set in the task common routine 2 as described above, the first task T1 is broken when the TRAP instruction of the task common routine 2 is executed, as shown in FIG. , debugger 3
Control returns to (step S14).

【0038】ここで、デバッガ3が出力するコマンドに
よりメモリ及びレジスタの内容がチェックされた後、デ
バッガ3が出力するコマンドによりブレークポイントB
Pのアドレス、即ち現在のPC値のアドレスからプログ
ラムが再実行される (ステップS15)。この際、先
にTRAP命令に書換えられた命令”MOV R1, 
R2”を実行する必要があるので、図26に示す如く、
デバッガ3はTRAP命令を”MOV R1, R2”
命令に書換え (ステップS16)、トレーストラップ
発生手段16によりトレーストラップを発生して”MO
V R1, R2”命令を実行する (ステップS17
)。
Here, after the contents of the memory and registers are checked by the command output by the debugger 3, breakpoint B is set by the command output by the debugger 3.
The program is re-executed from the address of P, that is, the address of the current PC value (step S15). At this time, the instruction “MOV R1,” which was rewritten to the TRAP instruction first,
Since it is necessary to execute “R2”, as shown in Figure 26,
Debugger 3 uses the TRAP instruction as “MOV R1, R2”
The instruction is rewritten (step S16), a trace trap is generated by the trace trap generating means 16, and the “MO”
Execute the “V R1, R2” command (step S17
).

【0039】即ち、一時的にブレークポイントBPを外
してトレーストラップをセットすることにより、ステッ
プS12における命令の書換えにより一旦破壊されたタ
スク共通ルーチン2の本来の命令”MOV R1, R
2”がこの時点で実行される。もし、ステップS18に
おいてタスクの実行が切替わらなければ、トレーストラ
ップがかかっているので”MOV R1,R2”命令が
実行された後、図27に示す如く、トラップがかってデ
バッガ3に制御が戻る (ステップS19)。
That is, by temporarily removing the breakpoint BP and setting a trace trap, the original instruction "MOV R1, R" of the task common routine 2, which was once destroyed by the rewriting of the instruction in step S12, is removed.
2" is executed at this point. If the execution of the task is not switched in step S18, since a trace trap is applied, after the "MOV R1, R2" command is executed, as shown in FIG. A trap is generated and control returns to the debugger 3 (step S19).

【0040】この後、デバッガ3は再びブレークポイン
トBPをセットするために図28に示す如く、”MOV
 R1, R2”命令をTRAP命令に書換える (ス
テップS20)。そしてこの後、TRAP命令の次のア
ドレスからプログラムが再実行される (ステップS2
1)。
After this, in order to set the breakpoint BP again, the debugger 3 selects "MOV" as shown in FIG.
R1, R2'' instructions are rewritten to TRAP instructions (step S20). After this, the program is re-executed from the address next to the TRAP instruction (step S2).
1).

【0041】このように、ステップS18でタスクが切
替わらない場合にはトレーストラップがかかって正常に
動作する。しかし、トレーストラップをかけるか否かを
判定するための情報は通常、タスクの切替えと共に書換
えられるタスクコンテキスト情報に含まれている。この
ため、ステップS18でタスクが切替わった場合には、
トレーストラップをかけるか否かを判定する情報がクリ
アされてしまうので、トレーストラップはかけられずに
第2タスクT2が実行されてしまい、タスク共通ルーチ
ン2が第2タスクT2から呼出されて実行される。
As described above, if the task is not switched in step S18, a trace trap is applied and normal operation occurs. However, information for determining whether to apply a trace trap is usually included in task context information that is rewritten when a task is switched. Therefore, when the task is switched in step S18,
Since the information for determining whether to apply a trace trap is cleared, the second task T2 is executed without applying a trace trap, and task common routine 2 is called and executed from the second task T2. .

【0042】ここでタスク共通ルーチン2は図27に示
す如き状態になっている。即ち、ブレークポイントBP
は解除になっていないがTRAP命令は一時的に外され
ていて元の”MOV R1, R2”命令がセットされ
ている。従って、第2タスクT2の実行はブレークされ
ずにそのままタスク共通ルーチン2が実行される (ス
テップS22)。これは、ステップS18において第3
タスクT3にタスクが切替わってタスク共通ルーチン2
が実行されている場合にも同様である。
Here, the task common routine 2 is in a state as shown in FIG. That is, breakpoint BP
has not been released, but the TRAP command has been temporarily removed and the original "MOV R1, R2" command has been set. Therefore, the execution of the second task T2 is not broken and the task common routine 2 is executed as is (step S22). This is the third step in step S18.
The task is switched to task T3 and task common routine 2 is started.
The same applies when the is being executed.

【0043】本来ならば、ブレークポイントBPは解除
されていないので、第2タスクT2に切替わっても第2
タスクT2からタスク共通ルーチン2が呼出されればタ
スクの実行がブレークされなければならない。しかし、
トレーストラップの実行権は第1タスクT1へ戻ってい
るので、トレーストラップをかける情報がセットされな
ければトレーストラップがかけられることはない (ス
テップS19)。
Normally, the breakpoint BP is not released, so even if the switch is made to the second task T2, the breakpoint BP is not released.
When task common routine 2 is called from task T2, execution of the task must be broken. but,
Since the right to execute the trace trap has returned to the first task T1, the trace trap will not be applied unless the information for applying the trace trap is set (step S19).

【0044】ここで、ステップS12, S16, S
17, S18, S19, S20, S21におけ
る各処理はデバッガ3の内部で実行されてるため、デバ
ッグ支援装置を使用しているユーザには見えない。ユー
ザから見れば、上述の各処理はタスク共通ルーチン2に
ブレークポイントBPをセットした上で実行し、第1タ
スクT1を実行している間にタスク共通ルーチン2のブ
レークポイントBPでプログラムの実行が中断し、その
時点でレジスタ及びメモリの内容をチェックした後、中
断したアドレスから再度タスク共通ルーチン2を実行し
たことになる。しかし、ブレークポイントは解除されて
おらず、しかも第2タスクT2及び第3タスクT3がタ
スク共通ルーチン2を実行したにもかかわらずプログラ
ムの実行をブレークすることは出来ない。
[0044] Here, steps S12, S16, S
17, S18, S19, S20, and S21 are executed inside the debugger 3, and are therefore invisible to the user using the debugging support device. From the user's perspective, each of the above-mentioned processes is executed after setting a breakpoint BP in the task common routine 2, and while the first task T1 is being executed, the program is executed at the breakpoint BP of the task common routine 2. After interrupting and checking the contents of the register and memory at that point, task common routine 2 is executed again from the address where it was interrupted. However, the breakpoint has not been canceled, and even though the second task T2 and the third task T3 have executed the task common routine 2, it is not possible to break the execution of the program.

【0045】デバッグ支援装置を使用しているユーザは
、タスク共通ルーチン2にブレークポイントをセットし
ているにも拘わらず、第2タスクT2及び第3タスクT
3の実行がブレークされないので、第2タスクT2及び
第3タスクT3は実行されなかったものとしてタスク群
のデバッグを進めることになる。従ってこの場合に、メ
モリの内容及びレジスタの内容が第2タスクT2あるい
は第3タスクT3により書換えられていれば、ユーザに
はその原因が判明せず困惑する事態になる。
A user using a debugging support device may set a breakpoint in the task common routine 2, but the second task T2 and the third task T
Since the execution of task No. 3 is not broken, debugging of the task group is proceeded on the assumption that the second task T2 and the third task T3 have not been executed. Therefore, in this case, if the contents of the memory and the contents of the register are rewritten by the second task T2 or the third task T3, the user will not be able to find out the cause and will be confused.

【0046】本発明は上述のような問題点を解消するた
めになされたものであり、マルチタスクOS上で動作す
る各タスクの実行を正確にブレークすることができるデ
バッグ支援装置の提供を目的とする。
The present invention has been made to solve the above-mentioned problems, and its purpose is to provide a debugging support device that can accurately break the execution of each task running on a multitasking OS. do.

【0047】[0047]

【課題を解決するための手段】本発明に係るデバッグ支
援装置は、マルチタスクオペレーティングシステムによ
り個々に独立して時分割で実行される複数のプログラム
をデバッグするためのデバッグ支援装置であって、プロ
グラムを構成する本来の命令を、その実行により予め登
録されている処理ルーチンへ制御を移すことによりブレ
ークポイントをセットする命令に書換えるソフトウェア
的な第1手段であるトラップ命令と、プログラムを構成
するメモリのアドレスが指定されることによりそのアド
レスにおいてプログラムの実行をブレークするハードウ
ェア的な第2手段と、第1手段によりプログラム中の命
令をトラップ命令に書換えると共にそのアドレスを第2
手段に指定することにより、プログラムの実行をブレー
クさせ、ブレーク解除後にトラップ命令に書換えられた
プログラムの本来の命令を実行させた後、第2手段によ
りプログラムの命令を再びブレークさせる制御手段とを
備えている。
[Means for Solving the Problems] A debugging support device according to the present invention is a debugging support device for debugging a plurality of programs that are executed individually and time-sharingly by a multitasking operating system. Trap instructions are the first software means of rewriting the original instructions that make up the program into instructions that set breakpoints by transferring control to a pre-registered processing routine when executed, and the memory that makes up the program. A second hardware means breaks the execution of the program at that address when the address is specified, and the first means rewrites the instruction in the program to a trap instruction and the
control means for causing a break in the execution of the program by specifying it in the second means, causing the original instructions of the program rewritten to the trap instructions to be executed after the break is released, and then causing the instructions in the program to be broken again by the second means; ing.

【0048】[0048]

【作用】本発明のデバッグ支援装置においては、ブレー
クポイントの設定のために第1手段であるトラップ命令
をセットすることによって書換えられたプログラム本来
の命令を実行する際に、ハードウェア的にプログラムの
実行をブレークする第2手段にその命令のアドレスが指
定される。これにより、トラップ命令によるブレークポ
イントのセットの際に書換えられた本来の命令を実行す
る時点で、タスクが切替わっている場合にも、タスクの
実行が正確にブレークされる。
[Operation] In the debugging support device of the present invention, when executing the original instructions of the program that have been rewritten by setting a trap instruction, which is the first means for setting a breakpoint, the program is The address of the instruction is specified to a second means of breaking execution. As a result, even if the task has been switched at the time when the original instruction that was rewritten when the breakpoint was set by the trap instruction is executed, the execution of the task is accurately broken.

【0049】[0049]

【実施例】以下、本発明の一実施例を図1乃至図12を
参照して説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to FIGS. 1 to 12.

【0050】図1は、本発明のデバッグ支援装置のソフ
トウェア構成を示すブロック図であり、基本的には従来
と同様の構成である。
FIG. 1 is a block diagram showing the software configuration of the debugging support device of the present invention, which is basically the same configuration as the conventional one.

【0051】図1において、参照符号1はタスク共通ル
ーチン2及び個々に独立した複数のプログラム (タス
クT1, T2, T3) からなる被デバッグプログ
ラムである。また、参照符号3はデバッグを行うための
システムプログラムであるデバッガ、4は複数のタスク
T1, T2, T3に処理時間を効率的に割当ててそ
れぞれを時分割実行するマルチタスクオペレーティング
システム (マルチタスクOS) である。
In FIG. 1, reference numeral 1 is a debugged program consisting of a task common routine 2 and a plurality of individually independent programs (tasks T1, T2, T3). Reference numeral 3 is a debugger which is a system program for debugging, and 4 is a multi-task operating system (multi-task OS) that efficiently allocates processing time to multiple tasks T1, T2, and T3 and executes each task in a time-sharing manner. ).

【0052】図2は本発明のデバッグ支援装置のハード
ウェア構成を示すブロック図である。
FIG. 2 is a block diagram showing the hardware configuration of the debug support device of the present invention.

【0053】図2において、参照符号5はデータを入力
するためのキーボード、6はデータを表示するためのデ
ィスプレイ(CRT) 、7はデータ及びプログラムを
格納しておくための外部記憶装置である磁気ディスク、
8は内部バス、9はこのデバッグ支援装置を制御するた
めのプログラム及びデータを格納するリードオンリメモ
リ(ROM) 、10は被デバッグプログラム等を格納
するランダムアクセスメモリ(RAM) 、11は中央
処理装置(CPU) である。
In FIG. 2, reference numeral 5 is a keyboard for inputting data, 6 is a display (CRT) for displaying data, and 7 is a magnetic storage device for storing data and programs. disk,
8 is an internal bus, 9 is a read-only memory (ROM) that stores programs and data for controlling this debug support device, 10 is a random access memory (RAM) that stores programs to be debugged, etc., and 11 is a central processing unit. (CPU).

【0054】CPU 11には、ハードウェア的にプロ
グラムの実行をブレークするブレーク手段であるハード
ウェアブレークポイントレジスタ12、ある命令が実行
された場合に予め登録されている処理ルーチンへ制御を
移すソフトウェアトラップ発生手段13、現在実行して
いるプログラムのアドレス(PC値) が格納されてい
るプログラムカウンタ(PC)14が備えられている。
[0054] The CPU 11 includes a hardware breakpoint register 12 which is a break means for breaking the execution of a program using hardware, and a software trap which transfers control to a pre-registered processing routine when a certain instruction is executed. It is provided with a generating means 13 and a program counter (PC) 14 in which the address (PC value) of the program currently being executed is stored.

【0055】なお、被デバッグプログラム1はRAM 
10に格納されており、デバッガ3、マルチタスクOS
4はROM9あるいはRAM10に格納されている。
Note that the program to be debugged 1 is a RAM
10, debugger 3, multitasking OS
4 is stored in ROM9 or RAM10.

【0056】なお、図1に示したタスク群がマルチタス
クOSによって時分割に実行される場合の各タスクの実
行状態は図3のタイミングチャートに示されている従来
例と同様である。
Note that when the task group shown in FIG. 1 is executed in a time-sharing manner by a multitasking OS, the execution state of each task is the same as in the conventional example shown in the timing chart of FIG.

【0057】図4は図1に示すタスクの実行を本発明の
デバッグ支援装置でブレークした場合のCPU 11に
よる処理内容を示すフローチャートである。
FIG. 4 is a flowchart showing the processing content of the CPU 11 when the execution of the task shown in FIG. 1 is broken by the debug support device of the present invention.

【0058】図5乃至図10はその各時点におけるタス
ク共通ルーチン2の状態を示す模式図である。
FIGS. 5 to 10 are schematic diagrams showing the state of the task common routine 2 at each point in time.

【0059】図11は、本発明のデバッグ支援装置にお
いてソフトウェアトラップ発生手段13によって起動さ
れる予め登録されている処理ルーチンの処理内容を示す
フローチャートである。
FIG. 11 is a flowchart showing the processing contents of a pre-registered processing routine activated by the software trap generating means 13 in the debugging support device of the present invention.

【0060】また、図12はハードウェアブレークポイ
ントレジスタ12にセットされた命令が実行された場合
に起動する予め登録されている処理ルーチンの処理内容
を示すフローチャートである。
FIG. 12 is a flowchart showing the processing contents of a pre-registered processing routine that is activated when an instruction set in the hardware breakpoint register 12 is executed.

【0061】なお、マルチタスクOS4及び各タスクは
前述の従来例と同様の動作をするものとする。
It is assumed that the multitasking OS 4 and each task operate in the same manner as in the conventional example described above.

【0062】図5はタスク共通ルーチン2の初期状態を
示す模式図である。
FIG. 5 is a schematic diagram showing the initial state of the task common routine 2.

【0063】なおここでは、タスク共通ルーチン2の”
MOV R1, R2”命令まで実行した時点でプログ
ラムの実行を一旦ブレークし、メモリ及びレジスタの内
容をチェックした後にデバッグを行うものとする。
[0063] Here, "" of task common routine 2 will be explained.
It is assumed that the execution of the program is temporarily broken when the "MOV R1, R2" instructions are executed, and the contents of the memory and registers are checked before debugging is performed.

【0064】まず、図5に示す如く、デバッガ3が出力
するコマンドによりブレークポイントBPが”MOV 
R1, R2”のアドレスにセットされる (ステップ
S31)。
First, as shown in FIG. 5, the breakpoint BP is set to "MOV" by the command output by the debugger 3.
R1, R2'' addresses (step S31).

【0065】ブレークポイントBPがセットされると、
デバッガ3は図6に示す如く、ブレークポイントBPが
セットされているアドレスの命令”MOV R1, R
2”をTRAP命令に書換える (ステップS32)。 このTRAP命令は、それが実行されるとソフトウェア
トラップを発生する命令である。
[0065] When breakpoint BP is set,
As shown in Figure 6, the debugger 3 executes the instruction "MOV R1, R" at the address where the breakpoint BP is set.
2'' is rewritten to a TRAP instruction (step S32). This TRAP instruction is an instruction that generates a software trap when executed.

【0066】次にデバッガ3が出力するコマンドにより
第1タスクT1が実行される (ステップS33)。こ
の際、タスク共通ルーチン2には上述の如く既にTRA
P命令がセットされているため、図7に示す如く、第1
タスクT1はタスク共通ルーチン2のTRAP命令を実
行した時点でトラップが発生してブレークされ、ソフト
ウェアトラップ処理ルーチンへ制御が移る (ステップ
S34)。
Next, the first task T1 is executed according to the command output by the debugger 3 (step S33). At this time, task common routine 2 already has TRA as described above.
Since the P command is set, the first
When the task T1 executes the TRAP instruction of the task common routine 2, a trap occurs and breaks, and control is transferred to the software trap processing routine (step S34).

【0067】図11のソフトウェアトラップ処理ルーチ
ンにおいて、ハードウェアブレークポイントHBP が
セットされている場合 (ステップS51)、そのハー
ドウェアブレークポイントHBP のアドレスにセット
されているTRAP命令によりトラップがかけられ、そ
のアドレスにセットされていたTRAP命令が一時的に
元の命令に戻されているので、TRAP命令がハードウ
ェアブレークポイントHBP が指しているアドレスへ
セットしなおされる (ステップS52)。先にステッ
プS32においてTRAP命令に書換えられた命令”M
OV R1, R2”を実行するために、TRAP命令
が”MOV R1, R2”命令と書換えられ (ステ
ップS53)、この後図8に示す如く、ハードウェアブ
レークポイントレジスタ12がそのアドレスの値へセッ
トされ (ステップS54)、”MOV R1, R2
”命令が実行される (ステップS55)。
In the software trap processing routine of FIG. 11, if the hardware breakpoint HBP is set (step S51), a trap is set by the TRAP instruction set at the address of the hardware breakpoint HBP, and the Since the TRAP instruction set at the address has been temporarily returned to the original instruction, the TRAP instruction is reset to the address pointed to by the hardware breakpoint HBP (step S52). The instruction “M” that was previously rewritten to the TRAP instruction in step S32
In order to execute "OV R1, R2", the TRAP instruction is rewritten as "MOV R1, R2" instruction (step S53), and then, as shown in FIG. 8, the hardware breakpoint register 12 is set to the value of that address. (Step S54), “MOV R1, R2
”The command is executed (step S55).

【0068】即ち、一時的にTRAP命令を外して、タ
スク共通ルーチン2の命令”MOV R1, R2”が
実行される。ここで、ステップS36においてタスクの
実行が切替わらない場合には、ハードウェアブレークポ
イントHBP がセットされているので、第1タスクT
1が”MOV R1, R2”命令を実行した後 (ス
テップS37)、ハードウェアブレークポイントトラッ
プがかかり (ステップS38)、図9に示す如く、ハ
ードウェアブレークポイントトラップ処理ルーチンが起
動される(ステップS39)。
That is, the TRAP instruction is temporarily removed and the instruction "MOV R1, R2" of the task common routine 2 is executed. Here, if the execution of the task is not switched in step S36, since the hardware breakpoint HBP is set, the first task T
1 executes the "MOV R1, R2" instruction (step S37), a hardware breakpoint trap is activated (step S38), and a hardware breakpoint trap processing routine is activated as shown in FIG. 9 (step S39). ).

【0069】図12のハードウェアブレークポイントト
ラップ処理ルーチンにおいて、ブレークがかけられたア
ドレスに再度TRAP命令がセットされる (ステップ
S61)。次に、図10に示す如く、ハードウェアブレ
ークポイントHBP のセットが解除され、デバッガへ
制御が移る。
In the hardware breakpoint trap processing routine of FIG. 12, a TRAP instruction is set again at the address where the break was applied (step S61). Next, as shown in FIG. 10, the hardware breakpoint HBP is unset and control is transferred to the debugger.

【0070】ここで、デバッガ3が出力するコマンドに
よりブレークポイントのアドレス、即ち現在のPC値の
アドレスからプログラムが再度実行される (ステップ
S40)。図10からも分かるように、第1タスクT1
の実行がブレークされてデバッガに制御が移った時点で
は、”MOVR1, R2”命令は既に実行された後で
あるため、そのままプログラムの実行が可能である。も
し図4のステップS36でタスクが切替わっていれば第
2タスクT2が実行され (ステップS41)、第2タ
スクT2がタスク共通ルーチン2を呼出す (ステップ
S42)。この時点ではタスク共通ルーチン2は図8に
示すような状態になっている。
Here, the program is executed again from the breakpoint address, ie, the address of the current PC value, by the command output by the debugger 3 (step S40). As can be seen from FIG. 10, the first task T1
When execution is broken and control is transferred to the debugger, the "MOVR1, R2" instructions have already been executed, so the program can be executed as is. If the task has been switched in step S36 of FIG. 4, the second task T2 is executed (step S41), and the second task T2 calls the task common routine 2 (step S42). At this point, the task common routine 2 is in a state as shown in FIG.

【0071】ハードウェアブレークポイントレジスタ1
2はタスクのコンテキストに含まれないため、タスクが
切替わってもそのまま残っている。従って、第2タスク
T2の実行はブレークされる (ステップS43)。ハ
ードウェアブレークポイント処理フローが実行された後
 (ステップS44)、デバッガに処理が戻る。そして
、メモリ及びレジスタの内容がチェックされた後、”M
OV R1, R2”命令の次のアドレスから再度プロ
グラムが実行される (ステップS45)。
Hardware breakpoint register 1
2 is not included in the context of the task, so it remains as is even if the task is switched. Therefore, the execution of the second task T2 is broken (step S43). After the hardware breakpoint processing flow is executed (step S44), the processing returns to the debugger. After checking the contents of memory and registers, “M”
The program is executed again from the address following the "OV R1, R2" instruction (step S45).

【0072】上述した実施例では、ブレークポイントを
各タスクの複数ヵ所にセットした場合でも同様にタスク
の実行をブレークすることができる。つまり、タスクの
実行のブレークはタスク中の命令をTRAP命令に書換
えることによって行われる。換言すれば、ブレークポイ
ントのアドレスの命令をTRAP命令に書換える処理の
みで、任意の数のブレークポイントを同時にセット可能
になる。 また、TRAP命令に書換えることによって壊れた本来
の命令は、ブレークポイントレジスタをその命令のアド
レスにセットしてから再実行される。これにより、一つ
のブレークポイントレジスタの使用により複数のブレー
クポイントを同時にセットでき、且つタスクが切替わっ
てもそのタスクの実行を正確にブレークすることが可能
になる。
In the embodiment described above, even if breakpoints are set at multiple locations in each task, execution of the task can be broken in the same way. That is, a break in the execution of a task is performed by rewriting the instruction in the task to a TRAP instruction. In other words, an arbitrary number of breakpoints can be set simultaneously by simply rewriting the instruction at the breakpoint address to a TRAP instruction. Furthermore, the original instruction that was destroyed by being rewritten to a TRAP instruction is re-executed after setting the breakpoint register to the address of the instruction. This makes it possible to set multiple breakpoints simultaneously by using one breakpoint register, and to accurately break the execution of the task even if the task is switched.

【0073】[0073]

【発明の効果】以上に説明した如く本発明によれば、ブ
レークポイントをセットすることによって書換えられて
破壊された命令を再実行した後、再びブレークポイント
をセットし直す処理を行う際に、タスクコンテキストに
依存せずにハードウェア的にプログラムの実行をブレー
クする手段を使用することにより、破壊された命令を実
行した後にデバッグ支援装置へ制御を戻すようにしたの
で、マルチタスクOS上で動作している各タスクの実行
を正確にブレークすることが可能なデバッグ支援装置を
得ることができる。
As explained above, according to the present invention, after re-executing an instruction that has been rewritten and destroyed by setting a breakpoint, the task By using a means to break program execution in hardware without depending on the context, control is returned to the debug support device after executing the destroyed instruction, so it can run on a multitasking OS. It is possible to obtain a debugging support device that can accurately break the execution of each task being executed.

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

【図1】マルチタスクオペレーティングシステム上で動
作するタスク群をデバッグする従来及び本発明のデバッ
グ支援装置のソフトウェア構成を示す模式的ブロック図
である。
FIG. 1 is a schematic block diagram showing the software configuration of a conventional debugging support device and the present invention for debugging a group of tasks running on a multitasking operating system.

【図2】本発明のデバッグ支援装置のハードウェア構成
を示すブロック図である。
FIG. 2 is a block diagram showing the hardware configuration of the debug support device of the present invention.

【図3】図1に示したタスク群がマルチタスクOSによ
り時分割実行される場合の各タスクの実行状態を示すタ
イミングチャートである。
FIG. 3 is a timing chart showing the execution state of each task when the task group shown in FIG. 1 is time-divisionally executed by a multitasking OS.

【図4】図1に示すタスクの実行を本発明のデバッグ支
援装置でブレークした場合の処理内容を示すフローチャ
ートである。
FIG. 4 is a flowchart showing the processing contents when the execution of the task shown in FIG. 1 is broken by the debugging support device of the present invention.

【図5】図4のフローチャートの初期状態におけるタス
ク共通ルーチンの状態を示す模式図である。
FIG. 5 is a schematic diagram showing a state of a task common routine in an initial state of the flowchart of FIG. 4;

【図6】図4のフローチャートのある時点におけるタス
ク共通ルーチンの状態を示す模式図である。
FIG. 6 is a schematic diagram showing the state of a task common routine at a certain point in the flowchart of FIG. 4;

【図7】図4のフローチャートのある時点におけるタス
ク共通ルーチンの状態を示す模式図である。
7 is a schematic diagram showing the state of a task common routine at a certain point in the flowchart of FIG. 4; FIG.

【図8】図4のフローチャートのある時点におけるタス
ク共通ルーチンの状態を示す模式図である。
FIG. 8 is a schematic diagram showing the state of a task common routine at a certain point in the flowchart of FIG. 4;

【図9】図4のフローチャートのある時点におけるタス
ク共通ルーチンの状態を示す模式図である。
9 is a schematic diagram showing the state of a task common routine at a certain point in the flowchart of FIG. 4; FIG.

【図10】図4のフローチャートのある時点におけるタ
スク共通ルーチンの状態を示す模式図である。
10 is a schematic diagram showing the state of a task common routine at a certain point in the flowchart of FIG. 4; FIG.

【図11】本発明のデバッグ支援装置においてソフトウ
ェアトラップ発生手段によって起動される予め登録され
ている処理ルーチンの処理内容を示すフローチャートで
ある。
FIG. 11 is a flowchart showing the processing contents of a pre-registered processing routine activated by software trap generating means in the debugging support device of the present invention.

【図12】ハードウェアブレークポイントレジスタにセ
ットされた命令が実行された場合に起動する予め登録さ
れている処理ルーチンの処理内容を示すフローチャート
である。
FIG. 12 is a flowchart showing the processing contents of a pre-registered processing routine that is activated when an instruction set in a hardware breakpoint register is executed.

【図13】従来のデバッグ支援装置のソフトウェア構成
を示す模式図である。
FIG. 13 is a schematic diagram showing the software configuration of a conventional debug support device.

【図14】従来のデバッグ支援装置のハードウェア構成
を示すブロック図である。
FIG. 14 is a block diagram showing the hardware configuration of a conventional debug support device.

【図15】被デバッグプログラムにブレークポイントを
セットして実行し、そのブレークポイントでプログラム
の実行が一旦ブレークし、その時点のメモリ及びレジス
タの内容がチェックされた後、ブレークしたアドレスか
ら再びプログラムの実行が開始される場合の処理内容を
示すフローチャートである。
[Figure 15] Set a breakpoint in the program to be debugged and execute it, the program execution will temporarily break at that breakpoint, the contents of memory and registers at that point will be checked, and then the program will start again from the address where the break occurred. 12 is a flowchart showing the processing contents when execution is started.

【図16】図15のフローチャートの初期状態における
被デバッグプログラムの状態を示す模式図である。
FIG. 16 is a schematic diagram showing the state of the debugged program in the initial state of the flowchart in FIG. 15;

【図17】図15のフローチャートのある時点における
被デバッグプログラムの状態を示す模式図である。
FIG. 17 is a schematic diagram showing the state of the debugged program at a certain point in the flowchart of FIG. 15;

【図18】図15のフローチャートのある時点における
被デバッグプログラムの状態を示す模式図である。
FIG. 18 is a schematic diagram showing the state of the debugged program at a certain point in the flowchart of FIG. 15;

【図19】図15のフローチャートのある時点における
被デバッグプログラムの状態を示す模式図である。
FIG. 19 is a schematic diagram showing the state of the debugged program at a certain point in the flowchart of FIG. 15;

【図20】図15のフローチャートのある時点における
被デバッグプログラムの状態を示す模式図である。
FIG. 20 is a schematic diagram showing the state of the debugged program at a certain point in the flowchart of FIG. 15;

【図21】図15のフローチャートのある時点における
被デバッグプログラムの状態を示す模式図である。
FIG. 21 is a schematic diagram showing the state of the debugged program at a certain point in the flowchart of FIG. 15;

【図22】図1に示すタスクの実行を従来のデバッグ支
援装置でブレークする場合の処理内容を示すフローチャ
ートである。
FIG. 22 is a flowchart showing processing details when the conventional debugging support device breaks execution of the task shown in FIG. 1;

【図23】図22のフローチャートの初期状態における
タスク共通ルーチンの状態を示す模式図である。
FIG. 23 is a schematic diagram showing the state of the task common routine in the initial state of the flowchart of FIG. 22;

【図24】図22のフローチャートのある時点における
タスク共通ルーチンの状態を示す模式図である。
24 is a schematic diagram showing the state of a task common routine at a certain point in the flowchart of FIG. 22; FIG.

【図25】図22のフローチャートのある時点における
タスク共通ルーチンの状態を示す模式図である。
25 is a schematic diagram showing the state of the task common routine at a certain point in the flowchart of FIG. 22; FIG.

【図26】図22のフローチャートのある時点における
タスク共通ルーチンの状態を示す模式図である。
26 is a schematic diagram showing the state of the task common routine at a certain point in the flowchart of FIG. 22; FIG.

【図27】図22のフローチャートのある時点における
タスク共通ルーチンの状態を示す模式図である。
FIG. 27 is a schematic diagram showing the state of the task common routine at a certain point in the flowchart of FIG. 22;

【図28】図22のフローチャートのある時点における
タスク共通ルーチンの状態を示す模式図である。
FIG. 28 is a schematic diagram showing the state of the task common routine at a certain point in the flowchart of FIG. 22;

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

1    被デバッグプログラム 2    タスク共通ルーチン 3    デバッガ 4    マルチタスクオペレーティングシステム (
マルチタスクOS) 12    ハードウェアブレークポイントレジスタ1
3    ソフトウェアトラップ発生手段T1, T2
, T3    タスク
1 Program to be debugged 2 Task common routine 3 Debugger 4 Multitasking operating system (
Multitasking OS) 12 Hardware breakpoint register 1
3 Software trap generation means T1, T2
, T3 task

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  マルチタスクオペレーティングシステ
ムにより個々に独立して時分割で実行される複数のプロ
グラムをデバッグするためのデバッグ支援装置において
、前記プログラムを構成する命令を、その実行により予
め登録されている処理ルーチンへ制御を移す命令に書換
えるソフトウェア的な第1手段と、前記プログラムを構
成するメモリのアドレスが指定されることによりそのア
ドレスにおいてプログラムの実行をブレークする第2手
段と、前記第1手段により前記プログラム中の命令を前
記命令に書換えると共にそのアドレスを前記第2手段に
指定することにより、前記プログラムの実行をブレーク
させ、ブレーク解除後に前記命令に書換えられたプログ
ラムの本来の命令を実行させた後、前記第2手段により
プログラムの命令を再びブレークさせる制御手段とを備
えたことを特徴とするデバッグ支援装置。
1. A debugging support device for debugging a plurality of programs that are executed independently and time-sharingly by a multitasking operating system, wherein instructions constituting the program are registered in advance by their execution. a first software means for rewriting an instruction to transfer control to a processing routine; a second means for breaking the execution of the program at the specified address by specifying a memory address constituting the program; and the first means. By rewriting the instruction in the program to the instruction and specifying its address to the second means, the execution of the program is broken, and after the break is released, the original instruction of the program rewritten to the instruction is executed. and control means for causing the second means to break the instructions of the program again.
JP3090165A 1991-04-22 1991-04-22 Debug back-up device Pending JPH04321139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3090165A JPH04321139A (en) 1991-04-22 1991-04-22 Debug back-up device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3090165A JPH04321139A (en) 1991-04-22 1991-04-22 Debug back-up device

Publications (1)

Publication Number Publication Date
JPH04321139A true JPH04321139A (en) 1992-11-11

Family

ID=13990873

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3090165A Pending JPH04321139A (en) 1991-04-22 1991-04-22 Debug back-up device

Country Status (1)

Country Link
JP (1) JPH04321139A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01177139A (en) * 1988-01-05 1989-07-13 Nec Corp Instruction substituting system
JPH02291031A (en) * 1989-04-28 1990-11-30 Nec Ic Microcomput Syst Ltd Microcomputer development supporting device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01177139A (en) * 1988-01-05 1989-07-13 Nec Corp Instruction substituting system
JPH02291031A (en) * 1989-04-28 1990-11-30 Nec Ic Microcomput Syst Ltd Microcomputer development supporting device

Similar Documents

Publication Publication Date Title
US5630049A (en) Method and apparatus for testing software on a computer network
US4819234A (en) Operating system debugger
JP2001134466A (en) Debug device and debug method and program recording medium
JPH04321139A (en) Debug back-up device
JPS5835648A (en) Program execution controlling system
JP2513142B2 (en) Program simulator device
JP2674873B2 (en) Step execution operation method of program development support device
JP2788353B2 (en) Task trace method
JPH02284236A (en) Program debugging processor
JPH06214828A (en) Interactive debug controller
JPH08185341A (en) Cpu simulator
JPH0772874B2 (en) Interrupt receiving device
JP3075359B2 (en) Program debugging start processing method
JPS6214240A (en) Program inspecting system
JPH02277146A (en) Program debugging system
JPH01147641A (en) Debug device
JPH01232446A (en) Program development assisting device for computer
JPH04324525A (en) Program transplantation supporting device
JPH05250208A (en) Program reexecution processing system
JP2002055845A (en) Method and device of parallel processing type for general-purpose debug for multitask system and storage medium with multitask system parallel processing type general debugging program stored therein
JPH02244232A (en) Information processor
JPH11191072A (en) Debug break processing method and debug processor
JPS62282327A (en) Information processor
JPH05233364A (en) Break point setting system
JPH04369751A (en) Memory collapse detection system