JP3503504B2 - Debug processing system, computer and debug processing method - Google Patents
Debug processing system, computer and debug processing methodInfo
- Publication number
- JP3503504B2 JP3503504B2 JP35238498A JP35238498A JP3503504B2 JP 3503504 B2 JP3503504 B2 JP 3503504B2 JP 35238498 A JP35238498 A JP 35238498A JP 35238498 A JP35238498 A JP 35238498A JP 3503504 B2 JP3503504 B2 JP 3503504B2
- Authority
- JP
- Japan
- Prior art keywords
- memory space
- memory
- space
- program
- computer
- 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
【0001】[0001]
【発明の属する技術分野】本発明は、コンピュータ(電
子計算機)上で動作するプログラムのデバッグ技術に係
わり、特に、1台のコンピュータ上でそれぞれ異なるメ
モリ空間で複数のオペレーティングシステム(OS)を
連動させて動作させるマルチOS環境で動作するOSを
含むプログラム(以下、「マルチメモリ空間プログラ
ム」と記載)のデバッグに好適なデバッグ処理システム
と計算機およびデバッグ処理方法に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debugging technique for a program operating on a computer (electronic computer), and in particular, a plurality of operating systems (OS) operating in different memory spaces on a single computer. program including an OS that operates in a multi-OS environment for operating Te (hereinafter, described as "multi-memory space program") suitable for debugging a debug processing system
The present invention relates to computer and debug processing method and.
【0002】[0002]
【従来の技術】電子計算機のプログラムを開発するにあ
たり、正しく動作するプログラムを開発するために、プ
ログラムの動作の順序や動作の不具合を調査するために
デバッグ装置、すなわちデバッガが用いられる。このデ
バッガには、プログラムの命令において、指定した命令
を実行停止させる機能や、メモリ内部の値の読み書きを
行なう機能などが提供されている。これにより、プログ
ラムが正確に動作するか否かを調べることが可能であ
る。尚、このようなデバッガに関する技術は、Jonathan
B. Rosenberg著、吉川邦夫訳「How Debuggers Work デ
バッガの理論と実装」(1998年、株式会社アスキー発行)
に記載されている。2. Description of the Related Art In developing a program for an electronic computer, a debug device, that is, a debugger is used to investigate the order of operation of a program and the malfunction of the program in order to develop a program that operates correctly. This debugger is provided with a function of stopping execution of a specified instruction in a program instruction, a function of reading and writing a value in a memory, and the like. This makes it possible to check whether or not the program operates correctly. Note that the technology related to such a debugger is Jonathan.
B. Rosenberg, Kunio Yoshikawa, “How Debuggers Work Debugger Theory and Implementation” (1998, published by ASCII Corporation)
It is described in.
【0003】電子計算機環境において、1つの電子計算
機で複数のOSを連動させて動作させるマルチOS環境
を構成するシステムが提供されている。このようなマル
チOSシステムにおけるプログラムのデバッグ支援技術
に関係するものとして、例えば、特開平10−1339
10号公報に記載の技術がある。これは応用プログラム
(アプリケーションプログラム)の開発環境となる汎用
OSと応用プログラムの実行環境となるリアルタイムO
Sが同一電子計算機上で動作するマルチOSシステムに
おいて、デバッグ対象の応用プログラムと非デバッグ対
象の応用プログラムとの連携動作を実現するものであ
る。ここで、連携動作とは、複数のプログラムが通信し
あって、1つの処理を実行する動作である。In an electronic computer environment, there is provided a system that constitutes a multi-OS environment in which a plurality of OSs are operated in cooperation with one electronic computer. A technique related to a program debugging support technique in such a multi-OS system is disclosed in, for example, Japanese Patent Laid-Open No. 10-1339.
There is a technique described in JP-A-10. This is a general-purpose OS that is the development environment for application programs (application programs) and real-time OS that is the execution environment for application programs.
In the multi-OS system in which S operates on the same electronic computer, the cooperative operation of the application program to be debugged and the application program to be debugged is realized. Here, the cooperative operation is an operation in which a plurality of programs communicate with each other to execute one process.
【0004】特開平10−133910号公報で用いら
れるデバッガは、マルチOSシステムが提供するエミュ
レータ装置を利用する。しかし、エミュレータ装置を持
たず、各OSが独立したメモリ空間を持ち、割り込みの
処理手順によりOSの実行をスケジューリングし、複数
のOSを1台の電子計算機で同時に動作させることを特
徴とする、マルチメモリ空間を持つマルチOSシステム
に対するデバッガは提供されていない。このようなマル
チメモリ空間を持つマルチOSシステムの場合、従来の
デバッグ技術では、各OSに対応したデバッガをそれぞ
れ開発して動作させることになる。The debugger used in Japanese Patent Laid-Open No. 10-133910 utilizes an emulator device provided by the multi-OS system. However, it is characterized by having no emulator device, each OS having an independent memory space, scheduling the execution of the OS according to an interrupt processing procedure, and operating a plurality of OSs simultaneously by one computer. No debugger is provided for a multi-OS system having a memory space. In the case of a multi-OS system having such a multi-memory space, the conventional debugging technique develops and operates a debugger corresponding to each OS.
【0005】すなわち、ある複数のプログラムがマルチ
メモリ空間で動作している場合、各メモリ空間で動作す
るOSを含む各プログラム(マルチメモリ空間プログラ
ム)をデバッグするには、各メモリ空間毎にデバッガを
起動させなければならない。また各マルチメモリ空間プ
ログラムが互いに連携して動作する場合、各メモリ空間
のプログラム毎にデバッグをしているようでは、その連
携動作に関するデバッグが不十分となる。That is, when a plurality of programs are operating in a multi-memory space, a debugger for each memory space is used to debug each program (multi-memory space program) including the OS operating in each memory space. Must be activated. Further, when each multi-memory space program operates in cooperation with each other, if debugging is performed for each program in each memory space, debugging related to the cooperation operation will be insufficient.
【0006】[0006]
【発明が解決しようとする課題】解決しようとする問題
点は、従来の技術では、マルチメモリ空間上で同時に動
作するプログラム(マルチメモリ空間プログラム)を一
つのデバッガでデバッグすることができない点と、マル
チメモリ空間のプログラムの連携動作に対応してデバッ
グすることができない点である。The problem to be solved is that, in the conventional technique, a program (multi-memory space program) operating simultaneously in the multi-memory space cannot be debugged by one debugger. The point is that it is not possible to debug corresponding to the cooperative operation of programs in the multi-memory space.
【0007】本発明の目的は、これら従来技術の課題を
解決し、1台のコンピュータ上でそれぞれ異なるメモリ
空間で複数のオペレーティングシステム(OS)を連動
させて動作させるマルチOS環境で動作するマルチメモ
リ空間プログラムのデバッグを効率的に行なうことを可
能とするデバッグ処理システムと計算機およびデバッグ
処理方法を提供することである。An object of the present invention is to solve these problems of the prior art and to operate in a multi-OS environment in which a plurality of operating systems (OS) operate in conjunction with each other in different memory spaces on one computer. Lud bagged system and the computer and debugging to enable to perform debug space program efficiently
It is to provide a processing method.
【0008】[0008]
【課題を解決するための手段】上記目的を達成するた
め、本発明のデバッグ処理システムと計算機およびデバ
ッグ処理方法は、デバッグ時に使用する例外ハンドラ
を、マルチメモリ空間で動作するプログラム内で共用す
る。これにより、例外がどのメモリ空間で起こっても捕
獲可能である。そして、デバッグ装置を実装する空間と
別の空間で例外を捕獲した場合、共用の例外ハンドラ
は、デバッグ装置を実装する空間へ空間切り替えを行っ
た後、再びブレークポイント例外を起こす。これによ
り、別空間の例外もデバッグ装置を実装する空間で捕獲
することが可能となる。To achieve the above object, according to an aspect of, debug processing system and the computer and de Bas <br/> Tsu grayed processing method of the present invention, the exception handler to be used for debugging, multi-memory Shared in a program that operates in space. This allows the exception to be caught in any memory space. When an exception is caught in a space different from the space where the debug device is installed, the shared exception handler performs space switching to the space where the debug device is installed and then causes a breakpoint exception again. This makes it possible to catch an exception in another space in the space where the debug device is mounted.
【0009】例外ハンドラを共用して管理するために
は、各メモリ空間のプログラムが操作可能な共通メモリ
領域を設け、この共通メモリ領域に、各メモリ空間の設
定情報や割り込みテーブルを設定し、この割り込みテー
ブルに、共用の例外ハンドラ(共用ハンドラ)の情報を
登録する。そして、共用ハンドラは、メモリ空間の設定
情報を利用して、各メモリ空間からデバッガの動作する
メモリ空間への切り替えを行なう。デバッグ用に利用さ
れる例外ハンドラは特権レベルに関わらず有効であり、
各プログラムの特権レベルに関わらず、捕獲可能であ
る。In order to share and manage the exception handler, a common memory area in which a program in each memory space can be operated is provided, and setting information and an interrupt table of each memory space are set in this common memory area. Register the information of the shared exception handler (shared handler) in the interrupt table. Then, the shared handler switches from each memory space to the memory space in which the debugger operates by using the setting information of the memory space. The exception handler used for debugging is valid regardless of privilege level,
It can be captured regardless of the privilege level of each program.
【0010】また、共通メモリ領域に、ブレークポイン
ト管理のためのテーブルなど、各メモリ空間のプログラ
ムをデバッグするのに必要な情報を設定し、あるメモリ
空間で動作するデバッガがこの共通メモリ領域のデバッ
グ情報を操作することで、各メモリ空間のプログラムを
デバッグすることが可能となる。In addition, information necessary for debugging a program in each memory space, such as a table for managing breakpoints, is set in the common memory area, and a debugger operating in a certain memory space can debug this common memory area. By manipulating the information, it becomes possible to debug the program in each memory space.
【0011】また、マルチOS環境を構成する場合、汎
用OSを一つのOSとして存在させるとき、汎用OSの
豊富なデバッガを有効利用することにより、デバッガの
開発工数の低下を図ることができる。そして、このデバ
ッガのみを利用して、他のメモリ空間のOSを含むプロ
グラムのデバッグを行なうことにより、デバッグ環境を
共用でき、利便性が高まる。例えば、デバッガが動作す
るメモリ空間と異なるメモリ空間で動作するOS開発に
有効利用できる。Further, in the case of configuring a multi-OS environment, when a general-purpose OS exists as one OS, it is possible to reduce the development man-hours of the debugger by effectively using the abundant debuggers of the general-purpose OS. Then, by using only this debugger to debug the program including the OS in the other memory space, the debug environment can be shared and the convenience is enhanced. For example, it can be effectively used for OS development that operates in a memory space different from the memory space in which the debugger operates.
【0012】[0012]
【発明の実施の形態】以下、本発明の実施の形態を、図
面により詳細に説明する。図1は、本発明に係わるデバ
ッグシステムの構成例を示すブロック図である。本図1
において、100はデバッグを行なうプログラムが動作
しているデバッグ対象計算機、110はデバッグ対象計
算機100上のプログラムをデバッグするデバッガが起
動するデバッガ計算機である。BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described in detail below with reference to the drawings. FIG. 1 is a block diagram showing a configuration example of a debugging system according to the present invention. This Figure 1
In FIG. 1, 100 is a debug target computer in which a program to be debugged is operating, and 110 is a debugger computer activated by a debugger for debugging the program on the debug target computer 100.
【0013】デバッグ対象計算機100は、プロセッサ
(図中、「CPU」と記載)101、メモリ102、バ
ス107、通信装置108により構成されている。メモ
リ102においては、複数のプログラムを互いに影響な
く動作させるために、それぞれのプログラムが専用のメ
モリ領域を確保する。つまり、一方のプログラムが他方
のプログラムのメモリ領域を利用できないようにメモリ
領域を確保する。The debug target computer 100 is composed of a processor (described as "CPU" in the figure) 101, a memory 102, a bus 107, and a communication device 108. In the memory 102, in order to operate a plurality of programs without affecting each other, each program reserves a dedicated memory area. That is, a memory area is secured so that one program cannot use the memory area of the other program.
【0014】本例では、以上の性質をもつ2つのメモリ
空間を確保している。このメモリの領域を、それぞれ、
第1メモリ空間104、第2メモリ空間105とする。
また、互いのプログラムが協調して動作することを考慮
して、共通メモリ領域103を確保する。この共通メモ
リ領域103には、その詳細については後述するが、割
り込みテーブルや各メモリ空間の空間設定情報、およ
び、ブレークポイント情報などを確保する。In this example, two memory spaces having the above properties are secured. Each area of this memory
The first memory space 104 and the second memory space 105 are used.
Further, the common memory area 103 is secured in consideration of the mutual operation of the programs. In the common memory area 103, an interrupt table, space setting information of each memory space, break point information, and the like are secured, the details of which will be described later.
【0015】デバッガ計算機110には、キーボード等
の入力装置112、CRT(Cathode Ray Tube)等の出
力装置113が接続されている。このデバッガ計算機1
10に設けられたデバッガ(図中、「第1メモリ空間を
対象とするデバッガ」と記載)111は、デバッグ対象
計算機100における第1メモリ空間104のプログラ
ムをデバッグするデバッガである。デバッガ111の操
作は入力装置112により行ない、デバッグの結果は出
力装置113により出力される。An input device 112 such as a keyboard and an output device 113 such as a CRT (Cathode Ray Tube) are connected to the debugger computer 110. This debugger computer 1
A debugger (described as “a debugger targeting the first memory space” in the figure) 111 provided in the unit 10 is a debugger that debugs a program in the first memory space 104 in the debug target computer 100. The operation of the debugger 111 is performed by the input device 112, and the debug result is output by the output device 113.
【0016】デバッグ計算機110は、デバッグ対象計
算機100とケーブル109で接続され、デバッガ11
1のデバッグするための命令を、通信装置114からケ
ーブル109を通り、デバッグ対象計算機100の通信
装置108、バス107を介して、第1メモリ空間10
4にマッピングされているデバッグ支援プログラム10
6に渡す。The debug computer 110 is connected to the debug target computer 100 by a cable 109, and the debugger 11
The instruction for debugging No. 1 from the communication device 114 passes through the cable 109, the communication device 108 of the debug target computer 100, and the bus 107, and the first memory space 10
Debugging support program 10 mapped to 4
Pass to 6.
【0017】デバッグ支援プログラム106は、デバッ
ガ111からの命令を受け、デバッグ対象プログラムに
対して、デバッグ命令を設定する。デバッガ111は、
ブレークポイントの制御、シングルステップ実行の制御
のほか、仮想アドレス指定のメモリ参照、書き込みか
ら、物理メモリ参照、書き込みを可能とする。The debug support program 106 receives an instruction from the debugger 111 and sets a debug instruction for the program to be debugged. The debugger 111
In addition to control of breakpoints and control of single step execution, it is possible to reference and write to physical memory from memory reference and writing with virtual addressing.
【0018】このように、デバッガ111は、物理メモ
リ参照、書き込みが可能なので、共通メモリ領域103
にある空間情報(次の図2に示す空間情報テーブル21
0)を利用してページングの状況を解析し、第2メモリ
空間105のプログラムの仮想アドレスから、物理メモ
リのマッピングの状況が参照、書き込み可能となる。こ
れにより、第2メモリ空間105のプログラムのブレー
クポイント命令のコードを、第1メモリ空間104で動
作するデバッガ111から設定可能となる。As described above, since the debugger 111 can refer to and write to the physical memory, the common memory area 103
Space information (the space information table 21 shown in FIG.
0) is used to analyze the paging situation, and the mapping situation of the physical memory can be referred to and written from the virtual address of the program in the second memory space 105. As a result, the code of the breakpoint instruction of the program in the second memory space 105 can be set by the debugger 111 operating in the first memory space 104.
【0019】図2は、図1における共通メモリ領域の構
成例を示す説明図である。共通メモリ領域103には、
空間情報テーブル210と、割り込みテーブル220、
ブレークポイントテーブル230、レジスタテーブル2
40、トレーステーブル250、動作空間フラグ(図
中、「動作空間(第1,第2)」と記載)260、デバ
ッグモードフラグ(図中、「デバッグモード(On or Of
f)」と記載)270、シングルステップ実行停止モー
ドフラグ(図中、「シングルステップ実行停止モード
(On or Off)」と記載)280、トレース実行モード
フラグ(図中、「トレース実行モード(On or Off)」
と記載)281、および、シングルステップ実行判定フ
ラグ(図中、「シングルステップ実行判定(On or Of
f)」と記載)282が設けられている。FIG. 2 is an explanatory diagram showing a configuration example of the common memory area in FIG. In the common memory area 103,
Spatial information table 210, interrupt table 220,
Breakpoint table 230, register table 2
40, trace table 250, operation space flag (indicated as “operation space (first and second)” in the figure) 260, debug mode flag (in the figure, “debug mode (On or Of
f) ”), single-step execution stop mode flag (described as“ single-step execution stop mode (On or Off) ”in the figure) 280, trace execution mode flag (“ trace execution mode (On or Off) in the figure ”) Off) "
281 and a single step execution determination flag (in the figure, "single step execution determination (On or Of
f) ”) 282 is provided.
【0020】共通メモリ領域103は、図1の第1メモ
リ空間104のプログラムからも、第2メモリ空間10
5のプログラムからも利用可能である。従って、共通メ
モリ領域103にある各テーブル(210〜250)お
よびフラグ(260〜282)の状態により、デバッガ
の動作が制御可能である。これにより、ブレークポイン
ト例外ハンドラや、シングルステップ実行時に起こる例
外ハンドラは、通常使用する場合とデバッグで使用する
場合とを、フラグの指定で使い分けることが可能であ
る。すなわち、デバッグ専用の例外ハンドラと通常使用
する例外ハンドラとをシステム起動時に別々に設定する
必要はない。In the common memory area 103, the programs in the first memory space 104 shown in FIG.
It is also available from the 5 programs. Therefore, the operation of the debugger can be controlled by the states of the tables (210 to 250) and the flags (260 to 282) in the common memory area 103. As a result, the breakpoint exception handler and the exception handler that occurs at the time of single step execution can be used separately for normal use and for debugging by specifying a flag. That is, it is not necessary to separately set an exception handler for debugging and an exception handler normally used at system startup.
【0021】空間情報テーブル210においては、図1
の第1メモリ空間104と第2メモリ空間105のペー
ジテーブルのアドレスが、ページテーブル位置211と
して、また、各空間で用いるスタックのアドレスがスタ
ックポインタ位置212として格納されており、この空
間情報テーブル210により、各メモリ空間を識別でき
る。The spatial information table 210 is shown in FIG.
The address of the page table in the first memory space 104 and the second memory space 105 is stored as the page table position 211, and the address of the stack used in each space is stored as the stack pointer position 212. Can identify each memory space.
【0022】割り込みテーブル220には、割り込み例
外ハンドラの識別子毎に、各ハンドラのベースアドレス
221と割り込みハンドラの設定(図中、「割込み設
定」と記載)222が格納される。このように、割り込
みテーブル220は、共通メモリ領域103におかれ、
各メモリ空間の割り込み例外ハンドラが共用する。The interrupt table 220 stores a base address 221 of each handler and an interrupt handler setting (indicated as "interrupt setting" in the drawing) 222 for each interrupt exception handler identifier. Thus, the interrupt table 220 is placed in the common memory area 103,
Shared by interrupt exception handlers in each memory space.
【0023】ブレークポイントテーブル230は、第2
メモリ空間105のブレークポイント設定されたアドレ
スを登録するブレークポイントアドレス231と、ブレ
ークポイントを設定する以前の命令コード、すなわち、
元の命令コードを登録する元コード232、および、テ
ーブル内のブレークポイントが有効であるか無効である
かを登録する領域(図中、「有効or無効」と記載)23
3により構成されている。ブレークポイント設定時に
は、このブレークポイントテーブル230にテーブル内
の各項目を設定することで、ブレークポイントの制御が
可能となる。The breakpoint table 230 has a second
A breakpoint address 231 for registering an address where a breakpoint is set in the memory space 105, and an instruction code before the breakpoint is set, that is,
An original code 232 for registering an original instruction code, and an area for registering whether a breakpoint in a table is valid or invalid (described as "valid or invalid" in the figure) 23
It is composed of three. When setting a breakpoint, the breakpoint can be controlled by setting each item in the table in the breakpoint table 230.
【0024】レジスタテーブル240では、レジスタ名
とその値が、レジスタ名241と値242のそれぞれの
項目欄に格納され、トレーステーブル250では、トレ
ースデータがトレースデータ251の項目に格納され
る。また、動作空間フラグ260では、動作空間が第
1,第2メモリ空間のいずれであるかが示され、デバッ
グモードフラグ270では、デバッグモードか通常モー
ドであるかが示され、シングルステップ実行停止モード
フラグ280では、シングルステップ実行停止モードで
あるか否かが示され、そして、トレース実行モードフラ
グ281では、トレース実行モードであるか否かが示さ
れ、そして、シングルステップ実行判定フラグ282で
は、本例の技術でデバッグを行なう場合に、デバッグ例
外ハンドラがブレークポイントを発行したか否かが示さ
れる。In the register table 240, the register name and its value are stored in the respective item fields of the register name 241 and the value 242, and in the trace table 250, the trace data is stored in the item of the trace data 251. The operation space flag 260 indicates whether the operation space is the first or second memory space, the debug mode flag 270 indicates whether the operation space is the debug mode or the normal mode, and the single step execution stop mode is set. The flag 280 indicates whether or not the single-step execution stop mode is set, the trace execution mode flag 281 indicates whether or not the trace execution mode is set, and the single-step execution determination flag 282 indicates that When debugging with the example technique, it indicates whether the debug exception handler issued a breakpoint.
【0025】以下、このようなテーブルおよびフラグを
用いた図1におけるデバッグシステムの動作を説明す
る。図3は、図1におけるデバッグシステムの本発明に
係わるデバッグ方法の第1の処理手順例を示すフローチ
ャートである。本例は、ブレークポイント例外に対する
処理手順例を示している。各メモリ空間でブレークポイ
ントが発行されたとき、図2の割り込みテーブル220
に登録されているブレークポイント例外ハンドラ(以
下、「共用ハンドラ」と記載)が起動する。The operation of the debug system in FIG. 1 using such a table and flags will be described below. FIG. 3 is a flowchart showing a first processing procedure example of the debugging method according to the present invention of the debugging system in FIG. This example shows an example of a processing procedure for a breakpoint exception. When a breakpoint is issued in each memory space, the interrupt table 220 of FIG.
The breakpoint exception handler registered in (starts as "shared handler") is started.
【0026】起動した共用ハンドラは、まず。第1メモ
リ空間104でプログラムが動作しているかどうか判定
する(ステップ301)。第1メモリ空間104は、デ
バッガ111が動作しているメモリ空間であり、その判
定は、図2の動作空間フラグ260の値により行なう。The shared handler started up is first. It is determined whether the program is operating in the first memory space 104 (step 301). The first memory space 104 is a memory space in which the debugger 111 is operating, and its determination is made by the value of the operation space flag 260 in FIG.
【0027】第1メモリ空間104で動作していれば、
第1メモリ空間104のブレークポイント例外ハンドラ
へ移行する(ステップ302)。すなわち、デバッガ1
11に対するデバッグ支援プログラム106が使用する
ブレークポイント例外ハンドラを用いる。If operating in the first memory space 104,
The process moves to the breakpoint exception handler of the first memory space 104 (step 302). That is, the debugger 1
The breakpoint exception handler used by the debug support program 106 for 11 is used.
【0028】第1メモリ空間104以外(ここでは、第
2メモリ空間105)で動作している場合、後で割り込
み以前の状態に復帰する場合のために、レジスタの内容
を保存した後(ステップ303)、このハンドラがデバ
ッグのために用いられているかどうか判定する(ステッ
プ304)。この判定は、図2のデバッグモードフラグ
270の値により行なう。デバッグモードでなければ、
第2メモリ空間105のプログラムが通常用いるブレー
クポイント例外ハンドラへ移行する(ステップ30
6)。When operating in a region other than the first memory space 104 (here, the second memory space 105), the contents of the register are saved (step 303 in order to return to the state before the interrupt later). ), And determine if this handler is being used for debugging (step 304). This determination is made based on the value of the debug mode flag 270 in FIG. If not in debug mode
The program in the second memory space 105 shifts to the breakpoint exception handler normally used (step 30).
6).
【0029】デバッグモードで動作している場合、さら
に、デバッグ例外ハンドラで発行されたブレークポイン
トかどうか判定する(ステップ305)。これは、本例
の技術でデバッグを行なう場合には、図4で後述するよ
うに、デバッグ例外ハンドラがブレークポイントを発行
する場合があるからであり、ここでの判定は、デバッグ
例外ハンドラで設定される図2のシングルステップ実行
判定フラグ282を用いる。すなわち、シングルステッ
プ実行判定フラグ282が設定されていれば、デバッグ
例外ハンドラから発行されたブレークポイントとして判
定する。When operating in the debug mode, it is further determined whether or not the breakpoint is issued by the debug exception handler (step 305). This is because when debugging with the technique of this example, the debug exception handler may issue a breakpoint, as will be described later with reference to FIG. 4, and the determination here is set by the debug exception handler. The single step execution determination flag 282 of FIG. That is, if the single step execution determination flag 282 is set, it is determined as a breakpoint issued from the debug exception handler.
【0030】このように、デバッグ例外ハンドラから発
行されたブレークポイントであれば、ステップ309へ
移行する。すなわち、デバッグ例外ハンドラからのブレ
ークポイントのコードは始めから組み込まれているの
で、ブレークポイント発行位置の命令ポインタを操作す
る必要はない。また、デバッグ例外ハンドラ実行中のレ
ジスタの内容を保存しても有効な情報とならない。従っ
て、この場合は、次のステップ307,308の処理は
必要ない。As described above, if the breakpoint is issued from the debug exception handler, the process proceeds to step 309. That is, since the breakpoint code from the debug exception handler is incorporated from the beginning, it is not necessary to manipulate the instruction pointer at the breakpoint issue position. Also, saving the contents of the register during execution of the debug exception handler does not provide valid information. Therefore, in this case, the processing of the next steps 307 and 308 is not necessary.
【0031】ステップ305において、デバッグ例外ハ
ンドラから発行されたブレークポイントに対する処理で
ない場合、命令ポインタをブレークポイント発行位置に
変更する(ステップ307)。割込みハンドラがプログ
ラム動作に復帰するとき、通常、命令ポインタは、割込
みの起こったアドレスの次のアドレスに復帰するように
設定される。しかし、通常のプログラムのコードに戻す
ためには、ブレークポイント用のコードをブレークポイ
ント登録前の元のコードに戻し、かつ、ブレークポイン
トコードの位置に戻して、その元のコードから実行する
必要がある。この元コードに戻す処理は後述のステップ
314で行なう。If the process is not for the breakpoint issued from the debug exception handler in step 305, the instruction pointer is changed to the breakpoint issue position (step 307). When the interrupt handler returns to program operation, the instruction pointer is typically set to return to the address following the address where the interrupt occurred. However, in order to return to the code of a normal program, it is necessary to return the code for breakpoints to the original code before registering the breakpoint, return to the position of the breakpoint code, and execute from that original code. is there. The process of returning to the original code is performed in step 314 described later.
【0032】次に、ステップ303で保存したレジスタ
の内容を共通メモリ領域103のレジスタテーブル24
0に書き込む(ステップ308)。デバッガ111は、
共通メモリ領域103を仮想アドレス指定で参照できる
ので、テーブルのシンボル、またはアドレスを指定する
ことにより、ブレークポイント発行時のレジスタの値を
参照できる。次に、第2メモリ空間105の空間情報を
空間情報テーブル210に保存する(ステップ30
9)。Next, the contents of the registers saved in step 303 are transferred to the register table 24 in the common memory area 103.
Write to 0 (step 308). The debugger 111
Since the common memory area 103 can be referred to by the virtual address designation, the value of the register at the time of issuing the breakpoint can be referred to by designating the symbol or address of the table. Next, the spatial information of the second memory space 105 is stored in the spatial information table 210 (step 30).
9).
【0033】さらに、第2メモリ空間105から第1メ
モリ空間104にメモリ空間を切り替える(ステップ3
10)。第1メモリ空間104にメモリ空間を切り替え
るための情報は、図2の空間情報テーブル210から獲
得して設定し、図2の動作空間フラグを第1メモリ空間
に変更する。そして、ブレークポイントを発行する(ス
テップ311)。これにより、再び共用ハンドラが実行
され、今度はステップ301において第1メモリ空間1
04のブレークポイントとしてみなし、第1メモリ空間
104のブレークポイント例外ハンドラへ移行する。Further, the memory space is switched from the second memory space 105 to the first memory space 104 (step 3).
10). Information for switching the memory space to the first memory space 104 is acquired and set from the space information table 210 of FIG. 2, and the operation space flag of FIG. 2 is changed to the first memory space. Then, a breakpoint is issued (step 311). As a result, the shared handler is executed again, this time in step 301, the first memory space 1
It is regarded as the breakpoint of 04, and the processing moves to the breakpoint exception handler of the first memory space 104.
【0034】このように、共用ハンドラが動作すること
で、第1メモリ空間104を対象に動作するデバッガ1
11が、第2メモリ空間105のブレークポイントを捕
まえることができる。このデバッガ111がブレークポ
イントにより動作を停止することができれば、第2メモ
リ空間105のプログラムも、ステップ311における
ブレークポイント発行の時点で停止することが可能であ
る。すなわち、第2メモリ空間105のブレークポイン
トを設定すれば、第1メモリ空間104を対象とするデ
バッガ111が、第2メモリ空間105のブレークポイ
ントを捕獲することが可能である。As described above, the operation of the shared handler causes the debugger 1 to operate on the first memory space 104.
11 can catch a breakpoint in the second memory space 105. If the debugger 111 can stop the operation at the break point, the program in the second memory space 105 can also stop at the time of issuing the break point in step 311. That is, by setting a breakpoint in the second memory space 105, the debugger 111 targeting the first memory space 104 can capture the breakpoint in the second memory space 105.
【0035】そして、この第1メモリ空間104で発行
したブレークポイント例外ハンドラが終了すると、第2
メモリ空間105へ再び空間を切り替える(ステップ3
12)。これは、ステップ309の処理で、図2の空間
情報テーブル210に保存した第2メモリ空間の空間情
報に基づき行ない、図2の動作空間フラグを第2メモリ
空間に変更する。これにより、再び、第2メモリ空間1
05上で、共用ハンドラが動作することになる。When the breakpoint exception handler issued in the first memory space 104 ends, the second
The space is switched again to the memory space 105 (step 3)
12). This is done in the process of step 309 based on the space information of the second memory space stored in the space information table 210 of FIG. 2, and the operation space flag of FIG. 2 is changed to the second memory space. As a result, again, the second memory space 1
On 05, the shared handler will run.
【0036】その後、再度、デバッグ例外ハンドラで発
行されたブレークポイントであるかどうかを判定する
(ステップ313)。ここでの判定にも、図2のシング
ルステップ実行判定フラグ282を用いる。すなわち、
シングルステップ実行判定フラグ282が設定されてい
れば、デバッグ例外ハンドラから発行されたブレークポ
イントとして判定する。このようにデバッグ例外ハンド
ラで発行されたブレークポイントであれば、デバッグ例
外ハンドラのブレークポイントのコードは始めから組み
込まれているので、ステップ314〜316の処理をす
る必要はなく、ステップ317へ移行する。Then, it is again determined whether or not the breakpoint is issued by the debug exception handler (step 313). The single step execution determination flag 282 of FIG. 2 is also used for the determination here. That is,
If the single step execution determination flag 282 is set, it is determined as a breakpoint issued from the debug exception handler. In the case of the breakpoint issued by the debug exception handler in this way, the breakpoint code of the debug exception handler is incorporated from the beginning, so that it is not necessary to perform steps 314 to 316, and the process proceeds to step 317. .
【0037】デバッグ例外ハンドラで発行されたブレー
クポイントでなければ、ブレークポイントを指定したア
ドレスに元のコードを書き込む(ステップ314)。こ
れは、図2のブレークポイントテーブル230から、ブ
レークポイントを起こしたアドレスの元コードを取り出
して行なう。これにより、共用ハンドラが終了した後、
ブレークポイント設定したアドレスから元のコードで動
作することになる。If it is not the breakpoint issued by the debug exception handler, the original code is written at the address designated as the breakpoint (step 314). This is done by taking out the original code of the address at which the breakpoint occurred from the breakpoint table 230 of FIG. This will cause the shared handler to
From the address you set the breakpoint, the original code will work.
【0038】さらに、ブレークポイントの指定が有効か
どうか判定する(ステップ315)。これは、図2のブ
レークポイントテーブル230におけるブレークポイン
トアドレス231から、共用ハンドラを起こしたブレー
クポイントのアドレスを検査し、そのアドレスに対応す
る有効か無効かを示す項目233の状態により判定す
る。有効であればステップ316へ処理を移行し、無効
であればステップ317へ処理を移行する。Further, it is judged whether the designation of the break point is valid (step 315). This is done by checking the address of the breakpoint that caused the shared handler from the breakpoint address 231 in the breakpoint table 230 of FIG. 2 and judging by the state of the item 233 corresponding to the address indicating whether the breakpoint is valid or invalid. If it is valid, the process proceeds to step 316, and if it is invalid, the process proceeds to step 317.
【0039】ステップ316では、シングルステップ実
行モードを設定し、その後、ステップ317へ動作を移
行する。このシングルステップ実行モードによる処理動
作は、ブレークポイントの指定を繰り返し使用する場合
に必要である。すなわち、このシングルステップ実行時
に呼ばれる例外ハンドラにより、書き換えたブレークポ
イントのコードをこの時点で再びブレークポイントのコ
ードに書き込む。このようなシングルステップ実行時に
呼ばれる例外ハンドラについては、後の図4を用いて詳
細を説明する。At step 316, the single step execution mode is set, and then the operation is shifted to step 317. The processing operation in this single step execution mode is necessary when repeatedly using the specification of the breakpoint. That is, the rewritten breakpoint code is written again in the breakpoint code by the exception handler called at the time of single step execution. Details of the exception handler called during such single step execution will be described later with reference to FIG.
【0040】ステップ317では、ステップ303の処
理で保存したレジスタの内容を回復する。そして、この
共用ハンドラを終了する。このような共用ハンドラの処
理手順により、通常のデバッガ111のブレークポイン
ト例外ハンドラでは捕獲できない別のメモリ空間(第2
メモリ空間105)のプログラムのブレークポイントが
捕獲可能となる。In step 317, the contents of the register saved in the process of step 303 are restored. Then, this shared handler is terminated. Due to the processing procedure of the shared handler as described above, another memory space (second
A program breakpoint in the memory space 105) can be captured.
【0041】図4は、図1におけるデバッグシステムの
本発明に係わるデバッグ方法の第2の処理手順例を示す
フローチャートである。本例は、シングルステップ実行
時に呼ばれるデバッグ例外に対する処理手順例を示して
いる。FIG. 4 is a flowchart showing a second processing procedure example of the debugging method according to the present invention of the debugging system in FIG. This example shows an example of the processing procedure for a debug exception that is called during single step execution.
【0042】デバッグ例外が起こると、第1メモリ空間
104で動作しているか否かを判定する(ステップ40
1)。第1メモリ空間104は、デバッガ111が動作
しているメモリ空間である。また、判定は、図2の動作
空間フラグ260の値により判定する。When a debug exception occurs, it is determined whether the first memory space 104 is operating (step 40).
1). The first memory space 104 is a memory space in which the debugger 111 is operating. Further, the determination is made based on the value of the operation space flag 260 shown in FIG.
【0043】第1メモリ空間104で動作している場合
は、第1メモリ空間対象のデバッグ例外ハンドラへ移行
する(ステップ402)。また、第1メモリ空間104
以外で動作している場合は、まず、後で割り込み以前の
状態に復帰する場合のために、レジスタの内容を保存す
る(ステップ403)。次に、この例外ハンドラがデバ
ッグのために用いられているかどうか判定する(ステッ
プ404)。この判定は、図2のデバッグモードフラグ
270の値により行なう。If it is operating in the first memory space 104, the process moves to the debug exception handler for the first memory space (step 402). In addition, the first memory space 104
If it is operating in other than the above, first, the contents of the register are saved in case of returning to the state before the interruption later (step 403). Next, it is determined whether this exception handler is used for debugging (step 404). This determination is made based on the value of the debug mode flag 270 in FIG.
【0044】デバッグモードでなければ、第2メモリ空
間105のプログラムが通常用いるデバッグ例外ハンド
ラへ移行する(ステップ405)。デバッグモードが起
動している場合は、まず、有効とするブレークポイント
の位置にブレークポイント命令を書き込んだか否かを判
定する(ステップ406)。この判定は、シングルステ
ップ実行が起こったアドレスと、図2のブレークポイン
トテーブル230のブレークポイントアドレス231と
が等しいか否かで行なう。If it is not in the debug mode, the program in the second memory space 105 shifts to the debug exception handler normally used (step 405). When the debug mode is activated, it is first determined whether or not a break point instruction has been written at the position of the break point to be valid (step 406). This determination is made based on whether or not the address at which the single step execution has occurred and the breakpoint address 231 of the breakpoint table 230 of FIG. 2 are equal.
【0045】ここで判定されたアドレスがあれば、ブレ
ークポイント命令をそのアドレス位置に書き込む(ステ
ップ407)。このように、ブレークポイントを再び有
効とすることで、ブレークポイント設定時の状態にし
て、ブレークポイントの設定の状態を継続させる。If there is an address determined here, a breakpoint instruction is written at that address position (step 407). In this way, by re-enabling the breakpoint, the state at the time of setting the breakpoint is maintained and the state of setting the breakpoint is continued.
【0046】次に、シングルステップ実行を解除するか
どうか判定する(ステップ408)。これは、図2にお
ける共通メモリ領域103のシングルステップ実行停止
モードフラグ280とトレース実行モードフラグ281
の値により判定する。ここで、シングルステップ実行停
止モードとは、シングルステップ実行させる毎に動作を
停止させてデバッグするために用いるモードである。Next, it is determined whether or not the single step execution is canceled (step 408). This is the single step execution stop mode flag 280 and the trace execution mode flag 281 of the common memory area 103 in FIG.
It judges by the value of. Here, the single step execution stop mode is a mode used to stop the operation and debug each time the single step execution is performed.
【0047】どちらのフラグも指定されていなければ、
シングルステップ実行を解除する(ステップ409)。
これはプロセッサの設定の変更により実現する。このよ
うに、シングルステップ実行を解除することにより、こ
の例外ハンドラが終了した後、ブレークポイント設定時
と同じ通常の実行状況となり、その後、レジスタを回復
して(ステップ410)、デバッグ例外ハンドラを終了
する。If neither flag is specified,
The single step execution is canceled (step 409).
This is achieved by changing the processor settings. In this way, by canceling single-step execution, after this exception handler ends, the normal execution status is the same as when the breakpoint was set, and then the registers are restored (step 410) and the debug exception handler ends. To do.
【0048】また、ステップ408の処理において、シ
ングルステップ実行を解除しない場合には、ステップ4
03の処理において保存したレジスタの内容を図2のレ
ジスタテーブル240に書き込む(ステップ411)。
デバッガ111は、共通メモリ領域103を仮想アドレ
ス指定で参照できるので、テーブルのシンボル、または
アドレスを指定することにより、シングルステップ実行
時のレジスタの値を参照できる。If the single step execution is not canceled in the process of step 408, step 4
The contents of the register saved in the processing of 03 are written in the register table 240 of FIG. 2 (step 411).
Since the debugger 111 can refer to the common memory area 103 by virtual address designation, it can refer to the register value at the time of single step execution by designating the symbol or address of the table.
【0049】そして、シングルステップ実行停止モード
が指定されているかどうかを判定する(ステップ41
2)。これは、図2のシングルステップ実行停止モード
フラグ280が指定されているかどうかで判定する。こ
の処理は、シングルステップ実行毎に停止して、その状
態をデバッガで見るか、トレースのみを行い、シングル
ステップ実行毎には停止せずに実行するかどうかを判定
するものである。Then, it is judged whether the single step execution stop mode is designated (step 41).
2). This is determined by whether the single step execution stop mode flag 280 of FIG. 2 is designated. This processing is to stop after each single step execution and to see the state with a debugger, or to perform only trace and determine whether to execute without stopping after each single step execution.
【0050】シングルステップ実行停止モードが指定さ
れていれば、図2のシングルステップ実行判定フラグ2
82を設定する(ステップ413)。そして、シングル
ステップ実行毎に停止をするために、ブレークポイント
を発行する(ステップ414)。ここで発行するブレー
クポイントは、デバッガ111より設定したブレークポ
イントの処理とは異なる部分であるので、ステップ41
4で発行したブレークポイントであることを、図3の処
理を行なうブレークポインタ例外ハンドラ(共用ハンド
ラ)が判定可能となるように、シングルステップ実行判
定フラグを設定する。If the single step execution stop mode is designated, the single step execution determination flag 2 in FIG.
82 is set (step 413). Then, a breakpoint is issued to stop at each single step execution (step 414). The breakpoint issued here is different from the processing of the breakpoint set by the debugger 111, so step 41
The single step execution determination flag is set so that the break pointer exception handler (shared handler) that performs the processing of FIG. 3 can determine that it is the breakpoint issued in 4.
【0051】ステップ414でのブレークポイントの発
行により、シングルステップ実行毎にブレークポイント
で停止することが可能となり、前記共用ハンドラは、デ
バッガが動作しているメモリ空間以外のブレークポイン
トも捕獲できるので、第2メモリ空間105のシングル
ステップ実行した状態を、第1メモリ空間104で動作
するデバッガ111で参照することが可能となる。By issuing a breakpoint in step 414, it is possible to stop at a breakpoint after each single step execution, and the shared handler can capture a breakpoint other than the memory space in which the debugger is operating. It is possible to refer to the single-step executed state of the second memory space 105 by the debugger 111 operating in the first memory space 104.
【0052】その後、シングルステップ実行判定フラグ
282の設定を解除する(ステップ415)。そして、
次にトレース実行モードを指定しているかどうかを判定
する(ステップ416)。トレース実行モードが指定さ
れていれば、ステップ417の処理へ移行する。After that, the setting of the single step execution determination flag 282 is canceled (step 415). And
Next, it is judged whether or not the trace execution mode is designated (step 416). If the trace execution mode has been designated, the process proceeds to step 417.
【0053】このステップ417では、トレースデータ
を図2における共有領域103のトレーステーブル25
0に保存する。これにより、デバッガ111からトレー
スデータを参照することが可能となる。また、第1メモ
リ空間104のプログラムからも参照可能となる。この
ステップ417の処理後、または、ステップ416にお
いて、トレース実行モードが指定されていなければ、ス
テップ418の処理へ移行する。In this step 417, the trace data is transferred to the trace table 25 of the shared area 103 in FIG.
Save to 0. This enables the debugger 111 to refer to the trace data. Further, it can be referred from the program in the first memory space 104. After the process of step 417, or if the trace execution mode is not designated in step 416, the process proceeds to step 418.
【0054】ステップ418では、シングルステップ実
行モードを終了するかどうか判定する。これは、図2の
シングルステップ実行モードフラグ280とトレース実
行モードフラグ281の値により判定する。すなわち、
どちらのフラグも指定されていなければシングルステッ
プ実行を終了するものとし、ステップ409の処理へ移
行する。また、どちらかのフラグが設定されていれば、
シングルステップ実行を続けるものとし、ステップ41
0の処理へ移行する。At step 418, it is determined whether the single step execution mode is to be ended. This is determined by the values of the single step execution mode flag 280 and the trace execution mode flag 281 shown in FIG. That is,
If neither flag is specified, the single step execution is terminated, and the process proceeds to step 409. Also, if either flag is set,
Single step execution shall be continued, and step 41
The processing shifts to 0.
【0055】以上の図3および図4で述べた処理を行な
う例外ハンドラは、マルチメモリ空間のプログラムによ
り共通であり、ブレークポイント、シングルステップ実
行を、メモリ空間の相違に関わらず、例外が発生する毎
に捕獲可能である。従って、それぞれ異なる仮想メモリ
空間を持つ複数のプログラムが連携して動作するマルチ
OS環境においても、その連携動作の順序に従い、マル
チメモリ空間のプログラムのデバッグが可能である。The exception handler for performing the processing described with reference to FIGS. 3 and 4 is common to the programs in the multi-memory space, and an exception is generated in the breakpoint and the single step execution regardless of the difference in the memory space. Can be captured for each. Therefore, even in a multi-OS environment in which a plurality of programs each having a different virtual memory space operate cooperatively, it is possible to debug a program in the multi-memory space according to the order of the cooperative operation.
【0056】また、マルチメモリ空間におけるプログラ
ムのデバッグにおいて、空間情報テーブルの各メモリ空
間情報を設定し、ブレークポイントテーブル230を各
メモリ空間(104,105)毎に設定することで、メ
モリ空間の増減に対して、容易に対応可能である。Further, in debugging a program in a multi-memory space, by setting each memory space information of the space information table and setting the break point table 230 for each memory space (104, 105), the memory space is increased or decreased. Can be easily dealt with.
【0057】以上、図1〜図4を用いて説明したよう
に、本例のマルチメモリ空間プログラムのデバッグシス
テムおよびそのデバッグ方法では、ブレークポイント例
外発生時に呼ばれる例外ハンドラ(共用ハンドラ)とシ
ングルステップ実行時に呼ばれる例外ハンドラ(デバッ
グ例外ハンドラ)を、各メモリ空間のプログラム共用す
る。As described above with reference to FIGS. 1 to 4, in the debug system and the debugging method for a multi-memory space program of this example, an exception handler (shared handler) called when a breakpoint exception occurs and a single step execution. An exception handler (debug exception handler) that is sometimes called is shared by programs in each memory space.
【0058】そして、デバッガの動作する第1のメモリ
空間とは異なる第2のメモリ空間のプログラムでも、第
2のメモリ空間のプログラムで発行されたブレークポイ
ント例外の例外ハンドラ(共用ハンドラ)が、デバッガ
の動作するメモリ空間に空間を切り替えて、再び、ブレ
ークポイントを発行することで、デバッガは、異なるメ
モリ空間のプログラムのブレークポイントを捕獲する。Then, even in a program in the second memory space different from the first memory space in which the debugger operates, the exception handler (shared handler) of the breakpoint exception issued by the program in the second memory space is the debugger. The debugger captures the breakpoint of the program in the different memory space by switching the space to the working memory space of and issuing the breakpoint again.
【0059】これにより、マルチメモリ空間で同時に動
作するOSを含む複数のプログラム(マルチメモリ空間
プログラム)に対しても、1つのデバッガでデバッグ可
能であり、マルチメモリ空間プログラムの連携動作にも
対応してデバッグ可能であり、また、ブレークポイント
の設定を継続して利用可能であり、例えば、第2メモリ
空間で動作するOSの開発のため等に、本例のデバッグ
技術を有効に用いることができる。As a result, it is possible to debug a plurality of programs (multi-memory space programs) including the OS that operate simultaneously in the multi-memory space with a single debugger, and it is possible to cooperate with the multi-memory space programs. And the breakpoints can be continuously set. For example, the debugging technique of this example can be effectively used for developing an OS that operates in the second memory space. .
【0060】また、本例によれば、各マルチメモリ空間
プログラムに対して、シングルステップ実行が設定され
ているとき、シングルステップ実行時の例外ハンドラ
が、ブレークポイントを発行し、前記共用ハンドラを呼
ぶことで、各プログラムはどのメモリ空間であるかに関
係なく、第1のメモリ空間で動作するデバッガがシング
ルステップ実行を捕獲することが可能である。Also, according to this example, when single step execution is set for each multi-memory space program, the exception handler at the time of single step execution issues a breakpoint and calls the shared handler. Thus, regardless of which memory space each program is, the debugger operating in the first memory space can capture the single step execution.
【0061】また、本例によれば、各マルチメモリ空間
プログラムに対して、シングルステップ実行が設定され
ているとき、シングルステップ実行時の例外ハンドラ
が、共通メモリ領域にトレースデータを格納すること
で、一つのメモリ空間上で各プログラムのトレースデー
タを参照することが可能である。Further, according to this example, when single step execution is set for each multi-memory space program, the exception handler at the time of single step execution stores the trace data in the common memory area. , It is possible to refer to the trace data of each program in one memory space.
【0062】また、本例では、デバッガの動作するメモ
リ空間とは異なるプログラムのデータの状況を、各メモ
リ空間からアクセス可能な共通メモリ領域に書き込むこ
とで、デバッグに必要なデータを捕獲することが可能で
ある。これにより、ブレークポイント発行時のレジスタ
の状態を共通メモリ領域に格納し、これをデバッガまた
はアプリケーションで参照することが可能である。Further, in this example, the data status of the program different from the memory space in which the debugger operates can be written in the common memory area accessible from each memory space to capture the data required for debugging. It is possible. As a result, the state of the register at the time of issuing the breakpoint can be stored in the common memory area and can be referenced by the debugger or application.
【0063】また、本例では、共通メモリ領域に、デバ
ッグ用の例外ハンドラの設定するフラグを用意すること
で、フラグの値に従い、例外ハンドラの処理が変更可能
である。これにより、例外ハンドラのコードを変更する
ことなく、デバッグ時に用いる例外ハンドラと、通常用
いる例外ハンドラの処理とを区別することが可能であ
る。Further, in this example, by preparing a flag set by the exception handler for debugging in the common memory area, the processing of the exception handler can be changed according to the value of the flag. As a result, it is possible to distinguish between the exception handler used during debugging and the exception handler processing normally used without changing the code of the exception handler.
【0064】尚、本発明は、図1〜図4を用いて説明し
た実施例に限定されるものではなく、その要旨を逸脱し
ない範囲において種々変更可能である。例えば、本例で
は、図1に示すように、デバッガ計算機110により、
通信装置114,108を介して、デバッグ対象計算機
100に対するデバッグを行なう構成としているが、こ
れは、デバッグ対象計算機100のOSにおける障害に
よりデバッグ対象計算機100がダウンした場合にも、
その情報が得られるようにしたものであり、そのような
危険性がなければ、デバッグ対象計算機100上でデバ
ッガ111を実行させる構成でも良い。The present invention is not limited to the embodiments described with reference to FIGS. 1 to 4, and various modifications can be made without departing from the scope of the invention. For example, in this example, as shown in FIG.
The debug target computer 100 is configured to be debugged via the communication devices 114 and 108. However, this is done even when the debug target computer 100 is down due to a failure in the OS of the debug target computer 100.
The information is obtained, and if there is no such risk, the debugger 111 may be executed on the debug target computer 100.
【0065】[0065]
【発明の効果】本発明によれば、マルチメモリ空間上で
同時に動作するOSを含むプログラム(マルチメモリ空
間プログラム)を一つのデバッガでデバッグすることが
でき、また、マルチメモリ空間プログラムの連携動作に
対応してデバッグすることができ、1台のコンピュータ
上でそれぞれ異なるメモリ空間で複数のオペレーティン
グシステム(OS)を連動させて動作させるマルチOS
環境で動作するマルチメモリ空間プログラムのデバッグ
を効率的に行なうことが可能である。According to the present invention, it is possible to debug a program including an OS (multi-memory space program) that simultaneously operates in the multi-memory space with a single debugger, and to perform a cooperative operation of the multi-memory space program. Multi-OS that can be debugged correspondingly and operates multiple operating systems (OS) in conjunction with each other in different memory spaces on one computer
It is possible to efficiently debug a multi-memory space program operating in the environment.
【図1】本発明に係わるデバッグシステムの構成例を示
すブロック図である。FIG. 1 is a block diagram showing a configuration example of a debug system according to the present invention.
【図2】図1における共通メモリ領域の構成例を示す説
明図である。FIG. 2 is an explanatory diagram showing a configuration example of a common memory area in FIG.
【図3】図1におけるデバッグシステムの本発明に係わ
るデバッグ方法の第1の処理手順例を示すフローチャー
トである。FIG. 3 is a flow chart showing a first processing procedure example of a debugging method according to the present invention of the debugging system in FIG.
【図4】図1におけるデバッグシステムの本発明に係わ
るデバッグ方法の第2の処理手順例を示すフローチャー
トである。FIG. 4 is a flowchart showing a second processing procedure example of the debugging method of the debugging system in FIG. 1 according to the present invention.
100:デバッグ対象計算機、101:プロセッサ、1
02:メモリ、103:共通メモリ領域、104:第1
メモリ空間、105:第2メモリ空間、106:デバッ
グ支援プログラム、107:バス、108:通信装置、
109:ケーブル、110:デバッガ計算機、111:
デバッガ(第1メモリ空間を対象とするデバッガ)、1
12:入力装置、113:出力装置、114:通信装
置、210:空間情報テーブル、211:ページテーブ
ル位置、212:スタックポインタ位置、220:割り
込みテーブル、221:ベースアドレス、222:割り
込みハンドラの設定(割込み設定)、230:ブレーク
ポイントテーブル、231:ブレークポイントアドレ
ス、232:元コード、233:領域(有効or無効)、
240:レジスタテーブル、241:レジスタ名、24
2:値、250:トレーステーブル、251:トレース
データ、260:動作空間フラグ(動作空間(第1,第
2))、270:デバッグモードフラグ(デバッグモー
ド(On or Off))、280:シングルステップ実行停
止モードフラグ(シングルステップ実行停止モード(On
or Off))、281:トレース実行モードフラグ(ト
レース実行モード(On or Off))、282:シングル
ステップ実行判定フラグ(シングルステップ実行判定
(On or Off))。100: computer to be debugged, 101: processor, 1
02: memory, 103: common memory area, 104: first
Memory space, 105: second memory space, 106: debug support program, 107: bus, 108: communication device,
109: cable, 110: debugger computer, 111:
Debugger (debugger for the first memory space), 1
12: input device, 113: output device, 114: communication device, 210: spatial information table, 211: page table position, 212: stack pointer position, 220: interrupt table, 221: base address, 222: interrupt handler setting ( Interrupt setting), 230: Breakpoint table, 231: Breakpoint address, 232: Original code, 233: Area (valid or invalid),
240: register table, 241: register name, 24
2: value, 250: trace table, 251: trace data, 260: operation space flag (operation space (first and second)), 270: debug mode flag (debug mode (On or Off)), 280: single step Execution stop mode flag (Single step execution stop mode (On
282: trace execution mode flag (trace execution mode (On or Off)), 282: single step execution determination flag (single step execution determination (On or Off)).
フロントページの続き (72)発明者 関口 知紀 神奈川県川崎市麻生区王禅寺1099番地 株式会社日立製作所システム開発研究所 内 (72)発明者 新井 利明 神奈川県川崎市麻生区王禅寺1099番地 株式会社日立製作所システム開発研究所 内 (72)発明者 冨田 理 愛知県尾張旭市晴丘町池上1番地 株式 会社日立製作所情報機器事業部内 (56)参考文献 特開 平6−19748(JP,A) 特開 平10−133910(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 9/46 - 9/54 G06F 11/28 - 11/34 Front page continuation (72) Inventor Tomoki Sekiguchi 1099 Ozenji, Aso-ku, Kawasaki-shi, Kanagawa Hitachi Systems Development Laboratory, Ltd. Development Laboratory (72) Inventor Risa Tomita 1 Ikegami, Haruoka-cho, Owariasahi-shi, Aichi Hitachi Information Technology Division (56) (JP, A) (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 9/46-9/54 G06F 11/28-11/34
Claims (9)
S)の動作を行うプログラムをそれぞれ記憶する複数の
メモリ空間を有する計算機と、上記プログラムのデバッ
グ処理を行うデバッガ計算機とを有するデバッグ処理シ
ステムであって、上記計算機は、 上記複数のOSのうち上記デバッガ計算機によりデバッ
グ処理可能な第1のOSの動作を行うプログラムを記憶
する 第1のメモリ空間と、 上記複数のメモリ空間のうち上記第1のメモリ空間を除
く 第2のメモリ空間と、 上記複数のメモリ空間各々の設定情報を記憶し、上記複
数のOSが共用可能な共通メモリ領域と、 上記第1のメモリ空間と上記第2のメモリ空間とに接続
され、上記共通メモリ領域に記憶された上記複数のメモ
リ空間各々の設定情報に従って、空間切替制御を行う制
御部とを有し、 該計算機の制御部は、 ブレークポイント例外が上記第2
のメモリ空間で発生した場合に、上記共通メモリ領域に
記憶された上記複数のメモリ空間各々の設定情報に従っ
て、上記プログラムの動作空間を、上記第2のメモリ空
間から上記第1のメモリ空間へ切り替え、 上記デバッガ計算機は、 上記第1のメモリ空間で、上記ブレークポイント例外を
発行 することを特徴するデバッグ処理システム。1. A multiple operating system (O
S) storing a plurality of programs each performing the operation
Debug and computer having a memory space, a debugging processing <br/> stem having a debugger computer to perform the process of debugging the program, the computer, by the debugger computer among the plurality of OS
Stores the program that operates the first OS that can be processed
A first memory space, the first memory space of the plurality of memory spaces divided
Storing Ku and second memory space, the configuration information of the plurality of memory spaces each said double
Connected to a common memory area that can be shared by several OSs, the first memory space, and the second memory space
And the plurality of memos stored in the common memory area.
Control that performs space switching control according to the setting information of each space
And a control unit, the control unit of the computer, the breakpoint exception the second
If it occurs in the memory space of
According to the stored setting information of each of the plurality of memory spaces
The operation space of the above program to the second memory space
Switch to the first memory space from above, and the debugger computer sets the breakpoint exception in the first memory space.
Issued characterized to Lud bag processing system to.
であって、シングルステップ実行時、上記共通メモリ領域にトレー
スデータを格納する手段を有 することを特徴とするデバ
ッグ処理システム。 2. The debug processing system according to claim 1 , wherein a tray is stored in the common memory area during single step execution.
To Lud bus and characterized in that we have a means for storing Sudeta <br/> Tsu grayed processing system.
かに記載のデバッグ処理システムであって、各メモリ空間で記憶された各プログラムのデバッグに必
要なデータを、各メモリ空間から上記共通メモリ領域に
書き込む手段を有 することを特徴とするデバッグ処理シ
ステム。 3. Either claim 1 or claim 2.
The debug processing system described in 1 above , which is necessary for debugging each program stored in each memory space.
Transfer necessary data from each memory space to the common memory area
To Lud bagged and characterized in that it have a means for writing sheet
Stem.
S)の動作を行うプログラムをそれぞれ記憶する複数の
メモリ空間を有する計算機であって、 上記複数のOSのうちデバッグ処理可能な第1のOSの
動作を行うプログラムを記憶する第1のメモリ空間と、 上記複数のメモリ空間のうち上記第1のメモリ空間を除
く第2のメモリ空間と、 上記複数のメモリ空間各々の設定情報を記憶し、上記複
数のOSが共用可能な共通メモリ領域と、 上記第1のメモリ空間と上記第2のメモリ空間とに接続
され、上記共通メモリ領域に記憶された上記複数のメモ
リ空間各々の設定情報に従って、空間切替制御を行うと
共に、上記第1のメモリ空間でのデバッグ処理を行う制
御部とを有し、 該制御部は、ブレークポイント例外が上記第2のメモリ
空間で発生した場合に、上記プログラムの動作空間を上
記第2のメモリ空間から上記第1のメモリ空間へ切り替
えて、該第1のメモリ空間で上記ブレークポイント例外
を発行する ことを特徴する計算機。4. A plurality of operating systems (O
S) storing a plurality of programs each performing the operation
A computer having a memory space, of a first OS capable of debug processing among the plurality of OSs
A first memory space for storing a program for performing an operation and the first memory space among the plurality of memory spaces are excluded.
The second memory space and the setting information of each of the plurality of memory spaces are stored, and
Connected to a common memory area that can be shared by several OSs, the first memory space, and the second memory space
And the plurality of memos stored in the common memory area.
When space switching control is performed according to the setting information for each space
Both have a control system for performing debug processing in the first memory space.
And a control unit, in which the breakpoint exception is the second memory.
If it occurs in the space, the operation space of the program above
Switch from the second memory space to the first memory space
Therefore, in the first memory space, the above breakpoint exception
Issuing a calculator .
スデータを格納する手段 を有することを特徴とする計算
機。5. The computer according to claim 4 , wherein a tray is stored in the common memory area during single step execution.
Calculation having means for storing data
Machine .
かに記載の計算機であって、各メモリ空間で記憶された各プログラムのデバッグに必
要なデータを、各メモリ空間から上記共通メモリ領域に
書き込む手段を有す ることを特徴とする計算機。6. Either claim 4 or claim 5 .
A computer according to either 必debugging of the programs stored in the memory space
Transfer necessary data from each memory space to the common memory area
A computer having means for writing .
S)の動作を行うプログラムをそれぞれ記憶する複数の
メモリ空間を有する計算機における上記プログラムのデ
バッグ処理方法であって、 上記計算機は、 ブレークポイント例外が、上記複数のOSのうちデバッ
グ処理可能な第1のOSの動作を行うプログラムを記憶
する第1のメモリ空間を除く第2のメモリ空間で発生し
た場合に、上記複数のOSが共用可能な共通メモリ領域
に記憶された上記複数のメモリ空間各々の設定情報に従
って、上記プログラムの動作空間を、上記 第2のメモリ
空間から上記第1のメモリ空間へ切り替えて、該第1の
メモリ空間で、上記ブレークポイント例外を発行 するこ
とを特徴するデバッグ処理方法。7. A plurality of operating systems (O
S) storing a plurality of programs each performing the operation
It met debugging method of the program in a computer having a memory space, the computer, the breakpoint exception, among the plurality of OS debugging
Stores the program that operates the first OS that can be processed
Occurs in the second memory space excluding the first memory space
Common memory area that can be shared by multiple OSs
According to the setting information of each of the plurality of memory spaces stored in
Then, the operation space of the program is set to the second memory.
Space to the first memory space and switch to the first memory space.
In the memory space, wherein to Lud bag processing method to issue the breakpoint exception.
って、 シ ングルステップ実行時、上記共通メモリ領域にトレー
スデータを格納することを特徴とするデバッグ処理方
法。 De bag processing method der according to 8. The method of claim 7
And Tsu, when sheet packaging le stepping tray to the common memory area
Features and to Lud bagged how <br/> method to store Sudeta.
かに記載のデバッグ処理方法であって、各メモリ空間で記憶された各プログラムのデバッグに必
要なデータを、各メモリ空間から 上記共通メモリ領域に
書き込むことを特徴とするデバッグ処理方法。9. Either claim 7 or claim 8.
It met debugging processing method according to either 必debugging of the programs stored in the memory space
The main data, <br/> writing write-law, features and be Lud bag processing method to the common memory area from the memory space.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP35238498A JP3503504B2 (en) | 1998-12-11 | 1998-12-11 | Debug processing system, computer and debug processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP35238498A JP3503504B2 (en) | 1998-12-11 | 1998-12-11 | Debug processing system, computer and debug processing method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000181748A JP2000181748A (en) | 2000-06-30 |
| JP3503504B2 true JP3503504B2 (en) | 2004-03-08 |
Family
ID=18423713
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP35238498A Expired - Fee Related JP3503504B2 (en) | 1998-12-11 | 1998-12-11 | Debug processing system, computer and debug processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3503504B2 (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1942859A (en) * | 2003-10-01 | 2007-04-04 | 扎鲁纳股份有限公司 | Operating systems |
| KR20060110359A (en) * | 2004-02-09 | 2006-10-24 | 콘티넨탈 테베스 아게 운트 코. 오하게 | Devices and methods for integrated systems for critical safety computer systems in automobiles |
| JP2007004516A (en) * | 2005-06-24 | 2007-01-11 | Hitachi Software Eng Co Ltd | Program debugging method of built-in system |
| JP2009175960A (en) * | 2008-01-23 | 2009-08-06 | Panasonic Corp | Virtual multiprocessor system |
-
1998
- 1998-12-11 JP JP35238498A patent/JP3503504B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2000181748A (en) | 2000-06-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7536605B2 (en) | Injection of software faults into an operational system | |
| US6988264B2 (en) | Debugging multiple threads or processes | |
| US5628017A (en) | Method and system for providing event-response capabilities to pseudocode | |
| US7950001B2 (en) | Method and apparatus for instrumentation in a multiprocessing environment | |
| JP2651916B2 (en) | In-circuit emulator | |
| US7171546B2 (en) | CPU life-extension apparatus and method | |
| CN1489729A (en) | Single step processing | |
| CN101446918A (en) | Method for realizing debugging of single function by user state debugger and system thereof | |
| US7228543B2 (en) | Technique for reaching consistent state in a multi-threaded data processing system | |
| CN115658321A (en) | Method and device for acquiring fault information of automobile instrument, electronic equipment and storage medium | |
| US20050229163A1 (en) | Thread-scoped breakpoints | |
| US20030004671A1 (en) | Remote debugging apparatus for executing procedure preregistered in database at program breakpoint | |
| US8612720B2 (en) | System and method for implementing data breakpoints | |
| JP3764405B2 (en) | Debugging apparatus and debugging method | |
| JP3503504B2 (en) | Debug processing system, computer and debug processing method | |
| US7526756B2 (en) | Address watch breakpoints with basing pointers | |
| US7418631B2 (en) | Program-controlled unit | |
| CN107203454A (en) | A kind of kernel internal memory monitoring method of power & environment supervision main frame | |
| CN118860762A (en) | Simulation system and method based on digital signal processor | |
| US9317636B1 (en) | System and method for stopping integrated circuit simulation | |
| JPH0922369A (en) | Malfunction detection method in multitasking kernel | |
| CN100492299C (en) | A method and system for developing embedded software | |
| JPH0581087A (en) | Processor monitoring system | |
| CN118672894A (en) | Method for testing a computer program | |
| JPS62290942A (en) | Debugger starting system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20031201 |
|
| LAPS | Cancellation because of no payment of annual fees |