JP2000315166A - Software debugging device - Google Patents

Software debugging device

Info

Publication number
JP2000315166A
JP2000315166A JP11123880A JP12388099A JP2000315166A JP 2000315166 A JP2000315166 A JP 2000315166A JP 11123880 A JP11123880 A JP 11123880A JP 12388099 A JP12388099 A JP 12388099A JP 2000315166 A JP2000315166 A JP 2000315166A
Authority
JP
Japan
Prior art keywords
variable
value
program
memory
data storage
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.)
Granted
Application number
JP11123880A
Other languages
Japanese (ja)
Other versions
JP3298554B2 (en
Inventor
Emi Yoshinaga
恵美 吉永
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 Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP12388099A priority Critical patent/JP3298554B2/en
Publication of JP2000315166A publication Critical patent/JP2000315166A/en
Application granted granted Critical
Publication of JP3298554B2 publication Critical patent/JP3298554B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To detect the updating of a variable value and to check a value obtained before updating without exerting influence upon the execution of a program. SOLUTION: The software debugging device is provided with a debugger part 120, an emulator part 121 and an output device 109. The emulator part 121 is provided with an emulation memory 101 for storing data or the like included in a program and a coverage memory 102 for recording the status of an access to the memory 101 due to the execution of the program, The debugger part 120 is provided with a coverage status monitoring part 110 for monitoring the memory 102 and the access status to the memory 101 due to the execution of the program. The monitoring part 110 acquires access status from an address of the memory 102, detects whether the value of a variable is updated or not on the basis of the access status and allows a display part to display corresponding contents.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はC言語等の高級言語
で記述されたソース・プログラムのディバグ作業で使用
されるソース・ディバッガに関し、特にソース・プログ
ラム中の特定の変数値の変更を検出することを可能にし
たソフトウェア・デバッグ装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a source debugger used for debugging a source program described in a high-level language such as C language, and more particularly, to detecting a change in a specific variable value in a source program. The present invention relates to a software debugging device that has made it possible.

【0002】[0002]

【従来の技術】従来のソフトウェア・デバック装置を図
7を参照して説明する。同図において、ホスト・マシー
ン1内のロード・モジュール100は、ユーザがC言語
等の高級言語によって作成したソース・プログラムをコ
ンパイル及びリンクを行い、デバッグ用の各種情報を含
んだ機械語に翻訳する。変数情報テーブル103は、ロ
ード・モジュール100の中のデバッグ情報から取得し
た、ソース・プログラム中の各変数の変数情報(変数の
型やアドレスなどのシンボル情報)を格納する。最新デ
ータ格納部104は、変数情報テーブル103に格納さ
れている各変数のアドレス情報を元にして、エミュレー
タ部121内のエミュレーション・メモリ101から取
得した各変数の最新の値を格納する。前記エミュレーシ
ョン・メモリ101は、エミレーション部122により
ユーザーの作成したプログラム(ロード・モジュール1
00の中のコード)やデータを格納する。また、旧デー
タ格納部105は、最新データ格納部104の内容がプ
ログラムの実行によって更新される前の変数の値を格納
する。データ比較部111は、各変数について最新デー
タ格納部104と旧データ格納部105の変数値を比較
し、変化の有無を変数値表示部107に通知する。出力
装置109は、変数値表示部107が最新データ格納部
104から取得した変数の値を表示する。
2. Description of the Related Art A conventional software debugging device will be described with reference to FIG. In FIG. 1, a load module 100 in a host machine 1 compiles and links a source program created by a user in a high-level language such as C language, and translates the source program into a machine language including various information for debugging. . The variable information table 103 stores variable information (symbol information such as variable type and address) of each variable in the source program acquired from the debug information in the load module 100. The latest data storage unit 104 stores the latest value of each variable obtained from the emulation memory 101 in the emulator unit 121 based on the address information of each variable stored in the variable information table 103. The emulation memory 101 stores a program (load module 1) created by the user by the emulation unit 122.
00) and data. The old data storage unit 105 stores the values of variables before the contents of the latest data storage unit 104 are updated by executing the program. The data comparison unit 111 compares the variable values of the latest data storage unit 104 and the old data storage unit 105 for each variable, and notifies the variable value display unit 107 of the presence or absence of a change. The output device 109 displays the value of the variable acquired by the variable value display unit 107 from the latest data storage unit 104.

【0003】このような構成のソフトウェア・デバッグ
装置の動作を図8のフローチャートを参照して説明す
る。図8(a)は、ユーザがソース・プログラム上に存
在する変数の中で、値を監視したい変数を出力装置10
9に表示するように操作したときの処理である。まず、
出力装置109に、値を監視したい変数を表示させる操
作をユーザが行う(ステップB1)。すると、ステップ
B1で指定された変数の情報(型、アドレスなどのシン
ボル情報)をロード・モジュール100の中のデバッグ
情報から取得し、変数情報テーブル103に格納する
(ステップB2)。さらに、変数情報テーブル103に
格納されている各変数のアドレス情報から、エミュレー
ション・メモリ101の中のどのアドレスに変数が割り
当てられているかを知ることができるので、そのアドレ
ス値を元に、エミュレーション・メモリ101から各変
数の最新の値を読み出し、最新データ格納部104に格
納する(ステップB3)。そして、変数値表示部107
が最新データ格納部104に格納されている各変数の値
を出力装置109に出力する(ステップB4)。
The operation of the software debug device having such a configuration will be described with reference to the flowchart of FIG. FIG. 8A shows a variable which the user wants to monitor the value among variables existing in the source program.
This is a process when an operation is performed so as to be displayed in FIG. First,
The user performs an operation of displaying a variable whose value is to be monitored on the output device 109 (step B1). Then, the information (symbol information such as type and address) of the variable specified in step B1 is acquired from the debug information in the load module 100 and stored in the variable information table 103 (step B2). Further, since it is possible to know to which address in the emulation memory 101 a variable is assigned from the address information of each variable stored in the variable information table 103, the emulation / decoding is performed based on the address value. The latest value of each variable is read from the memory 101 and stored in the latest data storage unit 104 (step B3). Then, the variable value display unit 107
Outputs the value of each variable stored in the latest data storage unit 104 to the output device 109 (step B4).

【0004】また、図8(b)は、ユーザがソース・プ
ログラムの実行を行う操作をしたときの処理であり、図
8(a)のフローチャートの処理により出力装置109
に表示された変数について、行われる処理である。ユー
ザによりソース・プログラムの実行が促された場合、ユ
ーザが指定した位置、または実行停止の命令が出された
ところまで、ソース・プログラムを実行する。プログラ
ムの実行終了後、まず、最新データ格納部104の内容
がプログラムの実行によって更新されたエミュレーショ
ン・メモリ101から各変数の最新の値を取得する前
に、旧データ格納部105に最新データ格納部104の
内容(実行前の各変数の値)を退避する(ステップB
7)。ステップB7の処理終了後、エミュレーション・
メモリ101から各変数の最新の値を取得し、最新デー
タ格納部104に格納する(ステップB8)。次に、デ
ータ比較部111は、各変数について最新データ格納部
104と旧データ格納部105の変数値を比較し(ステ
ップB9)、変化の有無を変数値表示部107に通知す
る。値に変化があった場合、変数値表示部107が最新
データ格納部104から取得した変数の値を、表示色を
変えて出力装置109に表示する(ステップB10&ス
テップB4)。変化が無かった場合は表示色を変えず表
示する(ステップB4)。
FIG. 8B shows a process when the user performs an operation for executing the source program. The output device 109 is executed by the process shown in the flowchart of FIG.
This is the process performed for the variables displayed in the above. When the execution of the source program is prompted by the user, the source program is executed up to the position designated by the user or to the point where the execution stop instruction is issued. After the execution of the program is completed, first, before acquiring the latest value of each variable from the emulation memory 101 in which the content of the latest data storage unit 104 has been updated by the execution of the program, the oldest data storage unit 105 stores the latest data storage unit. Save the contents of 104 (the values of each variable before execution) (step B
7). After the processing of step B7 is completed, emulation
The latest value of each variable is obtained from the memory 101 and stored in the latest data storage unit 104 (step B8). Next, the data comparison unit 111 compares the variable values of the latest data storage unit 104 and the old data storage unit 105 for each variable (step B9), and notifies the variable value display unit 107 of the presence or absence of a change. When there is a change in the value, the variable value display unit 107 displays the value of the variable acquired from the latest data storage unit 104 on the output device 109 by changing the display color (step B10 & step B4). If there is no change, the display is performed without changing the display color (step B4).

【0005】次に、詳細は後述するが、図3のソース・
プログラムを用いて、図4の変数情報テーブルと図5
(a)の表示例から、変数count とzeroを例にとり、プ
ログラムの実行により値に変化が無い場合とあった場合
の動作について説明する。図3のソース・プログラムに
おいて、9行目まで実行が行われていたとき、ユーザが
変数count を出力装置109に表示させる処理を行った
とする。また、この時点での変数count の値は「3」だ
ったとする。ユーザが変数count を出力装置109に表
示させる処理を行うと、デバッガ部120では、まず、
ロード・モジュール100の中のデバッグ情報から取得
した変数count のシンボル情報を変数情報テーブル10
3に登録する。
Next, as will be described in detail later, the source
Using the program, the variable information table of FIG.
From the display example of (a), taking the variables count and zero as an example, the operation when there is no change in the value due to the execution of the program and when there is a change will be described. In the source program of FIG. 3, it is assumed that the user performs a process of displaying the variable count on the output device 109 when the execution is performed up to the ninth line. Also, assume that the value of the variable count at this point is “3”. When the user performs a process of displaying the variable count on the output device 109, the debugger unit 120 first
The symbol information of the variable count acquired from the debug information in the load module 100 is stored in the variable information table 10.
Register to 3.

【0006】次に、エミュレーション・メモリ101か
らアドレス0x10E(変数情報テーブル103に格納され
ているアドレス)の値「3」を読み出し、最新データ格
納部104に格納する。変数値表示部107は、最新デ
ータ格納部104に格納された変数count の値「3」を
表示色を変えず、出力装置109に表示する。ここで、
ユーザが10行目を実行してプログラムを停止する操作
を行ったとする。実行終了後、最新データ格納部104
から旧データ格納部105にプログラム実行前の値
「3」を退避する。プログラム実行前の値を退避した
後、エミュレーション・メモリ101からアドレス0x10
Eの値「3」を読み出し、最新データ格納部104に格
納する。次に、最新データ格納部104と旧データ格納
部105の変数count の値をデータ比較部111で比較
する。変数値表示部107は、最新データ格納部104
から値「3」(実行後の値)を取得し、データ比較部1
11で新旧の値を比較した結果、値が同じなので、表示
色を変えずに出力装置109に変数値「3」を表示す
る。
Next, the value “3” of the address 0x10E (the address stored in the variable information table 103) is read from the emulation memory 101 and stored in the latest data storage unit 104. The variable value display unit 107 displays the value “3” of the variable count stored in the latest data storage unit 104 on the output device 109 without changing the display color. here,
It is assumed that the user performs an operation of executing the tenth line to stop the program. After the execution is completed, the latest data storage unit 104
Then, the value “3” before the program is executed is saved in the old data storage unit 105. After saving the value before executing the program, the address 0x10 is saved from the emulation memory 101.
The value “3” of E is read and stored in the latest data storage unit 104. Next, the data comparison unit 111 compares the value of the variable “count” between the latest data storage unit 104 and the old data storage unit 105. The variable value display unit 107 stores the latest data storage unit 104
From the data comparison unit 1
As a result of comparing the old and new values at 11, the values are the same, so that the variable value “3” is displayed on the output device 109 without changing the display color.

【0007】次に、ユーザから11行目を実行してプロ
グラムを停止する操作が行われたとする。実行終了後、
最新データ格納部104から旧データ格納部105にプ
ログラム実行前の値「3」を退避する。プログラム実行
前の値を退避した後、エミュレーション・メモリ101
からアドレス0x10Eの値「4」を読み出し、最新データ
格納部104に格納する。次に、最新データ格納部10
4と旧データ格納部105の変数count の値をデータ比
較部111で比較する。変数値表示部107は、最新デ
ータ格納部104から値「4」(実行後の値)を取得
し、データ比較部111で新旧の値を比較した結果、値
が異なるので、表示色を変えて出力装置109に変数値
「4」を表示する。
Next, it is assumed that the user performs an operation to execute the eleventh line and stop the program. After the execution ends,
The value “3” before the execution of the program is saved from the latest data storage unit 104 to the old data storage unit 105. After saving the values before program execution, the emulation memory 101
The value “4” of the address 0x10E is read out from the memory and stored in the latest data storage unit 104. Next, the latest data storage unit 10
4 and the value of the variable count of the old data storage unit 105 are compared by the data comparison unit 111. The variable value display unit 107 acquires the value “4” (the value after execution) from the latest data storage unit 104, and compares the new and old values with the data comparison unit 111. The variable value “4” is displayed on the output device 109.

【0008】ここで、ユーザが変数zeroを出力装置10
9に表示させる処理を行ったとする。11行目まで実行
が終了した時点での変数zeroの値は「0」である。この
とき、デバッガ120は、まず、ロード・モジュール1
00の中のデバッグ情報から取得した変数zeroのシンボ
ル情報を変数情報テーブル103に登録する。さらに、
エミュレーション・メモリ101からアドレス0x112
(変数情報テーブル103に格納されているアドレス)
の値「0」を読み出し、最新データ格納部104に格納
する。変数値表示部107は、最新データ格納部104
に格納された変数zeroの値「0」を表示色を変えず、出
力装置109に表示する。
[0008] Here, the user sets the variable zero to the output device 10.
It is assumed that a process for displaying the image on the screen 9 has been performed. The value of the variable zero at the time when the execution is completed up to the eleventh line is “0”. At this time, the debugger 120 first loads the load module 1
The symbol information of the variable zero acquired from the debug information in 00 is registered in the variable information table 103. further,
Address 0x112 from emulation memory 101
(Address stored in variable information table 103)
Is read out and stored in the latest data storage unit 104. The variable value display unit 107 stores the latest data storage unit 104
Is displayed on the output device 109 without changing the display color.

【0009】さらに、ユーザが13行目を実行してプロ
グラムを停止する操作を行ったとする。実行終了後、最
新データ格納部104から旧データ格納部105にプロ
グラム実行前の値「0」を退避する。プログラム実行前
の値を退避した後、エミュレーション・メモリ101か
らアドレス0x112 の値「0」を読み出し、最新データ格
納部104に格納する。次に、最新データ格納部104
と旧データ格納部105の変数count の値をデータ比較
部111で比較する。変数値表示部107は、最新デー
タ格納部104から「0」(実行後の値)を取得し、デ
ータ比較部111で新旧の値を比較した結果、値が同じ
なので、表示色を変えずに出力装置109に変数値
「0」を表示する。
[0009] Further, it is assumed that the user performs an operation of executing the thirteenth line to stop the program. After the execution is completed, the value “0” before the execution of the program is saved from the latest data storage unit 104 to the old data storage unit 105. After saving the value before the program is executed, the value “0” at the address 0x112 is read from the emulation memory 101 and stored in the latest data storage unit 104. Next, the latest data storage unit 104
And the value of the variable count of the old data storage unit 105 are compared by the data comparison unit 111. The variable value display unit 107 obtains “0” (the value after execution) from the latest data storage unit 104 and compares the old and new values by the data comparison unit 111. As a result, the values are the same, so that the display color is not changed. The variable value “0” is displayed on the output device 109.

【0010】[0010]

【発明が解決しようとする課題】このような従来のソフ
トウェア・デバッグ装置では、次のような問題点があっ
た。第1の問題点は、上記の変数変数zeroの例にのよう
に、同じ値、例えば、「0」→「0」への変化を検出す
ることができない。その理由は、最新の変数の値とプロ
グラム実行前の変数の値を比較することにより、変数の
値の変化を判定していたため、同じ値に変化したとき
は、変数の値の変化が検出できないためである。そのた
め、プログラム上での変数の値が更新されたか否かを判
断することができない。また、第2の問題点は、プログ
ラム実行前の値を表示できない。その理由は、旧データ
を表示する手段を持たないためである。そのため、更新
される前の値を確認しようとしたときに、その確認がで
きない。このように、従来のソフトウェア・デバッグ装
置では、変数の値の更新を確認する際の使い勝手が悪
く、適切なデバッグを行う際の障害になっている。
However, such a conventional software debug device has the following problems. The first problem is that the same value, for example, a change from “0” to “0” cannot be detected as in the example of the variable variable zero described above. The reason is that the change of the value of the variable is judged by comparing the value of the latest variable with the value of the variable before executing the program, so when the value changes to the same value, the change of the value of the variable can not be detected That's why. Therefore, it is not possible to determine whether the value of the variable in the program has been updated. The second problem is that the values before the program is executed cannot be displayed. The reason is that there is no means for displaying old data. Therefore, when trying to check the value before being updated, the check cannot be performed. As described above, the conventional software debug device is inconvenient when confirming the update of the value of a variable, and is an obstacle to appropriate debugging.

【0011】本発明の目的は、プログラムの実行に影響
を与えることなく、変数の値自体に変更があったときだ
けでなく、変数の値自体には変更が無かった場合でも、
変数値の更新を検出し、かつ更新前の値を確認すること
を可能にしたソフトウェア・デバッグ装置を提供するこ
とにある。
An object of the present invention is not only when the value of a variable is changed but also when the value of the variable itself is not changed without affecting the execution of a program.
It is an object of the present invention to provide a software debug device which can detect an update of a variable value and check a value before the update.

【0012】[0012]

【課題を解決するための手段】本発明は、デバッグ対象
となるプログラム中の変数を記憶する第1のメモリ手段
と、前記プログラムの実行による前記第1のメモリ手段
へのアクセス状況が記録される第2のメモリ手段と、前
記プログラムの実行後の前記変数の最新の値を格納する
最新データ格納手段と、前記プログラム実行前の前記変
数の値を格納する旧データ格納手段と、前記プログラム
の実行による前記第2のメモリ手段へのアクセス状況を
監視するステータス監視手段とを備えており、前記ステ
ータス監視手段は、前記第2のメモリ手段の監視からア
クセス・ステータスを取得し、このアクセス・ステータ
スに基づいて前記変数の値が更新されたかを検出し、そ
の検出に基づいて前記最新データ格納手段と旧データ格
納手段の各変数の値を表示する構成であることを特徴と
する。
According to the present invention, a first memory means for storing a variable in a program to be debugged and an access status to the first memory means by execution of the program are recorded. Second memory means, latest data storage means for storing the latest value of the variable after execution of the program, old data storage means for storing the value of the variable before execution of the program, and execution of the program And status monitoring means for monitoring an access status to the second memory means by the monitoring means. The status monitoring means obtains an access status from monitoring of the second memory means, and Detecting whether the value of the variable has been updated based on the detected value. Characterized in that it is configured to display the.

【0013】本発明の好ましい形態として、デバッグ対
象となるプログラムのデバッグを行うデバッガ部と、前
記プログラムの実行を行うエミュレータ部と、前記プロ
グラム中の変数の値を表示する出力装置とを備え、前記
エミュレータ部は、前記プログラム中のデータ等を記憶
するエミュレーション・メモリと、プログラムの実行に
よる前記エミュレーション・メモリへのアクセス状況が
記録されるカバレッジ・メモリと、プログラムを実行す
るエミュレーション部とを備え、前記デバッガ部は、前
記プログラム中の各変数の変数情報を格納する変数情報
テーブルと、各変数の最新の値を格納する最新データ格
納部と、各変数のプログラム実行前の値を格納する旧デ
ータ格納部と、各変数の最新の値を表示する変数値表示
部と、各変数の実行前の値を表示する旧変数値表示部
と、前記カバレッジ・メモリを監視して前記プログラム
の実行による前記エミュレーション・メモリへのアクセ
ス状況を監視するカバレッジ・ステータス監視部と、プ
ログラムを実行する直前にカバレッジの書き込みステー
タスをクリアするカバレッジ・メモリ初期化部とを備
え、前記カバレッジ・ステータス監視部は、前記カバレ
ッジ・メモリのアドレスからアクセス・ステータスを取
得し、前記変数の値が更新されたかを調べ、その結果を
前記変数値表示部と旧変数値表示部に通知する構成とす
る。
As a preferred embodiment of the present invention, the system comprises a debugger section for debugging a program to be debugged, an emulator section for executing the program, and an output device for displaying values of variables in the program. The emulator section includes an emulation memory that stores data and the like in the program, a coverage memory in which an access state to the emulation memory by executing the program is recorded, and an emulation section that executes the program. The debugger unit includes a variable information table that stores variable information of each variable in the program, a latest data storage unit that stores the latest value of each variable, and an old data storage that stores a value of each variable before program execution. Section, a variable value display section that displays the latest value of each variable, and the actual value of each variable. An old variable value display unit for displaying a previous value, a coverage status monitoring unit for monitoring the coverage memory and monitoring an access state to the emulation memory by executing the program, and immediately before executing the program. A coverage memory initialization unit that clears the coverage write status, the coverage status monitoring unit acquires an access status from the address of the coverage memory, and checks whether the value of the variable has been updated, The result is notified to the variable value display unit and the old variable value display unit.

【0014】本発明においては、デバッグ対象となるプ
ログラム、すなわち、ソース・プログラム中の変数は、
エミュレーション・メモリの中に割り当てられる。つま
り、ソース・プログラムの実行により、変数の値が更新
されるということは、その変数が割り当てられているエ
ミュレーション・メモリに対して書き込みが行われたこ
とと等価である。また、ソース・プログラムを実行する
ことにより、エミュレーション・メモリの各アドレスに
対してどのようなアクセスが行われたかをカバレッジ・
メモリに記録する。このため、エミュレーション・メモ
リの各アドレスに対応しているカバレッジ・メモリのス
テータスを見ることによって、変数の値が更新されたか
否かを判断することができる。このとき、注目するステ
ータスは、エミュレーション・メモリに対する書き込み
が行われたとき有効になるステータスで、書き込みステ
ータスと呼ばれる。例えば、値が「2」の変数に対し、
値「2」を代入すると、見かけ上は値に変化が無いが、
エミュレーション・メモリに対しては書き込みが行われ
ており、変数の値は更新されている。このため、その変
数が割り当てられているエミュレーション・メモリのア
ドレスに対応しているカバレッジ・メモリは、書き込み
ステータスが有効になっているので、値に変化があった
ことを知ることができる。この例のように、変数の値を
比べる方法では検出できなかった「同じ値への更新」
も、カバレッジ・メモリのステータスを監視することに
よって、検出することが可能となる。
In the present invention, a variable to be debugged, that is, a variable in a source program is:
Allocated in emulation memory. That is, updating the value of a variable by executing the source program is equivalent to writing to the emulation memory to which the variable is assigned. Also, by executing the source program, it is possible to determine what access was made to each address of the emulation memory.
Record in memory. Therefore, by checking the status of the coverage memory corresponding to each address of the emulation memory, it can be determined whether or not the value of the variable has been updated. At this time, the status of interest is a status that becomes valid when writing to the emulation memory is performed, and is called a write status. For example, for a variable with a value of "2",
When the value “2” is substituted, there is no apparent change in the value,
Writing has been performed to the emulation memory, and the value of the variable has been updated. For this reason, the coverage memory corresponding to the address of the emulation memory to which the variable is assigned can know that the value has changed since the write status is valid. "Update to the same value" that could not be detected by comparing the values of variables as in this example
Can also be detected by monitoring the status of the coverage memory.

【0015】[0015]

【発明の実施の形態】次に、本発明の実施形態を図面を
参照して説明する。図1を参照すると、本発明のソフト
ウェア・デバッグ装置は、ホスト・マシーン1内のデバ
ッグ対象となるロード・モジュール100と、デバッグ
を行うデバッガ部120と、デバッグされるユーザ・プ
ログラムの実行を行うエミュレータ部121と、ソース
・プログラム中の変数の値を表示する出力装置109
と、入力装置112を含んでいる。さらに、前記デバッ
ガ部120は、前記ロード・モジュール100の生成元
となったソース・プログラム中の各変数の変数情報を格
納した変数情報テーブル103と、各変数の最新の値を
格納する最新データ格納部104と、各変数のプログラ
ム実行前の値を格納する旧データ格納部105と、各変
数の最新の値を表示する手段である変数値表示部107
と、各変数の実行前の値を表示する手段である旧変数値
表示部108と、プログラムの実行によるメモリへのア
クセス状況を監視するカバレッジ・ステータス監視部1
06と、プログラムを実行する直前にカバレッジの書き
込みステータスをクリアするカバレッジ・メモリ初期化
部110とで構成される。また、前記エミュレータ部1
21は、エミュレーション・メモリ101と、プログラ
ムの実行によるメモリへのアクセス状況が記録されるカ
バレッジ・メモリ102と、プログラムの実行を行うエ
ミュレーション部122によって実現されている。
Next, embodiments of the present invention will be described with reference to the drawings. Referring to FIG. 1, a software debug device according to the present invention includes a load module 100 to be debugged in a host machine 1, a debugger unit 120 for debugging, and an emulator for executing a user program to be debugged. Unit 121 and output device 109 for displaying the value of a variable in the source program
And an input device 112. Further, the debugger unit 120 includes a variable information table 103 storing variable information of each variable in the source program from which the load module 100 is generated, and a latest data storage storing the latest value of each variable. Unit 104, an old data storage unit 105 for storing the value of each variable before program execution, and a variable value display unit 107 as a means for displaying the latest value of each variable.
And an old variable value display unit 108 as a means for displaying a value before execution of each variable, and a coverage status monitoring unit 1 for monitoring an access state to a memory by executing a program.
06, and a coverage memory initialization unit 110 that clears the coverage write status immediately before executing the program. The emulator unit 1
21 is realized by an emulation memory 101, a coverage memory 102 in which the state of access to the memory by the execution of the program is recorded, and an emulation unit 122 for executing the program.

【0016】前記各部について詳細に説明する。前記ロ
ード・モジュール100は、ユーザがC言語等の高級言
語によって作成したソース・プログラムをコンパイル及
びリンクを行い、デバッグ用の各種情報を含んだ機械語
に翻訳したものである。前記変数情報テーブル103
は、ロード・モジュール100の中のデバッグ情報から
取得した、ソース・プログラム中の各変数の変数情報
(変数の型やアドレスなどのシンボル情報)を格納す
る。前記最新データ格納部104は、変数情報テーブル
103に格納されている各変数のアドレス情報を元にし
て、エミュレーション・メモリ101から取得した各変
数の最新の値を格納する。前記旧データ格納部105
は、最新データ格納部104の内容がプログラムの実行
によって更新される前の変数の値を格納する。
The above components will be described in detail. The load module 100 compiles and links a source program created by a user in a high-level language such as C language, and translates the source program into a machine language containing various information for debugging. The variable information table 103
Stores the variable information (symbol information such as variable type and address) of each variable in the source program obtained from the debug information in the load module 100. The latest data storage unit 104 stores the latest value of each variable obtained from the emulation memory 101 based on the address information of each variable stored in the variable information table 103. The old data storage unit 105
Stores the value of a variable before the contents of the latest data storage unit 104 are updated by executing the program.

【0017】一方、前記エミュレータ部121のエミュ
レーション・メモリ101は、ユーザーの作成したプロ
グラム(ロード・モジュール100の中のコード)や、
データを格納する。また、前記カバレッジ・メモリ10
2は、プログラムの実行により、エミュレーション・メ
モリ101の各アドレスに対して、どのようなアクセス
(実行、読み出し、書き込み)がなされたかを記録す
る。ここで、前記エミュレーション・メモリ101とカ
バレッジ・メモリ102は、図6(a)のように一対一
に対応付けられているため、エミュレーション・メモリ
101の各アドレスに対して行われた実行、読み出し、
書き込みによるアクセスは、対応するカバレッジ・メモ
リ102に記録されることになる。したがって、前記カ
バレッジ・メモリ102に記録されたアクセス・ステー
タスの中で、特に、プログラム実行時の書き込みステー
タスを用いることで、プログラム実行時の変数値の更新
の有無を検出することが可能となる。この場合、1回の
ソース・プログラムの実行中(実行開始から実行停止ま
での間)でのエミュレーション・メモリ101に対する
書き込みのアクセスを検出する場合には、実行を始める
前に前記書き込みステータスを毎回クリアすることが必
要であり、この処理を行うのが前記カバレッジ・メモリ
初期化部110である。
On the other hand, the emulation memory 101 of the emulator section 121 stores programs (codes in the load module 100) created by the user,
Store the data. Further, the coverage memory 10
Numeral 2 records what access (execution, reading, and writing) has been made to each address of the emulation memory 101 by executing the program. Here, since the emulation memory 101 and the coverage memory 102 are associated one-to-one as shown in FIG. 6A, execution, reading, and execution performed for each address of the emulation memory 101 are performed.
The write access is recorded in the corresponding coverage memory 102. Therefore, by using the write status at the time of executing the program among the access statuses recorded in the coverage memory 102, it is possible to detect whether or not the variable value is updated at the time of executing the program. In this case, when detecting a write access to the emulation memory 101 during one execution of the source program (between the start of execution and the stop of execution), the write status is cleared each time before the execution is started. The coverage memory initialization unit 110 performs this processing.

【0018】さらに、前記出力装置109は、ユーザの
作成したソース・プログラムの中で、ユーザが指定した
変数の値を表示する。前記カバレッジ・ステータス監視
部106は、出力装置109に表示されている各変数が
割り当てられている各アドレスに対応しているカバレッ
ジ・メモリ102のアドレスからアクセス・ステータス
を取得し、出力装置109に表示されている各変数の値
に変化があったか調べ、その結果を変数値表示部107
と旧変数値表示部108に通知する。前記カバレッジ・
メモリ102において、各変数が割り当てられているエ
ミュレーション・メモリ101の各アドレスに対応して
いるアドレスの書き込みステータスが有効になっている
ということは、そのエミュレーション・メモリ101中
のアドレスに対して、書き込みが行われたということで
あり、変数に対して代入などの値の更新処理が実行され
たことになる。カバレッジ・メモリ102から取得した
アクセス・ステータスを調査した結果、書き込みステー
タスが有効であれば、変数値に変化があった旨を、有効
でなければ変化がなかった旨を変数値表示部107と旧
変数値表示部108に通知する。変数値表示部107
は、最新データ格納部104から取得した変数の値を出
力装置109に表示する。このとき、カバレッジ・ステ
ータス監視部106から変数値の変更がある旨を知らさ
れた場合は表示色を変え、変更がなかった場合は表示色
を変えずに表示する。前記旧変数値表示部108は、カ
バレッジ・ステータス監視部106から変数値の変更が
ある旨を知らされ、変更のあった値の表示部分に入力装
置112であるマウス・ポインタが置かれた場合にの
み、旧データ格納部105から実行前の変数値を取得し
て出力装置109に表示する。
Further, the output device 109 displays the value of a variable designated by the user in the source program created by the user. The coverage status monitoring unit 106 obtains an access status from an address of the coverage memory 102 corresponding to each address to which each variable displayed on the output device 109 is assigned, and displays the access status on the output device 109. It is checked whether the value of each variable has changed, and the result is displayed on the variable value display unit 107.
To the old variable value display unit 108. The coverage
In the memory 102, the fact that the write status of the address corresponding to each address of the emulation memory 101 to which each variable is assigned is valid means that writing to the address in the emulation memory 101 Has been performed, which means that a value update process such as assignment has been performed on the variable. As a result of investigating the access status acquired from the coverage memory 102, if the write status is valid, the variable value display unit 107 and the variable value display unit 107 indicate that the variable value has changed if the write status is valid. The variable value display unit 108 is notified. Variable value display unit 107
Displays the value of the variable acquired from the latest data storage unit 104 on the output device 109. At this time, when the coverage status monitoring unit 106 notifies that the variable value has been changed, the display color is changed, and when there is no change, the display is performed without changing the display color. The old variable value display unit 108 is notified by the coverage status monitoring unit 106 that a variable value has been changed, and when the mouse pointer serving as the input device 112 is placed on the display portion of the changed value. Only the variable value before execution is acquired from the old data storage unit 105 and displayed on the output device 109.

【0019】次に、図2のフローチャートを参照して図
1のソフトウェア・デバッグ装置の動作を説明する。図
2(a)のフローチャートは、ユーザがソース・プログ
ラム上に存在する変数の中で、値を監視したい変数を出
力装置109に表示するように操作したときの処理であ
る。また、図2(b)のフローチャートは、ユーザがソ
ース・プログラムの実行を行う操作をしたときの処理で
あり、図2(a)のフローチャートの処理により出力装
置109に表示された変数について、行われる処理であ
る。先ず、ユーザがソース・プログラム上に存在する変
数の中で、特定の変数の値を監視しようとした場合、出
力装置109に値を監視したい変数を表示させる操作を
ユーザが行う(ステップA1)。すると、本発明のソフ
トウェア・デバッグ装置は、ステップA1で指定された
変数の情報(型、アドレスなどのシンボル情報)をロー
ド・モジュール100の中のデバッグ情報から取得し、
変数情報テーブル103に格納する(ステップA2)。
さらに、変数情報テーブル103に格納されている各変
数のアドレス情報から、エミュレーション・メモリ10
1の中のどのアドレスに変数が割り当てられているかを
知ることができるので、そのアドレス値を元に、エミュ
レーション・メモリ101から各変数の最新の値を読み
出し、最新データ格納部104に格納する(ステップA
3)。そして、変数値表示部107が最新データ格納部
104に格納されている各変数の値を出力装置109に
出力する(ステップA4)。
Next, the operation of the software debug device of FIG. 1 will be described with reference to the flowchart of FIG. The flowchart in FIG. 2A is a process when the user operates to display a variable whose value is to be monitored on the output device 109 among variables existing in the source program. The flowchart of FIG. 2B is a process performed when the user performs an operation of executing the source program. The variables displayed on the output device 109 by the process of the flowchart of FIG. This is the process that is performed. First, when the user attempts to monitor the value of a specific variable among the variables existing in the source program, the user performs an operation of displaying the variable whose value is to be monitored on the output device 109 (step A1). Then, the software debugging apparatus of the present invention acquires the information of the variable specified in step A1 (symbol information such as type and address) from the debugging information in the load module 100,
It is stored in the variable information table 103 (step A2).
Further, based on the address information of each variable stored in the variable information table 103, the emulation memory 10
Since it is possible to know which address in 1 the variable is assigned to, the latest value of each variable is read from the emulation memory 101 based on the address value and stored in the latest data storage unit 104 ( Step A
3). Then, the variable value display unit 107 outputs the value of each variable stored in the latest data storage unit 104 to the output device 109 (Step A4).

【0020】また、ユーザによりソース・プログラムの
実行が促された場合は、まず、ソース・プログラムの実
行が開始される前に、カバレッジ・メモリ初期化部11
0が、カバレッジ・メモリ102の書き込みステータス
を初期化する(ステップA5)。その後、プログラムの
実行を開始する(ステップA6)。プログラムの実行中
にユーザからプログラム実行を停止する命令を受けた
か、1行だけ実行する命令(以後、1ステップ実行)だ
ったか、予め、ユーザによりプログラム実行を停止させ
る位置を指定されていたか等の停止要因により、プログ
ラムの実行が停止する(ステップA7)。プログラムの
実行が停止後、まず、旧データ格納部105に最新デー
タ格納部104の内容(実行前の各変数の値)を退避す
る(ステップA8)。ステップA7の終了後、エミュレ
ーション・メモリ101から各変数の最新の値を取得
し、最新データ格納部104に格納する(ステップA
9)。次に、カバレッジ・ステータス監視部106は、
カバレッジ・メモリ102の変数が割り当てられている
アドレスのアクセス・ステータスを取得し(ステップA
10)、書き込みステータスが有効か否かを調べる(ス
テップA11)。書き込みステータスが有効ならば、最
新の値を表示色を変えて表示する(ステップA12&ス
テップA4)。有効でなければ、表示色を変えず値を表
示する(ステップA4)。また、入力装置112である
マウス・ポインタの位置がどこにあるか調べる(ステッ
プA13)。マウス・ポインタが変化のあった値の上に
位置付けられている場合は、プログラム実行前の値を表
示する(ステップA14)。マウス・ポインタが変化の
あった値の上に位置付けられていない場合は、処理を続
ける(ステップA15)。
When the execution of the source program is prompted by the user, first, before the execution of the source program is started, the coverage memory initialization unit 11
0 initializes the write status of the coverage memory 102 (step A5). Thereafter, execution of the program is started (step A6). Whether a command to stop the program execution has been received from the user during the execution of the program, a command to execute only one line (hereinafter, one-step execution), a position at which the program execution is to be stopped has been previously specified by the user, and the like. The execution of the program is stopped by the stop factor (step A7). After the execution of the program is stopped, first, the contents of the latest data storage unit 104 (values of the variables before execution) are saved in the old data storage unit 105 (step A8). After step A7, the latest value of each variable is obtained from the emulation memory 101 and stored in the latest data storage unit 104 (step A).
9). Next, the coverage status monitoring unit 106
Obtain the access status of the address of the coverage memory 102 to which the variable is assigned (step A)
10), it is checked whether the write status is valid (step A11). If the write status is valid, the latest value is displayed in a different display color (step A12 & step A4). If not valid, the value is displayed without changing the display color (step A4). Further, it checks where the position of the mouse pointer as the input device 112 is (step A13). If the mouse pointer is positioned over the changed value, the value before executing the program is displayed (step A14). If the mouse pointer is not positioned over the changed value, the process continues (step A15).

【0021】以上の動作の具体例を図3のソース・プロ
グラムを例に取って説明する。図3のソース・プログラ
ムでは、プログラム中に、str ,p ,count ,zeroとい
う変数が存在する。これらは、図4の変数情報テーブル
の例にあるように、それぞれ、エミュレーション・メモ
リの各アドレス0x100 ,0x10A,0x10E,0x112 に割り
当てられている。この4つの変数の中で、特に変数coun
t とzeroに着目し、図1における動作を見る。先ず、図
3のソース・プログラムにおける10行目の実行につい
てみてみる。このとき、10行目を実行する直前の変数
count の値が「3」だとする。旧データ格納部105に
は、10行目を実行する直前の変数count の値が「3」
が格納されている。10行目を実行すると、変数p の値
を「1」インクリメントする(1つ増加させる)処理が
行われるので、変数count に対する代入処理は行われな
い。つまり、エミュレーション・メモリ101のアドレ
ス0x10Eに対して書き込みは行われない。よって、アド
レス0x10Eに対応しているカバレッジ・メモリ102の
書き込みステータスも無効のままである。このため、変
数値表示部107は、最新データ格納部104から取得
した値「3」を、出力装置109に表示する。
A specific example of the above operation will be described using the source program of FIG. 3 as an example. In the source program of FIG. 3, variables str, p, count, and zero exist in the program. These are assigned to the respective addresses 0x100, 0x10A, 0x10E, 0x112 of the emulation memory as shown in the example of the variable information table in FIG. Among these four variables, especially the variable coun
Focusing on t and zero, the operation in FIG. First, consider the execution of the tenth line in the source program of FIG. At this time, the variable just before executing the 10th line
Assume that the value of count is "3". In the old data storage unit 105, the value of the variable count immediately before the execution of the tenth line is “3”.
Is stored. When the 10th line is executed, the process of incrementing the value of the variable p by “1” (incrementing it by one) is performed, so that the substitution process for the variable count is not performed. That is, writing is not performed on the address 0x10E of the emulation memory 101. Therefore, the write status of the coverage memory 102 corresponding to the address 0x10E remains invalid. Therefore, the variable value display unit 107 displays the value “3” obtained from the latest data storage unit 104 on the output device 109.

【0022】次に、次の11行目の実行についてみてみ
ると、11行目を実行する直前の変数count の値は
「3」であり、旧データ格納部105には、11行目を
実行する直前の変数count の値「3」が格納される。1
1行目を実行すると、変数countの値を「1」インクリ
メントする処理が行われるので、変数count に対して代
入処理が行われる。つまり、エミュレーション・メモリ
101のアドレス0x10Eに対して書き込みが行われる。
よって、アドレス0x10Eに対応しているカバレッジ・メ
モリ102の書き込みステータスが有効になる。このた
め、変数値表示部107は、最新データ格納部104か
ら取得した値「4」を、出力装置109に表示色を変え
て表示する。表示色を変えて表示されている値「4」の
上にマウス・ポインタが置かれた場合は、旧変数値表示
部108が、旧データ格納部105から実行前の変数の
値「3」を取得して出力装置109に表示する。
Next, looking at the execution of the next eleventh line, the value of the variable count immediately before the execution of the eleventh line is “3”, and the old data storage unit 105 executes the eleventh line. The value “3” of the variable “count” immediately before is stored. 1
When the first line is executed, a process of incrementing the value of the variable “count” by “1” is performed, so that an assignment process is performed on the variable “count”. That is, writing is performed to the address 0x10E of the emulation memory 101.
Therefore, the write status of the coverage memory 102 corresponding to the address 0x10E becomes valid. For this reason, the variable value display unit 107 displays the value “4” obtained from the latest data storage unit 104 on the output device 109 with a different display color. When the mouse pointer is placed on the value “4” displayed with the display color changed, the old variable value display unit 108 displays the variable value “3” before execution from the old data storage unit 105. The acquired information is displayed on the output device 109.

【0023】次に、13行目の実行における変数zeroつ
いてみてみると、13行目を実行する直前の変数zero値
は「0」であり、旧データ格納部105には、13行目
を実行する直前の変数zero値の「0」が格納される。1
3行目を実行すると、変数zeroに対して「0」を代入す
る処理が行われるため、エミュレーション・メモリ10
1のアドレス0x112 に対して書き込みが行われる。よっ
て、アドレス0x112 に対応しているカバレッジ・メモリ
102の書き込みステータスが有効になる。このため、
変数値表示部107は、最新データ格納部104から取
得した値「0」を、出力装置109に表示色を変えて表
示する。表示色を変えて表示されている変数の値「0」
の上にマウス・ポインタが置かれた場合は、旧変数値表
示部108が、旧データ格納部105から実行前の変数
の値「0」を取得して出力装置109に表示する。
Next, regarding the variable zero in the execution of the thirteenth line, the value of the variable zero immediately before the execution of the thirteenth line is “0”, and the old data storage unit 105 executes the execution of the thirteenth line. The value “0” of the variable zero immediately before is stored. 1
When the third line is executed, a process of substituting “0” for the variable zero is performed.
Writing is performed to address 1x112. Therefore, the write status of the coverage memory 102 corresponding to the address 0x112 becomes valid. For this reason,
The variable value display unit 107 displays the value “0” obtained from the latest data storage unit 104 on the output device 109 by changing the display color. Variable value "0" displayed with different display color
When the mouse pointer is placed on the variable, the old variable value display unit 108 acquires the value “0” of the variable before execution from the old data storage unit 105 and displays it on the output device 109.

【0024】以上の動作を詳細に説明する。ここでは、
前記した図3のソース・プログラムについて、図4の変
数情報テーブルと、図5(a)〜(c)の出力装置との
例と、図6(a)〜(c)のエミュレーション・メモリ
101とカバレッジ・メモリ102の関係から、変数co
unt とzeroを例にとり、プログラムの実行により値に変
化が無い場合とあった場合の動作について説明する。先
ず、図3のソース・プログラムにおいて、9行目まで実
行が行われていたとき、ユーザが変数count を出力装置
109に表示させる処理を行ったとする。また、この時
点での変数count の値は「3」だったとする。ユーザが
変数count を出力装置109に表示させる処理を行う
と、デバッガ部120では、まず、ロード・モジュール
100の中のデバッグ情報から取得した変数count のシ
ンボル情報を変数情報テーブル103に登録する。次
に、エミュレーション・メモリ101からアドレス0x10
E(変数情報テーブル103に格納されているアドレ
ス)の値「3」を読み出し、最新データ格納部104に
格納する。変数値表示部107は、最新データ格納部1
04に格納された変数count の値「3」を表示色を変え
ず、出力装置109に表示する。
The above operation will be described in detail. here,
For the source program of FIG. 3, the variable information table of FIG. 4, an example of the output device of FIGS. 5 (a) to 5 (c), and the emulation memory 101 of FIGS. 6 (a) to 6 (c). From the relationship of the coverage memory 102, the variable co
Using unt and zero as examples, the operation in the case where there is no change in the value due to the execution of the program and the case where the value does not change will be described. First, in the source program of FIG. 3, it is assumed that when the execution is performed up to the ninth line, the user performs a process of displaying the variable count on the output device 109. Also, assume that the value of the variable count at this point is “3”. When the user performs a process of displaying the variable count on the output device 109, the debugger unit 120 first registers the symbol information of the variable count acquired from the debug information in the load module 100 in the variable information table 103. Next, from the emulation memory 101, the address 0x10
The value “3” of E (address stored in the variable information table 103) is read and stored in the latest data storage unit 104. The variable value display unit 107 is the latest data storage unit 1
The value “3” of the variable “count” stored in 04 is displayed on the output device 109 without changing the display color.

【0025】ここで、ユーザが10行目を実行してプロ
グラムを停止する操作を行ったとする。まず、カバレッ
ジ・メモリ初期化部110がカバレッジ・メモリ102
の書き込みステータスを初期化する。実行終了後、最新
データ格納部104から旧データ格納部105にプログ
ラム実行前の値「3」を退避する。プログラム実行前の
値を退避した後、エミュレーション・メモリ101から
アドレス0x10Eの値「3」を読み出し、最新データ格納
部104に格納する。次に、カバレッジ・ステータス監
視部106で、エミュレーション・メモリ101のアド
レス0x10Eに対応しているカバレッジ・メモリ102の
アクセス・ステータスを取得し、書き込みステータスが
有効か否かを調べる。この場合、カバレッジ・メモリ1
02は、図6(a)のようになっており、変数count が
割り当てられているアドレスには、書き込みステータス
が有効になっていないので、変数値表示部107と旧変
数値表示部108に値に変更がなかったことを伝える。
変数値表示部107は、最新データ格納部104から値
「3」を取得し、図5(a)のように、表示色を変えず
に出力装置109に値を表示する。
Here, it is assumed that the user performs an operation of executing the tenth line to stop the program. First, the coverage memory initialization unit 110 executes the operation of the coverage memory 102.
Initialize the write status of. After the execution is completed, the value “3” before program execution is saved from the latest data storage unit 104 to the old data storage unit 105. After saving the value before the program is executed, the value “3” at the address 0x10E is read from the emulation memory 101 and stored in the latest data storage unit 104. Next, the coverage status monitoring unit 106 acquires the access status of the coverage memory 102 corresponding to the address 0x10E of the emulation memory 101, and checks whether the write status is valid. In this case, the coverage memory 1
02 is as shown in FIG. 6A. Since the write status is not valid at the address to which the variable count is assigned, the value is displayed in the variable value display unit 107 and the old variable value display unit 108. Tell that there were no changes.
The variable value display unit 107 acquires the value “3” from the latest data storage unit 104, and displays the value on the output device 109 without changing the display color as shown in FIG.

【0026】次に、ユーザが11行目を実行してプログ
ラムを停止する操作を行ったとする。まず、カバレッジ
・メモリ初期化部110がカバレッジ・メモリ102の
書き込みステータスを初期化する。実行終了後、最新デ
ータ格納部104から旧データ格納部105にプログラ
ム実行前の値「3」を待避する。プログラム実行前の値
を待避した後、エミュレーション・メモリ101からア
ドレス0x10Eの値「4」を読み出し、最新データ格納部
104に格納する。次に、カバレッジ・ステータス監視
部106で、エミュレーション・メモリ101のアドレ
ス0x10Eに対応しているカバレッジ・メモリ102のア
クセス・ステータスを取得し、書き込みステータスが有
効か否かを調べる。この場合、カバレッジ・メモリ10
2は、図6(b)のようになっており、変数count が割
り当てられているアドレスには、書き込みステータスが
有効になっているので、変数値表示部107と旧変数値
表示部108に値に変更があったことを伝える。変数値
表示部107は、最新データ格納部104から値「4」
を取得し、表示色を変えて出力装置109に値を表示す
る。変数値「4」(実行後の値)の上にマウス・ポイン
タが置かれたら、旧変数値表示部108は、旧データ格
納部105から値「3」(実行前の値)を取得し、図5
(b)のように、出力装置109に値を表示する。
Next, it is assumed that the user performs an operation of executing the eleventh line to stop the program. First, the coverage memory initialization unit 110 initializes the write status of the coverage memory 102. After the execution is completed, the value “3” before the execution of the program is saved from the latest data storage unit 104 to the old data storage unit 105. After saving the value before executing the program, the value “4” at the address 0x10E is read from the emulation memory 101 and stored in the latest data storage unit 104. Next, the coverage status monitoring unit 106 acquires the access status of the coverage memory 102 corresponding to the address 0x10E of the emulation memory 101, and checks whether the write status is valid. In this case, the coverage memory 10
2 is as shown in FIG. 6B. Since the write status is valid at the address to which the variable count is assigned, the value is displayed in the variable value display unit 107 and the old variable value display unit 108. Tell them that there has been a change. The variable value display unit 107 reads the value “4” from the latest data storage unit 104.
Is acquired, and the value is displayed on the output device 109 by changing the display color. When the mouse pointer is placed on the variable value “4” (the value after execution), the old variable value display unit 108 acquires the value “3” (the value before execution) from the old data storage unit 105, FIG.
The value is displayed on the output device 109 as shown in FIG.

【0027】ここで、ユーザが変数zeroを出力装置10
9に表示させる処理を行ったとする。11行目まで実行
が終了した時点での変数zeroの値は「0」である。この
とき、デバッガ部120は、まず、ロード・モジュール
100の中のデバッグ情報から取得した変数zeroのシン
ボル情報を変数情報テーブル103に登録する。さら
に、エミュレーション・メモリ101からアドレス0x11
2 (変数情報テーブル103に格納されているアドレ
ス)の値「0」を読み出し、最新データ格納部104に
格納する。変数値表示部107は、最新データ格納部1
04に格納された変数zeroの値「0」を表示色を変え
ず、出力装置109に表示する。
Here, the user sets the variable zero in the output device 10.
It is assumed that a process for displaying the image on the screen 9 has been performed. The value of the variable zero at the time when the execution is completed up to the eleventh line is “0”. At this time, the debugger unit 120 first registers the symbol information of the variable zero acquired from the debug information in the load module 100 in the variable information table 103. Further, the address 0x11 is read from the emulation memory 101.
2 The value “0” of (the address stored in the variable information table 103) is read and stored in the latest data storage unit 104. The variable value display unit 107 is the latest data storage unit 1
The value “0” of the variable zero stored in 04 is displayed on the output device 109 without changing the display color.

【0028】さらに、ユーザが13行目までを実行して
プログラムを停止する操作を行ったとする。まず、カバ
レッジ・メモリ初期化部110がカバレッジ・メモリ1
02の書き込みステータスを初期化する。実行終了後、
最新データ格納部104から旧データ格納部105にプ
ログラム実行前の値「0」を待避する。プログラム実行
前の値を待避した後、エミュレーション・メモリ101
からアドレス0x112 の値「0」を読み出し、最新データ
格納部104に格納する。次に、カバレッジ・ステータ
ス監視部106で、エミュレーション・メモリ101の
アドレス0x112に対応しているカバレッジ・メモリ10
2のアクセス・ステータスを取得し、書き込みステータ
スが有効か否かを調べる。この場合、カバレッジ・メモ
リ102は、図6(c)のようになっており、変数zero
が割り当てられているアドレスには、書き込みステータ
スが有効になっているので、変数値表示部107と旧変
数値表示部108に値に変更があったことを伝える。変
数値表示部107は、最新データ格納部104から値
「0」(実行後の値)を取得し、表示色を変えて出力装
置109に値を表示する。変数値0の上にマウス・ポイ
ンタが置かれたら、旧変数値表示部108は、旧データ
格納部105から「0」(実行前の値)を取得し、図5
(c)のように、ポップアップ表示する。
Further, it is assumed that the user performs an operation to stop the program by executing up to the thirteenth line. First, the coverage memory initialization unit 110 determines whether the coverage memory 1
02 is initialized. After the execution ends,
The value “0” before executing the program is saved from the latest data storage unit 104 to the old data storage unit 105. After saving the value before executing the program, the emulation memory 101
The value “0” at the address 0x112 is read out from the storage unit 104 and stored in the latest data storage unit 104. Next, the coverage status monitoring unit 106 checks the coverage memory 10 corresponding to the address 0x112 of the emulation memory 101.
2 is obtained, and it is checked whether the write status is valid. In this case, the coverage memory 102 is as shown in FIG.
Since the write status is valid for the address to which is assigned, the variable value display unit 107 and the old variable value display unit 108 are notified that the value has been changed. The variable value display unit 107 acquires the value “0” (the value after execution) from the latest data storage unit 104, and changes the display color to display the value on the output device 109. When the mouse pointer is placed over the variable value 0, the old variable value display unit 108 acquires “0” (the value before execution) from the old data storage unit 105, and
A pop-up is displayed as shown in FIG.

【0029】[0029]

【発明の効果】以上説明したように本発明は、プログラ
ム中の変数を記憶する第1のメモリ手段へのアクセス状
況が記録される第2のメモリ手段をステータス監視手段
によって監視し、この監視による得られるアクセス・ス
テータスに基づいて変数の値が更新されたかを検出し、
その検出に基づいてプログラム実行後の最新の変数と実
行前の旧変数を表示するように構成しているので、次の
ような効果を得ることができる。第1の効果は、変数の
値がプログラムの実行によって、異なる値へ変更された
こと、例えば、「0」→「1」への変数値の変更だけで
なく、同じ値へ変更されたこと、例えば「0」→「0」
への変数値の変更も、プログラムの実行に影響を与えず
に、検出することができる。その理由は、従来の新旧デ
ータの比較では検出することができなった同じ値への変
化を、第2のメモリ手段での書き込みステータスを監視
することにより検出するため、異なる値への変化だけで
なく、同じ値への変化も検出することができるのであ
る。また、第2の効果は、プログラムの実行により、値
に変更があった変数に関して、プログラム実行前の値を
最新の値を表示しているウィンドウ上に表示できること
にある。その理由は、旧データを保持し、旧データを表
示する機能を備え、第2のメモリ手段に記録された書き
込みステータスにより、値が変更された変数が特定でき
るためである。
As described above, according to the present invention, the status monitoring means monitors the second memory means in which the access status to the first memory means for storing the variables in the program is recorded. Detect if the value of a variable has been updated based on the access status obtained,
Based on the detection, the latest variables after the execution of the program and the old variables before the execution are displayed, so that the following effects can be obtained. The first effect is that the value of the variable is changed to a different value by executing the program, for example, that the variable value is changed not only from “0” to “1” but also to the same value, For example, "0" → "0"
The change of the variable value to can be detected without affecting the execution of the program. The reason is that a change to the same value, which could not be detected by the comparison of the old and new data, is detected by monitoring the write status in the second memory means. Instead, a change to the same value can be detected. A second effect is that, for a variable whose value has been changed by execution of a program, the value before execution of the program can be displayed on a window displaying the latest value. The reason is that a function of retaining old data and displaying old data is provided, and a variable whose value has been changed can be specified by the write status recorded in the second memory means.

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

【図1】本発明のデバッグ装置のブロック構成図であ
る。
FIG. 1 is a block diagram of a debugging device according to the present invention.

【図2】本発明の動作を説明するためのフローチャート
である。
FIG. 2 is a flowchart for explaining the operation of the present invention.

【図3】デバッグ装置での動作を説明するためのソース
・プログラムの一例である。
FIG. 3 is an example of a source program for explaining the operation of the debugging device.

【図4】図3のソース・プログラムの変数情報テーブル
例を示す図である。
FIG. 4 is a diagram showing an example of a variable information table of the source program of FIG. 3;

【図5】出力装置の表示例を示す図である。FIG. 5 is a diagram illustrating a display example of an output device.

【図6】エミュレーション・メモリとカバレッジ・メモ
リの対応関係を示す図である。
FIG. 6 is a diagram showing a correspondence between an emulation memory and a coverage memory;

【図7】従来のデバッグ装置の一例のブロック構成図で
ある。
FIG. 7 is a block diagram illustrating an example of a conventional debugging device.

【図8】従来のデバッグ装置の動作を説明するためのフ
ローチャートである。
FIG. 8 is a flowchart for explaining the operation of the conventional debugging device.

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

1 ホスト・マシーン 100 ロード・モジュール 101 エミュレーション・メモリ 102 カバレッジ・メモリ 103 変数情報テーブル 104 最新データ格納部 105 旧データ格納部 106 旧変数値表示部 107 変数値表示部 108 カバレッジ・ステータス監視部 109 出力装置 110 カバレッジ・メモリ初期化部 111 データ比較部 112 入力装置 120 デバッガ部 121 エミュレータ部 122 エミュレーション部 1 Host Machine 100 Load Module 101 Emulation Memory 102 Coverage Memory 103 Variable Information Table 104 Latest Data Storage 105 Old Data Storage 106 Old Variable Value Display 107 Variable Value Display 108 Coverage Status Monitor 109 Output Device 110 Coverage memory initialization unit 111 Data comparison unit 112 Input device 120 Debugger unit 121 Emulator unit 122 Emulation unit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 デバッグ対象となるプログラム中の変数
を記憶する第1のメモリ手段と、前記プログラムの実行
による前記第1のメモリ手段へのアクセス状況が記録さ
れる第2のメモリ手段と、前記プログラムの実行後の前
記変数の最新の値を格納する最新データ格納手段と、前
記プログラム実行前の前記変数の値を格納する旧データ
格納手段と、前記プログラムの実行による前記第2のメ
モリ手段へのアクセス状況を監視するステータス監視手
段とを備えており、前記ステータス監視手段は、前記第
2のメモリ手段の監視からアクセス・ステータスを取得
し、このアクセス・ステータスに基づいて前記変数の値
が更新されたかを検出し、その検出に基づいて前記最新
データ格納手段と旧データ格納手段の各変数の値を表示
する構成であることを特徴とするソフトウェア・デバッ
グ装置。
A first memory for storing a variable in a program to be debugged; a second memory for recording an access state to the first memory by execution of the program; To the latest data storage means for storing the latest value of the variable after execution of the program, to the old data storage means for storing the value of the variable before execution of the program, and to the second memory means by execution of the program Status monitoring means for monitoring an access status of the second memory means, wherein the status monitoring means obtains an access status from monitoring of the second memory means, and updates the value of the variable based on the access status. Configuration to detect whether the data has been deleted and to display the values of the variables in the latest data storage means and the old data storage means based on the detection. A software debug device characterized by the following.
【請求項2】 デバッグ対象となるプログラムのデバッ
グを行うデバッガ部と、前記プログラムの実行を行うエ
ミュレータ部と、前記プログラム中の変数の値を表示す
る出力装置とを備え、前記エミュレータ部は、前記プロ
グラム中のデータ等を記憶するエミュレーション・メモ
リと、プログラムの実行による前記エミュレーション・
メモリへのアクセス状況が記録されるカバレッジ・メモ
リと、プログラムを実行するエミュレーション部とを備
え、前記デバッガ部は、前記プログラム中の各変数の変
数情報を格納する変数情報テーブルと、各変数の最新の
値を格納する最新データ格納部と、各変数のプログラム
実行前の値を格納する旧データ格納部と、各変数の最新
の値を表示する変数値表示部と、各変数の実行前の値を
表示する旧変数値表示部と、前記カバレッジ・メモリを
監視して前記プログラムの実行による前記エミュレーシ
ョン・メモリへのアクセス状況を監視するカバレッジ・
ステータス監視部と、プログラムを実行する直前にカバ
レッジの書き込みステータスをクリアするカバレッジ・
メモリ初期化部とを備え、前記カバレッジ・ステータス
監視部は、前記カバレッジ・メモリのアドレスからアク
セス・ステータスを取得し、前記変数の値が更新された
かを調べ、その結果を前記変数値表示部と旧変数値表示
部に通知する構成としたことを特徴とするソフトウェア
・デバッグ装置。
A debugger section for debugging a program to be debugged; an emulator section for executing the program; and an output device for displaying a value of a variable in the program. An emulation memory for storing data and the like in the program; and an emulation memory for executing the program.
A coverage memory in which an access state to the memory is recorded; and an emulation unit that executes the program. The debugger unit includes a variable information table that stores variable information of each variable in the program, and a latest information of each variable. The latest data storage unit that stores the value of each variable, the old data storage unit that stores the value of each variable before the program is executed, the variable value display unit that displays the latest value of each variable, and the value before execution of each variable An old variable value display unit for displaying the program, and a coverage unit for monitoring the coverage memory to monitor an access state to the emulation memory by executing the program.
A status monitor and a coverage monitor that clears the coverage write status immediately before executing the program
A memory initialization unit, wherein the coverage status monitoring unit acquires an access status from an address of the coverage memory, checks whether the value of the variable has been updated, and displays the result with the variable value display unit. A software debugging device characterized in that a notification is provided to an old variable value display section.
【請求項3】 前記最新データ格納部は、前記変数情報
テーブルに格納されている各変数のアドレス情報を元に
して、前記エミュレーション・メモリから取得した各変
数の最新の値を格納し、前記旧データ格納部は、前記最
新データ格納部の内容がプログラムの実行によって更新
される前の変数の値を格納することを特徴とする請求項
2に記載のソウトウェア・デバッグ装置。
3. The latest data storage unit stores the latest value of each variable obtained from the emulation memory based on the address information of each variable stored in the variable information table, The software debug device according to claim 2, wherein the data storage unit stores a value of a variable before the content of the latest data storage unit is updated by executing a program.
【請求項4】 前記変数値表示部は、前記最新データ格
納部から取得した変数の値を前記出力装置に出力し、前
記カバレッジ・ステータス監視部から変数の更新が通知
されたときには前記取得した変数の表示色を変え、更新
がなかった場合は表示色を変えずに表示を行い、また前
記旧変数値表示部は前記旧データ格納部から取得した変
数の値を前記出力装置に出力し、前記カバレッジ・ステ
ータス監視部から変数の更新が通知されたときには、変
更のあった値の表示部分にマウス・ポインタが置かれた
場合にのみ、取得した変数を表示することを特徴とする
請求項2または3に記載のソフトウェア・デバッグ装
置。
4. The variable value display unit outputs the value of the variable obtained from the latest data storage unit to the output device, and when the coverage status monitoring unit notifies the update of the variable, the obtained variable value is displayed. Change the display color of, if there is no update, perform display without changing the display color, and the old variable value display unit outputs the value of the variable obtained from the old data storage unit to the output device, 3. The acquired variable is displayed only when the mouse pointer is placed on the display portion of the changed value when the update of the variable is notified from the coverage status monitoring unit. 4. The software debugging device according to 3.
JP12388099A 1999-04-30 1999-04-30 Software debugging equipment Expired - Fee Related JP3298554B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12388099A JP3298554B2 (en) 1999-04-30 1999-04-30 Software debugging equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12388099A JP3298554B2 (en) 1999-04-30 1999-04-30 Software debugging equipment

Publications (2)

Publication Number Publication Date
JP2000315166A true JP2000315166A (en) 2000-11-14
JP3298554B2 JP3298554B2 (en) 2002-07-02

Family

ID=14871662

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12388099A Expired - Fee Related JP3298554B2 (en) 1999-04-30 1999-04-30 Software debugging equipment

Country Status (1)

Country Link
JP (1) JP3298554B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101400396B1 (en) * 2012-09-05 2014-05-27 재단법인대구경북과학기술원 Real-time embedded software deburgging method using memory address
JP2015018467A (en) * 2013-07-12 2015-01-29 デジタルセンセーション株式会社 Information processor, and information processing method
JP2020071601A (en) * 2018-10-30 2020-05-07 カシオ計算機株式会社 Display processing device, display processing method, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101400396B1 (en) * 2012-09-05 2014-05-27 재단법인대구경북과학기술원 Real-time embedded software deburgging method using memory address
JP2015018467A (en) * 2013-07-12 2015-01-29 デジタルセンセーション株式会社 Information processor, and information processing method
JP2020071601A (en) * 2018-10-30 2020-05-07 カシオ計算機株式会社 Display processing device, display processing method, and program

Also Published As

Publication number Publication date
JP3298554B2 (en) 2002-07-02

Similar Documents

Publication Publication Date Title
US8813037B2 (en) Debugging a high performance computing program
US6550056B1 (en) Source level debugger for debugging source programs
US7266809B2 (en) Software debugger and software development support system for microcomputer operable to execute conditional execution instruction
CN108664380B (en) After-execution software debugging system with performance display and debugging method
EP0455946A2 (en) System for debugging shared memory multiprocessor computers
JP3298554B2 (en) Software debugging equipment
JP3358759B2 (en) Data trace method for programmable controller
US8468393B2 (en) Triggering diagnostic operations within a data processing apparatus
JPS5840772B2 (en) Data comparison match display method
JP3001470B2 (en) Boot failure detection system for personal computer
JP4192519B2 (en) Information processing method and apparatus
JP2001202272A (en) Debugging method, debugging device using this method and recording medium with debugging method recorded thereon
JP3101458B2 (en) Program error detection device
JPH03294934A (en) Debugger for high level program lenguage
JP2001265619A (en) Data tracing system
JPS59177660A (en) Logging system of diagnostic result in electronic computer
JPH05334135A (en) Error information display system for abnormal end of program
JPS63294049A (en) Key telephone system
JPH01145740A (en) Emulator for multi-process
JPH0131215B2 (en)
JPH04337847A (en) Program check method
JPH05324396A (en) Program traveling history recording system
JPH07319724A (en) Emulation cpu
JP2003015907A (en) Debugging device, debugger and program recording medium
JPH04149746A (en) Debug device

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080419

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090419

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100419

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110419

Year of fee payment: 9

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110419

Year of fee payment: 9

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120419

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120419

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130419

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140419

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees