JPH09146776A - Object generation method and debugging method - Google Patents

Object generation method and debugging method

Info

Publication number
JPH09146776A
JPH09146776A JP7327959A JP32795995A JPH09146776A JP H09146776 A JPH09146776 A JP H09146776A JP 7327959 A JP7327959 A JP 7327959A JP 32795995 A JP32795995 A JP 32795995A JP H09146776 A JPH09146776 A JP H09146776A
Authority
JP
Japan
Prior art keywords
name
function
object name
program
information
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.)
Withdrawn
Application number
JP7327959A
Other languages
Japanese (ja)
Inventor
Hiroki Tagami
寛樹 田上
Hiroshi Yajima
宏 矢島
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP7327959A priority Critical patent/JPH09146776A/en
Publication of JPH09146776A publication Critical patent/JPH09146776A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

(57)【要約】 【課題】 ソフトウェアデバッグの効率向上を図ること
にある。 【解決手段】 初期設定関数にオブジェクトの名前(オ
ブジェクト名)を埋込むための処理を追加することによ
り、そのオブジェクトのデバッグにおいては、特定のオ
ブジェクトから呼出された関数のみブレークさせること
ができ(S11〜S14)、そのようにオブジェクトと
関数の条件を組合わせたブレークポイントの設定を可能
とすることで、ソフトウェアデバッグの効率向上を達成
する。
(57) [Abstract] [Problem] To improve the efficiency of software debugging. By adding a process for embedding an object name (object name) to an initialization function, only a function called from a specific object can be broken in debugging the object (S11). (S14), it is possible to set a breakpoint by combining the conditions of the object and the function in this way, thereby improving the efficiency of software debugging.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、ソフトウェア開発
支援技術、さらにはソフトウェアデバッグの効率向上を
図るための技術に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a software development support technique and a technique for improving the efficiency of software debugging.

【0002】[0002]

【従来の技術】Cコンパイラ又はアセンブラで作成した
オブジェクトモジュール(単に「オブジェクト」とも称
する)、又はリンケージエディタで作成したロードモジ
ュールは、デバッグシステムによってデバッグすること
ができる。そのようなオブジェクトモジュールやロード
モジュールは、デバッグ対象プログラムと称される。デ
バッグ対象プログラムを実際に実行させ、その実行軌跡
を追うことによりプログラムの誤りを見つけ出すことが
でき、そのようなツールとして、デバッガやシミュレー
タが知られている。
2. Description of the Related Art An object module (also referred to simply as "object") created by a C compiler or assembler or a load module created by a linkage editor can be debugged by a debug system. Such an object module or load module is called a debug target program. A program or program to be debugged can be actually executed, and an error in the program can be detected by following the execution locus. Debuggers and simulators are known as such tools.

【0003】デバッガは、デバッグ対象プログラムを実
行させ、指定により1命令実行毎にその実行結果をトレ
ースバッファに書込むトレース機能や、デバッグ対象プ
ログラム実行中にブレーク条件が成立した場合に、ブレ
ーク条件成立のメッセージを表示してプログラム実行を
中断するブレーク機能を備えている。ブレーク条件とし
ては、ブレーク系コマンドの条件成立によるブレーク、
デバッグ対象プログラム実行時エラー検出によるブレー
ク、割込みキー入力によるブレークなどがある。
The debugger executes a debug target program and writes a result of execution into a trace buffer every execution of one instruction by a designation, and a break condition is satisfied when a break condition is satisfied during execution of the debug target program. It has a break function to display the message and interrupt the program execution. As break conditions, breaks due to the satisfaction of break command conditions,
There are breaks due to error detection during execution of the debug target program and breaks due to interrupt key input.

【0004】尚、デバッガについて記載された文献の例
としては、昭和60年12月25日に株式会社オーム社
から発行された「マイクロコンピュータハンドブック
(第569頁〜)」がある。
An example of a document describing a debugger is "Microcomputer Handbook (Page 569-)" issued by Ohm Co., Ltd. on December 25, 1985.

【0005】[0005]

【発明が解決しようとする課題】高級言語プログラムの
デバッグにおいて、プログラムのブレークポイントを関
数内部に設定し、処理がブレークポイントの位置に到達
したときにプログラム実行を中断させたい場合がある。
しかし、例えメンバ関数内部にブレークポイントを設定
して、そこでプログラム実行を中断しても、ブレークポ
イント位置でメンバ関数を呼出したオブジェクトを調べ
ることはできない。それは、デバッガにおいて、オブジ
ェクトのデバッグ情報が、オブジェクトの型の構成を示
す情報と、オフセット位置を示す静的情報とから成り、
プログラム実行時に動的に変化するオブジェクトを特定
することができないことに起因する。例えば図3(a)
に示されるように、ソースプログラム1からソースプロ
グラム2への関数呼出しがある場合を考えてみると、プ
ログラム実行処理が関数内部のときに、デバッガが参照
できる情報は、図3(b)に示されるように、オブジェ
クトのオフセット位置、及びオブジェクトの型情報に基
づくオブジェクトのメンバ情報であり、オブジェクト名
a1,a2のいずれかを特定することができない。つま
り、関数呼出しにより処理実行が関数内部に移った場合
に、その関数呼出しが、a1によるものなのか、a2に
よるものなのかを判別することができない。そのため
に、ブレークポイントは、必然的に「a1.f()」、
あるいは「a2.f()」に設定するしかなく、例えば
「a1」、あるいは「a2」のように、特定のオブジェ
クトから呼出された関数のみブレークさせたい場合で
も、それを行うことができない。
In debugging a high-level language program, it is sometimes desired to set a breakpoint of the program inside the function and suspend the program execution when the processing reaches the position of the breakpoint.
However, even if a breakpoint is set inside the member function and the program execution is suspended there, the object that called the member function at the breakpoint cannot be examined. In the debugger, the debug information of an object consists of information that indicates the structure of the type of the object and static information that indicates the offset position.
This is because it is not possible to specify an object that changes dynamically during program execution. For example, in FIG.
Considering the case where there is a function call from the source program 1 to the source program 2 as shown in FIG. 3, the information that the debugger can refer to when the program execution process is inside the function is shown in FIG. As described above, it is the member position information of the object based on the offset position of the object and the type information of the object, and it is not possible to specify either of the object names a1 and a2. That is, when the process execution is moved to the inside of the function by the function call, it is impossible to determine whether the function call is due to a1 or a2. Therefore, the break point is necessarily "a1.f ()",
Alternatively, even if setting to "a2.f ()" is required, and it is desired to break only the function called from a specific object like "a1" or "a2", that cannot be done.

【0006】本発明の目的は、ソフトウェアデバッグの
効率向上を図ることにある。
An object of the present invention is to improve the efficiency of software debugging.

【0007】本発明の別の目的は、オブジェクトと関数
の条件を組合わせたブレークポイントの設定を可能とす
るための技術を提供することにある。
Another object of the present invention is to provide a technique for enabling the setting of breakpoints that combine the conditions of objects and functions.

【0008】本発明の前記並びにその他の目的と新規な
特徴は本明細書の記述及び添付図面から明らかになるで
あろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

【0009】[0009]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application.

【0010】すなわち、ソースプログラムに基づいてオ
ブジェクトを生成する場合に、オブジェクトの内部にそ
のオブジェクトの識別を可能とするオブジェクト名の情
報を埋込むことにより、関数内部から、それを呼出した
オブジェクトの把握を可能とする。
That is, when an object is generated based on a source program, by embedding the information of the object name that enables the identification of the object inside the object, the inside of the function grasps the object that called it. Is possible.

【0011】具体的な態様として、オブジェクトを生成
する場合において、ユーザ定義サイズを求め(S1)、
ポインタサイズ及びオブジェクト名の文字サイズに基づ
いて、オブジェクト名の情報埋込みに要するサイズを求
め(S2)、求められたサイズに基づいて、オブジェク
トの内部にそのオブジェクトの識別を可能とするオブジ
ェクト名の情報を埋込むようにする。
As a concrete mode, when an object is generated, a user-defined size is obtained (S1),
Based on the pointer size and the character size of the object name, the size required for embedding the information of the object name is obtained (S2), and based on the obtained size, the information of the object name that enables the object to be identified inside the object. To be embedded.

【0012】そして、上記のようにして生成されたオブ
ジェクトのデバッグにおいては、関数呼出しに係るオブ
ジェクト名を、オブジェクト内部に埋込まれたオブジェ
クト名の情報に基づいて特定するようにする。
In debugging the object generated as described above, the object name relating to the function call is specified based on the information of the object name embedded inside the object.

【0013】さらに、上記デバッグにおけるブレーク処
理では、指定されたオブジェクトにより呼出される関数
の内部の任意のプログラム行にブレークポイントを設定
し、プログラムカウンタによって示されるアドレスが、
上記関数のアドレスと一致したか否かを判別し(S1
1)、この判別結果に基づいて、上記オブジェクトから
オブジェクト名のアドレスを取得して(S12)、その
アドレスからオブジェクト名を取得し(S13)、取得
されたオブジェクト名が上記ブレークポイント設定に係
るオブジェクトに一致するか否かを判別し(S14)、
この判別結果に基づいてプログラム実行を中断するよう
にする。
Further, in the break processing in the above debug, a breakpoint is set at an arbitrary program line inside the function called by the specified object, and the address indicated by the program counter becomes
It is determined whether or not the address of the above function matches (S1
1) Based on this determination result, the address of the object name is acquired from the object (S12), the object name is acquired from the address (S13), and the acquired object name is the object related to the breakpoint setting. Is determined (S14),
The program execution is suspended based on this determination result.

【0014】[0014]

【発明の実施の形態】図2には、本発明の一実施例方法
が適用されるソフトウェア開発支援システムが示され
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 2 shows a software development support system to which a method according to an embodiment of the present invention is applied.

【0015】このシステムは、ソフトウェア開発支援に
関する各種プログラムの実行により所定の演算処理を行
うための演算処理装置21、情報表示のための表示装置
22、及び各種情報の入出力装置23を含む。演算処理
装置21は、アセンブラ言語で記述されたソースプログ
ラムを翻訳してオブジェクトモジュールを生成するため
のアセンブラ211、高級言語で記述されたソースプロ
グラムを翻訳してオブジェクトモジュールを生成するた
めのコンパイラ212、上記オブジェクトモジュールを
ライブラリ化するためのライブラリアン214、複数の
オブジェクトモジュールをリンクさせるためのリンケー
ジエディタ215、シミュレータとしての機能やデバッ
ガとしての機能を備えたシミュレータ・デバッガ21
6、及び開発対象ソフトウェアが実際に使用されるマイ
クロコンピュータ(ターゲットCPU)に関する各種情
報ファイルを作成するためのターゲットCPU情報解析
手段213などが、所定のプログラム実行により機能的
に実現される。
This system includes an arithmetic processing unit 21 for performing predetermined arithmetic processing by executing various programs related to software development support, a display unit 22 for displaying information, and an input / output unit 23 for various information. The processor 21 includes an assembler 211 for translating a source program written in assembler language to generate an object module, a compiler 212 for translating a source program written in a high-level language to generate an object module, A librarian 214 for converting the object module into a library, a linkage editor 215 for linking a plurality of object modules, a simulator / debugger 21 having a function as a simulator and a function as a debugger.
6, and the target CPU information analysis means 213 for creating various information files regarding the microcomputer (target CPU) in which the software to be developed is actually used are functionally realized by executing a predetermined program.

【0016】図6には、上記ソフトウェア開発支援シス
テムによるデバッグ対象プログラム作成の流れが示され
る。
FIG. 6 shows a flow of creating a debug target program by the software development support system.

【0017】アセンブラ言語で記述されたアセンブラソ
ースプログラムが、アセンブラ211で翻訳されてオブ
ジェクトモジュール13が生成される。また、高級言語
で記述されたソースプログラムはコンパイラで翻訳され
てオブジェクトモジュール13が生成される。上記アセ
ンブラ211やコンパイラ212によって生成されたオ
ブジェクトモジュール13はライブラリアン214によ
りライブラリ化され、それによってライブラリファイル
14が作られる。さらに、複数のオブジェクトモジュー
ルは、リンケージエディタ215によって結合され、そ
れによってロードモジュール16が生成される。このロ
ードモジュール16がシミュレータ・デバッガ216に
よってデバッグされる。
The assembler source program written in the assembler language is translated by the assembler 211 to generate the object module 13. A source program written in a high level language is translated by a compiler to generate an object module 13. The object module 13 generated by the assembler 211 or the compiler 212 is converted into a library by the librarian 214, and the library file 14 is created thereby. Further, the plurality of object modules are combined by the linkage editor 215, thereby generating the load module 16. The load module 16 is debugged by the simulator / debugger 216.

【0018】次に、オブジェクト生成について説明す
る。
Next, the object generation will be described.

【0019】図4(a)にはC++ソースプログラムの一
例が示される。
FIG. 4A shows an example of a C ++ source program.

【0020】図4(a)において、「struct
A」はユーザ定義型とされる。「struct」は構造
体の宣言であり、その型名は「A」であることを示して
いる。そしてそれに続く「int a」は、int型の
変数aの領域をメモリ上に確保することを示し、「lo
ng b」は、long型の変数bの領域をメモリ上に
確保することを示している。int型の変数aの領域、
及びlong型の変数bの領域は、特に制限されない
が、それぞれ4バイトとされる。さらに、上記変数a,
bについての初期設定関数が記述され、そこで、「a=
2」、「b=10」により初期化される。そして、その
初期設定関数の後に、「A aa;」が記述されてい
る。この「A aa;」は、オブジェクト名の設定を意
味し、それについてのコンパイルは、コンパイラ212
によって、以下のように処理される。
In FIG. 4 (a), "struct
"A" is a user-defined type. “Struct” is a declaration of a structure and its type name is “A”. Then, "int a" that follows indicates that an area for the int type variable a is secured in the memory, and "lot"
"ng b" indicates that the area of the long type variable b is secured in the memory. area of int type variable a,
The areas of the long type variable b and the long type variable b are each 4 bytes, although not particularly limited thereto. Furthermore, the variable a,
An initialization function for b is described, where "a =
2 ”and“ b = 10 ”. Then, “A aa;” is described after the initialization function. This “A aa;” means the setting of the object name, and the compilation for it is done by the compiler 212.
Is processed as follows.

【0021】図4(b)には上記「A aa;」につい
てのコンパイル処理の流れが示される。
FIG. 4 (b) shows the flow of the compiling process for "A aa;".

【0022】このコンパイル処理では、初期設定関数に
オブジェクトの名前(オブジェクト名)を埋込むための
処理が追加されることによって、オブジェクト内にその
オブジェクト名が埋込まれる。
In this compile process, the object name is embedded in the object by adding a process for embedding the object name (object name) to the initialization function.

【0023】先ず、ユーザ定義型(A)のサイズが求め
られる(ステップS1)。この実施例では、「int
a」、「long b」がそれぞれ4バイトとされるた
め、ユーザ定義型(A)のサイズは、4+4=8(バイ
ト)とされる。
First, the size of the user-defined type (A) is obtained (step S1). In this example, "int
Since “a” and “long b” are each 4 bytes, the size of the user-defined type (A) is 4 + 4 = 8 (bytes).

【0024】次に、オブジェクト名(aa)を埋込むた
めに要するサイズが求められる(ステップS2)。この
実施例では、オブジェクト名の情報として、オブジェク
ト名の設定エリアのアドレス保持のためのポインタのサ
イズが4バイト、オブジェクト名(aa)の文字サイズ
が2バイトとされるため、オブジェクト名(aa)を埋
込むために、4+2=6バイトが必要とされる。
Next, the size required to embed the object name (aa) is obtained (step S2). In this embodiment, since the size of the pointer for holding the address of the object name setting area is 4 bytes and the character size of the object name (aa) is 2 bytes as the information of the object name, the object name (aa) 4 + 2 = 6 bytes are required to pad the.

【0025】そして、初期設定関数により、図5(a)
に示されるように、メモリにオブジェクトが設定される
(ステップS3)。オブジェクトの先頭には、オブジェ
クト名の記憶エリア42のアドレスを指示すためのポイ
ンタの記憶エリア41が形成され、それに続いてデータ
(a=2,b=10)が設定される。そして、一つのオ
ブジェクトは、オフセットの位置からデータ(b=1
0)までであり、その後に、そのオブジェクトの名前を
示す文字(aa)の記憶エリア42が設定される。この
実施例では、データa=2,b=10がそれぞれ4バイ
トとされることから、オブジェクト名記憶エリア42の
アドレスは、ポインタ記憶エリア41から8バイト先と
なる。すなわち、この実施例では、図4(a)に示され
る初期設定関数に対して、図5(b)に示されるよう
に、「オブジェクト名(aa)のあるアドレス」、及び
「オブジェクト名=aa」が追加されたものとしてコン
パイル処理が行われ、それによって、オブジェクト名の
埋込みが行われる。そのようにオブジェクト名の埋込み
が行われることにより、後述するデバッグ処理において
は、オブジェクト名のあるアドレスから、そのオブジェ
クトの名前を把握することができる。
Then, according to the initialization function, FIG.
As shown in, the object is set in the memory (step S3). At the beginning of the object, a pointer storage area 41 for pointing to the address of the object name storage area 42 is formed, and subsequently data (a = 2, b = 10) is set. Then, one object has data (b = 1
Up to 0), and after that, the storage area 42 of the character (aa) indicating the name of the object is set. In this embodiment, since the data a = 2 and b = 10 each have 4 bytes, the address of the object name storage area 42 is 8 bytes ahead of the pointer storage area 41. That is, in this embodiment, as shown in FIG. 5B, “address with object name (aa)” and “object name = aa” for the initialization function shown in FIG. Is added, and the object name is embedded. By embedding the object name in such a manner, the name of the object can be grasped from the address having the object name in the debug processing described later.

【0026】上記のようにして生成されたオブジェクト
のデバッグについて説明する。
The debugging of the object generated as described above will be described.

【0027】図1には、デバッガ216によるブレーク
に関する処理の流れが示される。
FIG. 1 shows a flow of processing regarding a break by the debugger 216.

【0028】デバッガ216は、デバッグ対象プログラ
ムを実行させ、指定により1命令実行毎にその実行結果
をトレースバッファに書込むトレース機能や、デバッグ
対象プログラム実行中にブレーク条件が成立した場合
に、ブレーク条件成立のメッセージを表示してプログラ
ム実行を中断するブレーク機能を備えており、ブレーク
条件として、ブレーク系コマンドの条件成立によるブレ
ーク、デバッグ対象プログラム実行時エラー検出による
ブレーク、割込みキー入力によるブレーク等を有する。
そしてこの実施例では、ブレーク系コマンドとして、単
に関数fにブレークポイントを設定する場合の他に、特
定のデータに対して関数fの処理を開始する直前にブレ
ークポイントを設定する場合のように、オブジェクトと
関数の条件とを組合わせたブレークポイントの設定を可
能とするコマンドが用意されている。例えば、「bre
ak a−>f」と指定することによって、データaに
対して関数fの処理を開始する直前にブレークポイント
を設定することができる。そのようなブレークコマンド
によりブレークポイントが設定された場合、デバッガ2
16では、図1に示されるように処理される。
The debugger 216 executes the debug target program and writes the execution result to the trace buffer every execution of one instruction according to the specification, and the break condition when the break condition is satisfied during the execution of the debug target program. It has a break function that displays a success message and suspends program execution. Break conditions include breaks when the break command is satisfied, breaks when an error is detected during execution of the debug target program, and breaks when an interrupt key is entered. .
In this embodiment, as a break command, in addition to simply setting a breakpoint in the function f, as in the case of setting a breakpoint immediately before the processing of the function f is started for specific data, There is a command that allows you to set breakpoints that combine the conditions of objects and functions. For example, "bre
By specifying "ak a->f", a breakpoint can be set for the data a immediately before the processing of the function f is started. If a breakpoint is set by such a break command, the debugger 2
At 16, processing is performed as shown in FIG.

【0029】プログラムカウンタの出力アドレスが更新
される毎に、プログラムカウンタ(PC)の値と、関数
f()の値とが一致したか否かの判別が行わる(ステッ
プS11)。この判別において、プログラムカウンタ
(PC)の値と、関数f()の値とが不一致の場合には
(no)、ブレーク条件不成立により、そのときのプロ
グラムカウンタ(PC)の値に基づいて対応するコマン
ドが実行される。また、上記ステップS11の判別にお
いて、プログラムカウンタ(PC)の値と、関数f()
の値とが一致した(yes)と判断された場合には、そ
のときのプログラムカウンタ(PC)の値に対応するコ
マンド実行に先立ち、ポインタによりオブジェクト名の
アドレスが取得され(ステップS12)、そのアドレス
に基づいてオブジェクト名が取得される(ステップS1
3)。そして、ユーザ指定のオブジェクト名と、オブジ
ェクト名(aa)が一致したか否かの判別が行われる
(ステップS14)。この判別において、それらが一致
した(yes)と判断された場合には上記ブレークポイ
ントでのブレーク条件成立により、必要情報が表示装置
22に表示され、デバッグ対象プログラムの実行が中断
される。また、上記ステップS14の判別において、ユ
ーザ指定のオブジェクト名と、オブジェクト名(a)が
一致しない(no)と判断された場合には、ブレーク条
件不成立により、プログラムカウンタの値に対応するコ
マンドが実行され、上記ステップ11の判別に移行され
る。そのように、オブジェクトと関数の条件とを組合わ
せたブレークポイントの設定が可能とされるので、関数
内部の所望位置にブレーク条件を設定して、その場合の
動作状態を把握可能とすることにより、デバッグ効率の
向上を図ることができる。
Every time the output address of the program counter is updated, it is determined whether or not the value of the program counter (PC) and the value of the function f () match (step S11). In this determination, when the value of the program counter (PC) and the value of the function f () do not match (no), the break condition is not satisfied, and the value is dealt with based on the value of the program counter (PC) at that time. The command is executed. In the determination in step S11, the value of the program counter (PC) and the function f ()
If it is determined that the value of the object has coincided with the value of (yes), the address of the object name is acquired by the pointer before executing the command corresponding to the value of the program counter (PC) at that time (step S12). The object name is acquired based on the address (step S1)
3). Then, it is determined whether or not the object name designated by the user matches the object name (aa) (step S14). In this determination, if it is determined that they match (yes), the necessary information is displayed on the display device 22 and the execution of the debug target program is interrupted due to the establishment of the break condition at the breakpoint. If it is determined in step S14 that the object name specified by the user and the object name (a) do not match (no), the command corresponding to the value of the program counter is executed because the break condition is not satisfied. Then, the process proceeds to the determination in step 11 above. In this way, it is possible to set a breakpoint that combines the object and the condition of the function, so by setting the break condition at the desired position inside the function and making it possible to grasp the operating state in that case. It is possible to improve the debugging efficiency.

【0030】上記実施例によれば、以下の作用効果を得
ることができる。
According to the above embodiment, the following operational effects can be obtained.

【0031】(1)コンパイルにおいて、初期設定関数
にオブジェクトの名前(オブジェクト名)を埋込むため
の処理が追加されることにより、図3(a)に示される
ように、ソースプログラム1からソースプログラム2へ
の関数呼出しがある場合でも、プログラム実行処理が関
数内部のときに、オブジェクトのオフセット位置、及び
オブジェクトの型情報からオブジェクトのメンバ情報に
加えて、オブジェクト名を参照することができるので、
関数呼出しにより処理実行が関数内部に移った場合に、
その関数呼出しが、a1によるものなのか、b1による
ものなのかを判別することができ、それによりソフトウ
ェアデバッグ効率の向上を図ることができる。
(1) In compilation, a process for embedding an object name (object name) in the initialization function is added, so that as shown in FIG. Even when there is a function call to 2, the object name can be referenced in addition to the member information of the object from the offset position of the object and the type information of the object when the program execution process is inside the function.
When the process execution is moved to the inside of the function by the function call,
It is possible to determine whether the function call is due to a1 or b1, and thus it is possible to improve the software debugging efficiency.

【0032】(2)また、上記のように、初期設定関数
にオブジェクトの名前(オブジェクト名)を埋込むため
の処理が追加されることにより、そのオブジェクトのデ
バッグにおいては、特定のオブジェクトから呼出された
関数のみブレークさせることができ(S11〜S1
4)、そのようにオブジェクトと関数の条件を組合わせ
たブレークポイントの設定を可能とすることで、ソフト
ウェアデバッグの効率向上を図ることができる。
(2) Further, as described above, by adding the processing for embedding the name of the object (object name) to the initialization function, in debugging the object, it is called from a specific object. It is possible to break only the function (S11-S1
4) In this way, it becomes possible to set breakpoints that combine the conditions of objects and functions, so that the efficiency of software debugging can be improved.

【0033】以上本発明者によってなされた発明を実施
例に基づいて具体的に説明したが、本発明はそれに限定
されるものではなく、その要旨を逸脱しない範囲におい
て種々変更可能であることは言うまでもない。
The invention made by the present inventor has been specifically described based on the embodiments, but the present invention is not limited thereto, and needless to say, various modifications can be made without departing from the scope of the invention. Yes.

【0034】例えば、上記実施例ではC++ソースプログ
ラムを使用した場合について説明したが、C++言語に限
定されるものではなく、各種オブジェクト指向言語プロ
グラムを使用することができる。
For example, in the above embodiment, the case where the C ++ source program is used has been described, but the present invention is not limited to the C ++ language, and various object-oriented language programs can be used.

【0035】また、上記実施例ではポインタを利用して
オブジェクト名の文字(aa)の記憶エリア42をメモ
リに確保するようにしたが、上記ポインタに代えて、オ
ブジェクト毎に設定されたデバッグ情報用ID番号等を
埋込むようにすれば、それによって直ちにオブジェクト
の判別が可能とされるので、オブジェクト名の文字(a
a)の記憶エリア42をメモリに確保する必要がなくな
る。
In the above embodiment, the pointer is used to secure the storage area 42 of the character (aa) of the object name in the memory. However, instead of the pointer, it is for the debug information set for each object. By embedding an ID number or the like, the object can be immediately identified by the embedded ID number.
It is not necessary to secure the storage area 42 of a) in the memory.

【0036】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるコンパ
イラとそれによって生成されたオブジェクトのデバッグ
に適用した場合について説明したが、本発明はそれに限
定されるものではなく、アセンブラとそれによって生成
されたオブジェクトのデバッグに適用することができ
る。
In the above description, the invention made by the present inventor was mainly applied to debugging the compiler which is the background field of application and the object generated by the compiler, but the present invention is not limited thereto. It can be applied to debug the assembler and the objects it creates, not the ones.

【0037】本発明は、少なくともオブジェクトを生成
することを条件に適用することができる。
The present invention can be applied on condition that at least an object is generated.

【0038】[0038]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。
The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows.

【0039】すなわち、コンパイルにおいて、初期設定
関数にオブジェクトの名前(オブジェクト名)を埋込む
ための処理が追加されることにより、プログラム実行処
理が関数内部のときに、オブジェクトのオフセット位
置、及びオブジェクトの型情報からオブジェクトのメン
バ情報に加えて、オブジェクト名を参照することができ
るので、関数呼出しにより処理実行が関数内部に移った
場合に、その関数呼出し先を判別することができ、それ
によってデバッグ効率の向上を図ることができる。
That is, in the compilation, the processing for embedding the object name (object name) in the initialization function is added, so that when the program execution processing is inside the function, the offset position of the object and the object Since it is possible to refer to the object name in addition to the member information of the object from the type information, it is possible to determine the callee of the function when the processing execution is moved to the inside of the function by the call of the function. Can be improved.

【0040】また、上記のように初期設定関数にオブジ
ェクトの名前(オブジェクト名)を埋込むための処理が
追加されることにより、特定のオブジェクトから呼出さ
れた関数のみブレークさせることができ、オブジェクト
と関数の条件を組合わせたブレークポイントの設定が可
能とされる。そのように関数呼出し先の判定や、オブジ
ェクトと関数の条件を組合わせたブレークポイントの設
定が可能とされることにより、デバッグ効率の向上を図
ることができる。
Further, by adding the processing for embedding the object name (object name) to the initialization function as described above, it is possible to break only the function called from a specific object, It is possible to set breakpoints that combine the conditions of functions. In this way, it is possible to determine the callee of the function and set a breakpoint that combines the conditions of the object and the function, thereby improving the debugging efficiency.

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

【図1】本発明の一実施例方法が適用されるコンパイル
処理の主要部のフローチャートである。
FIG. 1 is a flowchart of a main part of a compilation process to which a method according to an embodiment of the present invention is applied.

【図2】上記コンパイル処理を行うためのソフトウェア
開発支援システムの機能ブロック図である。
FIG. 2 is a functional block diagram of a software development support system for performing the compilation process.

【図3】本実施例におけるオブジェクトとの比較対象と
されるオブジェクトの型の構成説明図である。
FIG. 3 is a structural explanatory diagram of types of objects to be compared with objects in the present embodiment.

【図4】本実施例におけるソースプログラムとそれの主
要部についてのコンパイル処理のフローチャートであ
る。
FIG. 4 is a flowchart of a compile process for a source program and its main part in the present embodiment.

【図5】本実施例におけるオブジェクトの型の説明図で
ある。
FIG. 5 is an explanatory diagram of types of objects in this embodiment.

【図6】上記ソフトウェア開発支援システムによるデバ
ッグ対象プログラム作成のフローチャートである。
FIG. 6 is a flowchart for creating a debug target program by the software development support system.

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

11 アセンブラソースプログラム 12 高級言語で記述されたソースプログラム 13 オブジェクトモジュール 14 ライブラリファイル 15 CPU情報ファイル 16 ロードモジュール 21 演算処理装置 22 表示装置 23 入出力装置 41 ポインタの記憶エリア 42 オブジェクト名の文字記憶エリア 11 assembler source program 12 source program written in high-level language 13 object module 14 library file 15 CPU information file 16 load module 21 arithmetic processing unit 22 display device 23 input / output device 41 pointer storage area 42 object name character storage area

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 ソースプログラムに基づいて、デバッグ
対象とされるオブジェクトを生成するオブジェクト生成
方法において、 オブジェクトの内部にそのオブジェクトの識別を可能と
するオブジェクト名の情報を埋込むステップを含むこと
を特徴とするオブジェクト生成方法。
1. An object generation method for generating an object to be debugged based on a source program, including a step of embedding information on an object name that enables identification of the object inside the object. Object generation method.
【請求項2】 ソースプログラムに基づいて、デバッグ
対象とされるオブジェクトを生成するオブジェクト生成
方法において、 ユーザ定義のサイズを求める第1ステップと、 ポインタサイズ及びオブジェクト名の文字サイズに基づ
いて、オブジェクト名の情報埋込みに要するサイズを求
める第2ステップと、 初期設定関数によるオブジェクト設定の際に、上記第
1,第2ステップで求められたサイズに基づいて、オブ
ジェクトの内部にそのオブジェクトの識別を可能とする
オブジェクト名の情報を埋込む第3ステップと、 を含むことを特徴とするオブジェクト生成方法。
2. An object generation method for generating an object to be debugged based on a source program, the first step of obtaining a user-defined size, and the object name based on the pointer size and the character size of the object name. The second step of obtaining the size required for embedding the information, and the object can be identified inside the object based on the size obtained in the first and second steps when the object is set by the initialization function. And a third step of embedding the information of the object name to be executed.
【請求項3】 請求項1又は2記載のオブジェクト生成
方法によって生成されたオブジェクトをデバッグするデ
バッグ方法において、 関数呼出しに係るオブジェクト名を、オブジェクト内部
に埋込まれたオブジェクト名の情報に基づいて特定する
ステップを含むことを特徴とするデバッグ方法。
3. A debugging method for debugging an object generated by the object generating method according to claim 1 or 2, wherein an object name relating to a function call is specified based on information of the object name embedded inside the object. A debugging method comprising the steps of:
【請求項4】 指定されたオブジェクトにより呼出され
る関数の内部の任意のプログラム行にブレークポイント
を設定する第4ステップと、 プログラムカウンタによって示されるアドレスが、上記
関数のアドレスと一致したか否かを判別する第5ステッ
プと、 この判別結果に基づいて、上記オブジェクトからオブジ
ェクト名のアドレスを取得する第6ステップと、 オブジェクト名のアドレスからオブジェクト名を取得す
る第7ステップと、 取得されたオブジェクト名が上記ブレークポイント設定
に係るオブジェクトと一致するか否かを判別する第8ス
テップと、 この判別結果に基づいてプログラム実行を中断する第9
ステップと、 を含むことを特徴とする請求項3記載のデバッグ方法。
4. A fourth step of setting a breakpoint at an arbitrary program line inside a function called by a specified object, and whether the address indicated by the program counter matches the address of the function. The fifth step of determining the object name, the sixth step of obtaining the address of the object name from the object based on the determination result, the seventh step of obtaining the object name of the object name address, and the obtained object name And an eighth step of determining whether or not matches the object related to the breakpoint setting, and a ninth step of interrupting the program execution based on the determination result.
The debugging method according to claim 3, further comprising:
JP7327959A 1995-11-22 1995-11-22 Object generation method and debugging method Withdrawn JPH09146776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7327959A JPH09146776A (en) 1995-11-22 1995-11-22 Object generation method and debugging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7327959A JPH09146776A (en) 1995-11-22 1995-11-22 Object generation method and debugging method

Publications (1)

Publication Number Publication Date
JPH09146776A true JPH09146776A (en) 1997-06-06

Family

ID=18204930

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7327959A Withdrawn JPH09146776A (en) 1995-11-22 1995-11-22 Object generation method and debugging method

Country Status (1)

Country Link
JP (1) JPH09146776A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004326789A (en) * 2003-04-21 2004-11-18 Microsoft Corp Just-my-code debugging method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004326789A (en) * 2003-04-21 2004-11-18 Microsoft Corp Just-my-code debugging method

Similar Documents

Publication Publication Date Title
US8266608B2 (en) Post-compile instrumentation of object code for generating execution trace data
US7100152B1 (en) Software analysis system having an apparatus for selectively collecting analysis data from a target system executing software instrumented with tag statements and method for use thereof
US9152531B2 (en) Post-compile instrumentation of object code for generating execution trace data
US5987250A (en) Transparent instrumentation for computer program behavior analysis
CA2179553C (en) Determining dynamic properties of programs
US6430741B1 (en) System and method for data coverage analysis of a computer program
EP0785510B1 (en) Program debugging system for debugging a program having a graphical user interface
EP0632377B1 (en) Method for testing a message-driven operating system
JP4901075B2 (en) Computer-readable medium, method and computing device
JPH0689200A (en) Debug system and method
US10229031B2 (en) Debugging inline functions in optimized code
US20060200806A1 (en) Apparatus, system, and method for trace insertion
JP2006185211A (en) Program analysis device, test execution device, analysis method thereof, and program
US20050246691A1 (en) Debugging tool for debugging multi-threaded programs
JP2004164554A (en) Program execution monitoring device and method
JP2003050715A (en) Compiler and debug device
US8533683B2 (en) Stack walking enhancements using sensorpoints
JPH03188535A (en) Program error detection method
JP2010287101A (en) Software debugging apparatus and method
JP2005338987A (en) Exception test support program and exception test support device
Spinellis Trace: A tool for logging operating system call transactions
JPH0766342B2 (en) Program test equipment
US20030018957A1 (en) Debugger monitor with anticipatory highlights
JP2004287869A (en) Program execution monitoring device and method
JP3165105B2 (en) Program tracer, compiler and linker

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20030204