[go: up one dir, main page]

JPH10161904A - Debugging device and debugging method for multiple languages - Google Patents

Debugging device and debugging method for multiple languages

Info

Publication number
JPH10161904A
JPH10161904A JP8322943A JP32294396A JPH10161904A JP H10161904 A JPH10161904 A JP H10161904A JP 8322943 A JP8322943 A JP 8322943A JP 32294396 A JP32294396 A JP 32294396A JP H10161904 A JPH10161904 A JP H10161904A
Authority
JP
Japan
Prior art keywords
watchpoint
programming language
language
debugging
debugging device
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
JP8322943A
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 JP8322943A priority Critical patent/JPH10161904A/en
Publication of JPH10161904A publication Critical patent/JPH10161904A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

(57)【要約】 【課題】プログラミング言語の切り替えを管理すること
によって効率的なデバッグを実現するデバッグ装置を提
供する。 【解決手段】デバッガ14は、メモリ3上に配置された
実行ロードモジュール24に含まれるエントリすべてに
ユーザが任意の箇所に設定するブレークポイントとは異
なる陰のブレークポイントを設定する。そして、この陰
のブレークポイントによって制御が移行してきた際に、
飛び先の言語タイプと現在の言語タイプとを比較し、言
語タイプが異なった場合に言語切替えが発生したとし
て、ウォッチポイントテーブル141から飛び先の言語
タイプに対応するウォッチポイント情報を読み出し、こ
の読み出したウォッチポイント情報にしたがってウォッ
チポイントレジスタ2の再設定を実行する。
(57) [Summary] [PROBLEMS] To provide a debugging device which realizes efficient debugging by managing switching of programming languages. A debugger sets a shadow point different from a break point set at an arbitrary position by a user in all entries included in an execution load module arranged on a memory. And when control shifts due to this hidden breakpoint,
The target language type is compared with the current language type, and if the language type is different, it is determined that language switching has occurred, and watchpoint information corresponding to the target language type is read from the watchpoint table 141, and this readout is performed. The watch point register 2 is reset according to the watch point information.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、複数種のプログ
ラミング言語で構築されたプログラムのデバッグに適用
して好適なデバッグ装置およびデバッグ方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debugging apparatus and a debugging method suitable for debugging programs constructed in a plurality of types of programming languages.

【0002】[0002]

【従来の技術】従来において、たとえば手続き型言語と
アセンブラ言語とにより構築されたプログラムや、オブ
ジェクト指向言語と手続き型言語とが併用されたプログ
ラムなどのように、2種類以上のプログラミング言語で
構成されるプログラムモジュールをデバッグする場合、
言語ごとに別のデバッガを適用して実施するか、一つの
デバッガで言語モードを切り替えて使うなどして実施し
ていた。また、後者の場合であっても、言語間に跨がる
情報は共有されていないため、操作性が充分でないとい
った問題があった。たとえば、ある変数の領域を所望の
プログラミング言語で構築されたモジュールがアクセス
したときにのみブレークを発生させたいような場合であ
っても、プログラミング言語の種別を考慮せずに画一的
な設定が行なわれてしまうために、意図しないプログラ
ミング言語で構築されたモジュールがその変数領域をア
クセスしたときにもブレークが発生してしまい、デバッ
グの作業効率を低下させてしまっていた。
2. Description of the Related Art Conventionally, there are two or more types of programming languages such as a program constructed by a procedural language and an assembler language, and a program in which an object-oriented language and a procedural language are used in combination. When debugging a program module that
This was done either by applying a different debugger for each language, or by switching language modes with one debugger. In addition, even in the latter case, there is a problem that operability is not sufficient because information across languages is not shared. For example, even when it is desired to generate a break only when a certain variable area is accessed by a module constructed in a desired programming language, uniform setting is performed without considering the type of programming language. As a result, a break occurs even when a module constructed in an unintended programming language accesses the variable area, thereby reducing debugging work efficiency.

【0003】[0003]

【発明が解決しようとする課題】このように、従来で
は、2種類以上のプログラミング言語で構成されるプロ
グラムモジュールをデバッグする場合、言語ごとに別の
デバッガを適用して実施するか、一つのデバッガで言語
モードを切り替えて使うなどして実施しており、また、
後者の場合であっても、言語間に跨がる情報は共有され
ていないため、操作性が充分でないといった問題があっ
た。
As described above, conventionally, when debugging a program module composed of two or more types of programming languages, a different debugger is applied for each language, or one debugger is used. It is implemented by switching the language mode and using it.
Even in the latter case, there is a problem that the operability is not sufficient because information across languages is not shared.

【0004】この発明はこのような実情に鑑みてなされ
たものであり、互いに異なるプログラミング言語間で共
有できる情報を認識し、言語切り替えを管理することに
よって効率的なデバッグを実現するデバッグ装置および
デバッグ方法を提供することを目的とする。
The present invention has been made in view of the above circumstances, and recognizes information that can be shared between different programming languages, and realizes an efficient debugging by managing language switching and a debugging apparatus. The aim is to provide a method.

【0005】[0005]

【課題を解決するための手段】この発明のデバッグ装置
は、複数種のプログラミング言語で構築されたプログラ
ムをデバッグするデバッグ装置であって、予め指定され
た変数の領域であるウォッチポイントがアクセスされた
際に制御を獲得するウォッチポイント機能を有するデバ
ッグ装置において、前記ウォッチポイントを示すウォッ
チポイント情報を前記プログラミング言語ごとに保持す
るウォッチポイントテーブルと、前記プログラムの実行
中にプログラミング言語が切り替わった際、その旨を検
知して新たなプログラミング言語に対応するウォッチポ
イント情報を前記ウォッチポイントテーブルから読み取
り、この読み取ったウォッチポイント情報にしたがって
前記ウォッチポイントを設定し直すウォッチポイント設
定手段とを具備してなることを特徴とする。
SUMMARY OF THE INVENTION A debugging device according to the present invention is a debugging device for debugging a program constructed in a plurality of types of programming languages, wherein a watch point, which is an area of a predetermined variable, is accessed. In a debugging device having a watchpoint function to obtain control at the time, a watchpoint table holding watchpoint information indicating the watchpoint for each programming language, and when a programming language is switched during execution of the program, Watchpoint information corresponding to a new programming language is detected from the watchpoint table, and watchpoint setting means for resetting the watchpoint in accordance with the read watchpoint information is provided. Characterized in that it comprises.

【0006】この発明のデバッグ装置においては、ウォ
ッチポイント(アクセスを監視する変数の領域)をプロ
グラミング言語ごとに管理しておき、実行中のプログラ
ムでプログラミング言語の切り替えが発生したときに、
新たなプログラミング言語に対応したウォッチポイント
を設定し直す。したがって、ユーザに対してプログラミ
ング言語それぞれに応じた操作を強いることなく、ま
た、あるプログラミング言語に対して設定したウォッチ
ポイントが他のプログラミング言語に対して作用するよ
うなことがなくなるため、複数種のプログラミング言語
で構築されたプログラムに対し、効率的であって、かつ
操作性のよいデバッグ環境を提供することができる。
In the debug device of the present invention, watchpoints (areas of variables for monitoring access) are managed for each programming language, and when a switching of the programming language occurs in a program being executed,
Set watchpoints for the new programming language. Therefore, it is not necessary to force the user to perform an operation corresponding to each programming language, and the watchpoint set for one programming language does not act on another programming language. An efficient and operable debugging environment can be provided for a program constructed in a programming language.

【0007】このプログラミング言語の切り替えの判定
は、たとえばプログラム中に含まれるエントリ部すべて
にユーザが関知しない陰のブレークポイントを設定し、
このブレークポイントによって制御が移行されてきたと
きに、呼ぶ側のオブジェクトのプログラミング言語と呼
ばれる側のオブジェクトのプログラミング言語とを比較
して、不一致であったときにプログラミング言語が切り
替わったと判定するなどによればよい。また、陰のグレ
ークポイントは、たとえばリンカによって、関数コール
や関数ポインタなどの外部参照情報をデバッグ情報とし
て各オブジェクトのシンボル情報に付加しておき、この
外部参照情報に基づいて設定するなどによればよい。さ
らに、プログラミング言語の認識は、たとえばコンパイ
ラによって、エントリそれぞれに対応した言語識別情報
を各オブジェクトのシンボル情報に付加しておき、この
言語識別情報に基づいて行なえばよい。
[0007] The determination of the switching of the programming language is performed, for example, by setting a hidden break point which is not related to the user in all entry sections included in the program,
When control is transferred by this breakpoint, the programming language of the calling object is compared with the programming language of the called object, and when there is a mismatch, it is determined that the programming language has been switched. I just need. The shaded gray point is determined by, for example, adding external reference information such as a function call or a function pointer to the symbol information of each object as debug information by a linker, and setting based on the external reference information. I just need. Furthermore, the recognition of the programming language may be performed based on the language identification information, for example, by adding language identification information corresponding to each entry to the symbol information of each object by a compiler.

【0008】また、この発明のデバッグ装置は、複数種
のプログラミング言語で構築されたプログラムをデバッ
グするデバッグ装置であって、予め指定された変数の領
域であるウォッチポイントがアクセスされた際に制御を
獲得するウォッチポイント機能を有するデバッグ装置に
おいて、デバッグ対象とするプログラミング言語を設定
する設定手段と、前記ウォッチポイント機能により制御
が獲得された際、実行中のオブジェクトのプログラミン
グ言語と前記設定手段により設定されたプログラミング
言語が一致するか否か判定する判定手段と、前記判定手
段の判定結果が不一致であったときに、獲得した制御を
速やかに返却する制御返却手段とを具備してなることを
特徴とする。
[0008] A debugging device according to the present invention is a debugging device for debugging a program constructed in a plurality of types of programming languages, and controls when a watchpoint which is a region of a variable designated in advance is accessed. In a debugging device having a watchpoint function to acquire, setting means for setting a programming language to be debugged, and when the control is acquired by the watchpoint function, a programming language of an object being executed and set by the setting means. Determination means for determining whether or not the programming languages match, and control return means for promptly returning the acquired control when the determination results of the determination means do not match. I do.

【0009】この発明のデバッグ装置においては、いず
れのプログラミング言語をデバッグ対象とするか、その
デバッグ対象のプログラミング言語を管理しておき、ウ
ォッチポイントによって制御が移行されてきたときに、
実行中のオブジェクトのプログラミング言語とデバッグ
対象とするプログラミング言語とを比較して、不一致で
あったときに獲得した制御を速やかに返却する。これに
より、意図しないオブジェクトによるブレークを発生さ
せることがなくなるため、効率的なデバッグが実現され
ることになる。
In the debugging device of the present invention, which programming language is to be debugged, the programming language to be debugged is managed, and when control is transferred by a watchpoint,
The programming language of the object being executed is compared with the programming language to be debugged, and the control acquired when there is a mismatch is promptly returned. As a result, a break caused by an unintended object does not occur, so that efficient debugging is realized.

【0010】また、この発明のデバッグ装置は、予め設
定された条件に合致したときに制御を獲得するブレーク
機能を有するデバッグ装置において、前記条件を設定す
るための文字列がいずれのプログラミング言語の記法で
書かれているか判定する判定手段と、この判定手段で判
定されたプログラミング言語の条件表現に基づいて前記
条件を設定するブレーク条件設定手段とを具備してなる
ことを特徴とする。
Further, according to the debugging apparatus of the present invention, in a debugging apparatus having a break function for acquiring control when a preset condition is met, a character string for setting the condition can be expressed in any programming language. And a break condition setting means for setting the condition based on a conditional expression of a programming language determined by the judgment means.

【0011】この発明のデバッグ装置においては、ブレ
ーク条件を設定するための文字列がいずれのプログラミ
ング言語の記法で書かれているか判定し、その判定結果
にしたがって文字列の読み取りを実施し条件を設定する
ため、ユーザはデバッグ対象とするオブジェクトのプロ
グラミング言語の種別を意識することなく、使い慣れた
プログラミング言語で条件設定を行なうことができるた
め、操作性を飛躍的に向上させることが可能となる。
In the debugging apparatus of the present invention, it is determined which character string for setting a break condition is written in which programming language, and the character string is read in accordance with the result of the determination to set the condition. Therefore, the user can set the conditions in a familiar programming language without being aware of the type of the programming language of the object to be debugged, so that the operability can be drastically improved.

【0012】[0012]

【発明の実施の形態】以下、図面を参照してこの発明の
実施の形態を説明する。図1にはこの発明を実施するた
めの機能ブロックが示されている。この発明は、ウォッ
チポイント機能をより効率的に活用するためのものであ
り、ここでいうウォッチポイント機能とは、プログラム
が予め指定された変数をアクセスしたときに、プログラ
ムの実行を中断してデバッガに制御を移す機能をいう。
これにより、予期せぬメモリアクセスをユーザが検出で
きることになる。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows functional blocks for implementing the present invention. The present invention is intended to make more efficient use of the watchpoint function. The watchpoint function referred to here is a debugger that interrupts program execution when a program accesses a predetermined variable. Function to transfer control to
This allows the user to detect an unexpected memory access.

【0013】一般に、デバッガの操作(コマンド)で
は、たとえばwatch var(変数varへの書き
込み時にブレークせよ)といった指定をする。いま、A
言語に対してこのような指定をしたとする。そして、B
言語においてはvarに相当する変数名がvar’であ
るとする。この場合、B言語内でvar’への書き込み
が発生したとすると、ブレークが発生することになる。
Generally, in the operation (command) of the debugger, for example, a designation such as a watch var (break when writing to a variable var) is specified. Now, A
Suppose you specify this for a language. And B
In the language, a variable name corresponding to var is var '. In this case, if writing to var 'occurs in the B language, a break will occur.

【0014】もし、ユーザがA言語のみを対象にしたデ
バッグを意図して行なっているとすると、不要なブレー
クが発生することになる。つまり、B言語では、ウォッ
チポイントを設定しないか、別の変数に設定しているな
どしており、var’には関心がない場合、これでは困
ることになる。そこで、この発明では、var’に対す
るブレークを発生しないようにする仕掛けを提案するこ
とを特徴とする。なお、ウォッチポイント処理に対する
実装は、ハードウェアによるサポートがある場合と
(「ウォッチポイントレジスタ」に、例外発生の条件を
指定しておく)、ソフトウェアにおいて内部的にステッ
プ実行を行なうことによって実装される場合とがあり、
どちらでも適用できるが、ここでは前者の場合で説明す
る。
If the user intends to debug only the A language, an unnecessary break will occur. In other words, in the B language, a watchpoint is not set or another variable is set. If the user is not interested in var ', this becomes a problem. Therefore, the present invention is characterized by proposing a mechanism for preventing a break from occurring in var '. It should be noted that the implementation for the watchpoint process is implemented by performing step execution internally in software when there is support by hardware (specifying an exception occurrence condition in the “watchpoint register”). And sometimes
Either can be applied, but the former case will be described here.

【0015】まず、言語タイプの切替えは、次のように
ブレークポイント機能を利用してチェックする。ここで
いうブレークポイント機能とは、プログラムが予め設定
されたステップを実行するときに、プログラムの実行を
中断してデバッガに制御を移す機能をいう。
First, the switching of the language type is checked using the breakpoint function as follows. Here, the breakpoint function refers to a function of interrupting the execution of the program and transferring control to the debugger when the program executes a preset step.

【0016】コンパイラ11は、ソースプログラムファ
イル21に格納されたソースプログラムを読み出してコ
ンパイルを実行し、コンパイル結果である単体オブジェ
クトをオブジェクトファイル22に出力する際、各オブ
ジェクトの中で定義されているエントリに対する「言語
識別情報」をオブジェクトのシンボル情報に含ませる
(同一コンパイル単位に、異種言語による記載が含まれ
ていても良い)。
The compiler 11 reads the source program stored in the source program file 21 and compiles it. When outputting a single object, which is the result of compilation, to the object file 22, the entry defined in each object is defined. Is included in the symbol information of the object (a description in a different language may be included in the same compilation unit).

【0017】一方、リンカ12は、このオブジェクトフ
ァイル22から単体オブジェクトを読み出してリンクを
実行し、リンク結果である実行ロードモジュールをプロ
グラム実行ファイル23に出力する際、各オブジェクト
における関数コールや関数ポインタなどの「外部参照情
報」をデバッグ情報としてオブジェクトのシンボル情報
に付け加える。
On the other hand, the linker 12 reads a single object from the object file 22 and executes a link, and when outputting an execution load module as a link result to the program execution file 23, a function call, a function pointer, or the like in each object. Is added to the symbol information of the object as debug information.

【0018】そして、デバッガ14は、この「外部参照
情報」を参照して、ローダ13によりメモリ3上に配置
された実行モジュール24内の対応するエントリ部すべ
てに陰のプレークポイントを設定する。
The debugger 14 refers to the “external reference information” and sets a hidden break point in all the corresponding entry portions in the execution module 24 arranged on the memory 3 by the loader 13.

【0019】プログラム実行時にブレークしたら、デバ
ッガ14は、ユーザ指定の通常のブレークポイントであ
るかチェックする。そうではなく、前述の陰のブレーク
ポイントである場合、言語切り替えの可能性があるの
で、「言語識別情報」を参照することにより、飛び先が
これまでのプログラミング言語と同じ言語のエントリで
あるか調べる。異なった場合、デバッガ14は、言語切
替えが発生したと判断し、ウォッチポイントテーブル1
41から飛び先のプログラミング言語に対応するウォッ
チポイントを読み出して、ウォッチポイントレジスタ2
の再設定を実行する。なお、CPU1は、このウォッチ
ポイントレジスタ2に格納された値で示される領域への
アクセスが発生すると、デバッガ14に制御を移行す
る。
If a break occurs during execution of the program, the debugger 14 checks whether it is a normal breakpoint specified by the user. Otherwise, if it is the above-mentioned shadow breakpoint, there is a possibility of language switching, so refer to "language identification information" to see if the jump destination is an entry in the same language as the previous programming language Find out. If not, the debugger 14 determines that language switching has occurred, and sets the watchpoint table 1
41, the watchpoint corresponding to the programming language of the jump destination is read out, and the watchpoint register 2
Execute the reset of. The CPU 1 transfers control to the debugger 14 when an access to the area indicated by the value stored in the watchpoint register 2 occurs.

【0020】図2には、この発明のブレークポイント処
理の流れが示されている。デバッガ14は、ブレークが
発生した際、そのブレークポイントがユーザ指定のブレ
ークポイントか前述した陰のブレークポイントかを判定
し(ステップA1,ステップA3)、ユーザ指定のブレ
ークポイントであった場合には(ステップA1のY)、
通常のブレークポイント処理を実行する(ステップA
2)。一方、陰のブレークポイントであった場合(ステ
ップA3のY)、デバッガ14は、飛び先の言語タイプ
をシンボル情報から調べ(ステップA5)、現在の言語
タイプと同じかどうか判定する(ステップA6)。そし
て、言語タイプが同じであった場合には(ステップA6
のY)、言語切替えは発生しなかったとして、ユーザプ
ログラムに復帰する(ステップA7)。一方、言語タイ
プが異なった場合には(ステップA6のN)、言語切替
えが発生したとして、ウォッチポイントレジスタ2の切
替え処理を実行する(ステップA8)。
FIG. 2 shows the flow of the breakpoint processing of the present invention. When a break occurs, the debugger 14 determines whether the breakpoint is a user-specified breakpoint or the above-described shadow breakpoint (step A1 and step A3). Y in step A1),
Execute normal breakpoint processing (step A
2). On the other hand, if it is a shadow breakpoint (Y in step A3), the debugger 14 checks the language type of the jump destination from the symbol information (step A5) and determines whether or not it is the same as the current language type (step A6). . If the language types are the same (step A6)
Y), it is determined that language switching has not occurred, and the process returns to the user program (step A7). On the other hand, if the language types are different (N in step A6), it is determined that language switching has occurred, and the watchpoint register 2 is switched (step A8).

【0021】図3には、この発明のウォッチポイントレ
ジスタ2の切替え処理の流れが示されている。デバッガ
14は、まず、ウォッチポイントレジスタ2に格納され
た値をメモリ3に保存する(ステップB1)。次に、デ
バッガ14は、新しい言語タイプでウォッチポイントが
設定されていたかどうかを判定する(ステップB2)。
ウォッチポイントが設定されていた場合(ステップB2
のY)、デバッガ14は、新しい言語タイプに対応する
ウォッチポイント情報をウォッチポイントレジスタ2に
復元した後に(ステップB3)、ユーザプログラムに制
御を戻す(ステップB4)。
FIG. 3 shows the flow of the switching process of the watchpoint register 2 of the present invention. First, the debugger 14 stores the value stored in the watchpoint register 2 in the memory 3 (Step B1). Next, the debugger 14 determines whether a watchpoint has been set in the new language type (step B2).
If a watchpoint has been set (step B2
(Y), after restoring the watchpoint information corresponding to the new language type in the watchpoint register 2 (step B3), the debugger 14 returns control to the user program (step B4).

【0022】一方、ウォッチポイントが設定されていな
かった場合には(ステップB2のN)、デバッガ14
は、ウォッチポイントレジスタ2をクリアした後に(ス
テップB5)、ユーザプログラムに制御を戻す(ステッ
プB6)。
On the other hand, if no watchpoint has been set (N in step B2), the debugger 14
Returns the control to the user program after clearing the watchpoint register 2 (step B5) (step B6).

【0023】これにより、プログラミング言語それぞれ
に対して個別にウォッチポイントを設定することができ
ることになり、効率的なデバッグが実現されることにな
るとともに、その操作性は飛躍的に向上する。
As a result, it is possible to set a watchpoint individually for each programming language, so that efficient debugging is realized, and the operability is dramatically improved.

【0024】次に、デバッガ14が、ユーザの入力した
条件式がいずれの言語の文法によるかを自動判定し、そ
れぞれの言語に応じてデバッガ処理を行なう際の動作原
理を説明する。
Next, a description will be given of the principle of operation when the debugger 14 automatically determines which language grammar the conditional expression input by the user uses and performs debugger processing according to each language.

【0025】たとえば、funcをA言語で書かれた関
数とする。そして、 break func((cond a b)) と指定すると、funcにプログラムの実行が移った
際、(cond a b)が真の場合にのみブレークが
発生する。ここで、(cond a b)は、B言語で
書かれた式であるとする。すなわち、ここでは、デバッ
グ対象のプログラミング言語にとらわれずに所望のプロ
グラミング言語によってブレーク条件を指定することを
可能とする方法を提案することを特徴とする。
For example, let func be a function written in the A language. If break func ((cond ab)) is specified, a break occurs only when (cond ab) is true when the execution of the program is transferred to func. Here, (cond ab) is assumed to be an expression written in the B language. That is, the present invention is characterized by proposing a method that enables a break condition to be designated by a desired programming language without being restricted to a programming language to be debugged.

【0026】図4には、このときのデバッガ14の動作
手順が示されている。なお、ここでは、条件式をA言語
パーサおよびB言語パーサで解析し、どちらか一方のみ
解析可能であったときに、その言語に関する条件と判定
するものとし、あいまいさが残存する場合のみユーザに
対して選択処理を発生させるものとする。
FIG. 4 shows an operation procedure of the debugger 14 at this time. In this case, the conditional expression is analyzed by the A language parser and the B language parser, and when only one of them can be analyzed, it is determined that the condition is related to the language. On the other hand, a selection process is to be performed.

【0027】デバッガ14は、まず条件式がA言語に適
合するかどうか判定し(ステップC1)、適合しなかっ
た場合には(ステップC1のN)、さらに条件式がB言
語に適合するかどうか判定する(ステップC2)。そし
て、B言語にも適合しなかった場合(ステップC2の
N)、デバッガ14は、エラーを表示する(ステップC
3)。また、条件式がB言語に適合した場合には(ステ
ップC2のY)、この条件式はB言語で記述されたもの
として(ステップC4)、ブレーク設定を実行する。
The debugger 14 first determines whether the conditional expression conforms to the A language (step C1). If the conditional expression does not conform (N in step C1), the debugger 14 further determines whether the conditional expression conforms to the B language. A determination is made (step C2). If the language does not conform to the B language (N in step C2), the debugger 14 displays an error (step C2).
3). When the conditional expression conforms to the B language (Y in step C2), the conditional expression is described in the B language (step C4), and a break setting is executed.

【0028】一方、条件式がA言語に適合した場合も
(ステップC1のY)、デバッガ14は、さらに条件式
がB言語に適合するかどうか判定する(ステップC
5)。そして、適合しなかった場合には(ステップC5
のN)、この条件式はA言語で記述されたものとして
(ステップC6)、ブレーク設定を実行する。なお、B
言語にも適合すると判定された場合には(ステップC5
のY)、操作者に対して選択を促す(ステップC7)。
On the other hand, even when the conditional expression conforms to the A language (Y in step C1), the debugger 14 further determines whether the conditional expression conforms to the B language (step C1).
5). Then, if they do not match (step C5)
N), this conditional expression is described in the A language (step C6), and a break setting is executed. Note that B
If it is determined that the language is compatible (step C5)
Y), prompting the operator to make a selection (step C7).

【0029】これにより、ユーザは、常に所望のプログ
ラミング言語で条件設定を行なうことができ、その使い
勝手は向上する。なお、前述した実施形態では、プログ
ラミング言語それぞれにウォッチポイントを管理し、言
語切替えが発生したときに新しいプログラミング言語に
対応するウォッチポイントを設定し直す例を説明した
が、ウォッチポイントは従来どおり一種類のみ設定し、
いずれのプログラミング言語をデバッグ対象とするかを
選択することも有効である。この場合、デバッガ14
は、ウォッチポイントによりブレークが発生した際、飛
び先のプログラミング言語が選択されたプログラミング
言語と同じであるかどうか判定し、同じでない場合、速
やかにプログラムに制御を戻すことにより、意図したプ
ログラミング言語のみを対象としたデバッグが実現され
ることになり、2種類以上のプログラム言語が混在する
プログラムおデバッグの効率を向上させることができ
る。
Thus, the user can always set conditions in a desired programming language, and the usability is improved. In the above-described embodiment, an example has been described in which a watchpoint is managed for each programming language and a watchpoint corresponding to a new programming language is reset when language switching occurs. Only set,
It is also effective to select which programming language is to be debugged. In this case, the debugger 14
Determines whether the target programming language is the same as the selected programming language when a break occurs due to a watchpoint, and if not, returns control to the program promptly, allowing only the intended programming language Is realized, and the efficiency of debugging a program in which two or more types of programming languages are mixed can be improved.

【0030】[0030]

【発明の効果】以上詳述したように、この発明によれ
ば、ウォッチポイントをプログラミング言語ごとに管理
し、プログラミング言語の切り替えが発生したときに新
たなプログラミング言語に対応したウォッチポイントを
設定し直すため、プログラミング言語それぞれに対応し
たデバッグが行なえることになり、複数種のプログラミ
ング言語で構築されたプログラムに対し、効率的かつ操
作性のよいデバッグ環境を提供することができる。
As described in detail above, according to the present invention, watchpoints are managed for each programming language, and when a programming language is switched, a watchpoint corresponding to a new programming language is reset. Therefore, debugging corresponding to each programming language can be performed, and an efficient and operable debugging environment can be provided for a program constructed in a plurality of types of programming languages.

【0031】また、ブレーク条件を設定するための文字
列がいずれのプログラミング言語の記法で書かれている
か判定し、その判定結果にしたがって条件を設定するた
め、ユーザは常に所望のプログラミング言語で条件設定
を行なうことができ、操作性を向上させることが可能と
なる。
In addition, it is determined whether the character string for setting the break condition is written in any programming language, and the condition is set according to the result of the determination. Therefore, the user always sets the condition in the desired programming language. Can be performed, and operability can be improved.

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

【図1】この発明を実施するための機能ブロックを示す
図。
FIG. 1 is a diagram showing functional blocks for implementing the present invention.

【図2】この発明のブレークポイント処理の流れを示す
フローチャート。
FIG. 2 is a flowchart showing a flow of a breakpoint process according to the present invention.

【図3】この発明のウォッチポイントレジスタの切替え
処理の流れを示すフローチャート。
FIG. 3 is a flowchart showing a flow of a watchpoint register switching process according to the present invention;

【図4】この発明のデバッガが条件式を記述した言語を
認識して条件設定を行なうときの動作手順を示すフロー
チャート。
FIG. 4 is a flowchart showing an operation procedure when the debugger of the present invention recognizes a language in which a conditional expression is described and sets conditions.

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

1…CPU 2…ウォッチポイントレジスタ 3…メモリ 11…コンパイラ 12…リンカ 13…ローダ 14…デバッガ 141…ウォッチポイントテーブル 21…ソースプログラムファイル 22…オブジェクトファイル 23…プログラム実行ファイル DESCRIPTION OF SYMBOLS 1 ... CPU 2 ... Watchpoint register 3 ... Memory 11 ... Compiler 12 ... Linker 13 ... Loader 14 ... Debugger 141 ... Watchpoint table 21 ... Source program file 22 ... Object file 23 ... Program execution file

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 複数種のプログラミング言語で構築され
たプログラムをデバッグするデバッグ装置であって、予
め指定された変数の領域であるウォッチポイントがアク
セスされた際に制御を獲得するウォッチポイント機能を
有するデバッグ装置において、 前記ウォッチポイントを示すウォッチポイント情報を前
記プログラミング言語ごとに保持するウォッチポイント
テーブルと、 前記プログラムの実行中にプログラミング言語が切り替
わった際、その旨を検知して新たなプログラミング言語
に対応するウォッチポイント情報を前記ウォッチポイン
トテーブルから読み取り、この読み取ったウォッチポイ
ント情報にしたがって前記ウォッチポイントを設定し直
すウォッチポイント設定手段とを具備してなることを特
徴とするデバッグ装置。
1. A debugging device for debugging a program constructed in a plurality of types of programming languages, the device having a watchpoint function for acquiring control when a watchpoint which is an area of a variable specified in advance is accessed. In the debugging device, a watchpoint table holding watchpoint information indicating the watchpoint for each programming language, and when the programming language is changed during execution of the program, the fact is detected and a new programming language is supported. A watch point setting means for reading watch point information to be set from the watch point table and resetting the watch point according to the read watch point information.
【請求項2】 予め指定されたステップが実行される際
に制御を獲得するブレークポイント機能を有し、 前記ウォッチポイント設定手段は、ユーザが任意の箇所
に設定する第1のブレークポイントとは異なる第2のブ
レークポイントを前記プログラムに含まれるエントリ部
すべてに設定するブレークポイント設定手段と、 前記第2のブレークポイントにより制御が獲得された
際、呼ぶ側のオブジェクトのプログラミング言語と呼ば
れる側のオブジェクトのプログラミング言語とを比較し
てプログラミング言語の切り替わりを検知する検知手段
とを具備してなることを特徴とする請求項1記載のデバ
ッグ装置。
2. A breakpoint function for acquiring control when a predetermined step is executed, wherein the watchpoint setting means is different from a first breakpoint set by a user at an arbitrary position. Breakpoint setting means for setting a second breakpoint in all of the entry sections included in the program; and when control is acquired by the second breakpoint, a breakpoint of the calling object is called a programming language of the calling object. 2. The debugging device according to claim 1, further comprising: a detection unit configured to detect a switching of the programming language by comparing with the programming language.
【請求項3】 前記ブレークポイント設定手段は、各オ
ブジェクトが保有するシンボル情報に含まれる外部参照
情報に基づいて前記第2のブレークポイントを設定する
手段を具備し、 前記検知手段は、各オブジェクトが保有するシンボル情
報に含まれるエントリそれぞれに対応した言語識別情報
に基づいてプログラミング言語の切り替わりを検知する
手段を具備してなることを特徴とする請求項2記載のデ
バッグ装置。
3. The breakpoint setting means includes means for setting the second breakpoint based on external reference information included in symbol information held by each object, and the detection means includes: 3. The debugging device according to claim 2, further comprising means for detecting a switching of a programming language based on language identification information corresponding to each entry included in the held symbol information.
【請求項4】 前記外部参照情報は、リンカによって前
記シンボル情報に格納され、前記言語識別情報は、コン
パイラによって前記シンボル情報に格納されることを特
徴とする請求項3記載のデバッグ装置。
4. The debugging device according to claim 3, wherein the external reference information is stored in the symbol information by a linker, and the language identification information is stored in the symbol information by a compiler.
【請求項5】 複数種のプログラミング言語で構築され
たプログラムをデバッグするデバッグ装置であって、予
め指定された変数の領域であるウォッチポイントがアク
セスされた際に制御を獲得するウォッチポイント機能を
有するデバッグ装置において、 デバッグ対象とするプログラミング言語を設定する設定
手段と、 前記ウォッチポイント機能により制御が獲得された際、
実行中のオブジェクトのプログラミング言語と前記設定
手段により設定されたプログラミング言語が一致するか
否か判定する判定手段と、 前記判定手段の判定結果が不一致であったときに、獲得
した制御を速やかに返却する制御返却手段とを具備して
なることを特徴とするデバッグ装置。
5. A debugging device for debugging a program constructed in a plurality of types of programming languages, the device having a watchpoint function for acquiring control when a watchpoint which is an area of a variable designated in advance is accessed. In the debugging device, setting means for setting a programming language to be debugged, and when control is obtained by the watchpoint function,
Determining means for determining whether the programming language of the object being executed matches the programming language set by the setting means; and promptly returning the acquired control when the determination results of the determining means do not match. And a control returning means.
【請求項6】 前記判定手段は、各オブジェクトが保有
するシンボル情報に含まれるエントリそれぞれに対応し
た言語識別情報により実行中のオブジェクトのプログラ
ミング言語を知得する手段を具備してなることを特徴と
する請求項5記載のデバッグ装置。
6. The method according to claim 1, wherein the determination unit includes a unit for acquiring a programming language of the object being executed based on language identification information corresponding to each entry included in the symbol information held by each object. The debugging device according to claim 5.
【請求項7】 前記言語識別情報は、コンパイラによっ
て前記シンボル情報に格納されることを特徴とする請求
項6記載のデバッグ装置。
7. The debugging device according to claim 6, wherein the language identification information is stored in the symbol information by a compiler.
【請求項8】 予め設定された条件に合致したときに制
御を獲得するブレーク機能を有するデバッグ装置におい
て、 前記条件を設定するための文字列がいずれのプログラミ
ング言語の記法で書かれているか判定する判定手段と、 この判定手段で判定されたプログラミング言語の条件表
現に基づいて前記条件を設定するブレーク条件設定手段
とを具備してなることを特徴とするデバッグ装置。
8. A debugging device having a break function for acquiring control when a preset condition is met, and determining in which programming language a character string for setting the condition is written. A debugging device comprising: a determination unit; and a break condition setting unit that sets the condition based on a conditional expression of a programming language determined by the determination unit.
【請求項9】 前記ブレーク条件設定手段は、前記条件
を設定するための文字列をデバッグ対象とするオブジェ
クトのプログラム言語以外のプログラム言語で入力可能
であることを特徴とする請求項8記載のデバッグ装置。
9. The debugging device according to claim 8, wherein the break condition setting means can input a character string for setting the condition in a programming language other than a programming language of an object to be debugged. apparatus.
【請求項10】 複数種のプログラミング言語で構築さ
れたプログラムをデバッグするデバッグ装置であって、
予め指定された変数の領域であるウォッチポイントがア
クセスされた際に制御を獲得するウォッチポイント機能
を有するデバッグ装置に適用されるデバッグ方法におい
て、 前記ウォッチポイントを示すウォッチポイント情報を前
記プログラミング言語ごとに保持し、 前記プログラムの実行中にプログラミング言語が切り替
わった際、その旨を検知し、前記保持した新たなプログ
ラミング言語に対応するウォッチポイント情報にしたが
って、前記ウォッチポイントを設定し直すことを特徴と
するデバッグ方法。
10. A debugging device for debugging a program constructed in a plurality of types of programming languages,
In a debugging method applied to a debugging device having a watchpoint function for acquiring control when a watchpoint that is an area of a previously specified variable is accessed, watchpoint information indicating the watchpoint is provided for each of the programming languages. Holding, when the programming language is changed during the execution of the program, the fact is detected, and the watchpoint is reset according to the watchpoint information corresponding to the held new programming language. How to debug.
JP8322943A 1996-12-03 1996-12-03 Debugging device and debugging method for multiple languages Pending JPH10161904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8322943A JPH10161904A (en) 1996-12-03 1996-12-03 Debugging device and debugging method for multiple languages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8322943A JPH10161904A (en) 1996-12-03 1996-12-03 Debugging device and debugging method for multiple languages

Publications (1)

Publication Number Publication Date
JPH10161904A true JPH10161904A (en) 1998-06-19

Family

ID=18149375

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8322943A Pending JPH10161904A (en) 1996-12-03 1996-12-03 Debugging device and debugging method for multiple languages

Country Status (1)

Country Link
JP (1) JPH10161904A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007304840A (en) * 2006-05-11 2007-11-22 Matsushita Electric Ind Co Ltd Compiling method, debugging method, compiling program and debugging program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007304840A (en) * 2006-05-11 2007-11-22 Matsushita Electric Ind Co Ltd Compiling method, debugging method, compiling program and debugging program

Similar Documents

Publication Publication Date Title
US5621886A (en) Method and apparatus for providing efficient software debugging
US5740413A (en) Method and apparatus for providing address breakpoints, branch breakpoints, and single stepping
JP2749528B2 (en) Tracer system for error analysis
KR100303548B1 (en) Method and apparatus for dynamically combining software modules within a computer system during program execution
KR101247062B1 (en) Method of instrumenting code having restrictive calling conventions
US5121472A (en) Method for replacing keyboard data using single step process mode
US20060041867A1 (en) Method, apparatus and computer program product for implementing enhanced compiled breakpoint analysis
WO2005111801A2 (en) Apparatus and method for improving emulation speed of high-level languages in on-chip emulation systems
US5737521A (en) Tracer system for analyzing errors in running real-time systems
JPH10214203A (en) Information processor
JPH10161904A (en) Debugging device and debugging method for multiple languages
CN119475361B (en) Method, system and device for realizing trusted static measurement element acquisition control
JPH1011315A (en) In-circuit emulator device and in-circuit emulation method
JP4295912B2 (en) Debug system
JP2795676B2 (en) Program trace device
JP4192519B2 (en) Information processing method and apparatus
JPH0695910A (en) Interactive debugging control system for abnormality processing
JP2002073370A (en) Debugging support device and debugging method using the same
JPH06103109A (en) Data processor and debug device using the same
JP2000181748A (en) Multi-memory space program debugging system and debugging method
JP2697230B2 (en) Debug support device
JP3077627B2 (en) Debugging method and recording medium for recording debug program
WO2024069730A1 (en) Debugging device and debugging method
JPS61180344A (en) Step execution system for high level language
JP2001265619A (en) Data trace method