JP2926590B1 - Program debugger, program debugging method and recording medium - Google Patents

Program debugger, program debugging method and recording medium

Info

Publication number
JP2926590B1
JP2926590B1 JP10238247A JP23824798A JP2926590B1 JP 2926590 B1 JP2926590 B1 JP 2926590B1 JP 10238247 A JP10238247 A JP 10238247A JP 23824798 A JP23824798 A JP 23824798A JP 2926590 B1 JP2926590 B1 JP 2926590B1
Authority
JP
Japan
Prior art keywords
program
file format
data access
debug
access function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP10238247A
Other languages
Japanese (ja)
Other versions
JP2000066920A (en
Inventor
貴志 村中
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.)
NIPPON DENKI MAIKON TEKUNOROJII KK
Original Assignee
NIPPON DENKI MAIKON TEKUNOROJII KK
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 NIPPON DENKI MAIKON TEKUNOROJII KK filed Critical NIPPON DENKI MAIKON TEKUNOROJII KK
Priority to JP10238247A priority Critical patent/JP2926590B1/en
Application granted granted Critical
Publication of JP2926590B1 publication Critical patent/JP2926590B1/en
Publication of JP2000066920A publication Critical patent/JP2000066920A/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

【要約】 【課題】 複数ファイルフォーマットのプログラムに対
応できるデバッガの提供。 【解決手段】 利用者が入力装置1からデバッグ対象プ
ログラムのプログラム名を入力すると、ファイルフォー
マット自動判別部22は、そのファイルフォーマットを
判別し、対応するデータアクセス機能をファイルフォー
マット依存部23から呼び出す。ファイルフォーマット
依存部23は、デバッグ対象プログラム記憶部31から
当該プログラムのデバッグ情報を読み出す。ファイルフ
ォーマット自動判別部22は、デバッグ情報によってデ
ータベースを作成する。共通処理部21は、上述のデー
タアクセス機能により、ターゲット通信部24を介して
デバッグ対象プログラムをターゲットシステム部5にロ
ードしデバッグを実行する。このとき、上記データベー
スとデータアクセス機能が適時起動される。
Abstract: PROBLEM TO BE SOLVED: To provide a debugger which can correspond to a program of a plurality of file formats. When a user inputs a program name of a program to be debugged from an input device, a file format automatic determination unit determines the file format and calls a corresponding data access function from a file format dependence unit. The file format dependent unit 23 reads out the debug information of the program from the debug target program storage unit 31. The file format automatic determination unit 22 creates a database based on the debug information. The common processing unit 21 loads a debug target program into the target system unit 5 via the target communication unit 24 and executes debugging by using the data access function described above. At this time, the database and the data access function are activated at appropriate times.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、コンパイル後のプ
ログラムの正当性を検証するプログラムデバッガおよび
プログラムデバッグ方法に関する。
The present invention relates to a program debugger and a program debugging method for verifying the validity of a compiled program.

【0002】[0002]

【従来の技術】プログラムのファイルフォーマットの代
表的なものとしては、ELF,COFF,DWARFな
どがあるが、これらのファイルフォーマットはコンパイ
ラのベンダや、デバッグ対象プログラムがロードされる
ターゲットシステムによって異なったものとなる。ファ
イルフォーマットが異なれば、データを読み出す手順も
違ってくる。そのため、従来のプログラムデバッガは、
コンパイラやターゲットシステム等のデバッグ構成シス
テムごとに個別に提供されている。
2. Description of the Related Art Typical file formats of a program include ELF, COFF, DWARF and the like. These file formats differ depending on a compiler vendor and a target system on which a program to be debugged is loaded. Becomes Different file formats have different procedures for reading data. Therefore, the conventional program debugger
It is provided separately for each debug configuration system such as a compiler and target system.

【0003】[0003]

【発明が解決しようとする課題】上述した従来のプログ
ラムデバッガでは、唯一つのファイルフォーマットにし
か対応できず、またそれぞれのファイルフォーマット間
に共通性はほとんどないため、もし開発途中で開発シス
テムを変更するなどしてプログラムのファイルフォーマ
ットが変更された場合、前のシステムで作成したプログ
ラムは新しい開発システムで使用できなくなってしま
う。また、過去に異なる環境で作成されたプログラムを
新たな環境で作成されたプログラムと同時使用したい場
合は、デバッガが単一のファイルフォーマットしか扱え
ない関係上、すべてのプログラムのファイルフォーマッ
トを統一する必要があった。そのため、旧フォーマット
で作成したプログラムを何らかの手段を用いて新しいフ
ォーマットに変更する必要があった。これは開発効率の
向上や過去の資源の再利用、という観点からみて有効で
はない。
The above-mentioned conventional program debugger can handle only one file format, and there is almost no commonality between the respective file formats. Therefore, if the development system is changed during the development, If, for example, the file format of the program is changed, the program created in the previous system cannot be used in the new development system. Also, if you want to use a program created in a different environment in the past and a program created in a new environment at the same time, the file format of all programs must be unified because the debugger can handle only a single file format. was there. Therefore, it was necessary to change the program created in the old format to the new format using some means. This is not effective in terms of improving development efficiency and reusing past resources.

【0004】本発明の目的は、この問題を解決するため
に複数ファイルフォーマットに対応するプログラムデバ
ッガおよびプログラムデバッグ方法を提供することにあ
る。
[0004] It is an object of the present invention to provide a program debugger and a program debugging method which support a plurality of file formats in order to solve this problem.

【0005】また、本発明の他の目的は、ファイルフォ
ーマットの異なる複数のプログラムを同時にデバッグで
きるプログラムデバッガおよびプログラムデバッグ方法
を提供することにある。
It is another object of the present invention to provide a program debugger and a program debugging method capable of simultaneously debugging a plurality of programs having different file formats.

【0006】[0006]

【課題を解決するための手段】本発明のプログラムデバ
ッガは、プログラムのファイルフォーマットごとに、該
ファイルフォーマットに依存する処理手段を備え、利用
者がデバッグ対象プログラムのプログラム名を入力する
と、これに対応する前記処理手段を起動し、記憶装置上
のデバッグ対象プログラムに対して所定の処理を施して
ターゲットシステムにロードし、また該ターゲットシス
テム上でデバッグを実行時には、適時前記処理手段を呼
び出すことを特徴とする。
A program debugger according to the present invention comprises processing means depending on a file format of a program for each file format. When a user inputs a program name of a program to be debugged, the program debugger responds. Activating the processing means, performing predetermined processing on a program to be debugged on a storage device and loading the program into a target system, and calling the processing means at a time when debugging is performed on the target system. And

【0007】本発明の好ましい実施の形態としてのプロ
グラムデバッガは、前記ファイルフォーマットごとのデ
ータアクセス機能を有し、前記プログラム名をもつデバ
ッグ対象プログラムを前記記憶装置から探し出して、そ
のデバッグ情報を読み出すファイルフォーマット依存部
と、前記プログラム名に対するファイルフォーマットを
判別して対応する前記ファイルフォーマット依存部を切
り替え起動し、ファイルフォーマット依存部からの前記
デバッグ情報によってデータベースを作成してデバッグ
に供するファイルフォーマット自動判別部と、当該デバ
ッガと前記ターゲットシステムとの間の情報の授受を行
うターゲット通信部と、前記利用者との間でユーザイン
タフェース部を形成するとともに、前記ファイルフォー
マット自動判別部と前記ターゲット通信部との間の情報
授受の仲介を行う共通処理部とを有することを特徴とす
る。
A program debugger according to a preferred embodiment of the present invention has a data access function for each file format, finds a program to be debugged having the program name from the storage device, and reads out the debug information. A file format automatic discriminating unit for discriminating a file format for the program name, switching and starting the corresponding file format dependent unit, creating a database based on the debug information from the file format dependent unit, and providing the database for debugging. A target communication unit for transmitting and receiving information between the debugger and the target system; and a user interface unit between the user and the file format automatic discrimination unit. And having a common processing unit for mediating information exchange between the target communication unit.

【0008】本発明の好ましい実施の形態としてのプロ
グラムデバッガは、前記ファイルフォーマット依存部を
モジュール化し、新規のファイルフォーマットに対応し
て追加可能としたことを特徴とする。
A program debugger according to a preferred embodiment of the present invention is characterized in that the file format dependent section is modularized and can be added in accordance with a new file format.

【0009】また、本発明のプログラムデバッグ方法
は、利用者がデバッグ対象プログラムのプログラム名を
入力すると対応するプログラムのファイルフォーマット
を判別する手順と、該ファイルフォーマット対応のデー
タアクセス機能を呼び出す手順と、該データアクセス機
能によって当該デバッグ対象プログラムからデバッグ情
報を読み出してデータベースを作成する手順と、前記デ
ータアクセス機能によって当該デバッグ対象プログラム
をターゲットシステムにロードする手順と、該ターゲッ
トシステム上で当該デバッグ対象プログラムを実行する
手順と、該実行時に適時前記データベースおよびデータ
アクセス機能を起動する手順と、該デバッグの結果を出
力する手順とを有する。
Further, the program debugging method of the present invention comprises: a step of determining a file format of a corresponding program when a user inputs a program name of a program to be debugged; a step of calling a data access function corresponding to the file format; Reading the debug information from the debug target program by the data access function to create a database; loading the debug target program into the target system by the data access function; and loading the debug target program on the target system. It has a procedure for executing, a procedure for activating the database and the data access function at the time of the execution, and a procedure for outputting a result of the debugging.

【0010】本発明では、ダウンロードされるプログラ
ムのファイルフォーマットをデバッガ内で自動判別し、
デバッグの内部処理を切り変える。ファイルフォーマッ
ト間の差異は内部処理で解決してしまうことでユーザイ
ンタフェースを一律にすることができる。そのため、利
用者はプログラムのファイルフォーマットを変更する手
間をかけずにデバッガにプログラムをダウンロードする
ことができる。また、利用者はプログラムのファイルフ
ォーマットの違いを意識することなくインタフェース上
でデバッグ作業を行うことができるようになる。
According to the present invention, the file format of a program to be downloaded is automatically determined in a debugger,
Switch the internal processing of debugging. The user interface can be made uniform by resolving differences between file formats by internal processing. Therefore, the user can download the program to the debugger without having to change the file format of the program. In addition, the user can perform debugging work on the interface without being aware of the difference in the file format of the program.

【0011】[0011]

【発明の実施の形態】次に、本発明の実施の形態につい
て説明する。
Next, an embodiment of the present invention will be described.

【0012】本発明のプログラムデバッガは、プログラ
ムのファイルフォーマットごとに、該ファイルフォーマ
ットに依存する処理手段を備え、利用者がデバッグ対象
プログラムのプログラム名を入力すると、これに対応す
る前記処理手段を起動し、記憶装置上のデバッグ対象プ
ログラムに対して所定の処理を施してターゲットシステ
ムにロードし、また該ターゲットシステム上でデバッグ
を実行時には、適時前記処理手段を呼び出すことを特徴
とする。
The program debugger of the present invention includes processing means for each file format of a program, the processing means depending on the file format, and when a user inputs a program name of a program to be debugged, the processing means corresponding to this is activated. Then, a predetermined process is performed on the program to be debugged on the storage device and loaded into the target system, and when the debugging is executed on the target system, the processing means is called at an appropriate time.

【0013】また、本発明のプログラムデバッグ方法
は、利用者がデバッグ対象プログラムのプログラム名を
入力すると対応するプログラムのファイルフォーマット
を判別する手順と、該ファイルフォーマット対応のデー
タアクセス機能を呼び出す手順と、該データアクセス機
能によって当該デバッグ対象プログラムからデバッグ情
報を読み出してデータベースを作成する手順と、前記デ
ータアクセス機能によって当該デバッグ対象プログラム
をターゲットシステムにロードする手順と、該ターゲッ
トシステム上で当該デバッグ対象プログラムを実行する
手順と、該実行時に適時前記データベースおよびデータ
アクセス機能を起動する手順と、該デバッグの結果を出
力する手順とを有する。
Further, the program debugging method of the present invention comprises: a step of determining a file format of a corresponding program when a user inputs a program name of a program to be debugged; a step of calling a data access function corresponding to the file format; Reading the debug information from the debug target program by the data access function to create a database; loading the debug target program into the target system by the data access function; and loading the debug target program on the target system. It has a procedure for executing, a procedure for activating the database and the data access function at the time of the execution, and a procedure for outputting a result of the debugging.

【0014】以下、本発明の実施例について図面を参照
して説明する。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.

【0015】通常、Cソースプログラムをコンパイラに
かけるとアセンブルプログラムだけが生成され、もとの
Cソースとの関連性は失われてしまう。つまり、Cソー
スプログラム中のどの行がどのアドレスに対応するか、
とかどの変数がどういったメモリ配置で置かれている
か、といった依存関係はコンパイルした後ではわからな
くなってしまうのである。そこで、本発明は、この依存
関係の情報をデバッグ情報としてプログラムに付加的に
追加し、デバッガは、このデバッグ情報内に記述されて
いる依存関係情報を読み取り、処理しやすい形のデータ
ベースとして蓄えることによってデバッガに必要な機能
を実現している。
Normally, when a C source program is applied to a compiler, only an assemble program is generated, and the association with the original C source is lost. That is, which line in the C source program corresponds to which address,
Dependencies such as what variables are located in what memory locations are lost after compilation. Therefore, the present invention adds the dependency information to the program as debug information, and the debugger reads the dependency information described in the debug information and stores it as a database in a form that can be easily processed. This realizes the functions required for the debugger.

【0016】ここで、デバッグ対象となるプログラムが
もつファイルフォーマット(形式)については、EL
F,COFF,DWARFなど、幾つか制定されている
が、あるベンダの作成したコンパイラがどのようなファ
イルフォーマット(形式)を採用するかは任意であり、
各ファイルフォーマットが持つデバッグ情報のデータ形
式がそれぞれ異なっているため、データベースの構造も
それに依存した形で持つことにした。
The file format of the program to be debugged is described in EL
F, COFF, DWARF, etc. are established, but it is arbitrary what file format is adopted by a compiler created by a certain vendor.
Because the data format of the debug information in each file format is different, we decided to have the database structure dependent on it.

【0017】データベース内に蓄えられる主なデータは
以下の通りである。
The main data stored in the database is as follows.

【0018】・プログラムを作成するときに使用された
Cソースプログラム名とそのファイルが保存されている
場所(ディレクトリ)の情報。
Information on the name of the C source program used to create the program and the location (directory) where the file is stored.

【0019】・あるCソースファイル中にどのような関
数・変数が記述されているかを示す情報。またその関数
・変数がアセンブルプログラム中のどの位置に対応して
いるかの情報。
Information indicating what functions and variables are described in a certain C source file. Information on where the function / variable corresponds in the assembly program.

【0020】・あるCソースファイル中に記述されてい
るCソース行について、アセンブルプログラム中のどの
位置に対応しているかを示す情報。
Information indicating which position in the assemble program corresponds to a C source line described in a certain C source file.

【0021】図1は、本発明の一実施例を示すブロック
図である。本デバッガ2は、プログラム制御により動作
するデータ処理装置であり、キーボード等の入力装置1
と、情報を記憶する記憶装置3と、ディスプレイ装置や
印刷装置等の出力装置4と、デバッグ対象プログラムが
ロードされるターゲットシステム5とに接続されてい
る。また、デバッガ2は、共通処理部21と、ファイル
フォーマット自動判別部22と、ファイルフォーマット
対応のファイルフォーマット依存部23と、ターゲット
通信部24とを備えている。
FIG. 1 is a block diagram showing one embodiment of the present invention. The debugger 2 is a data processing device that operates under program control, and includes an input device 1 such as a keyboard.
And a storage device 3 for storing information, an output device 4 such as a display device or a printing device, and a target system 5 on which a program to be debugged is loaded. Further, the debugger 2 includes a common processing unit 21, an automatic file format determination unit 22, a file format dependent unit 23 corresponding to a file format, and a target communication unit 24.

【0022】デバッガ・共通処理部21はユーザインタ
フェース機能を備えており、利用者と下位モジュール
(ファイルフォーマット依存部23やターゲットシステ
ム5)との情報の仲介を行う。ファイルフォーマット依
存部23は、ターゲットシステム5にダウンロードする
プログラムに含まれるデバッグ情報を読み出し、共通処
理部21からの要求に応えてプログラムの情報を返却す
る。プログラムのファイルフォーマット毎にデータを読
み出す手順が異なるため、ファイルフォーマット依存部
23には、ファイルフォーマット毎に異なるデータアク
セス機能が用意されている。ファイルフォーマット自動
判別部22はターゲットシステム5にダウンロードされ
るプログラムのファイルフォーマット種別を判別し、そ
のフォーマットにあわせてファイルフォーマット依存部
23の中の適切なデータアクセス機能を呼び出す機能を
もつ。
The debugger / common processing unit 21 has a user interface function, and mediates information between a user and lower modules (the file format dependent unit 23 and the target system 5). The file format dependent unit 23 reads out the debug information included in the program to be downloaded to the target system 5 and returns the information of the program in response to a request from the common processing unit 21. Since the procedure for reading data differs for each file format of the program, the file format dependent unit 23 has a different data access function for each file format. The file format automatic determination unit 22 has a function of determining the file format type of a program downloaded to the target system 5 and calling an appropriate data access function in the file format dependent unit 23 according to the format.

【0023】記憶装置3は、ターゲットシステム5にダ
ウンロードするためのプログラムを予め記憶しているデ
バッグ対象プログラム記憶部31を備えている。
The storage device 3 includes a debug target program storage section 31 which stores a program to be downloaded to the target system 5 in advance.

【0024】次に、図1,図2および図3を参照して本
実施例の動作について詳細に説明する。
Next, the operation of this embodiment will be described in detail with reference to FIG. 1, FIG. 2 and FIG.

【0025】まず、ターゲットシステム5にプログラム
をダウンロードする場合、入力装置1からダウンロード
したいプログラム名を入力する(図2ステップS1)。
このファイル名は共通処理部21に渡される。ファイル
フォーマット依存部23は、共通処理部21からの指示
により、デバッグ対象プログラム記憶部31の中から該
当するファイル名をもつプログラムを探し出し、このフ
ァイルに含まれるデバッグ情報を読み込む。この時、ま
だプログラムのファイルフォーマットは未知であり、デ
ータ読み出しの手順が決定できないため、ファイルフォ
ーマット自動判別部22は、先にプログラムのファイル
フォーマットがどの形式を持つものかを調べる。プログ
ラムはファイルフォーマット毎に判別用のキーを持って
おり(ファイルの先頭にある一定のパターンのデータの
並びを持つ、など)、ファイル中をシークすることでど
のファイルフォーマットを持つプログラムかを判断する
ことができる(S2)。
First, when downloading a program to the target system 5, the name of the program to be downloaded is input from the input device 1 (step S1 in FIG. 2).
This file name is passed to the common processing unit 21. The file format dependent unit 23 searches for a program having a corresponding file name from the debug target program storage unit 31 according to an instruction from the common processing unit 21 and reads debug information included in this file. At this time, since the file format of the program is not yet known and the procedure for reading data cannot be determined, the file format automatic discrimination unit 22 first checks which format the file format of the program has. The program has a key for discrimination for each file format (such as having a certain pattern of data at the beginning of the file), and seeks through the file to determine which file format the program has. (S2).

【0026】この後、ファイルフォーマット自動判別部
22は、プログラムのファイルフォーマット用のダウン
ロード機能を呼び出し、このプログラムに関するデータ
ベースを作成する(S3)。データベースには、ファイ
ルフォーマット情報も含まれているため、これ以降にプ
ログラム情報にアクセスする場合でも、その都度プログ
ラムのファイルフォーマットを調べる必要はない。共通
処理部21は、作成されたデータベースの情報を基に、
プログラムに含まれるバイナリデータをターゲット通信
部24を経由してターゲットシステム5に書き込むこと
でデバッグのダウンロード処理を終了する。
Thereafter, the file format automatic discrimination section 22 calls a download function for the file format of the program, and creates a database relating to the program (S3). Since the database also includes file format information, it is not necessary to check the file format of the program each time the program information is accessed thereafter. The common processing unit 21 performs, based on the information of the created database,
By writing the binary data included in the program to the target system 5 via the target communication unit 24, the debug download process ends.

【0027】次に、実際のデバッグ処理を行う場合、例
えば、プログラムAの中に記述されている変数aの値を
参照するとする。このとき、共通処理部21は、まずプ
ログラムAのデータベースを参照し、プログラムAのフ
ァイルフォーマットαを取得する(図3ステップS
5)。いまの場合は、フォーマットがAであるから(S
6)、ファイルフォーマットα用の変数参照機能を呼び
出すと、プログラムAのファイルの中からファイルフォ
ーマットαの読み出し方式に則って変数aの情報(アド
レスやサイズなど)を読み出してくれる(S7)。ここ
で得られたパラメータをターゲット通信部24に渡す
と、変数aに対応したアドレスから適切な値を読み出す
ことができる(S9)。
Next, when an actual debugging process is performed, for example, the value of the variable a described in the program A is referred to. At this time, the common processing unit 21 first refers to the database of the program A and acquires the file format α of the program A (step S in FIG. 3).
5). In this case, since the format is A (S
6) When the variable reference function for the file format α is called, the information (address, size, etc.) of the variable a is read from the file of the program A in accordance with the reading method of the file format α (S7). By passing the parameter obtained here to the target communication unit 24, an appropriate value can be read from the address corresponding to the variable a (S9).

【0028】また、引き続いてプログラムBの中に記述
されている変数bの値を参照するとする。この時はプロ
グラムBのデータベースからプログラムBのファイルフ
ォーマットを取得する(S5)。プログラムBのファイ
ルフォーマットβがプログラムAのファイルフォーマッ
トαと異なっている場合でも、ファイルフォーマットが
プログラムAと異なっていることはデータベースの情報
から予めわかるため(S6)、ファイルフォーマットβ
に適した変数参照機能を呼び出すことができる(S
8)。
It is assumed that the value of the variable b described in the program B is subsequently referred to. At this time, the file format of the program B is obtained from the database of the program B (S5). Even when the file format β of the program B is different from the file format α of the program A, the fact that the file format is different from that of the program A can be known in advance from the information in the database (S6).
Variable reference function suitable for
8).

【0029】さらに、他のデバッガの機能を使用する場
合でも、変数の場合と同様に、ファイルフォーマットに
適した処理を行うことで、常に必要な情報を取得するこ
とができる。
Furthermore, even when using other debugger functions, necessary information can always be obtained by performing processing suitable for the file format, as in the case of using variables.

【0030】次に、本実施例の他の動作例として、ファ
イルフォーマットが異なる複数のプログラムを同時にダ
ウンロードし、かつデバッグする場合について説明す
る。
Next, as another operation example of the present embodiment, a case where a plurality of programs having different file formats are simultaneously downloaded and debugged will be described.

【0031】例えば、ファイルフォーマット形式αをも
つプログラムAと、ファイルフォーマット形式βを持つ
プログラムBを同時にダウンロードしたとする。また、
プログラムAはソースファイルaをコンパイルして生成
されたものとし、プログラムBはソースファイルbをコ
ンパイルして生成されたものとする。プログラムAとプ
ログラムBはターゲットシステム5のメモリ領域中にダ
ウンロードされており、また、プログラムAとプログラ
ムBのメモリ領域はまったく重複しないものとする。こ
のとき、ターゲットシステムのメモリ中のあるアドレス
に対して、一意的に対応するプログラムを決定すること
ができる。
For example, assume that a program A having the file format α and a program B having the file format β are downloaded simultaneously. Also,
It is assumed that the program A is generated by compiling the source file a, and the program B is generated by compiling the source file b. The programs A and B are downloaded into the memory area of the target system 5, and the memory areas of the programs A and B do not overlap at all. At this time, a program uniquely corresponding to a certain address in the memory of the target system can be determined.

【0032】例えば、プログラムAが0〜100、Bが
200〜300の領域を持つとすると、50番地のアド
レスに対するプログラムはAである、と一意的に決定す
ることができるのである。
For example, if program A has an area of 0 to 100 and B has an area of 200 to 300, it can be uniquely determined that the program for the address of address 50 is A.

【0033】ここで、デバッガの表示として、ロードし
たプログラムに対するソースファイルの内容を表示させ
ようとした場合を考える。ロードしたプログラムをター
ゲットシステム5上で実行させた場合、ターゲットシス
テム5上のプログラムカウンタ(以下PC)レジスタ値
が実行に伴い変化していく。デバッガ上に表示させるプ
ログラムのソースファイル行をターゲットシステム5上
のプログラムの実行にあわせて移動させていくような場
合、ターゲットシステム5内部のPCレジスタ値の変化
を常にモニタリングして対応するソース行の位置を見つ
け出さなければならない。現在のPCレジスタ値はター
ゲット通信部24を通して取得することができ、このP
Cレジスタ値に対応するプログラムがA・Bいずれであ
るかは一意的に決定できる(この判断処理はファイルフ
ォーマット自動判別部22が行う)。すなわち、データ
ベース中にはソースファイルのある行がメモリ領域中の
どのアドレスに対応しているかを示す情報が含まれてい
るので、これを基にアドレス一行番号の関連付けの出力
などを行うことができる。
Here, it is assumed that the contents of the source file for the loaded program are to be displayed as the display of the debugger. When the loaded program is executed on the target system 5, a program counter (hereinafter, PC) register value on the target system 5 changes with execution. When the source file line of the program to be displayed on the debugger is moved in accordance with the execution of the program on the target system 5, a change in the PC register value inside the target system 5 is constantly monitored to check the corresponding source line. I have to find a position. The current PC register value can be obtained through the target communication unit 24.
Whether the program corresponding to the C register value is A or B can be uniquely determined (this determination process is performed by the file format automatic determination unit 22). That is, since the database includes information indicating which address in the memory area corresponds to a certain line in the source file, it is possible to output the association of one line number of the address based on the information. .

【0034】上記の例では、取得されたPCレジスタ値
が50だった場合、そのアドレスに対応するプログラム
はAであるので、プログラムAのデータベースの中から
50番地に対応するプログラム行の情報を取得し、その
情報を基にデバッガの表示を行う。さらにターゲット中
のプログラムを引き続き実行し、PCレジスタ値が25
0になったとする。この時、そのアドレスに対応するプ
ログラムはBであるので、プログラムBのデータベース
の中から250番地に対応するプログラム行の情報を取
得しその情報を基にデバッガの表示を行う。フォーマッ
トαに対する行番号検索処理とフォーマットβに対する
それとでは、処理内容が異なるが、ファイルフォーマッ
ト自動判別部22によってどちらか必要な方の処理を自
動的に呼び出して出力用のデータの取得を行うことがで
きる。この際、ファイルフォーマットの違いをすべてフ
ァイルフォーマット依存部23の中で吸収させること
で、出力内容をファイルフォーマットに依存しない、画
一的なものに統一することができる。したがってデバッ
ガのユーザはファイルフォーマットの差を気にすること
なく、どちらのプログラムもまったく同じ動作環境で使
用することができるようになる。
In the above example, if the acquired PC register value is 50, the program corresponding to that address is A, so the program line information corresponding to address 50 is obtained from the program A database. Then, the debugger is displayed based on the information. Further, the program in the target is continuously executed, and the PC register value becomes 25
Suppose that it becomes 0. At this time, since the program corresponding to the address is B, the information of the program line corresponding to the address 250 is obtained from the database of the program B, and the debugger is displayed based on the information. Although the processing contents are different between the line number search processing for the format α and the processing for the format β, the file format automatic discrimination unit 22 can automatically call the necessary processing to acquire data for output. it can. At this time, by absorbing all differences in the file format in the file format dependent unit 23, the output contents can be unified to a uniform one independent of the file format. Therefore, the user of the debugger can use both programs in exactly the same operating environment without worrying about the difference in the file format.

【0035】次に、本発明の他の実施例を図4により説
明する。
Next, another embodiment of the present invention will be described with reference to FIG.

【0036】図1におけるファイルフォーマット依存部
23は、本来はデバッガ2の中に含まれるものであり、
基本的には対応しようとするファイルフォーマットの種
類の数だけ、予め用意しておかなければならない(図4
A)。しかし、これでは未知のファイルフォーマットに
対して、対応できない。そこで、図4Bに示すように、
ファイルフォーマットを別モジュールとして扱い、新し
いファイルフォーマットに対応する時には、そのファイ
ルフォーマットに対応するファイルフォーマット依存部
分54だけを新たに作成し、旧来のモジュールとしての
ファイルフォーマット依存部52,53に追加すること
によって、どのようなファイルフォーマットにも対応で
きるようにすることができる様になる。
The file format dependent unit 23 in FIG. 1 is originally included in the debugger 2,
Basically, the number of file formats to be supported must be prepared in advance (see FIG. 4).
A). However, this cannot handle unknown file formats. Therefore, as shown in FIG. 4B,
When a file format is treated as a separate module and a new file format is supported, only a file format dependent portion 54 corresponding to the new file format is newly created and added to the file format dependent portions 52 and 53 as the old modules. Thus, any file format can be supported.

【0037】また、図1および図4に示したデバッガを
プログラムによって実現し、それを半導体メモリ,磁気
ディスク等コンピュータ読み込み可能な記録媒体に記録
して、コンピュータに読み込ませて実行させることによ
りデバッグを実行するようにしてもよい。
The debugger shown in FIGS. 1 and 4 is realized by a program, recorded on a computer-readable recording medium such as a semiconductor memory or a magnetic disk, and read and executed by a computer to perform debugging. It may be executed.

【0038】[0038]

【発明の効果】本発明によれば、第1に、プログラムの
ファイルフォーマットはデバッガ側で判断するため、利
用者がファイルフォーマットを意識する必要がなくな
る。すなわち、どのようなコンパイラで作成されたプロ
グラムでもダウンロードしてデバッグ作業を行うことが
できる。
According to the present invention, first, since the file format of the program is determined on the debugger side, the user does not need to be aware of the file format. That is, a program created by any compiler can be downloaded and debugged.

【0039】第2に、ファイルフォーマットが異なる複
数のプログラムでも、ファイルフォーマットの変換をす
ることなく、ターゲットシステムに同時にロードして、
同時にデバッグすることができるという効果を有する。
Second, even if a plurality of programs having different file formats are simultaneously loaded into the target system without converting the file format,
This has the effect of enabling debugging at the same time.

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

【図1】本発明の一実施例のブロック図FIG. 1 is a block diagram of one embodiment of the present invention.

【図2】本発明におけるデバッグ対象のダウンロード時
のフローチャート
FIG. 2 is a flowchart for downloading a debug target according to the present invention;

【図3】本発明におけるデバッグ時における変数値取得
を例とする処理のフローチャート
FIG. 3 is a flowchart illustrating a process of obtaining variable values during debugging according to the present invention;

【図4】本発明の他の実施例の要部を示すブロック図FIG. 4 is a block diagram showing a main part of another embodiment of the present invention.

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

1 入力装置 2 デバッガ 3 記憶装置 4 出力装置 5 ターゲットシステム 21 共通処理部 22,51 ファイルフォーマット自動判別部 23,23a,23b,52,53,54 ファイルフ
ォーマット依存部 24 ターゲット通信部 31 デバッグ対象プログラム記憶部
DESCRIPTION OF SYMBOLS 1 Input device 2 Debugger 3 Storage device 4 Output device 5 Target system 21 Common processing part 22, 51 File format automatic discrimination part 23, 23a, 23b, 52, 53, 54 File format dependent part 24 Target communication part 31 Debug target program storage Department

Claims (6)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】プログラムのファイルフォーマットごと
に、該ファイルフォーマットに依存する処理手段を備
え、利用者がデバッグ対象プログラムのプログラム名を
入力すると、これに対応する前記処理手段を起動し、記
憶装置上のデバッグ対象プログラムに対して所定の処理
を施してターゲットシステムにロードし、また該ターゲ
ットシステム上でデバッグを実行時には、適時前記処理
手段を呼び出すことを特徴とするプログラムデバッガ。
1. A processing means depending on a file format of a program is provided, and when a user inputs a program name of a program to be debugged, the processing means corresponding to the program name is activated and stored in a storage device. A program debugger which performs predetermined processing on a program to be debugged and loads the program into a target system, and calls the processing means at appropriate times when debugging is performed on the target system.
【請求項2】前記ファイルフォーマットごとのデータア
クセス機能を有し、前記プログラム名をもつデバッグ対
象プログラムを前記記憶装置から探し出して、そのデバ
ッグ情報を読み出すファイルフォーマット依存部と、 前記プログラム名に対するファイルフォーマットを判別
して対応する前記ファイルフォーマット依存部を切り替
え起動し、ファイルフォーマット依存部からの前記デバ
ッグ情報によってデータベースを作成してデバッグに供
するファイルフォーマット自動判別部と、 当該デバッガと前記ターゲットシステムとの間の情報の
授受を行うターゲット通信部と、 前記利用者との間でユーザインタフェース部を形成する
とともに、前記ファイルフォーマット自動判別部と前記
ターゲット通信部との間の情報授受の仲介を行う共通処
理部とを有することを特徴とする請求項1記載のプログ
ラムデバッガ。
2. A file format dependent unit having a data access function for each file format, searching for a debug target program having the program name from the storage device, and reading out the debug information, and a file format for the program name. A file format automatic discriminating section for switching and starting the corresponding file format dependent section, creating a database based on the debug information from the file format dependent section, and providing the file for debugging; and between the debugger and the target system. A target communication unit for transmitting and receiving information, and a user interface unit between the user and the common communication unit for mediating information transmission and reception between the file format automatic discrimination unit and the target communication unit. Program debugger according to claim 1; and a processing section.
【請求項3】前記ファイルフォーマット依存部をモジュ
ール化し、新規のファイルフォーマットに対応して追加
可能としたことを特徴とする請求項2記載のプログラム
デバッガ。
3. The program debugger according to claim 2, wherein said file format dependent section is modularized and can be added in accordance with a new file format.
【請求項4】前記ファイルフォーマットは、ELF,C
OFFまたはDWARFであることを特徴とする請求項
1〜請求項3のいずれかに記載のプログラムデバッガ。
4. The file format is ELF, C
4. The program debugger according to claim 1, wherein the program debugger is OFF or DWARF.
【請求項5】利用者がデバッグ対象プログラムのプログ
ラム名を入力すると対応するプログラムのファイルフォ
ーマットを判別する手順と、該ファイルフォーマット対
応のデータアクセス機能を呼び出す手順と、該データア
クセス機能によって当該デバッグ対象プログラムからデ
バッグ情報を読み出してデータベースを作成する手順
と、前記データアクセス機能によって当該デバッグ対象
プログラムをターゲットシステムにロードする手順と、
該ターゲットシステム上で当該デバッグ対象プログラム
を実行する手順と、該実行時に適時前記データベースお
よびデータアクセス機能を起動する手順と、該デバッグ
の結果を出力する手順とを有するプログラムデバッグ方
法。
5. A procedure for determining a file format of a corresponding program when a user inputs a program name of a program to be debugged, a procedure for calling a data access function corresponding to the file format, and a procedure for calling a data access function corresponding to the file format. Reading debug information from the program to create a database, loading the debug target program into the target system by the data access function,
A program debugging method comprising: a step of executing the debug target program on the target system; a step of activating the database and the data access function at the time of the execution; and a step of outputting a result of the debug.
【請求項6】利用者がデバッグ対象プログラムのプログ
ラム名を入力すると対応するプログラムのファイルフォ
ーマットを判別する手順と、該ファイルフォーマット対
応のデータアクセス機能を呼び出す手順と、該データア
クセス機能によって当該デバッグ対象プログラムからデ
バッグ情報を読み出してデータベースを作成する手順
と、前記データアクセス機能によって当該デバッグ対象
プログラムをターゲットシステムにロードする手順と、
該ターゲットシステム上で当該デバッグ対象プログラム
を実行する手順と、該実行時に適時前記データベースお
よびデータアクセス機能を起動する手順と、該デバッグ
の結果を出力する手順とを有するプログラムデバッグ方
法をコンピュータに実行させるためのプログラムを記録
したコンピュータ読み取り可能な記録媒体。
6. A procedure for determining a file format of a corresponding program when a user inputs a program name of a program to be debugged, a procedure for calling a data access function corresponding to the file format, and a procedure for calling a data access function corresponding to the file format. Reading debug information from the program to create a database, loading the debug target program into the target system by the data access function,
Causing a computer to execute a program debugging method having a procedure of executing the program to be debugged on the target system, a procedure of activating the database and data access function at the time of the execution, and a procedure of outputting a result of the debugging. Readable recording medium on which a program for recording is recorded.
JP10238247A 1998-08-25 1998-08-25 Program debugger, program debugging method and recording medium Expired - Lifetime JP2926590B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10238247A JP2926590B1 (en) 1998-08-25 1998-08-25 Program debugger, program debugging method and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10238247A JP2926590B1 (en) 1998-08-25 1998-08-25 Program debugger, program debugging method and recording medium

Publications (2)

Publication Number Publication Date
JP2926590B1 true JP2926590B1 (en) 1999-07-28
JP2000066920A JP2000066920A (en) 2000-03-03

Family

ID=17027345

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10238247A Expired - Lifetime JP2926590B1 (en) 1998-08-25 1998-08-25 Program debugger, program debugging method and recording medium

Country Status (1)

Country Link
JP (1) JP2926590B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7721334B2 (en) 2004-01-30 2010-05-18 Microsoft Corporation Detection of code-free files

Also Published As

Publication number Publication date
JP2000066920A (en) 2000-03-03

Similar Documents

Publication Publication Date Title
US6922827B2 (en) Iterative software development environment with prioritized build rules
US20080127113A1 (en) Method and system for implementing watchpoints
JPH0836488A (en) Method and device for checking run-time error using dynamic patching
US6810519B1 (en) Achieving tight binding for dynamically loaded software modules via intermodule copying
JP4724660B2 (en) How to manage software components that are integrated into an embedded system
CN112882718A (en) Compiling processing method, device, equipment and storage medium
JP2007527562A5 (en)
US5963741A (en) Information processor which rewrites instructions in program to dynamically change program structure and method therefor
JP2926590B1 (en) Program debugger, program debugging method and recording medium
KR900006667B1 (en) Program assembling system
CN112882701A (en) Executable file static pile inserting technical framework supporting multiple architectures
JP3461185B2 (en) Method and apparatus for registering source code line number to load module
JP2003114809A (en) Simulation apparatus and simulation method
AU651682B2 (en) Improved system and method for detecting cross-domain instruction calls and data references especiallly adapted for code interface jacketing in a multi-code execution and debugging system within a multi-architecture environment
CN113535230B (en) Method and system for dynamically adapting engineering source code to different hardware resources
JP2000076095A (en) Device and method for tracing program and storage medium storing program therefor
CN117435171A (en) Integrated development method for RISC-V architecture processor
JPH09251378A (en) Method and device for updating class library
JPH0588879A (en) Program development supporting system
CN116048903A (en) Method and device for generating multithread test cases, electronic equipment and storage medium
JP3604936B2 (en) Optimization method, optimization device, and recording medium
JPH07152577A (en) Sharing system for compiling and linking method
JP3293821B2 (en) Dynamic link system
KR20000039214A (en) Method for loading block in code division multiple access system
JPH05119903A (en) Terminal function key input system