JP2000339189A - Method for detecting illegal memory access debugging device and storage medium - Google Patents

Method for detecting illegal memory access debugging device and storage medium

Info

Publication number
JP2000339189A
JP2000339189A JP11149438A JP14943899A JP2000339189A JP 2000339189 A JP2000339189 A JP 2000339189A JP 11149438 A JP11149438 A JP 11149438A JP 14943899 A JP14943899 A JP 14943899A JP 2000339189 A JP2000339189 A JP 2000339189A
Authority
JP
Japan
Prior art keywords
guard area
task
guard
area
switching
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
JP11149438A
Other languages
Japanese (ja)
Inventor
Yoshinori Kaneko
善則 金子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Microcomputer Technologies Ltd
Original Assignee
NEC Microcomputer Technologies 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 NEC Microcomputer Technologies Ltd filed Critical NEC Microcomputer Technologies Ltd
Priority to JP11149438A priority Critical patent/JP2000339189A/en
Publication of JP2000339189A publication Critical patent/JP2000339189A/en
Pending legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To easily and efficiently detect any illegal access by setting a guard area for each task, and dynamically switching the guard area according to the switching of the task. SOLUTION: This ICE(in-circular emulator) is provided with a guard area chart 101 which stores a guard area for each task, a holding means 12 which holds the guard area of a task which is being executed, a detecting means 13 which detects that access to the guard area is performed by the task which is being executed, a guard area switching program 112 which sets a guard area after the switching of the task in the holding means 12 when the task is switched, and a guard area registration program 111 which registers the guard area to be set in the guard area chart 101.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は情報処理装置に関
し、特に不正なメモリアクセスを検出する方法、デバッ
グ装置および記録媒体に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to an information processing apparatus, and more particularly, to a method for detecting an illegal memory access, a debugging apparatus, and a recording medium.

【0002】[0002]

【従来の技術】コンピュータの組み込み分野では、アプ
リケーション規模の増大とその複雑化により、アプリケ
ーション開発にリアルタイムOS(以下RTOSとい
う)を用いることが多くなってきている。RTOSを用
いることによって設計やコーディングが容易になる反
面、システム全体の動作を見通すことが非常に難解とな
っており、デバッグの段階ではプログラムバグの検出を
困難にしている。高性能の情報処理装置では仮想記憶機
構を備えているが、この分野では仮想記憶機構を備えて
いないことが多い。このため、あるタスクの実行でプロ
グラムバグにより不正にメモリへのアクセスが実行され
た結果、他のタスクにまで影響を与えてしまった場合、
原因となる不正メモリアクセスを究明するのに多くの時
間と労力を必要とするケースが増えている。
2. Description of the Related Art In the field of embedding a computer, a real-time OS (hereinafter, referred to as an RTOS) is often used for application development due to an increase in application scale and its complexity. The use of the RTOS facilitates design and coding, but makes it very difficult to see the operation of the entire system, and makes it difficult to detect program bugs at the debugging stage. Although a high-performance information processing apparatus is provided with a virtual storage mechanism, it is often not provided with a virtual storage mechanism in this field. For this reason, if a program bug causes illegal access to memory during the execution of a certain task, which may affect other tasks,
Increasingly, it takes a lot of time and effort to determine the cause of the illegal memory access.

【0003】このため、プログラムバグの検出を容易に
してデバッグ作業を効率化し開発コストを押さえること
が重要になっている。従来は、不正なメモリアクセス領
域をガードエリアとして設定しプログラム実行中に不正
なメモリアクセスを検出できる仕組みをもったデバッグ
装置としてインサーキットエミュレータ(以下ICEと
いう)装置を利用していた。しかしながら、従来の技術
では次のような問題があった。
For this reason, it is important to easily detect program bugs, to make debugging work more efficient, and to reduce development costs. Conventionally, an in-circuit emulator (hereinafter referred to as ICE) has been used as a debugging device having a mechanism for setting an illegal memory access area as a guard area and detecting an illegal memory access during program execution. However, the conventional technique has the following problems.

【0004】[0004]

【発明が解決しようとする課題】RTOSのようなオペ
レーティングシステムでは実行状態のタスク毎にガード
エリアが異なるという状況が多く発生するが、従来の技
術では不正なガードエリアの設定をタスク毎に独立して
行えなかったり、タスクの切り換えに伴ってガードエリ
アを変更することができなかったため、容易で効率のよ
いデバッグを実行できないという欠点があった。
In an operating system such as an RTOS, there are many situations in which a guard area is different for each task in an execution state, but in the prior art, illegal guard area setting is made independent for each task. And the guard area could not be changed in accordance with the task switching, so that easy and efficient debugging could not be performed.

【0005】本発明の目的は、タスク毎にガードエリア
を設定し、かつ、タスクの切り換えに伴って動的にガー
ドエリアを切り換えられるようにして、容易で効率のよ
い不正なメモリアクセスを検出するデバッグ方法、デバ
ッグ装置および記録媒体を提供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to set a guard area for each task and dynamically switch the guard area in accordance with the task switching, thereby detecting an easy, efficient and unauthorized memory access. A debugging method, a debugging device, and a recording medium are provided.

【0006】[0006]

【課題を解決するための手段】本発明の第1の不正なメ
モリアクセスを検出する方法は、タスクが切り換えられ
た際に、アクセスが禁止されたメモリ領域であるガード
エリアをタスク毎に記憶しているガードエリア表から切
り換え後のタスクのガードエリアを読み出してメモリア
クセスのアドレスと前記読み出されたガードエリアとを
比較する手順を有する。
According to the first method of the present invention, when a task is switched, a guard area, which is a memory area where access is prohibited, is stored for each task when the task is switched. And reading the guard area of the task after switching from the guard area table, and comparing the address of the memory access with the read guard area.

【0007】本発明の第2の不正なメモリアクセスを検
出する方法は、使用者の入力要求があった際に、アクセ
スが禁止されたメモリ領域であるガードエリアをガード
エリア表に登録して記憶しておき、タスクが切り換えら
れた際に、前記ガードエリアをタスク毎に複数個記憶し
ているガードエリア表から切り換え後のタスクの複数個
のガードエリアを読み出してメモリアクセスのアドレス
と前記読み出された複数個のガードエリアとを比較する
手順を有する。
According to a second method for detecting an unauthorized memory access of the present invention, a guard area, which is a memory area for which access is prohibited, is registered and stored in a guard area table when an input request is made by a user. In addition, when a task is switched, a plurality of guard areas of the switched task are read from a guard area table storing a plurality of guard areas for each task, and a memory access address and the read are read. And comparing the plurality of guard areas.

【0008】本発明の第1のデバッグ装置は、アクセス
が禁止されたメモリ領域であるガードエリアをタスク毎
に登録して記憶するガードエリア表記憶手段と、実行中
のタスクのガードエリアを前記ガードエリア表記憶手段
から読み出して保持する保持手段と、実行中のタスクが
前記保持手段に保持されているガードエリアをアクセス
したことを検出する検出手段とを有する。
The first debugging device of the present invention comprises a guard area table storing means for registering and storing, for each task, a guard area which is a memory area for which access is prohibited, and a guard area for storing the guard area of the task being executed. The storage unit includes a holding unit that reads from the area table storage unit and holds the same, and a detection unit that detects that the task being executed has accessed the guard area held by the holding unit.

【0009】本発明の第2のデバッグ装置は、アクセス
が禁止されたメモリ領域であるガードエリアをタスク毎
に登録して記憶するガードエリア表記憶手段と、実行中
のタスクのガードエリアを前記ガードエリア表記憶手段
から読み出して保持する保持手段と、実行中のタスクが
前記保持手段に保持されているガードエリアをアクセス
したことを検出する検出手段と、タスクが切り換えられ
た際に、前記保持手段に切り換え後のガードエリアを設
定してガードエリアを切り換える手順とを有する。
A second debugging apparatus according to the present invention comprises: a guard area table storing means for registering and storing a guard area, which is a memory area whose access is prohibited, for each task; and storing the guard area of the task being executed in the guard area. Holding means for reading and holding from the area table storage means; detecting means for detecting that a task being executed has accessed a guard area held in the holding means; and And setting the guard area after the switching and switching the guard area.

【0010】本発明の第3のデバッグ装置は、アクセス
が禁止されたメモリ領域であるガードエリアをタスク毎
に複数個登録して記憶するガードエリア表記憶手段と、
実行中のタスクのガードエリアを前記ガードエリア表記
憶手段から読み出して複数個保持する保持手段と、実行
中のタスクが前記保持手段に保持されている複数個のガ
ードエリアの少なくとも1つをアクセスしたことを検出
する検出手段と、タスクが切り換えられた際に、前記保
持手段に切り換え後のガードエリアを設定してガードエ
リアを切り換える手順とを有する。
[0010] A third debugging device of the present invention is a guard area table storing means for registering and storing a plurality of guard areas, which are memory areas for which access is prohibited, for each task.
Holding means for reading a guard area of a task being executed from the guard area table storage means and holding a plurality of guard areas; and executing the task accessed at least one of the guard areas held by the holding means. And a procedure for setting the guard area after switching to the holding means and switching the guard area when the task is switched.

【0011】本発明の第4のデバッグ装置は、前記第
1、第2または第3のデバッグ装置に追加して、プログ
ラムやデータを記憶する共有メモリを有する。
A fourth debugging device of the present invention has a shared memory for storing programs and data in addition to the first, second or third debugging device.

【0012】本発明の記録媒体は、使用者の要求があっ
た際にアクセスが禁止されたメモリ領域であるガードエ
リアをガードエリア表に登録して記憶する手順と、タス
クが切り換えられた際に前記ガードエリア表から切り換
え後のタスクのガードエリアを読み出しメモリアクセス
のアドレスと前記読み出されたガードエリアとを比較し
て不正なメモリアクセスを検出する手順とをデバッグ装
置に実行させるプログラムを記録する。
According to the recording medium of the present invention, a procedure for registering and storing a guard area, which is a memory area for which access is prohibited at the request of a user, in a guard area table and a procedure for switching between tasks are provided. A program for causing the debug device to execute a procedure of reading the guard area of the task after switching from the guard area table and comparing the address of the memory access with the read guard area to detect an illegal memory access is recorded. .

【0013】[0013]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して詳細に説明する。図1は本発明の第1
の実施の形態のブロック図である。デバッグ装置の形態
としてはインサーキットエミュレータ(ICE)装置を
示しており、ガードエリアはタスク毎に2個備えた形態
を示している。ICE装置1は、ICE装置1を制御す
る制御部14と、ICEメモリ10と、実行中のタスク
のガードエリアをガードエリア表101から読み出して
保持する保持手段12と、メモリアクセスのアドレスが
保持手段12にセットされたガードエリア内であるか否
かを検出する検出手段13と、入力手段15と、表示手
段16とを備える。図1ではICE装置1に入力手段1
5と、表示手段16を備えているが、これらはICE装
置1内にある必要はなく、インターフェースにより外部
の装置と接続し、その外部の装置で入力および表示を行
ってもよい。
Next, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 shows the first embodiment of the present invention.
FIG. 3 is a block diagram of the embodiment. As a form of the debugging apparatus, an in-circuit emulator (ICE) apparatus is shown, and a form in which two guard areas are provided for each task is shown. The ICE device 1 includes a control unit 14 for controlling the ICE device 1, an ICE memory 10, a holding unit 12 for reading and holding a guard area of the task being executed from the guard area table 101, and a memory access address holding unit. A detection unit 13 for detecting whether the area is within the guard area set at 12, an input unit 15, and a display unit 16 are provided. In FIG. 1, the input means 1 is connected to the ICE device 1.
5 and display means 16, which need not be in the ICE device 1, but may be connected to an external device via an interface and input and display may be performed by the external device.

【0014】ICE制御プログラム11は、ICE装置
1上で実行されるプログラムであり、ガードエリア登録
プログラム111や、ガードエリア切換プログラム11
2も含んでいる。記録媒体2はこれらのプログラムを格
納した媒体であり、格納されたプログラムは必要に応じ
てICE装置1にロードされる。メモリ30は被デバッ
グ装置3のメモリである。被デバッグ装置3で実行され
るプログラム40は複数のタスクを含んでいる。図1で
は、分かり易くするためにタスク41〜タスク43のみ
を例示しているが、一般的には数十個以上のタスクを含
んでいることが多い。タスクディスパッチャ等で実現さ
れるタスク切換手段44はタスク41〜タスク43の中
からどのタスクを次に実行するかを制御し切り換える。
The ICE control program 11 is a program executed on the ICE device 1 and includes a guard area registration program 111 and a guard area switching program 11
2 is also included. The recording medium 2 is a medium that stores these programs, and the stored programs are loaded into the ICE device 1 as needed. The memory 30 is a memory of the device 3 to be debugged. The program 40 executed by the debugged device 3 includes a plurality of tasks. FIG. 1 illustrates only the tasks 41 to 43 for the sake of simplicity, but generally includes several tens or more tasks in general. The task switching means 44 realized by a task dispatcher or the like controls and switches which task to execute next from the tasks 41 to 43.

【0015】図2はガードエリア表101を説明する図
である。図1では、ガードエリア表101はICEメモ
リ10内に設けられているが、ICEメモリ10とは別
の記憶手段に設けてもよい。特に、デバッグ装置以外の
情報処理装置でガードエリア表を設ける場合は、ファー
ムウェアが管理している記憶手段に設けた方が制御が容
易になることも考えられる。
FIG. 2 is a diagram for explaining the guard area table 101. In FIG. 1, the guard area table 101 is provided in the ICE memory 10, but may be provided in a storage unit different from the ICE memory 10. In particular, when the guard area table is provided in an information processing device other than the debug device, it may be easier to control the guard area table if the guard area table is provided in storage means managed by the firmware.

【0016】ガードエリア表101はタスク毎にガード
エリアAとガードエリアBの2個のエントリをセットと
して、タスクの数だけ登録される。本実施の形態では、
タスク数は3つであるので、合計で6個のエントリから
なる。タスク数が4以上の場合はガードエリアAとガー
ドエリアBのエントリをセットにしてタスク数分だけガ
ードエリア表101に追加すればよい。図1ではタスク
毎に2つのガードエリアを備える場合を示しているが、
タスク毎に3つ以上のガードエリアを備える場合は、ガ
ードエリアC、ガードエリアDとタスク毎に追加してい
けばよく、保持手段12のレジスタや、検出手段13の
比較回路および関連する回路は必要に応じて追加したり
変更したりすればよい。
In the guard area table 101, two entries, a guard area A and a guard area B, are set for each task and registered as many as the number of tasks. In the present embodiment,
Since the number of tasks is three, the task consists of a total of six entries. When the number of tasks is four or more, the entries of the guard area A and the guard area B may be set and added to the guard area table 101 by the number of tasks. Although FIG. 1 shows a case where two guard areas are provided for each task,
When three or more guard areas are provided for each task, the guard area C and the guard area D may be added for each task, and the register of the holding means 12, the comparison circuit and the related circuits of the detection means 13 may be added. It can be added or changed as needed.

【0017】上記のガードエリア表101の各エントリ
は図3に示すように、ガードエリアが有効か否かを示す
Vビットと、ガードエリアの下限アドレス(以下LLA
ともいう)と、上限アドレス(以下ULAともいう)と
からなる。初期状態のVビットは「0」としておく。な
お、ガードエリアの指定領域のサイズをあらかじめ決め
ておくことにより下限アドレスと上限アドレスの双方を
備えずに、1つのアドレス情報だけでガードエリアを表
現することもできる。たとえば、ガードエリアのサイズ
を1Mバイト単位として定義すればアドレスの下位20
ビットを除いた上位アドレス部分をガードエリア単位に
1つだけ使用すればよい。この場合、回路やガードエリ
ア表を小さくする利点を生むが、同時に、ガードエリア
の設定の制限が大きくなるという欠点ももつ。
As shown in FIG. 3, each entry of the guard area table 101 has a V bit indicating whether the guard area is valid and a lower limit address of the guard area (hereinafter referred to as LLA).
) And an upper limit address (hereinafter, also referred to as ULA). The V bit in the initial state is set to “0”. By determining the size of the designated area of the guard area in advance, the guard area can be represented by only one piece of address information without having both the lower limit address and the upper limit address. For example, if the size of the guard area is defined in units of 1 Mbyte, the lower 20
Only one upper address portion excluding the bits needs to be used for each guard area. In this case, there is an advantage that the circuit and the guard area table are made smaller, but at the same time, there is a disadvantage that the setting of the guard area is more restricted.

【0018】図4は図1の保持手段12と検出手段13
を詳細に示したブロック図である。保持手段12は実行
中のタスクのガードエリアAを保持するレジスタ121
と、ガードエリアBを保持するレジスタ122とからな
る。レジスタ121はガードエリアAのVビット、LL
A、ULAを各々保持するV1部分、LLA1部分、お
よびULA1部分とを含んでおり、同様にレジスタ12
2はガードエリアBのVビット、LLA、ULAを各々
保持するV2部分、LLA2部分、ULA2部分を含ん
でいる。
FIG. 4 shows the holding means 12 and the detecting means 13 of FIG.
FIG. 3 is a block diagram showing in detail. The holding unit 12 holds a register 121 for holding the guard area A of the task being executed.
And a register 122 for holding the guard area B. Register 121 has V bit, LL of guard area A
A, ULA1, and VLA1 which respectively hold ULA, and ULA1.
Reference numeral 2 includes a V2 portion, an LLA2 portion, and an ULA2 portion that respectively hold the V bit, LLA, and ULA of the guard area B.

【0019】被デバッグ装置3とICE装置1とは、図
示していないが被デバッグ装置3のプロセッサチップの
入出力ピンをインターフェースとして接続されている。
プログラム40は、被デバッグ装置3上で実行される
が、ICE装置1と接続してデバッグを実行する場合に
は、ICE装置1上で実行されるICE制御プログラム
11の制御下で実行される。従って、プログラム40が
実行するメモリアクセスはメモリアドレス線X2により
ICE装置1から被デバッグ装置3へ送られるので、メ
モリアドレス線X2とレジスタ121、レジスタ122
を比較回路で比較することにより、不正なメモリアクセ
スを検出できる。
Although not shown, the debugged device 3 and the ICE device 1 are connected to each other using an input / output pin of a processor chip of the debugged device 3 as an interface.
The program 40 is executed on the device to be debugged 3. However, when the program 40 is connected to the ICE device 1 to execute debugging, the program 40 is executed under the control of the ICE control program 11 executed on the ICE device 1. Therefore, the memory access executed by the program 40 is sent from the ICE device 1 to the device to be debugged 3 via the memory address line X2, so that the memory address line X2 and the registers 121 and 122
Are compared by the comparison circuit, an illegal memory access can be detected.

【0020】検出手段13において、比較回路131
は、レジスタ121のLLAの値よりメモリアドレス線
X2の値が大きいとき「1」を出力し、比較回路132
は、メモリアドレス線X2の値よりレジスタ121のU
LAの値が大きいとき「1」を出力する。AND回路1
35では、比較回路131の出力と比較回路132の出
力との論理積を出力しメモリアドレスがガードエリアA
であることを検出する。ただし、レジスタ121のVビ
ットが「0」の場合は検出は無効となる。同様に比較回
路133、比較回路134とAND回路136はメモリ
アクセスのアドレスがガードエリアB内であるか否かを
検出するための回路である。OR回路137はガードエ
リアAとガードエリアBの検出結果との論理和を出力し
実行中のタスクがガードエリアをアクセスしたことを検
出信号線X4にて制御部14に通知する。メモリアドレ
ス線X2はメモリアドレス以外のデータも転送するバス
であってもよい。制御部14はメモリアドレス線X2上
に有効なメモリアドレスが出力されているときのみ、検
出信号線X4を参照するようにしている。
In the detecting means 13, the comparison circuit 131
Outputs “1” when the value of the memory address line X2 is larger than the value of LLA of the register 121,
Is based on the value of the memory address line X2,
When the value of LA is large, "1" is output. AND circuit 1
At 35, the logical product of the output of the comparison circuit 131 and the output of the comparison circuit 132 is output, and the memory address is set to the guard area A.
Is detected. However, when the V bit of the register 121 is “0”, the detection becomes invalid. Similarly, the comparison circuit 133, the comparison circuit 134, and the AND circuit 136 are circuits for detecting whether or not the address of the memory access is within the guard area B. The OR circuit 137 outputs the logical sum of the detection results of the guard area A and the guard area B, and notifies the control unit 14 via the detection signal line X4 that the task being executed has accessed the guard area. The memory address line X2 may be a bus for transferring data other than the memory address. The control unit 14 refers to the detection signal line X4 only when a valid memory address is output on the memory address line X2.

【0021】次に図面を参照して、本発明の実施の形態
の動作を説明する。ICE装置1を使用して被デバッグ
装置3のデバッグを行う使用者は、プログラム40の実
行以前に、入力手段15から各タスクのガードエリアの
設定を行う。使用者によりガードエリアの登録が要求さ
れると、ICE制御プログラム11はガードエリア登録
プログラム111を呼び出し、ガードエリア登録プログ
ラム111により入力されたガードエリア情報がガード
エリア表101内に図3に示すエントリ形式で登録され
る。一度登録されたガードエリア表101の内容を保存
しておけば、繰り返しデバッグする際には保存しておい
たガードエリア表をロードすることにより、再登録を省
略して効率的にデバッグを行うことができる。あるい
は、ガードエリア表をメモリとは別の、たとえばフラッ
シュメモリのような不揮発性の記憶素子に設けておけ
ば、さらに使いやすくなる。
Next, the operation of the embodiment of the present invention will be described with reference to the drawings. A user who debugs the debug target device 3 using the ICE device 1 sets a guard area for each task from the input unit 15 before executing the program 40. When the user requests the guard area registration, the ICE control program 11 calls the guard area registration program 111, and the guard area information input by the guard area registration program 111 is stored in the guard area table 101 as an entry shown in FIG. Registered in format. Once the contents of the guard area table 101 registered once are saved, when the debugging is repeatedly performed, the saved guard area table 101 is loaded, so that re-registration can be omitted and efficient debugging can be performed. Can be. Alternatively, if the guard area table is provided in a nonvolatile storage element other than the memory, for example, a flash memory, it becomes easier to use.

【0022】タスク41に対して第1のガードエリアと
して下限アドレス=LLA41−1、上限アドレス=U
LA41−1が、第2のガードエリアとして下限アドレ
ス=LLA41−2、上限アドレス=ULA41−2が
入力された場合について、図5を用いてガードエリア登
録プログラム111の動作を説明していく。ガードエリ
アAは入力されるので、ステップS101からS102
に進み、ステップS102の実行により図2のガードエ
リア表101のエントリ1011に対してVビット=
「1」、LLA=LLA41−1、ULA=ULA41
−1が書き込まれる。続いてガードエリアBも入力され
るので、図5のステップS104からステップS105
へと進みステップS105の実行により図2のガードエ
リア表101のエントリ1012に対してVビット=
「1」、LLA=LLA41−2、ULA=ULA41
−2が書き込まれる。上記はガードエリアA、ガードエ
リアBともに入力があった場合であるが、ガードエリア
の入力がない場合はVビット=「0」としてガードエリ
ア表101内のエントリに書き込まれる。
As the first guard area for the task 41, the lower limit address = LLA41-1 and the upper limit address = U
The operation of the guard area registration program 111 will be described with reference to FIG. 5 in the case where the LA 41-1 has input the lower limit address = LA 41-2 and the upper limit address = ULA 41-2 as the second guard area. Since the guard area A is input, steps S101 to S102
Then, the execution of step S102 causes the V bit = for the entry 1011 of the guard area table 101 in FIG.
"1", LLA = LLA41-1, ULA = ULA41
-1 is written. Subsequently, since the guard area B is also input, steps S104 to S105 in FIG.
The execution proceeds to step S105, and the V bit for the entry 1012 of the guard area table 101 in FIG.
“1”, LLA = LLA41-2, ULA = ULA41
-2 is written. The above is the case where both the guard area A and the guard area B have been input. If there is no guard area input, the V bit is set to “0” and written to the entry in the guard area table 101.

【0023】使用者は以上の入力操作を行った後に、プ
ログラム40をスタートさせる。プログラム40はタス
ク切換手段44によってタスクを切り換えながら処理を
実行していく。ICE制御プログラム11は、タスク切
換手段44がタスクを切り換えようとしたことを検出す
ると、ガードエリア切換プログラム112を呼び出す。
タスク切り換えの検出方法は、対象となる命令セットに
依存し、ICE制御プログラム11で検出できる場合
や、プログラム40から命令によりICE制御プログラ
ム11へ通知する場合がある。
The user starts the program 40 after performing the above input operation. The program 40 executes processing while switching tasks by the task switching means 44. The ICE control program 11 calls the guard area switching program 112 when detecting that the task switching means 44 has switched the task.
The method of detecting task switching depends on the target instruction set, and may be detected by the ICE control program 11 or notified to the ICE control program 11 by an instruction from the program 40.

【0024】次に、タスクをタスク41に切り換えて起
動する場合について、ガードエリア切換プログラム11
2の動作を図6のフローチャートを用いて説明する。
Next, a case in which the task is switched to the task 41 and activated will be described.
Operation 2 will be described with reference to the flowchart of FIG.

【0025】ステップS201でガードエリア表101
のエントリ1011からタスク41のガードエリアAを
読み出す。Vビット=「1」と書き込まれているのでス
テップS204、S205、S206と順次実行し、図
4のレジスタ121のV1部分に「1」を、LLA1部
分にLLA41−1を、ULA1部分にULA41−1
をセットする。続いてステップS211、S212、S
214、S215、S216を順次実行する。ガードエ
リア表101のエントリ1012からタスク41のガー
ドエリアBを読み出し、図4のレジスタ122のV2部
分に「1」を、LLA2部分にLLA41−2を、UL
A2部分にULA41−2をセットする。
In step S201, the guard area table 101
The guard area A of the task 41 is read from the entry 1011 of FIG. Since the V bit = “1” is written, steps S204, S205, and S206 are sequentially executed, and “1” is set in the V1 portion of the register 121 of FIG. 4, LLA41-1 is set in the LLA1 portion, and ULA4−1 is set in the ULA1 portion. 1
Is set. Subsequently, steps S211, S212, S
Steps 214, S215, and S216 are sequentially performed. The guard area B of the task 41 is read from the entry 1012 of the guard area table 101, “1” is written in the V2 part of the register 122 in FIG. 4, LLA41-2 is written in the LLA2 part, and ULA is written in the LLA2 part.
ULA41-2 is set in the A2 portion.

【0026】このようにしてガードエリア切換プログラ
ム112により保持手段12にガードエリアがセットさ
れると、検出手段13では、メモリアドレス線X2上の
アドレスとガードエリアAおよびガードエリアBとを比
較し、ガードエリアAまたはガードエリアBをアクセス
した場合は検出信号を検出信号線X4に出力する。検出
信号が通知されると制御部14では、現在メモリアドレ
ス線X2上のアドレスが有効である場合は、ガードエリ
アへのアクセスが実行されたと判断してICE制御プロ
グラム11へ通知する。この通知を受けるとICE制御
プログラム11は、実行中の処理を一旦停止させる。こ
の後は使用者が有効な情報を取得するための使用者の操
作環境に移行したり、あるいは停止状態の情報について
あらかじめ決めておいた情報をICEメモリ10内に記
録した後さらに処理を継続したりすることになる。使用
者の操作環境に移行した場合は、使用者がICE装置1
に備えられたデバッグ手段を用いて所望の情報を採取す
ることができる。検出後の動作については使用者がデバ
ッグの目的に合わせて選択して効率のよいデバッグを行
うことができる。
When the guard area is set in the holding means 12 by the guard area switching program 112 in this way, the detecting means 13 compares the address on the memory address line X2 with the guard area A and the guard area B. When the guard area A or the guard area B is accessed, a detection signal is output to the detection signal line X4. When the detection signal is notified, if the address on the memory address line X2 is currently valid, the control unit 14 determines that the access to the guard area has been executed, and notifies the ICE control program 11. Upon receiving this notification, the ICE control program 11 temporarily stops the processing being executed. After that, the operation shifts to the user's operation environment for the user to obtain valid information, or the predetermined information on the information of the stopped state is recorded in the ICE memory 10 and the processing is further continued. Or will be. When the operation environment has been shifted to the user's operation environment,
The desired information can be collected by using the debugging means provided in the program. The operation after detection can be selected by the user in accordance with the purpose of debugging, and efficient debugging can be performed.

【0027】[0027]

【発明の効果】以上に説明したように本発明は、タスク
毎に設定されたガードエリアをRTOSのタスク切り換
えに伴って動的に変更して設定する手段を備えているの
で、従来困難であったタスク毎の不正なメモリアクセス
を容易に検出できるという効果がある。また、ガードエ
リアを2以上備えることにより、より複雑なデバッグを
容易に実行することができる。また、検出手段および保
持手段はタスク単位のガードエリア数だけ備えればいい
ので、タスク数が増加してもハードウェア量はそのまま
でよい。
As described above, according to the present invention, there is provided a means for dynamically changing and setting the guard area set for each task in accordance with the task switching of the RTOS. There is an effect that an illegal memory access for each task can be easily detected. By providing two or more guard areas, more complicated debugging can be easily performed. Further, since the detection means and the holding means only need to be provided for the number of guard areas in task units, the hardware amount can be kept as it is even if the number of tasks increases.

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

【図1】本発明の実施の形態のブロック図である。FIG. 1 is a block diagram of an embodiment of the present invention.

【図2】本発明の実施の形態のガードエリア表101を
表す図である。
FIG. 2 is a diagram showing a guard area table 101 according to the embodiment of the present invention.

【図3】本発明の実施の形態のガードエリアのエントリ
形式を表す図である。
FIG. 3 is a diagram illustrating an entry format of a guard area according to the embodiment of the present invention.

【図4】本発明の実施の形態の保持手段12と検出手段
13のブロック図である。
FIG. 4 is a block diagram of a holding unit 12 and a detecting unit 13 according to the embodiment of the present invention.

【図5】本発明の実施の形態のガードエリア登録プログ
ラム111のフローチャートである。
FIG. 5 is a flowchart of a guard area registration program 111 according to the embodiment of the present invention.

【図6】本発明の実施の形態のガードエリア切換プログ
ラム112のフローチャートである。
FIG. 6 is a flowchart of a guard area switching program 112 according to the embodiment of the present invention.

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

1 ICE装置 2 記録媒体 3 被デバッグ装置 10 ICEメモリ 101 ガードエリア表 11 ICE制御プログラム 111 ガードエリア登録プログラム 112 ガードエリア切換プログラム 12 保持手段 121 レジスタ 122 レジスタ 13 検出手段 131 比較回路 132 比較回路 133 比較回路 134 比較回路 14 制御部 15 入力手段 16 表示手段 30 メモリ 40 プログラム DESCRIPTION OF SYMBOLS 1 ICE apparatus 2 Recording medium 3 Device to be debugged 10 ICE memory 101 Guard area table 11 ICE control program 111 Guard area registration program 112 Guard area switching program 12 Holding means 121 Register 122 Register 13 Detection means 131 Comparison circuit 132 Comparison circuit 133 Comparison circuit 134 comparison circuit 14 control unit 15 input means 16 display means 30 memory 40 program

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 複数のタスクを切り換えながら実行する
処理装置に接続したデバッグ装置における不正なメモリ
アクセスを検出する方法において、 タスクが切り換えられた際に、アクセスが禁止されたメ
モリ領域であるガードエリアをタスク毎に記憶している
ガードエリア表から切り換え後のタスクのガードエリア
を読み出してメモリアクセスのアドレスと前記読み出さ
れたガードエリアとを比較して不正なメモリアクセスを
検出する方法。
In a method for detecting an illegal memory access in a debugging device connected to a processing device that executes while switching a plurality of tasks, when a task is switched, a guard area which is a memory area whose access is prohibited when the task is switched. A method of reading a guard area of a task after switching from a guard area table storing for each task, and comparing an address of a memory access with the read guard area to detect an illegal memory access.
【請求項2】 複数のタスクを切り換えながら実行する
処理装置に接続したデバッグ装置における不正なメモリ
アクセスを検出する方法において、 使用者の入力要求があった際に、アクセスが禁止された
メモリ領域であるガードエリアをガードエリア表に登録
して記憶しておき、タスクが切り換えられた際に、前記
ガードエリアをタスク毎に複数個記憶しているガードエ
リア表から切り換え後のタスクの複数個のガードエリア
を読み出してメモリアクセスのアドレスと前記読み出さ
れた複数個のガードエリアとを比較して不正なメモリア
クセスを検出する方法。
2. A method for detecting an illegal memory access in a debugging device connected to a processing device which executes a plurality of tasks while switching between the tasks, comprising the steps of: A certain guard area is registered and stored in a guard area table, and when a task is switched, a plurality of guard areas of the task after switching from a guard area table storing a plurality of guard areas for each task are stored. A method for detecting an illegal memory access by reading an area and comparing a memory access address with the plurality of read guard areas.
【請求項3】 複数のタスクを切り換えながら実行する
処理装置に接続して使用するデバッグ装置において、 アクセスが禁止されたメモリ領域であるガードエリアを
タスク毎に登録して記憶するガードエリア表記憶手段
と、実行中のタスクのガードエリアを前記ガードエリア
表記憶手段から読み出して保持する保持手段と、実行中
のタスクが前記保持手段に保持されているガードエリア
をアクセスしたことを検出する検出手段とを備えたデバ
ッグ装置。
3. A guard area table storing means for registering and storing, for each task, a guard area, which is a memory area for which access is prohibited, in a debugging apparatus which is used by being connected to a processing apparatus which executes while switching a plurality of tasks. Holding means for reading and holding the guard area of the task being executed from the guard area table storage means, and detecting means for detecting that the task being executed has accessed the guard area held in the holding means. Debugging device with
【請求項4】 複数のタスクを切り換えながら実行する
処理装置に接続して使用するデバッグ装置において、 アクセスが禁止されたメモリ領域であるガードエリアを
タスク毎に登録して記憶するガードエリア表記憶手段
と、実行中のタスクのガードエリアを前記ガードエリア
表記憶手段から読み出して保持する保持手段と、実行中
のタスクが前記保持手段に保持されているガードエリア
をアクセスしたことを検出する検出手段とを備え、 タスクが切り換えられた際に、前記保持手段に切り換え
後のガードエリアを設定してガードエリアを切り換える
ことを特徴としたデバッグ装置。
4. A guard area table storage means for registering and storing, for each task, a guard area, which is a memory area for which access is prohibited, in a debugging apparatus connected to a processing apparatus which executes a plurality of tasks while switching the tasks. Holding means for reading and holding the guard area of the task being executed from the guard area table storage means, and detecting means for detecting that the task being executed has accessed the guard area held in the holding means. A debugging apparatus characterized in that when a task is switched, a guard area after switching is set in the holding means and the guard area is switched.
【請求項5】 複数のタスクを切り換えながら実行する
処理装置に接続して使用するデバッグ装置において、 アクセスが禁止されたメモリ領域であるガードエリアを
タスク毎に複数個登録して記憶するガードエリア表記憶
手段と、実行中のタスクのガードエリアを前記ガードエ
リア表記憶手段から読み出して複数個保持する保持手段
と、実行中のタスクが前記保持手段に保持されている複
数個のガードエリアの少なくとも1つをアクセスしたこ
とを検出する検出手段とを備え、 タスクが切り換えられた際に、前記保持手段に切り換え
後のガードエリアを設定してガードエリアを切り換える
ことを特徴としたデバッグ装置。
5. A guard area table for registering and storing a plurality of guard areas, each of which is a memory area for which access is prohibited, for each task in a debugging apparatus connected to a processing apparatus for executing a plurality of tasks while switching the tasks. Storage means, holding means for reading a guard area of a task being executed from the guard area table storage means and holding a plurality of guard areas, and at least one of a plurality of guard areas in which the task being executed is held in the holding means Detecting means for detecting access to one of the devices, wherein when the task is switched, the guard area after switching is set in the holding means and the guard area is switched.
【請求項6】請求項3、請求項4または請求項5のデバ
ッグ装置において、さらにプログラムやデータを記憶す
る共有メモリを備え、前記ガードエリア表記憶手段を前
記共有メモリ内に設けたことを特徴としたデバッグ装
置。
6. The debugging device according to claim 3, further comprising a shared memory for storing programs and data, wherein said guard area table storage means is provided in said shared memory. Debugging device.
【請求項7】 使用者の入力要求があった際に、アクセ
スが禁止されたメモリ領域であるガードエリアをガード
エリア表に登録して記憶する手順と、タスクが切り換え
られた際に、前記ガードエリアをタスク毎に複数個記憶
しているガードエリア表から切り換え後のタスクの複数
個のガードエリアを読み出してメモリアクセスのアドレ
スと前記読み出された複数個のガードエリアとを比較す
る手順とをデバッグ装置に実行させるプログラムを記録
した記録媒体。
7. A procedure for registering and storing a guard area, which is a memory area for which access is prohibited, in a guard area table when an input request is made by a user, and a procedure for storing the guard area when a task is switched. Reading a plurality of guard areas of the switched task from a guard area table storing a plurality of areas for each task, and comparing a memory access address with the read plurality of guard areas. A recording medium on which a program to be executed by a debugging device is recorded.
JP11149438A 1999-05-28 1999-05-28 Method for detecting illegal memory access debugging device and storage medium Pending JP2000339189A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11149438A JP2000339189A (en) 1999-05-28 1999-05-28 Method for detecting illegal memory access debugging device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11149438A JP2000339189A (en) 1999-05-28 1999-05-28 Method for detecting illegal memory access debugging device and storage medium

Publications (1)

Publication Number Publication Date
JP2000339189A true JP2000339189A (en) 2000-12-08

Family

ID=15475128

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11149438A Pending JP2000339189A (en) 1999-05-28 1999-05-28 Method for detecting illegal memory access debugging device and storage medium

Country Status (1)

Country Link
JP (1) JP2000339189A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005309613A (en) * 2004-04-19 2005-11-04 Ueda Japan Radio Co Ltd Illicit access detection device, method, and program
JP2007287103A (en) * 2006-04-20 2007-11-01 Nec Electronics Corp Microcomputer and memory access control method
JP2008071250A (en) * 2006-09-15 2008-03-27 Ricoh Co Ltd Access control device
JP2011180840A (en) * 2010-03-01 2011-09-15 Toshiba Corp Processor, multiprocessor system, and method of detecting illegal memory access
JP2011222055A (en) * 2011-08-12 2011-11-04 Renesas Electronics Corp Microcomputer and control method for memory access
US9098628B2 (en) 2012-07-26 2015-08-04 International Business Machines Corporation Memory system with multiple block write control to control state data

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005309613A (en) * 2004-04-19 2005-11-04 Ueda Japan Radio Co Ltd Illicit access detection device, method, and program
JP4611659B2 (en) * 2004-04-19 2011-01-12 上田日本無線株式会社 Unauthorized access detection device, unauthorized access detection method, program
JP2007287103A (en) * 2006-04-20 2007-11-01 Nec Electronics Corp Microcomputer and memory access control method
US8312238B2 (en) 2006-04-20 2012-11-13 Renesas Electronics Corporation Microcomputer and method for controlling memory access
US9003148B2 (en) 2006-04-20 2015-04-07 Renesas Electronics Corporation Microcomputer and method for controlling memory access
US9262341B2 (en) 2006-04-20 2016-02-16 Renesas Electronics Corporation Microcomputer and method for controlling memory access
US9904631B2 (en) 2006-04-20 2018-02-27 Renesas Electronics Corporation Microcomputer and method for controlling memory access
JP2008071250A (en) * 2006-09-15 2008-03-27 Ricoh Co Ltd Access control device
JP2011180840A (en) * 2010-03-01 2011-09-15 Toshiba Corp Processor, multiprocessor system, and method of detecting illegal memory access
JP2011222055A (en) * 2011-08-12 2011-11-04 Renesas Electronics Corp Microcomputer and control method for memory access
US9098628B2 (en) 2012-07-26 2015-08-04 International Business Machines Corporation Memory system with multiple block write control to control state data

Similar Documents

Publication Publication Date Title
US20180322083A1 (en) System-on-chip, mobile terminal, and method for operating the system-on-chip
US20090083736A1 (en) Virtualized computer, monitoring method of the virtualized computer and a computer readable medium thereof
KR970012145A (en) How to work with the data processor, how to run its debugging operations, and how to modify its breakpoint values
JPH0430053B2 (en)
US20070180323A1 (en) Interactive debug system for multiprocessor array
TW584800B (en) Method, computer and peripheral/expansion bus bridge for booting up with debug system
WO2007002940A2 (en) Debugging using virtual watchpoints
JPH0696008A (en) Information processor
GB2216306A (en) Load and synchronize computer architecture and process
US5003468A (en) Guest machine execution control system for virutal machine system
JP2000339189A (en) Method for detecting illegal memory access debugging device and storage medium
US7617417B2 (en) Method for reading input/output port data
US6105101A (en) 16 bit bios interrupt calls under 32 bit protected mode application
US6141635A (en) Method of diagnosing faults in an emulated computer system via a heterogeneous diagnostic program
JPH1165898A (en) Maintenance system for electronic computer
JP3130798B2 (en) Bus transfer device
JPH11143789A (en) Bus tracing device
JP2002132743A (en) Device and method for monitoring memory access and recording medium recording program for memory access monitor
JP2665173B2 (en) Processor trap circuit
JPS5834856B2 (en) Kiokuseigiyosouchi
JP2654105B2 (en) Microprocessor
JPS61204755A (en) Controlling system for direct memory access
JPS6270947A (en) Control system for debug interruption
JPH1039958A (en) Reset device
JP2002251299A (en) Program tracing device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20020108