JPH11110256A - Device and method for debugging program, and computer readable recording medium recorded with the method for the same - Google Patents

Device and method for debugging program, and computer readable recording medium recorded with the method for the same

Info

Publication number
JPH11110256A
JPH11110256A JP9272792A JP27279297A JPH11110256A JP H11110256 A JPH11110256 A JP H11110256A JP 9272792 A JP9272792 A JP 9272792A JP 27279297 A JP27279297 A JP 27279297A JP H11110256 A JPH11110256 A JP H11110256A
Authority
JP
Japan
Prior art keywords
script
debug
program
file
log
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9272792A
Other languages
Japanese (ja)
Inventor
Izuru Miyamoto
出 宮本
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP9272792A priority Critical patent/JPH11110256A/en
Publication of JPH11110256A publication Critical patent/JPH11110256A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To debug a program by generating an object file so that the debugging object and the final object are managed with the same execution object a mem ory of target machine side is not burdened in debugging. SOLUTION: An object file 24 generated by a compiler 21 based on a source file 23 is divided into a debug script file activated in debugging, an execution object file which does not include a debug script, and a symbol table of debug script activation information relating the debug script with a position of a source line. In downloading the execution object file in a target machine 11, executing this file and debugging it, when an execution of the program reaches the debug script part, a debugger 22 executes a debug script file on a host machine on the basis of debug script activation information and executes a debug.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、コンピュータプロ
グラム開発時のコンパイラと、デバッガを備えたプログ
ラムデバッグ装置、プログラムデバッグ方法、及びその
方法を記録したコンピュータ読取り可能な記録媒体に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiler for developing a computer program, a program debugging device having a debugger, a program debugging method, and a computer-readable recording medium recording the method.

【0002】[0002]

【従来の技術】従来、組込みシステムのアプリケーショ
ン開発の際等に於いて、ターゲットシステム上のプログ
ラムのデバッグを行なう際、エラーチェックルーチンを
組込んでデバッグを行ない、プログラムをリリースする
際にはエラーチェックルーチンを含まないコードを改め
て生成するケースが多々あった。
2. Description of the Related Art Conventionally, in developing an application of an embedded system, when debugging a program on a target system, an error check routine is incorporated and debugging is performed. When releasing a program, an error check is performed. In many cases, code without routines was generated anew.

【0003】この場合は、再コンパイルが必要であり開
発効率が悪い。また、エラーチェックルーチンの有無と
いうデバッグ時とリリース時ではプログラム自体が異な
ることによる物件管理面での問題、エラーチェックルー
チンを含むためデバッグ時により多くのメモリを必要と
するという問題もあった。
In this case, recompilation is required and the development efficiency is low. In addition, there is a problem in property management due to the difference between the program itself at the time of debugging and the release at the time of the presence or absence of an error check routine, and a problem that more memory is required at the time of debugging because the error check routine is included.

【0004】一般に、プログラム開発者は、プログラム
を記述する場合、それをデバッグすることを意識して作
成する場合が多い。具体的には、ソースファイルにエラ
ーチェックルーチンを含めておくことが多い。そしてコ
ンパイルオプションでこれを有効にしてコンパイルし、
実行モジュールを作成してデバッグする。
In general, when writing a program, a program developer often creates the program in consideration of debugging. Specifically, an error check routine is often included in the source file. And compile with this enabled in the compile options,
Create and debug an executable.

【0005】デバッグが完了すると、このようなコード
を無効にしてコンパイルすることで最終プログラムを生
成する。特に、組込み製品でのプログラムでは最終的に
エラー処理ルーチンは除きたい場合が多々ある。
When the debugging is completed, a final program is generated by invalidating such code and compiling. In particular, there are many cases where it is desired to finally eliminate the error processing routine in a program for an embedded product.

【0006】また、多くのデバッガでは、スクリプト記
述が可能であり、新たなデバッグコマンドを記述したり
することはできるが、ソースプログラムと独立である。
具体的なイメージを擬似言語で記述すれば、以下のよう
なコードを開発者が記述することになる。
In many debuggers, a script can be described and a new debug command can be described, but is independent of a source program.
If a specific image is described in a pseudo language, the following code will be described by the developer.

【0007】 DEBUGをオンにして(コンパイルして)オブジェク
トを生成しデバッグ完了したあと、DEBUGをオフに
して再度(コンパイルして)オブジェクトを生成し最終
物件を作成する。
[0007] After DEBUG is turned on (compiled) to generate an object and debugging is completed, DEBUG is turned off and the object is generated again (compiled) to create a final property.

【0008】これでは、デバッグ時のオブジェクトと最
終的なオブジェクトとが別ものになり、管理上の問題を
生じたり、再コンパイルが必要で開発効率が悪い。ま
た、デバッグ時では、最終プログラムより多くのコード
を含むため、一時的にせよ、メモリを多く必要としてし
まう。これは、メモリに厳しい制限のある組込み製品な
どの場合、問題となる場合がある。
[0008] In this case, the object at the time of debugging is different from the final object, which causes a management problem and requires recompilation, resulting in poor development efficiency. Also, at the time of debugging, since more code is included than the final program, more memory is required even temporarily. This can be problematic for embedded products with strict memory restrictions.

【0009】[0009]

【発明が解決しようとする課題】上述したように問題点
を解決するには、以下のような開発環境が提供されるこ
とが望ましい。1.デバッグ時物件と、最終物件とを同
じ実行オブジェクトで管理できる。
In order to solve the problems as described above, it is desirable to provide the following development environment. 1. The property at the time of debugging and the final property can be managed with the same execution object.

【0010】2.デバッグ処理時に、ターゲットマシン
側のメモリ負担がないようにする。これらの開発環境
は、コンパイラやデバッガに係わる部分を従来と変更す
ることで実現される。
[0010] 2. Make sure there is no memory load on the target machine during debugging. These development environments are realized by changing the parts related to the compiler and the debugger from the conventional one.

【0011】そこで、本発明は上記事情を考慮してなさ
れたもので、デバッグ用スクリプト記述やプログラムの
記述言語による(主にエラーチェックなどの)記述を、
ソースファイル内に記述可能で、コンパイラが自動的に
それを抽出してオブジェクトファイル内に保存し、デバ
ッグ時の開発者(デバッガ操作者)の要求に従い、プロ
グラム実行時に自動的にデバッグ用スクリプト記述やプ
ログラムの記述言語による(主にエラーチェックなど
の)記述を実行することで、デバッグ時物件と最終物件
とを同一のオブジェクトファイルとして扱うことがで
き、且つクロス開発の場合に、デバッグのためのコード
をターゲットマシン内にロードすることを回避避するこ
とができるプログラムデバッグ装置、及びプログラム管
理方法、並びにその方法を記録したコンピュータ読取り
可能な記録媒体を提供することを目的とする。
Therefore, the present invention has been made in view of the above circumstances, and describes a script description for debugging or a description (mainly error checking, etc.) in a program description language.
It can be described in the source file, the compiler automatically extracts it, saves it in the object file, and automatically writes the debug script or By executing the description in the program description language (mainly error checking etc.), the property at the time of debugging and the final property can be handled as the same object file, and the code for debugging in the case of cross development And a program management method capable of avoiding loading of a program into a target machine, and a computer-readable recording medium recording the method.

【0012】[0012]

【課題を解決するための手段】本発明は、上記目的を達
成するため、本発明のプログラムデバッグ装置は、プロ
グラムの実行時にデバッグ時にのみ実行する処理を記述
するデバッグスクリプトを含んだソースファイルを、通
常のプログラム部分である実行オブジェクトファイル
と、上記デバッグスクリプト部分であるデバッグスクリ
プトファイルと、上記ソースファイルのソース行の位置
と上記デバッグスクリプトを対応付けるデバッグスクリ
プト起動情報を持つシンボルテーブルとを含むオブジェ
クトファイルにコンパイルするコンパイラと、デバッグ
時に上記デバッグスクリプトを有効にするか否かを指定
するデバッグ指定手段と、このデバッグ指定手段により
上記デバッグスクリプトを有効にした場合、上記実行オ
ブジェクトファイルを実行する際上記デバッグスクリプ
トにプログラムの制御が到達したことを判定する判定手
段と、この判定手段により上記デバッグスクリプトにプ
ログラムの制御が到達したことを判定した時に、上記デ
バッグスクリプト起動情報に基づいて対応した上記デバ
ッグスクリプトファイルを実行することを特徴とする。
According to the present invention, in order to achieve the above object, a program debugging apparatus according to the present invention includes a source file including a debug script describing processing executed only at the time of execution of a program. An object file including an execution object file which is a normal program part, a debug script file which is the above debug script part, and a symbol table having debug script activation information for associating the position of a source line of the above source file with the above debug script. Compiler to be compiled, debug specification means for specifying whether to enable the debug script at the time of debugging, and, when the debug script is enabled by the debug specification means, the execution object file A determining means for determining that the control of the program has reached the debug script at the time of execution, and responding based on the debug script activation information when determining that the control of the program has reached the debug script. And executing the debug script file described above.

【0013】この構成によれば、デバッグ時のプログラ
ムと最終プログラムを同一のオブジェクトファイルとし
て扱うことができる。また、デバッグのためのコード
は、別のオブジェクトファイルとして管理するので、デ
バッグのためのコードをターゲットマシン内にロードす
ることを避けることができる。さらに、上記構成のコン
パイラをインタプリタに置き換えても同様な効果が得ら
れる。そして、デバッグスクリプトをログ出力コードに
置き換え、このログ出力コードをデバッグ時に利用して
も同様な効果が得られる。
With this configuration, the program at the time of debugging and the final program can be handled as the same object file. Also, since the code for debugging is managed as a separate object file, it is possible to avoid loading the code for debugging into the target machine. Further, the same effect can be obtained by replacing the compiler having the above configuration with an interpreter. The same effect can be obtained by replacing the debug script with the log output code and using the log output code at the time of debugging.

【0014】[0014]

【発明の実施の形態】以下、図面を参照しながら本発明
の一実施の形態を説明する。 (第1の実施形態)図1は本発明の実施形態の前提とな
るシステム構成を示すブロック図である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. (First Embodiment) FIG. 1 is a block diagram showing a system configuration as a premise of an embodiment of the present invention.

【0015】ここではデバッグ対象となるプログラムが
動作するマシンをターゲットマシン11、プログラムを
開発(生成)するマシンをホストマシン10と呼ぶ。両
者は、同一のハードウェアであっても良いが、ここでは
以下のようにターゲットマシン11で動作するプログラ
ムを、別個のホストマシン10を用いて開発する場合を
想定する。また、両者は特に図示しないが、CPU、メ
モリ、HDD等の補助記憶装置、表示装置、通信手段
等、通常のコンピュータが備える構成を当然に有してい
るものとする。そして、両者はLAN(Local Area Net
work)やシリアル等の通信媒体/手段たる例えばネット
ワーク12で接続されており、互いにデータを送受信す
る。
Here, the machine on which the program to be debugged runs is called the target machine 11, and the machine that develops (generates) the program is called the host machine 10. Although both may be the same hardware, it is assumed here that a program that operates on the target machine 11 is developed using a separate host machine 10 as described below. Although not particularly shown, both of them naturally have a configuration provided in an ordinary computer, such as an auxiliary storage device such as a CPU, a memory, and an HDD, a display device, and a communication unit. And both are LAN (Local Area Net)
work) or a communication medium such as a serial or the like, for example, a network 12, and transmits and receives data to and from each other.

【0016】図2を参照して、ホストマシン10上の構
成を説明する。ホストマシン10では、プログラムソー
ス(ソースファイル)23をコンパイラ21でコンパイ
ルする。そして、作成されたオブジェクトファイル24
より、実行イメージをホスト上のデバッガ22が、ネッ
トワーク12を介して、ターゲットマシン11上にダウ
ンロードする。
Referring to FIG. 2, the configuration on the host machine 10 will be described. In the host machine 10, the program source (source file) 23 is compiled by the compiler 21. Then, the created object file 24
Thus, the debugger 22 on the host downloads the execution image to the target machine 11 via the network 12.

【0017】デバッガ22は、プログラムのシンボル情
報を取り込むことで、ユーザはシンボリックなデバッグ
をホストマシン10上で行うことができる。ユーザの記
述したソースファイル23は、通常のプログラム以外に
「デバッグスクリプト」を含めることができる。これ
は、デバッグ時に、オプションにより該当する部分にプ
ログラムが到達した場合、そのデバッグスクリプトを実
行することを保証するものである。このオプションを指
定しなければ、この部分は全く実行されない。
The debugger 22 allows the user to perform symbolic debugging on the host machine 10 by taking in the symbol information of the program. The source file 23 described by the user can include a “debug script” in addition to a normal program. This guarantees that the debug script is executed when the program reaches a corresponding part by an option during debugging. If this option is not specified, this part will not be executed at all.

【0018】本ツールでは、コンパイラが通常のオブジ
ェクトファイル24内に、デバッグスクリプトを保存す
るセクションを定義する。これにより、コンパイルした
オブジェクトファイル24には、プログラムコードに相
当するセクション(テキストセクション)、データに相
当するセクション(データセクション)等を含む通常の
プログラムの実行オブジェクトファイルのセクション
と、デバッグスクリプトのオブジェクトファイルを保存
するデバッグスクリプトセクションと、デバッグスクリ
プトとソース行の位置を対応づけるデバッグスクリプト
起動情報等を含むシンボルテーブルが含まれる。
In this tool, a compiler defines a section for storing a debug script in a normal object file 24. As a result, the compiled object file 24 includes a section of an ordinary program execution object file including a section (text section) corresponding to program code, a section (data section) corresponding to data, and the like, and an object file of a debug script. And a symbol table including debug script activation information for associating the debug script with the position of the source line.

【0019】デバッガ22は、デバッグスクリプトを利
用しない場合、通常のリモートデバッグシステムと同様
な様相を呈する。デバッグスクリプトオプションが指定
された場合でも、プログラムのターゲットマシン11へ
のダウンロード機能については全く同じである。
When a debug script is not used, the debugger 22 has the same appearance as a normal remote debugging system. Even when the debug script option is specified, the function of downloading the program to the target machine 11 is exactly the same.

【0020】図3を参照して、ターゲットマシン11の
構成を説明する。本実施形態では、通常のターゲットシ
ステムでよく用いられるターゲットモニタ31を仮定す
るが必須ではない。ターゲットモニタ31は、ホストマ
シン10との通信機能を備え、デバッグ実行時にブレー
ク命令により例外が発生した場合ホストマシン10に通
知する。32は、ホストマシン10からダウンロードさ
れた対象プログラム(オブジェクトファイル)である。
With reference to FIG. 3, the configuration of the target machine 11 will be described. In the present embodiment, a target monitor 31 that is often used in a normal target system is assumed, but is not essential. The target monitor 31 has a communication function with the host machine 10, and notifies the host machine 10 when an exception occurs due to a break instruction during debugging. Reference numeral 32 denotes a target program (object file) downloaded from the host machine 10.

【0021】次に、ホスト側の言語処理システムの説明
をする。ユーザプログラムは、通常の高級プログラミン
グ言語と、この言語のコンパイラの存在を仮定する。上
記コンパイラは、特に図示しないが、構文解析部、最適
化部、コード生成部などから構成される。その内、本実
施形態で主に関係があるのは、構文解析部である。
Next, the language processing system on the host side will be described. The user program assumes the presence of a normal high-level programming language and a compiler for this language. Although not particularly shown, the compiler includes a syntax analyzer, an optimizer, a code generator, and the like. Among them, the syntax analyzer is mainly relevant in the present embodiment.

【0022】構文解析部では、デバッグスクリプト部と
そうでない部分を切り分けて処理する。この識別は、プ
ログラム開発者がソースファイルを作成する際に、「コ
ンパイラ指示子」をソースファイル内に埋め込むことで
行う。デバッグ用スクリプトの具体的実施例としては、
「ソースプログラム本体と同じ言語(場合によっては、
文法的にサブセット)によって記述」、もしくは「デバ
ッガコマンドからなる記述」、もしくは上記が混在した
ものが考えられる。
The syntax analyzer separates and processes the debug script part and the part that is not. This identification is performed by embedding a “compiler designator” in the source file when the program developer creates the source file. As a concrete example of the debug script,
"The same language as the source program itself (in some cases,
Describing by grammar subset), or "description consisting of debugger commands", or a mixture of the above.

【0023】C言語風の表現では、以下のようにソース
ファイルの記述の中に、コンパイル指示子で、デバッグ
コマンド部分などを記述する。コンパイラの構文解析部
は、この部分を通常のプログラムと別の処理を行う。
In the C-language-like expression, a debug command portion and the like are described in a source file description using a compile indicator as follows. The syntax analysis unit of the compiler performs this part differently from a normal program.

【0024】下記例でコンパイル指示子とは、「#if
def debug_by_command ...
#endif」「#ifdef debug_by_C
... #endif」を指す。これらは、プログラ
ムの本来の記述ではなく、コンパイラするときのコンパ
イラに対する動作指示となる。
In the following example, the compile indicator is "#if
def debug_by_command. . .
#Endif ""#ifdef debug_by_C
. . . #Endif ". These are not the original description of the program but the operation instructions to the compiler when compiling.

【0025】この例では、コンパイラは、「#ifde
f debug_by_command」を発見する
と、ここからは普通のプログラムではなく、デバッグコ
マンドであると認識して処理する。また、同様に「#i
fdef debug_by_C」を発見すると、ここ
からはデバッグコマンドに翻訳すると認識する。 func(int a, int b){ int c; #ifdef debug_by_command //ここからデバッガコマンド watch a // デバッガコマンドの例 print a #endif #ifdef debug_by_C //C言語のチェック // →デバッグコマンドに変換する c= convert (a, b); // →関数の一時実行コマンドに変換 // call $1 = check(a, b) // set c = $1 if (a > b) printf ("error:a = %d\n ", a); // →式の評価に変換: // set $2 = a // set $3 = b // if ($2 > $3) call printf //("error:a = %d\n ", a) #endif c = .... .... } 上記のように「コンパイラ指示子」では、その記述言語
の種類を指定する。今、その種類として、ソースと同一
のプログラム言語、デバッガコマンドを想定する。ソー
スと同一のプログラム言語の場合、これを自動的にデバ
ッガコマンドに変換する。
In this example, the compiler determines "#ifde
When "f debug_by_command" is found, it is recognized as a debug command, not an ordinary program, and is processed. Similarly, “#i
If "fdef debug_by_C" is found, it recognizes that it will be translated into a debug command. func (int a, int b) {int c; #ifdef debug_by_command // debugger command from here watch a // debugger command example print a #endif #ifdef debug_by_C // check C language // → convert to debug command c = convert (a, b); // → Convert to function temporary execution command // call $ 1 = check (a, b) // set c = $ 1 if (a> b) printf ("error: a =% d \ n ", a); // → Convert to expression evaluation: // set $ 2 = a // set $ 3 = b // if ($ 2> $ 3) call printf // (" error: a =% d \ n ", a) #endif c = .... ....} As described above, the" compiler specifier "specifies the type of the description language. Now, assume that the type is the same programming language and debugger command as the source. In the case of the same programming language as the source, this is automatically converted to a debugger command.

【0026】図4を参照して、ホストマシン10上での
上記の様なソースファイルのコンパイル処理の流れを説
明する。ソースファイル23をコンパイラ21にてコン
パイルする場合、まず、コンパイラ21はコンパイラ指
示子が言語記述か否かを判定する(ステップA1)。
Referring to FIG. 4, the flow of the above-described source file compiling process on the host machine 10 will be described. When compiling the source file 23 with the compiler 21, first, the compiler 21 determines whether or not the compiler designator is a language description (step A1).

【0027】言語記述であれば(ステップA1のye
s)、デバッグスクリプトへの変換ルーチンを呼び出し
(ステップA4)、デバッグスクリプトセクションを定
義して翻訳する(ステップA5)。もし、デバッグスプ
リクトへ変換できなかった場合はエラー処理(ステップ
A6)として終了する。
If it is a language description (yes in step A1)
s), a conversion routine to a debug script is called (step A4), and a debug script section is defined and translated (step A5). If it cannot be converted to the debug script, the process ends as an error process (step A6).

【0028】言語記述でなければ(ステップA1のn
o)、次にコンパイラ指示子がデバッグコマンドか否か
を判定する(ステップA2)。コンパイラ指示子がデバ
ッグコマンドである場合(ステップA2のyes)、デ
バッグスクリプトセクションを定義して翻訳する(ステ
ップA5)。コンパイラ指示子がデバッグコマンドでな
い場合(ステップA2のno)、従来の処理と同様とな
る(ステップA3)。
If it is not a language description (n in step A1)
o) Then, it is determined whether or not the compiler designator is a debug command (step A2). If the compiler specifier is a debug command (Yes in step A2), a debug script section is defined and translated (step A5). If the compiler designator is not a debug command (No in step A2), the process is the same as the conventional process (step A3).

【0029】図5に、ホストマシン10上でのソースフ
ァイル23のコンパイル処理によるオブジェクトファイ
ル生成の概念図を示す。ソースファイル23の一例であ
るソースファイル50をコンパイラ21により、コンパ
イルして生成されるオブジェクトファイルは、実行オブ
ジェクトファイル51、デバッグスクリプトファイル5
2、シンボルテーブル53の3つの部分に分けられる。
FIG. 5 is a conceptual diagram of object file generation by compiling the source file 23 on the host machine 10. An object file generated by compiling a source file 50 which is an example of the source file 23 by the compiler 21 includes an execution object file 51 and a debug script file 5
2. The symbol table 53 is divided into three parts.

【0030】実行オブジェクトファイル51は、デバッ
グスクリプト部を含まない実行オブジェクトファイルの
セクションである。デバッグスクリプトファイル52
は、デバッグスクリプトのオブジェクトファイルである
デバッガ用のスクリプトファイルセクションであり、デ
バッグ時に使用される。シンボルテーブル53は、シン
ボル情報を含むファイルのセクションである。シンボル
情報とは、例えば、デバッガ用スクリプトを起動する際
に用いるソース行とそれに対応する実行オブジェクトフ
ァイルのロケーション(位置)とのマッピング情報等で
ある。
The execution object file 51 is a section of the execution object file that does not include the debug script part. Debug script file 52
Is a script file section for a debugger which is an object file of a debug script, and is used at the time of debugging. The symbol table 53 is a section of a file containing symbol information. The symbol information is, for example, mapping information between a source line used when activating a debugger script and a location of an execution object file corresponding to the source line.

【0031】そして、オブジェクトファイル51である
当該セクションのみがターゲットマシン11にロードさ
れる。次に、ホストマシン10上でのデバッグ時の動作
説明をする。
Then, only the section, which is the object file 51, is loaded into the target machine 11. Next, an operation at the time of debugging on the host machine 10 will be described.

【0032】まず、図6により、通常のブレークポイン
ト指定処理の流れを説明する。ブレークポイントとは、
デバッグ時にデバッグ操作者が、必要に応じて実行オブ
ジェクトファイルの実行を中断するためのポイントであ
り、このブレークポイントを示すため上記実行オブジェ
クトファイルにはブレーク命令が挿入される。また、こ
の例でのデバッグは、上記ソースファイル50をコンパ
イルして生成された実行オブジェクトファイル51につ
いて行うこととし、その際、デバッグスクリプトファイ
ル52、シンボルテーブル53を参照する。
First, the flow of a normal breakpoint designation process will be described with reference to FIG. What is a breakpoint?
This is a point for the debug operator to interrupt the execution of the execution object file as needed during debugging, and a break instruction is inserted into the execution object file to indicate this breakpoint. The debugging in this example is performed on the execution object file 51 generated by compiling the source file 50. At this time, the debug script file 52 and the symbol table 53 are referred to.

【0033】ブレークポイントの指定は、デバッグ操作
者がブレークポイントに対応するソース行を指定して行
う(ステップB1)。ホストのデバッガ22が、シンボ
ルテーブル53にあるシンボル情報(ここでは、ソース
行とそれに対応する実行オブジェクトファイル51のロ
ケーションとのマッピング情報)に基づき、上記指定し
たブレークポイントに対する実行オブジェクトファイル
51のロケーションにブレーク命令を書き込む(ステッ
プB2)。その際に、上記ステップB1で指定したブレ
ーク命令を書き込んだ実行オブジェクトファイル51の
ロケーションに有った元々の命令はデバッガ22のメモ
リの中に保存しておく(ステップB3)。
The break point is specified by the debug operator by specifying the source line corresponding to the break point (step B1). Based on the symbol information in the symbol table 53 (here, the mapping information between the source line and the location of the execution object file 51 corresponding thereto), the debugger 22 of the host sets the location of the execution object file 51 corresponding to the specified breakpoint in the Write a break instruction (step B2). At this time, the original instruction at the location of the execution object file 51 into which the break instruction specified in step B1 has been written is stored in the memory of the debugger 22 (step B3).

【0034】次に、図7により、通常のブレークポイン
トの解除処理の流れを説明する。デバッガ操作者が、ブ
レークポイントを解除する(ステップC1)。デバッガ
22は、実行オブジェクトファイル51の解除されたブ
レークポイントのブレーク命令のロケーションに、メモ
リに保存しておいたこのブレーク命令のロケーションに
有った元々の命令を書き込む(ステップC2)。これに
より、このロケーションの命令を実行してもブレーク命
令による例外は発生しない。
Next, with reference to FIG. 7, the flow of a normal break point clearing process will be described. The debugger operator releases the break point (step C1). The debugger 22 writes the original instruction stored in the memory at the location of the break instruction in the location of the break instruction of the released break point in the execution object file 51 (step C2). As a result, even if the instruction at this location is executed, no exception occurs due to the break instruction.

【0035】本実施形態では、デバッグ時にターゲット
マシン11で実行オブジェクトファイル51を実行する
際に、実行オブジェクトファイル51に挿入したブレー
ク命令にプログラムの処理が到達した時、このブレーク
命令がデバッグスクリプトに対応している場合、ホスト
マシン10上のシンボルテーブル53のシンボル情報に
基づき、ホストマシン10上のデバッグスクリプトファ
イル52からこのブレークポイントに対応したデバッグ
スクリプトを実行して、デバッグを行う。
In this embodiment, when the execution of the execution object file 51 on the target machine 11 at the time of debugging, when the processing of the program reaches the break instruction inserted in the execution object file 51, this break instruction corresponds to the debug script. If so, the debug script corresponding to this breakpoint is executed from the debug script file 52 on the host machine 10 based on the symbol information of the symbol table 53 on the host machine 10 to perform debugging.

【0036】デバッグ操作者によるデバッグスクリプト
有効化または無効化の指示について以下に説明する。ま
ず、図8により、デバッグスクリプト有効化処理の流れ
を説明する。デバッグ操作者が、デバッグスクリプト有
効化を指定する(ステップD1)。デバッグスクリプト
有効化が指定されると、デバッガ22は、シンボルテー
ブル53より、各デバッグスクリプト毎に、実行オブジ
ェクトファイル51の該当するロケーションを調べそこ
にブレーク命令を書き込む(ステップD2)。ブレーク
命令のパラメータとして、各デバッグスクリプト毎のI
Dを示すデバッグスクリプトIDを挿入しておく。ステ
ップD2の際に、実行オブジェクトファイル51の該当
するロケーションにあった元々の命令をデバッガのメモ
リに保存しておく(ステップD3)。
The instruction by the debug operator to enable or disable the debug script will be described below. First, the flow of the debug script enabling process will be described with reference to FIG. The debug operator specifies to enable the debug script (step D1). When the debug script validation is specified, the debugger 22 checks a corresponding location of the execution object file 51 for each debug script from the symbol table 53 and writes a break instruction there (step D2). As a parameter of the break instruction, I for each debug script
A debug script ID indicating D is inserted. At step D2, the original instruction at the corresponding location in the execution object file 51 is stored in the memory of the debugger (step D3).

【0037】続いて図9により、デバッグスクリプト無
効化処理の流れを説明する。デバッグ操作者が、デバッ
グスクリプト無効化を指定する(ステップE1)。デバ
ッグスクリプト無効化が指定されると、デバッガ22
は、シンボルテーブル53より、各デバッグスクリプト
毎に、実行オブジェクトファイル51の該当するロケー
ションを調べ、対応するブレーク命令のロケーションに
デバッガの保存領域にコピーしてあったそのロケーショ
ンに有った元々の命令を書き込む(ステップE2)。こ
れにより、デバッグ時に、ブレーク命令によるブレーク
例外は発生せずデバッグスクリプトは無視される。
Next, the flow of the debug script invalidating process will be described with reference to FIG. The debug operator specifies the invalidation of the debug script (step E1). When the debug script invalidation is specified, the debugger 22
Finds the corresponding location of the execution object file 51 for each debug script from the symbol table 53, and replaces the original instruction at that location copied to the location of the corresponding break instruction into the storage area of the debugger. Is written (step E2). Thus, at the time of debugging, a break exception due to a break instruction does not occur and the debug script is ignored.

【0038】図10により、デバッグ時の処理の流れを
説明する。デバッグ時、ターゲットマシン11で実行オ
ブジェクトファイル51を実行する際、ブレーク命令に
プログラムが到達すると(ステップF1)と、通常のC
PUでは例外が発生する。例外とは、外部からの割込
み、ゼロによる割り算などのときにも起こるもので、こ
れが発生するとCPUは、現在のプログラムの実行を止
めて、図示しない例外処理ハンドラにジャンプする。
Referring to FIG. 10, the flow of the processing at the time of debugging will be described. When the execution object file 51 is executed on the target machine 11 at the time of debugging, when the program reaches a break instruction (step F1), a normal C
An exception occurs in the PU. The exception also occurs at the time of interruption from the outside, division by zero, or the like. When this occurs, the CPU stops execution of the current program and jumps to an exception handler (not shown).

【0039】例外処理ハンドラでは、どのような例外が
発生してここに飛んできたか、CPUのレジスタなどを
参照して判定し、それぞれサブの処理ルーチンに飛ば
す。例外が発生した時、それが「ブレーク命令」によっ
て起こったものだとわかると、ターゲットモニタ31に
それを知らせる。ターゲットモニタ31は、内蔵する通
信機能によりホストマシン10のデバッガ22に、ブレ
ークが起きたことを知らせる。
In the exception handler, what kind of exception has occurred and jumped here is determined by referring to a register of the CPU and the like, and jumps to each sub-routine. When an exception occurs, it is notified to the target monitor 31 if it is found that the exception was caused by a “break instruction”. The target monitor 31 notifies the debugger 22 of the host machine 10 that a break has occurred by using a built-in communication function.

【0040】ホストマシン10のデバッガ22は、ブレ
ークポイントを張っていることを分かっているので、デ
バッグ操作者にそれをわかるようにターゲットマシン1
1の表示装置に表示する。
Since the debugger 22 of the host machine 10 knows that a breakpoint has been set, the target machine 1
1 is displayed on the display device.

【0041】ターゲットモニタ31は、次のデバッガ2
2からのコマンドを待つ。ここでは、まずホストマシン
10上のデバッガ22は、発生した例外がデバッグ例外
か否かを判定する(ステップF2)。
The target monitor 31 is connected to the next debugger 2.
Wait for command from 2. Here, first, the debugger 22 on the host machine 10 determines whether or not the occurred exception is a debug exception (Step F2).

【0042】デバッグ例外でない場合(ステップF2の
no)、通常の例外処理を実行し(ステップF6)、終
了する。デバッグ例外で有る場合(ステップF2のye
s)、デバッグスクリプト対応か否か判定する(ステッ
プF3)。
If it is not a debug exception (No in step F2), normal exception processing is executed (step F6), and the process ends. If it is a debug exception (yes in step F2)
s) It is determined whether or not it is compatible with a debug script (step F3).

【0043】デバッグスクリプト対応でない場合(ステ
ップF3のno)、通常のデバッグ例外処理を実行し
(ステップF7)、終了する。デバッグスクリプト対応
である場合(ステップF3のyes)、デバッガ22
は、デバッグスクリプトIDを調べ、シンボルテーブル
53のシンボル情報に基づきホストマシン10上のデバ
ッグスクリプトファイル52から各デバッガコマンドを
実行し(ステップF4)、例外処理より復帰する(ステ
ップF5)。例外処理より復帰したら、続けてプログラ
ムを実行する。
If the debug script is not supported (No in step F3), normal debug exception processing is executed (step F7), and the process ends. If the debug script is supported (yes in step F3), the debugger 22
Checks the debug script ID, executes each debugger command from the debug script file 52 on the host machine 10 based on the symbol information in the symbol table 53 (step F4), and returns from the exception processing (step F5). After returning from the exception processing, the program is continuously executed.

【0044】以上のようにすることで、デバッグ時プロ
グラムと最終プログラムを同一のオブジェクトファイル
として扱うことができ、またデバッグのためのコードを
ターゲットマシン内にロードすることを避けることがで
きる。
By doing as described above, the program at the time of debugging and the final program can be handled as the same object file, and loading of the code for debugging into the target machine can be avoided.

【0045】上述の第1の実施形態では、コンパイラを
仮定していたが、インタプリタ方式でも同様に扱うこと
ができる。また、プログラム言語としては、複数種の存
在を仮定することもできる。さらに、コンパイル指示子
の種類により、記述の種類を判別したが、より高度にコ
ンパイラでの自動判定することが考えられる。
In the above-described first embodiment, a compiler is assumed. However, an interpreter method can be similarly used. Also, a plurality of types of programming languages can be assumed. Furthermore, the type of description is determined based on the type of the compilation indicator. However, it is conceivable that the compiler automatically determines the type of description.

【0046】所定の記述、例えば、関数名、変数名がd
ebug_...を含む式や、それを含む文を判定しデ
バッグコマンドに自動変換するなど。例として、以下の
ようなものがあげられる。 func (int a, int b){ int c; debug_watch a //デバッグコマンドとして処理: watch a debug_print a //デバッグコマンドとして処理: print a printf ("%d\n", c); //通常プログラムとして処理 c = debug_convert (a, b); //デバッグコマンドとして処理: // call $1 = check(a, b) // set c = $1 } (第2の実施形態)次に、本発明に係わる第2の実施形
態について説明する。
A predetermined description, for example, if the function name and the variable name are d
ebug_. . . Expressions containing, and statements containing them are automatically converted to debug commands. Examples include the following. func (int a, int b) {int c; debug_watch a // Process as debug command: watch a debug_print a // Process as debug command: print a printf ("% d \ n", c); // Normal program C = debug_convert (a, b); // process as a debug command: // call $ 1 = check (a, b) // set c = $ 1} (Second Embodiment) Next, the present invention will be described. A second embodiment will be described.

【0047】本実施形態は、上記第1の実施形態でデバ
ッグスクリプトに相当する部分を、デバッグ時にログと
して出力されるコードに置き換えたものと考えることが
できる。
This embodiment can be considered as a part in which the part corresponding to the debug script in the first embodiment is replaced with a code output as a log at the time of debugging.

【0048】本実施形態でのソースファイル例であるソ
ースファイル70をコンパイルしてオブジェクトファイ
ルを生成する概念図を図11に示す。ソースファイル7
0をコンパイラにてコンパイルすると、生成されるオブ
ジェクトファイルは、実行オブジェクトファイル71、
ログスクリプトファイルセクション72、シンボルテー
ブル73の3つの部分に分けられる。
FIG. 11 is a conceptual diagram of compiling a source file 70, which is an example of a source file according to the present embodiment, to generate an object file. Source file 7
0 is compiled by the compiler, the generated object file is an execution object file 71,
The log script file section 72 and the symbol table 73 are divided into three parts.

【0049】実行オブジェクトファイル71は、デバッ
グスクリプト部(この場合ログとして出力されるコー
ド)を含まない実行オブジェクトファイルのセクション
である。ログスクリプトファイルセクション72は、デ
バッガ用のスクリプトファイルセクションであり、ログ
出力がデバッグ用に使用される。
The execution object file 71 is a section of the execution object file that does not include the debug script part (code output as a log in this case). The log script file section 72 is a script file section for a debugger, and the log output is used for debugging.

【0050】シンボルテーブル73は、シンボル情報を
含むファイルのセクションである。シンボル情報とは、
例えばデバッガ用スクリプトであるログを起動する際に
用いるソース行とそれに対応する実行オブジェクトファ
イルのロケーションとのマッピング情報等である。
The symbol table 73 is a section of a file containing symbol information. What is symbol information?
For example, it is mapping information of a source line used when starting a log which is a script for a debugger and a location of an execution object file corresponding to the source line.

【0051】本実施形態のログ出力の有効化、無効化処
理は、第1の実施形態のデバッグスクリプトの有効化、
無効化処理と同様に扱うことができる。ログ出力が有効
化されれば、ログ出力命令のブレークポイントにプログ
ラムが到達した場合、ログスクリプトファイルセクショ
ン72からこのログ出力命令に対応するログ出力を選択
して実行しデバッグを行うことができる。
The process of enabling / disabling log output according to the present embodiment is performed by enabling the debug script according to the first embodiment.
It can be handled in the same way as the invalidation processing. When the log output is enabled, when the program reaches a breakpoint of the log output instruction, a log output corresponding to the log output instruction can be selected from the log script file section 72 and executed to perform debugging.

【0052】[0052]

【発明の効果】以上詳記したように本発明によれば、デ
バッグ時物件と最終物件とを同一のオブジェクトファイ
ルとして扱うことができ、デバッグのためのコードをタ
ーゲットマシン内にロードすることを回避することで、
ターゲットマシンのメモリ要求量を抑制することができ
る。また、ソースファイルとデバッグ用スクリプトを一
括して管理できる。そして、デバッグスクリプトとし
て、プログラムを記述している言語そのものが使用で
き、プログラマ(プログラム開発者)からみると、それ
がデバッグコマンドに翻訳されて実行されるということ
を意識しないで良いという優れた効果を奏する。
As described in detail above, according to the present invention, the property at the time of debugging and the final property can be handled as the same object file, and the loading of the code for debugging into the target machine is avoided. by doing,
The required memory amount of the target machine can be suppressed. In addition, source files and debugging scripts can be managed collectively. As a debug script, the language that describes the program itself can be used, and from the viewpoint of the programmer (program developer), there is no need to be aware that it is translated into a debug command and executed. To play.

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

【図1】本発明の第1の実施形態に於ける装置の概略構
成を示す図。
FIG. 1 is a diagram showing a schematic configuration of an apparatus according to a first embodiment of the present invention.

【図2】同実施の形態に係るホストマシン上の構成要素
を示す概念図。
FIG. 2 is an exemplary conceptual view showing components on the host machine according to the embodiment.

【図3】同実施の形態に係るターゲットマシン上の構成
要素を示す概念図。
FIG. 3 is a conceptual diagram showing components on a target machine according to the embodiment.

【図4】同実施の形態に係るソースファイルのコンパイ
ル処理の流れを示すフローチャート。
FIG. 4 is an exemplary flowchart showing the flow of a source file compiling process according to the embodiment;

【図5】同実施の形態に係るソースファイルをコンパイ
ルして生成されるオブジェクトフアイルの概念図。
FIG. 5 is an exemplary conceptual view of an object file generated by compiling a source file according to the embodiment;

【図6】同実施の形態に係る通常のブレークポイント指
定処理の流れを示すフローチャート。
FIG. 6 is an exemplary flowchart showing the flow of a normal breakpoint designation process according to the embodiment;

【図7】同実施の形態に係る通常のブレークポイント解
除処理の流れを示すフローチャート。
FIG. 7 is an exemplary flowchart showing the flow of normal breakpoint release processing according to the embodiment;

【図8】同実施の形態に係るデバッグスクリプト有効化
処理の流れを示すフローチャート。
FIG. 8 is a flowchart showing a flow of a debug script enabling process according to the embodiment;

【図9】同実施の形態に係るデバッグスクリプト無効化
処理の流れを示すフローチャート。
FIG. 9 is an exemplary flowchart showing the flow of a debug script invalidating process according to the embodiment;

【図10】同実施の形態に係るデバッグ時の処理の流れ
を示すフローチャート。
FIG. 10 is an exemplary flowchart showing the flow of a process during debugging according to the embodiment;

【図11】本発明の第2の実施形態に於ける、ソースフ
ァイルをコンパイルして生成されるオブジェクトファイ
ルの概念図。
FIG. 11 is a conceptual diagram of an object file generated by compiling a source file according to the second embodiment of the present invention.

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

10…ホストマシン 11…ターゲットマシン 12…ネットワーク 21…コンパイラ 22…デバッガ 23…ソースファイル 24…オブジェクトファイル 31…ターゲットモニタ 32…ダウンロードされた対象プログラム DESCRIPTION OF SYMBOLS 10 ... Host machine 11 ... Target machine 12 ... Network 21 ... Compiler 22 ... Debugger 23 ... Source file 24 ... Object file 31 ... Target monitor 32 ... Downloaded target program

Claims (27)

【特許請求の範囲】[Claims] 【請求項1】 プログラムの実行時にデバッグ時にのみ
実行する処理を記述するデバッグスクリプトを含んだソ
ースファイルを、通常のプログラム部分である実行オブ
ジェクトファイルと、上記デバッグスクリプト部分であ
るデバッグスクリプトファイルと、上記ソースファイル
のソース行の位置と上記デバッグスクリプトを対応付け
るデバッグスクリプト起動情報を持つシンボルテーブル
とを含むオブジェクトファイルにコンパイルするコンパ
イラと、 デバッグ時に上記デバッグスクリプトを有効にするか否
かを指定するデバッグ指定手段と、 このデバッグ指定手段により上記デバッグスクリプトを
有効にしたとき、上記実行オブジェクトファイルを実行
する際に上記デバッグスクリプトにプログラムの制御が
到達したことを判定する判定手段とを具備し、 上記判定手段により上記デバッグスクリプトにプログラ
ムの制御が到達したことを判定したときに、上記デバッ
グスクリプト起動情報に基づいて対応した上記デバッグ
スクリプトファイルを実行することを特徴とするプログ
ラムデバッグ装置。
1. A source file including a debug script describing a process to be executed only at the time of execution of a program during execution of a program includes an execution object file as a normal program portion, a debug script file as the debug script portion, and a A compiler that compiles an object file including a symbol table having debug script startup information for associating the position of a source line of a source file with the debug script, and a debug designating unit that specifies whether to enable the debug script during debugging And when the debug script is enabled by the debug designating means, when executing the execution object file, determining that program control has reached the debug script. And a step of executing the corresponding debug script file based on the debug script activation information when the determining means determines that the control of the program has reached the debug script. Debug device.
【請求項2】 上記コンパイラは、上記ソースファイル
をコンパイルする際に、所定の記述により上記デバッグ
スクリプトを識別しコンパイルすることを特徴とする請
求項1記載のプログラムデバッグ装置。
2. The program debugging device according to claim 1, wherein the compiler identifies and compiles the debug script according to a predetermined description when compiling the source file.
【請求項3】 上記ソースファイルは、上記デバッグス
クリプトが他のプログラムと同一の言語により文法的に
他のプログラム記述部と区別できる識別子で記述され、 上記コンパイラは、上記ソースファイルをコンパイルす
る際に上記識別子にて上記デバッグスクリプトを識別し
コンパイルすることを特徴とする請求項1記載のプログ
ラムデバッグ装置。
3. The source file is described with an identifier that allows the debug script to be grammatically distinguished from another program description part in the same language as another program. 2. The program debugging device according to claim 1, wherein the debug script is identified by the identifier and compiled.
【請求項4】 上記デバッグ指定手段は、上記デバッグ
スクリプトを有効にした場合、上記デバッグスクリプト
を識別できる命令を上記デバッグスクリプト起動情報に
基づき上記実行オブジェクトファイルの対応する位置に
書き込み、 上記判定手段は、上記命令に基づき上記デバッグスクリ
プトにプログラムの制御が到達したことを判定すること
を特徴とする請求項1乃至3のいずれかに記載のプログ
ラムデバッグ装置。
4. The debug designating means, when the debug script is enabled, writes an instruction capable of identifying the debug script in a corresponding position of the execution object file based on the debug script activation information. 4. The program debugging device according to claim 1, wherein it is determined that control of the program reaches the debug script based on the command.
【請求項5】 プログラムの実行時にデバッグ時にのみ
実行する処理を記述するデバッグスクリプトを含んだソ
ースファイルを、通常のプログラム部分である実行オブ
ジェクトファイルと、上記デバッグスクリプト部分であ
るデバッグスクリプトファイルと、上記ソースファイル
のソース行の位置と上記デバッグスクリプトを対応づけ
るデバッグスクリプト起動情報を持つシンボルテーブル
とを含むオブジェクトファイルに所定のステップ毎に翻
訳し実行するインタプリタと、 デバッグ時に上記デバッグスクリプトを有効にするか否
かを指定するデバッグ指定手段と、 このデバッグ指定手段により上記デバッグスクリプトを
有効にした場合、上記実行オブジェクトファイルを実行
する際に上記デバッグスクリプトにプログラムの制御が
到達したことを判定する判定手段と、 この判定手段により上記デバッグスクリプトにプログラ
ムの制御が到達したことを判定したときに、上記デバッ
グスクリプト起動情報に基づいて対応した上記デバッグ
スクリプトファイルを実行するプログラムデバッグ装
置。
5. A source file including a debug script describing a process to be executed only at the time of execution of a program at the time of execution of a program includes an execution object file as a normal program part, a debug script file as the debug script part, An interpreter that translates and executes, at predetermined steps, an object file including a symbol table having debug script activation information for associating the position of the source line of the source file with the debug script, and whether to enable the debug script at the time of debugging Debug specification means for specifying whether or not the debug script is enabled by the debug specification means. When the execution object file is executed, program control reaches the debug script. A determination unit that, when the control program to the debug script determines that it has reached this decision means, a program debugging device for executing the debugging script file corresponding based on the debug script activation information.
【請求項6】 上記インタプリタは、上記ソースファイ
ルを翻訳する際所定の記述によりデバッグスクリプトを
識別して翻訳し実行することを特徴とする請求項5記載
のプログラムデバッグ装置。
6. The program debugging apparatus according to claim 5, wherein the interpreter identifies, translates and executes a debug script by a predetermined description when translating the source file.
【請求項7】 上記ソースファイルは、上記デバッグス
クリプトが他のプログラムと同一の言語により文法的に
他のプログラム記述部と区別できる識別子で記述され、 上記インタプリタは、上記ソースファイルを翻訳する際
に上記識別子にて上記デバッグスクリプトを識別して翻
訳し実行することを特徴とする請求項5記載のプログラ
ムデバッグ装置。
7. The source file is described with an identifier by which the debug script can be grammatically distinguished from another program description part in the same language as another program. The interpreter reads the source file when translating the source file. 6. The program debugging apparatus according to claim 5, wherein said debug script is identified by said identifier, translated and executed.
【請求項8】 上記デバッグ指定手段は、上記デバッグ
スクリプトを有効にした場合、上記デバッグスクリプト
を識別できる命令を上記デバッグスクリプト起動情報に
基づき上記実行オブジェクトファイルの対応する位置に
書き込み、 上記判定手段は、上記命令に基づき上記デバッグスクリ
プトにプログラムの制御が到達したことを判定すること
を特徴とする請求項5乃至7のいずれかに記載のプログ
ラムデバッグ装置。
8. The debug designator, when the debug script is enabled, writes an instruction capable of identifying the debug script in a corresponding position of the execution object file based on the debug script activation information. 8. The program debugging device according to claim 5, wherein it is determined that the control of the program has reached the debug script based on the command.
【請求項9】 プログラムの実行時にログを出力するコ
ードであるログスクリプトを含んだソースファイルを、
通常のプログラム部分である実行オブジェクトファイル
と、上記ログスクリプト部分であるログスクリプトファ
イルと、上記ソースファイルのソース行の位置と上記ロ
グスクリプトを対応づけるログスクリプト起動情報を持
つシンボルテーブルとを含むオブジェクトファイルにコ
ンパイルするコンパイラと、 デバッグ時に上記ログスクリプトを有効にするか否かを
指定するデバッグ指定手段と、 このデバッグ指定手段により上記ログスクリプトを有効
にした場合、上記実行オブジェクトファイルを実行する
際に上記ログスクリプトにプログラムの制御が到達した
ことを判定する判定手段と、 この判定手段により上記ログスクリプトにプログラムの
制御が到達したことを判定した時に、上記ログスクリプ
ト起動情報に基づいて対応した上記ログスクリプトファ
イルを実行するプログラムデバッグ装置。
9. A source file including a log script which is a code for outputting a log when a program is executed,
An object file including an execution object file which is a normal program part, a log script file which is the log script part, and a symbol table having log script activation information for associating a position of a source line of the source file with the log script. A compiler that compiles the log script, and a debug specification unit that specifies whether to enable the log script during debugging. If the log script is enabled by the debug specification unit, the execution object file is executed when the log script is enabled. Judging means for judging that the control of the program has reached the log script; and determining, by the judging means, that the control of the program has reached the log script, the log corresponding to the log script start information. Program debugging device to run the script file.
【請求項10】 上記コンパイラは、上記ソースファイ
ルをコンパイルする際所定の記述によりログスクリプト
を識別しコンパイルすることを特徴とする請求項9記載
のプログラムデバッグ装置。
10. The program debugging device according to claim 9, wherein the compiler identifies and compiles a log script based on a predetermined description when compiling the source file.
【請求項11】 上記ソースファイルは、上記ログスク
リプトが他のプログラムと同一の言語により文法的に他
のプログラム記述部と区別できる識別子で記述され、 上記コンパイラは、上記ソースファイルをコンパイルす
る際に上記識別子にて上記ログスクリプトを識別しコン
パイルすることを特徴とする請求項9記載のプログラム
デバッグ装置。
11. The source file is described with an identifier that allows the log script to be grammatically distinguished from another program description part in the same language as another program, and the compiler is configured to compile the source file when compiling the source file. 10. The program debugging device according to claim 9, wherein the log script is identified by the identifier and compiled.
【請求項12】 上記デバッグ指定手段は、上記ログス
クリプトを有効にした場合、上記ログスクリプトを識別
できる命令を上記ログスクリプト起動情報に基づき上記
実行オブジェクトファイルの対応する位置に書き込み、 上記判定手段は、上記命令に基づき上記ログスクリプト
にプログラムの制御が到達したことを判定することを特
徴とする請求項9乃至11のいずれかに記載のプログラ
ムデバッグ装置。
12. The debug designating means, when the log script is enabled, writes an instruction capable of identifying the log script in a corresponding position of the execution object file based on the log script activation information. 12. The program debugging device according to claim 9, wherein it is determined that control of the program has reached the log script based on the command.
【請求項13】 プログラムの実行時にデバッグ時にの
み実行する処理を記述するデバッグスクリプトを含んだ
ソースファイルを、通常のプログラム部分である実行オ
ブジェクトファイルと、上記デバッグスクリプト部分で
あるデバッグスクリプトファイルと、上記ソースファイ
ルのソース行の位置と上記デバッグスクリプトを対応づ
けるデバッグスクリプト起動情報を持つシンボルテーブ
ルとを含むオブジェクトファイルにコンパイルし、 デバッグ時に、上記デバッグスクリプトを有効にするか
否かを指定し、 上記デバッグスクリプトを有効にした場合、上記実行オ
ブジェクトファイルを実行する際に上記デバッグスクリ
プトにプログラムの制御が到達したことを判定し、 上記デバッグスクリプトにプログラムの制御が到達した
ことを判定した際に、上記デバッグスクリプト起動情報
に基づいて対応した上記デバッグスクリプトファイルを
実行することを特徴とするプログラムデバッグ方法。
13. A source file including a debug script describing processing to be executed only at the time of execution of a program at the time of execution of a program includes an execution object file which is a normal program part, a debug script file which is the debug script part, and Compile into an object file that contains the location of the source line in the source file and a symbol table that has debug script startup information that associates the debug script with the above. Specify whether or not to enable the debug script during debugging. When the script is enabled, when the execution object file is executed, it is determined that the program control has reached the debug script, and it is determined that the program control has reached the debug script. And executing the corresponding debug script file on the basis of the debug script activation information.
【請求項14】 上記ソースファイルをコンパイルする
際に所定の記述により上記デバッグスクリプトを識別し
コンパイルすることを特徴とする請求項13記載のプロ
グラムデバッグ方法。
14. The program debugging method according to claim 13, wherein when compiling said source file, said debug script is identified and compiled by a predetermined description.
【請求項15】 上記ソースファイルは、上記デバッグ
スクリプトが他のプログラムと同一の言語により文法的
に他のプログラム記述部と区別できる識別子で記述さ
れ、 上記ソースファイルをコンパイルする際に上記識別子に
て上記デバッグスクリプトを識別しコンパイルすること
を特徴とする請求項13記載のプログラムデバッグ方
法。
15. The source file is described with an identifier that allows the debug script to be grammatically distinguished from another program description part in the same language as another program, and is used when compiling the source file. 14. The program debugging method according to claim 13, wherein the debugging script is identified and compiled.
【請求項16】 上記デバッグスクリプトを有効にした
場合、上記デバッグスクリプトを識別できる命令を上記
デバッグスクリプト起動情報に基づき上記実行オブジェ
クトファイルの対応する位置に書き込み、 上記命令に基づき上記デバッグスクリプトにプログラム
の制御が到達したことを判定することを特徴とする請求
項13乃至15のいずれかに記載のプログラムデバッグ
方法。
16. When the debug script is enabled, an instruction capable of identifying the debug script is written in a corresponding position of the execution object file based on the debug script activation information, and the program is added to the debug script based on the instruction. 16. The program debugging method according to claim 13, wherein it is determined that the control has been reached.
【請求項17】 プログラムの実行時にデバッグ時にの
み実行する処理を記述するデバッグスクリプトを含んだ
ソースファイルを、通常のプログラム部分である実行オ
ブジェクトファイルと、上記デバッグスクリプト部分で
あるデバッグスクリプトファイルと、上記ソースファイ
ルのソース行の位置と上記デバッグスクリプトを対応付
けるデバッグスクリプト起動情報を持つシンボルテーブ
ルとを含むオブジェクトファイルに所定のステップ毎に
翻訳し実行し、 デバッグ時に上記デバッグスクリプトを有効にするか否
かを指定し、 上記デバッグスクリプトを有効にした場合、上記実行オ
ブジェクトファイルを実行する際に上記デバッグスクリ
プトにプログラムの制御が到達したことを判定し、 上記デバッグスクリプトにプログラムの制御が到達した
ことを判定した際に、上記デバッグスクリプト起動情報
に基づいて対応した上記デバッグスクリプトファイルを
実行することを特徴とするプログラムデバッグ方法。
17. A source file containing a debug script describing a process to be executed only at the time of execution of a program at the time of execution of a program includes an execution object file which is a normal program part, a debug script file which is the debug script part, and Translated and executed for each predetermined step into an object file including a symbol table having debug script startup information for associating the position of the source line of the source file with the debug script, and determine whether to enable the debug script at the time of debugging. If the specified debug script is enabled and the execution of the execution object file is executed, it is determined that the program control has reached the debug script, and the program control has reached the debug script. A program debugging method, comprising: executing a corresponding debug script file based on the debug script activation information when it is determined that the debug script file is reached.
【請求項18】 上記ソースファイルを翻訳する際に所
定の記述によりデバッグスクリプトを識別して翻訳し実
行することを特徴とする請求項17記載のプログラムデ
バッグ方法。
18. The method according to claim 17, wherein, when translating the source file, a debug script is identified by a predetermined description, translated and executed.
【請求項19】 上記ソースファイルは、上記デバッグ
スクリプトが他のプログラムと同一の言語により文法的
に他のプログラム記述部と区別できる識別子で記述さ
れ、 上記ソースファイルを翻訳する際に上記識別子にて上記
デバッグスクリプトを識別して翻訳し実行することを特
徴とする請求項17記載のプログラムデバッグ方法。
19. The source file is described with an identifier by which the debug script can be grammatically distinguished from another program description part in the same language as another program, and is used when translating the source file. 18. The program debugging method according to claim 17, wherein the debugging script is identified, translated, and executed.
【請求項20】 上記デバッグスクリプトを有効にした
場合、上記デバッグスクリプトを識別できる命令を上記
デバッグスクリプト起動情報に基づき上記実行オブジェ
クトファイルの対応する位置に書き込み、 上記命令に基づき上記デバッグスクリプトにプログラム
の制御が到達したことを判定することを特徴とする請求
項17乃至19のいずれかに記載のプログラムデバッグ
方法。
20. When the debug script is enabled, an instruction capable of identifying the debug script is written in a corresponding position of the execution object file based on the debug script activation information, and the program is added to the debug script based on the instruction. 20. The program debugging method according to claim 17, wherein it is determined that control has been reached.
【請求項21】 プログラムの実行時にログを出力する
コードであるログスクリプトを含んだソースファイル
を、通常のプログラム部分である実行オブジェクトファ
イルと、上記ログスクリプト部分であるログスクリプト
ファイルと、上記ソースファイルのソース行の位置と上
記ログスクリプトを対応付けるログスクリプト起動情報
を持つシンボルテーブルとを含むオブジェクトファイル
にコンパイルし、 デバッグ時に上記ログスクリプトを有効にするか否かを
指定し、 上記ログスクリプトを有効にした場合、上記実行オブジ
ェクトファイルを実行する際に上記ログスクリプトにプ
ログラムの制御が到達したことを判定し、 上記ログスクリプトにプログラムの制御が到達したこと
を判定した際に、上記ログスクリプト起動情報に基づい
て対応した上記ログスクリプトファイルを実行するプロ
グラムデバッグ方法。
21. A source file containing a log script, which is a code for outputting a log when a program is executed, includes an execution object file which is a normal program part, a log script file which is the log script part, and the source file Compiles into an object file that contains the location of the source line of the log script and a symbol table with log script startup information that associates the log script, specifies whether to enable the log script during debugging, and enables the log script. When executing the execution object file, it is determined that the control of the program has reached the log script.When it is determined that the control of the program has reached the log script, the log script startup information is included. Respond based on A program debugging method for executing the above log script file.
【請求項22】 上記ソースファイルをコンパイルする
際所定の記述によりログスクリプトを識別しコンパイル
することを特徴とする請求項21記載のプログラムデバ
ッグ方法。
22. The program debugging method according to claim 21, wherein a log script is identified and compiled according to a predetermined description when compiling the source file.
【請求項23】 上記ソースファイルは、上記ログスク
リプトが他のプログラムと同一の言語により文法的に他
のプログラム記述部と区別できる識別子で記述され、 上記ソースファイルをコンパイルする際に上記識別子に
て上記ログスクリプトを識別しコンパイルすることを特
徴とする請求項21記載のプログラムデバッグ方法。
23. The source file is described with an identifier by which the log script can be grammatically distinguished from another program description part in the same language as another program, and is used when compiling the source file. 22. The program debugging method according to claim 21, wherein the log script is identified and compiled.
【請求項24】 上記ログスクリプトを有効にした場
合、上記ログスクリプトを識別できる命令を上記ログス
クリプト起動情報に基づき上記実行オブジェクトファイ
ルの対応する位置に書き込み、 上記命令に基づき上記ログスクリプトにプログラムの制
御が到達したことを判定することを特徴とする請求項2
1乃至23のいずれかに記載のプログラムデバッグ方
法。
24. When the log script is enabled, an instruction capable of identifying the log script is written in a corresponding position of the execution object file based on the log script activation information, and a program is stored in the log script based on the instruction. 3. The control system according to claim 2, wherein it is determined that the control has been reached.
24. The program debugging method according to any one of 1 to 23.
【請求項25】 プログラムの実行時にデバッグ時にの
み実行する処理を記述するデバッグスクリプトを含んだ
ソースファイルを、通常のプログラム部分である実行オ
ブジェクトファイルと、上記デバッグスクリプト部分で
あるデバッグスクリプトファイルと、上記ソースファイ
ルのソース行の位置と上記デバッグスクリプトを対応付
けるデバッグスクリプト起動情報を持つシンボルテーブ
ルとを含むオブジェクトファイルにコンパイルし、 デバッグ時に上記デバッグスクリプトを有効にするか否
かを指定し、 上記デバッグスクリプトを有効にした場合、上記実行オ
ブジェクトファイルを実行する際に上記デバッグスクリ
プトにプログラムの制御が到達したことを判定し、 上記デバッグスクリプトにプログラムの制御が到達した
ことを判定した際に、上記デバッグスクリプト起動情報
に基づいて対応した上記デバッグスクリプトファイルを
実行するプログラムデバッグ方法のプログラム情報を格
納したコンピュータ読み取り可能な記録媒体。
25. A source file including a debug script describing a process to be executed only at the time of execution of a program at the time of execution of a program includes an execution object file which is a normal program part, a debug script file which is the debug script part, and Compile into an object file that contains the location of the source line in the source file and the symbol table that has the debug script startup information that associates the above debug script, and specify whether or not to enable the above debug script during debugging. If enabled, determine that program control has reached the debug script when executing the execution object file, and determine that program control has reached the debug script. A computer-readable recording medium storing program information of a program debugging method for executing the debug script file corresponding to the debug script start information when the program is activated.
【請求項26】 プログラムの実行時にデバッグ時にの
み実行する処理を記述するデバッグスクリプトを含んだ
ソースファイルを、通常のプログラム部分である実行オ
ブジェクトファイルと、上記デバッグスクリプト部分で
あるデバッグスクリプトファイルと、上記ソースファイ
ルのソース行の位置と上記デバッグスクリプトを対応付
けるデバッグスクリプト起動情報を持つシンボルテーブ
ルとを含むオブジェクトファイルに所定のステップ毎に
翻訳し実行して、 デバッグ時に上記デバッグスクリプトを有効にするか否
かを指定し、 上記デバッグスクリプトを有効にした場合、上記実行オ
ブジェクトファイルを実行する際に上記デバッグスクリ
プトにプログラムの制御が到達したことを判定し、 上記デバッグスクリプトにプログラムの制御が到達した
ことを判定した際に、上記デバッグスクリプト起動情報
に基づいて対応した上記デバッグスクリプトファイルを
実行するプログラムデバッグ方法のプログラム情報を格
納したコンピュータ読み取り可能な記録媒体。
26. A source file including a debug script describing a process to be executed only at the time of execution of a program at the time of execution of a program includes an execution object file which is a normal program part, a debug script file which is the debug script part, and Translates and executes every predetermined step into an object file including a symbol table having debug script startup information for associating the position of the source line of the source file with the debug script, and whether to enable the debug script at the time of debugging When the above debug script is enabled, when the execution object file is executed, it is determined that the control of the program reaches the debug script, and the control of the program is transmitted to the debug script. A computer-readable recording medium storing program information of a program debugging method for executing a corresponding debug script file based on the debug script activation information when it is determined that the program has arrived.
【請求項27】 プログラムの実行時にログを出力する
コードであるログスクリプトを含んだソースファイル
を、通常のプログラム部分である実行オブジェクトファ
イルと、上記ログスクリプト部分であるログスクリプト
ファイルと、上記ソースファイルのソース行の位置と上
記ログスクリプトを対応づけるログスクリプト起動情報
を持つシンボルテーブルとを含むオブジェクトファイル
にコンパイルし、 デバッグ時に上記ログスクリプトを有効にするか否かを
指定し、 上記ログスクリプトを有効にした場合、上記実行オブジ
ェクトファイルを実行する際上記ログスクリプトにプロ
グラムの制御が到達したことを判定し、 上記ログスクリプトにプログラムの制御が到達したこと
を判定した際に、上記ログスクリプト起動情報に基づい
て対応した上記ログスクリプトファイルを実行するプロ
グラムデバッグ方法のプログラム情報を格納したコンピ
ュータ読み取り可能な記録媒体。
27. A source file containing a log script, which is a code for outputting a log when a program is executed, includes an execution object file, which is a normal program part, a log script file, which is the log script part, and the source file. Compiles into an object file that contains the location of the source line of the log script and a symbol table with log script startup information that associates the log script, specifies whether to enable the log script during debugging, and enables the log script. When executing the execution object file, it is determined that the program control reaches the log script, and when it is determined that the program control reaches the log script, the Respond based on A computer-readable recording medium storing program information of a program debugging method for executing the log script file.
JP9272792A 1997-10-06 1997-10-06 Device and method for debugging program, and computer readable recording medium recorded with the method for the same Pending JPH11110256A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9272792A JPH11110256A (en) 1997-10-06 1997-10-06 Device and method for debugging program, and computer readable recording medium recorded with the method for the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9272792A JPH11110256A (en) 1997-10-06 1997-10-06 Device and method for debugging program, and computer readable recording medium recorded with the method for the same

Publications (1)

Publication Number Publication Date
JPH11110256A true JPH11110256A (en) 1999-04-23

Family

ID=17518814

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9272792A Pending JPH11110256A (en) 1997-10-06 1997-10-06 Device and method for debugging program, and computer readable recording medium recorded with the method for the same

Country Status (1)

Country Link
JP (1) JPH11110256A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004036420A1 (en) * 2002-10-18 2004-04-29 Advantest Corporation Program development support device, program execution device, compile method and debug method
JP2004272908A (en) * 2003-03-06 2004-09-30 Microsoft Corp Method for integrating phase of design, development and management of system
US7941309B2 (en) 2005-11-02 2011-05-10 Microsoft Corporation Modeling IT operations/policies
JP2013080406A (en) * 2011-10-05 2013-05-02 Fujitsu Ltd Compilation device, information processing system, compilation method, compilation program, and storage medium
KR20170002765A (en) * 2015-06-29 2017-01-09 삼성전자주식회사 Operation method of storage device, operation method of host device, and operation method of user system including storage device and host device
US10540159B2 (en) 2005-06-29 2020-01-21 Microsoft Technology Licensing, Llc Model-based virtual system provisioning

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004036420A1 (en) * 2002-10-18 2004-04-29 Advantest Corporation Program development support device, program execution device, compile method and debug method
JP2004272908A (en) * 2003-03-06 2004-09-30 Microsoft Corp Method for integrating phase of design, development and management of system
US7886041B2 (en) 2003-03-06 2011-02-08 Microsoft Corporation Design time validation of systems
US10540159B2 (en) 2005-06-29 2020-01-21 Microsoft Technology Licensing, Llc Model-based virtual system provisioning
US7941309B2 (en) 2005-11-02 2011-05-10 Microsoft Corporation Modeling IT operations/policies
JP2013080406A (en) * 2011-10-05 2013-05-02 Fujitsu Ltd Compilation device, information processing system, compilation method, compilation program, and storage medium
KR20170002765A (en) * 2015-06-29 2017-01-09 삼성전자주식회사 Operation method of storage device, operation method of host device, and operation method of user system including storage device and host device

Similar Documents

Publication Publication Date Title
JP4901075B2 (en) Computer-readable medium, method and computing device
JP6280126B2 (en) System and method for debugging domain specific languages
US9003367B2 (en) Specific debug trace collecting
US7761855B2 (en) Computer program product and system for altering execution flow of a computer program
US5313387A (en) Re-execution of edit-compile-run cycles for changed lines of source code, with storage of associated data in buffers
US6948164B2 (en) Method and system for modifying executable code to add additional functionality
US5182806A (en) Incremental compiler for source-code development system
US5325531A (en) Compiler using clean lines table with entries indicating unchanged text lines for incrementally compiling only changed source text lines
US5170465A (en) Incremental-scanning compiler for source-code development system
US5193191A (en) Incremental linking in source-code development system
JP4057938B2 (en) Compiler, compiling method, and program development tool
US9672133B2 (en) Systems and methods for debugging applications using dual code generation
US6874140B1 (en) Debug annotations
US20130086424A1 (en) Debugging analysis in running multi-user systems
US8997049B1 (en) Method and system for debugging of compiled code using an interpreter
JPH11232138A (en) Emulation method
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
US8533683B2 (en) Stack walking enhancements using sensorpoints
US20080127118A1 (en) Method and system for dynamic patching of software
EP3891613B1 (en) Software checkpoint-restoration between distinctly compiled executables
JPH11110256A (en) Device and method for debugging program, and computer readable recording medium recorded with the method for the same
JP2004139458A (en) Program development support device, program execution device, compiling method, and debugging method
US20220297731A1 (en) Train signal system and linkage method therefor
JP2007004516A (en) Program debugging method of built-in system
JP2672968B2 (en) Source list output processing method for debugging