JP2679685B2 - Core file generation method - Google Patents

Core file generation method

Info

Publication number
JP2679685B2
JP2679685B2 JP7161520A JP16152095A JP2679685B2 JP 2679685 B2 JP2679685 B2 JP 2679685B2 JP 7161520 A JP7161520 A JP 7161520A JP 16152095 A JP16152095 A JP 16152095A JP 2679685 B2 JP2679685 B2 JP 2679685B2
Authority
JP
Japan
Prior art keywords
shared object
core file
entry
function
object list
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 - Fee Related
Application number
JP7161520A
Other languages
Japanese (ja)
Other versions
JPH08328913A (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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP7161520A priority Critical patent/JP2679685B2/en
Publication of JPH08328913A publication Critical patent/JPH08328913A/en
Application granted granted Critical
Publication of JP2679685B2 publication Critical patent/JP2679685B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明はコアファイル生成方式に
関し、特にプログラムの実行中に異常動作が行われた場
合にシグナルが発生し、そのシグナルが原因でプログラ
ムの動作が終了すると同時にコアファイルが生成される
オペレーティングシステムにおけるコアファイル生成方
式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a core file generation method, and in particular, a signal is generated when an abnormal operation is performed during the execution of a program, and the signal causes the operation of the program to end and the core file The present invention relates to a core file generation method in a generated operating system.

【0002】[0002]

【従来の技術】周知のように、UNIX(X/OPEN
の商標)系のオペレーティングシステムでは、プログラ
ムが動作中になんらかの異常状態となり、これ以上の動
作が不可能となった場合に、オペレーティングシステム
の機能によりその時点のコアメモリのデータセグメント
およびスタックセグメントをダンプしたコアファイルが
生成されるようになっていた。ユーザは、デバッガ等に
よりコアファイルの内容を解析することによってプログ
ラムの異常動作となった原因をある程度は調査すること
が可能であった。
2. Description of the Related Art As is well known, UNIX (X / OPEN
(Trademark) operating system dumps core data and stack segments of the core memory at that time when the program enters an abnormal state during operation and cannot operate anymore. A core file was created. The user was able to investigate to some extent the cause of the abnormal operation of the program by analyzing the contents of the core file with a debugger or the like.

【0003】[0003]

【発明が解決しようとする課題】上述した従来のオペレ
ーティングシステムでは、コアファイルに出力されるの
はデータセグメントおよびスタックセグメントのみであ
り、テキストセグメントは出力されていなかったので、
デバッガ等でコアファイルが生成されたときの状況を調
べようとしても、コアファイルが生成されたときの変数
の値は参照できるが、有効なスタックトレースを行うこ
とはできず、シグナルによりプログラム中のどの位置で
動作が終了したか否かを正確に知ることができないとい
う問題点があった。
In the above conventional operating system, only the data segment and the stack segment are output to the core file, and the text segment is not output.
Even if you try to check the situation when the core file is generated with a debugger etc., you can refer to the value of the variable when the core file was generated, but you cannot do a valid stack trace and the signal in the program There is a problem that it is not possible to accurately know at which position the operation has ended.

【0004】また、コアファイルにはプログラムから参
照されるすべての共有オブジェクトのデータセグメント
が出力されていたので、コアファイルが生成された時点
では一度も参照されていない共有オブジェクトのデータ
セグメントまでもコアファイルに出力されることにな
り、コアファイルが大きくなりすぎて完全な内容のコア
ファイルが生成できない場合が生じるという問題点があ
った。
Further, since the data segments of all the shared objects referred to by the program are output to the core file, even the data segments of the shared objects that have never been referenced at the time when the core file is generated are output to the core. There is a problem that the core file is output to a file and the core file becomes too large to generate a complete core file.

【0005】本発明の第1の目的は、上述の点に鑑み、
共有オブジェクトリストに共有オブジェクトの呼出し深
さを保持するようにして、共有オブジェクトの呼出し深
さが初期値以上であれば、コアファイルの作成時に参照
されていた共有オブジェクトであるので、この共有オブ
ジェクトのテキストセグメントおよびロードモジュール
のテキストセグメントをコアファイルに出力して、スタ
ックトレースが行えるようにしたコアファイル生成方式
を提供することにある。
In view of the above points, the first object of the present invention is to
Keep the shared object invocation depth in the shared object list. If the shared object invocation depth is equal to or greater than the initial value, it is the shared object that was referenced when the core file was created. It is to provide a core file generation method that outputs a text segment and a text segment of a load module to a core file so that a stack trace can be performed.

【0006】また、本発明の第2の目的は、共有オブジ
ェクトリストに参照された共有オブジェクトのエントリ
を作成するようにして、共有オブジェクトリストにエン
トリがあれば、コアファイルの作成時までに参照された
共有オブジェクトであるので、このような共有オブジェ
クトのデータセグメントのみをコアファイルに出力する
ようにして(一度も参照されていない共有オブジェクト
のデータセグメントを出力しないようにして)、コアフ
ァイルが大きくなりすぎて完全な内容のコアファイルが
生成できない場合が生じることがないようにしたコアフ
ァイル生成方式を提供することにある。
A second object of the present invention is to create an entry for the shared object referenced in the shared object list, and if there is an entry in the shared object list, it is referenced by the time the core file is created. Since it is a shared object, only the data segment of such a shared object is output to the core file (the data segment of the shared object that has never been referenced is not output), and the core file becomes large. It is to provide a core file generation method that prevents a case where a core file having a complete content cannot be generated due to too much.

【0007】さらに、本発明の第3の目的は、上記第1
の目的および第2の目的をともに満足するようにしたコ
アファイル生成方式を提供することにある。
Further, a third object of the present invention is to provide the above-mentioned first object.
It is an object of the present invention to provide a core file generation method that satisfies both the purpose and the second purpose.

【0008】なお、先行技術として、関数の呼出し深さ
が一定の値以上になるとトレース出力を抑止し、その後
復帰が行われて一定の値に戻った時点よりトレースの出
力を再開するようにした関数トレース出力方式が公知で
あるが(特開平2−245944号公報参照)、この方
式はトレースを行う際のものであり、本願発明のように
コアファイルの生成に関するものではない。
As a prior art, trace output is suppressed when the function call depth exceeds a certain value, and trace output is restarted from the time point when the function is restored and returned to a certain value. Although a function trace output method is known (see Japanese Patent Laid-Open No. 2-245944), this method is for performing tracing and is not related to generation of a core file as in the present invention.

【0009】[0009]

【課題を解決するための手段】本発明のコアファイル生
成方式は、プログラムの実行中に異常動作が行われた場
合にシグナルが発生し、そのシグナルが原因でプログラ
ムの動作が終了すると同時にコアファイルが生成される
オペレーティングシステムにおいて、プログラムが参照
する各共有オブジェクトのテキストセグメント中にある
各関数の処理を行う機械語列の先頭および後尾に共有オ
ブジェクトリスト作成手段を呼び出すジャンプ命令を埋
め込むジャンプ命令埋込み手段と、関数の先頭で呼び出
されたときに前記共有オブジェクトリストの該共有オブ
ジェクトのエントリの呼出し深さを1つ増やし、関数の
後尾で呼び出されたときに前記共有オブジェクトリスト
の該共有オブジェクトのエントリの呼出し深さを1つ減
らす前記共有オブジェクトリスト作成手段と、ロードモ
ジュールのテキストセグメントを前記コアファイルに出
力するとともに、前記共有オブジェクトリストの該共有
オブジェクトのエントリの呼出し深さが初期値よりも大
きければ該共有オブジェクトのテキストセグメントを前
記コアファイルに出力するコアファイル生成手段とを有
する。
According to the core file generation method of the present invention, a signal is generated when an abnormal operation is performed during the execution of a program, and the operation of the program ends at the same time as the signal causes the core file to be generated. In the operating system in which the jump instruction embedding means for embedding the jump instruction for calling the shared object list creating means at the beginning and the end of the machine language sequence for processing each function in the text segment of each shared object referenced by the program And the calling depth of the entry of the shared object in the shared object list is increased by 1 when called at the beginning of the function, and the entry of the shared object in the shared object list is increased when called at the end of the function. The shared object that reduces the call depth by one And a text list of the load module are output to the core file, and if the call depth of the entry of the shared object in the shared object list is larger than an initial value, the text segment of the shared object is output to the core. And a core file generating means for outputting to a file.

【0010】また、本発明のコアファイル生成方式は、
プログラムの実行中に異常動作が行われた場合にシグナ
ルが発生し、そのシグナルが原因でプログラムの動作が
終了すると同時にコアファイルが生成されるオペレーテ
ィングシステムにおいて、プログラムが参照する各共有
オブジェクトのテキストセグメント中にある各関数の処
理を行う機械語列に共有オブジェクトリスト作成手段を
呼び出すジャンプ命令を埋め込むジャンプ命令埋込み手
段と、関数で呼び出されたときに前記共有オブジェクト
リストに該共有オブジェクトのエントリがなければ該共
有オブジェクトのエントリを追加する前記共有オブジェ
クトリスト作成手段と、前記共有オブジェクトリストに
該共有オブジェクトのエントリがあれば該共有オブジェ
クトのデータセグメントを前記コアファイルに出力する
コアファイル生成手段とを有する。
The core file generation method of the present invention is
In operating systems where a signal is generated when an abnormal operation is performed during the execution of a program, and the signal terminates the operation of the program and at the same time a core file is generated, a text segment of each shared object that the program references Jump instruction embedding means for embedding a jump instruction for calling a shared object list creating means in a machine language string for processing each function therein, and if there is no entry of the shared object in the shared object list when called by a function The shared object list creating means for adding an entry for the shared object, and a core file generation for outputting a data segment of the shared object to the core file if the shared object list has an entry for the shared object. And a stage.

【0011】さらに、本発明のコアファイル生成方式
は、プログラムの実行中に異常動作が行われた場合にシ
グナルが発生し、そのシグナルが原因でプログラムの動
作が終了すると同時にコアファイルが生成されるオペレ
ーティングシステムにおいて、プログラムが参照する各
共有オブジェクトのテキストセグメント中にある各関数
の処理を行う機械語列の先頭および後尾に共有オブジェ
クトリスト作成手段を呼び出すジャンプ命令を埋め込む
ジャンプ命令埋込み手段と、関数の先頭で呼び出された
ときに前記共有オブジェクトリストに該共有オブジェク
トのエントリがなければ該共有オブジェクトのエントリ
を追加し、該共有オブジェクトのエントリがあれば該共
有オブジェクトのエントリの呼出し深さを1つ増やし、
関数の後尾で呼び出されたときに前記共有オブジェクト
リストの該共有オブジェクトの呼出し深さを1つ減らす
前記共有オブジェクトリスト作成手段と、ロードモジュ
ールのテキストセグメントを前記コアファイルに出力す
るとともに、前記共有オブジェクトリストに該共有オブ
ジェクトのエントリがあれば該共有オブジェクトのデー
タセグメントを前記コアファイルに出力し、該共有オブ
ジェクトのエントリの呼出し深さが初期値よりも大きけ
れば該共有オブジェクトのテキストセグメントを前記コ
アファイルに出力するコアファイル生成手段とを有す
る。
Further, according to the core file generation method of the present invention, a signal is generated when an abnormal operation is performed during the execution of a program, and the signal causes the operation of the program to end, and at the same time, the core file is generated. In the operating system, a jump instruction embedding means for embedding a jump instruction for calling the shared object list creating means at the beginning and at the end of a machine language string for processing each function in the text segment of each shared object referenced by the program, and a function If there is no entry for the shared object in the shared object list when called at the beginning, the entry for the shared object is added, and if there is an entry for the shared object, the call depth of the entry for the shared object is increased by one. ,
The shared object list creating means for reducing the calling depth of the shared object in the shared object list by one when called at the end of the function, and outputting the text segment of the load module to the core file, and the shared object. If there is an entry of the shared object in the list, the data segment of the shared object is output to the core file, and if the invocation depth of the entry of the shared object is larger than the initial value, the text segment of the shared object is output to the core file. And a core file generating means for outputting to.

【0012】[0012]

【作用】本発明のコアファイル生成方式では、ジャンプ
命令埋込み手段がプログラムが参照する各共有オブジェ
クトのテキストセグメント中にある各関数の処理を行う
機械語列の先頭および後尾に共有オブジェクトリスト作
成手段を呼び出すジャンプ命令を埋め込み、共有オブジ
ェクトリスト作成手段が関数の先頭で呼び出されたとき
に共有オブジェクトリストの該共有オブジェクトのエン
トリの呼出し深さを1つ増やし、関数の後尾で呼び出さ
れたときに共有オブジェクトリストの該共有オブジェク
トのエントリの呼出し深さを1つ減らし、コアファイル
生成手段がロードモジュールのテキストセグメントをコ
アファイルに出力するとともに、共有オブジェクトリス
トの該共有オブジェクトのエントリの呼出し深さが初期
値よりも大きければ該共有オブジェクトのテキストセグ
メントをコアファイルに出力する。
In the core file generating method of the present invention, the jump instruction embedding means has the shared object list creating means at the head and tail of the machine language string for processing each function in the text segment of each shared object referenced by the program. A jump instruction to be called is embedded, the calling depth of the entry of the shared object in the shared object list is incremented by one when the shared object list creating means is called at the beginning of the function, and the shared object is called at the end of the function. The call depth of the entry of the shared object in the list is decreased by one, the core file generation means outputs the text segment of the load module to the core file, and the call depth of the entry of the shared object in the shared object list is set to the initial value. Bigger than Output text segment of the shared object to the core file.

【0013】また、本発明のコアファイル生成方式で
は、ジャンプ命令埋込み手段がプログラムが参照する各
共有オブジェクトのテキストセグメント中にある各関数
の処理を行う機械語列に共有オブジェクトリスト作成手
段を呼び出すジャンプ命令を埋め込み、共有オブジェク
トリスト作成手段が関数で呼び出されたときに共有オブ
ジェクトリストに該共有オブジェクトのエントリがなけ
れば該共有オブジェクトのエントリを追加し、コアファ
イル生成手段が共有オブジェクトリストに該共有オブジ
ェクトのエントリがあれば該共有オブジェクトのデータ
セグメントをコアファイルに出力する。
Further, in the core file generating method of the present invention, the jump instruction embedding means calls the shared object list creating means to a machine language string for processing each function in the text segment of each shared object referenced by the program. When an instruction is embedded and the shared object list creating means is called by a function and there is no entry for the shared object in the shared object list, the shared object entry is added, and the core file creating means adds the shared object to the shared object list. If there is an entry of, the data segment of the shared object is output to the core file.

【0014】さらに、本発明のコアファイル生成方式で
は、ジャンプ命令埋込み手段がプログラムが参照する各
共有オブジェクトのテキストセグメント中にある各関数
の処理を行う機械語列の先頭および後尾に共有オブジェ
クトリスト作成手段を呼び出すジャンプ命令を埋め込
み、共有オブジェクトリスト作成手段が関数の先頭で呼
び出されたときに共有オブジェクトリストに該共有オブ
ジェクトのエントリがなければ該共有オブジェクトのエ
ントリを追加し、該共有オブジェクトのエントリがあれ
ば該共有オブジェクトのエントリの呼出し深さを1つ増
やし、関数の後尾で呼び出されたときに共有オブジェク
トリストの該共有オブジェクトの呼出し深さを1つ減ら
し、コアファイル生成手段がロードモジュールのテキス
トセグメントをコアファイルに出力するとともに、共有
オブジェクトリストに該共有オブジェクトのエントリが
あれば該共有オブジェクトのデータセグメントをコアフ
ァイルに出力し、該共有オブジェクトのエントリの呼出
し深さが初期値よりも大きければ該共有オブジェクトの
テキストセグメントをコアファイルに出力する。
Further, in the core file generation method of the present invention, the jump instruction embedding means creates a shared object list at the head and tail of a machine language string for processing each function in the text segment of each shared object referenced by the program. A jump instruction for calling the means is embedded, and when the shared object list creating means is called at the beginning of the function, if there is no entry for the shared object in the shared object list, the entry for the shared object is added, and the entry for the shared object is added. If there is, the call depth of the entry of the shared object is incremented by 1, and when called at the end of the function, the call depth of the shared object in the shared object list is reduced by 1, and the core file generation means sets the text of the load module. Core segment If the entry of the shared object exists in the shared object list, the data segment of the shared object is output to the core file, and if the invocation depth of the entry of the shared object is larger than the initial value, the shared object is output. Output the text segment of to the core file.

【0015】[0015]

【実施例】次に、本発明について図面を参照して詳細に
説明する。
Next, the present invention will be described in detail with reference to the drawings.

【0016】図1は、本発明の一実施例に係るコアファ
イル生成方式の構成を示すブロック図である。本実施例
のコアファイル生成方式は、ロードモジュール7が参照
する各共有オブジェクト8(図示は1つ)のテキストセ
グメント8a中にある各関数の処理を行う機械語列の先
頭および後尾に共有オブジェクトリスト作成手段2を呼
び出すジャンプ命令を埋め込むジャンプ命令埋込み手段
1と、ロードモジュール7が参照する共有オブジェクト
8について、その共有オブジェクト8に含まれる関数が
呼び出されている深さ(以下、呼出し深さという)を管
理する共有オブジェクトリスト5を作成する共有オブジ
ェクトリスト作成手段2と、アドレス空間4内からロー
ドモジュール7のテキストセグメント7aおよびコアフ
ァイル6の生成時に参照していた共有オブジェクト8の
テキストセグメント8aと、ロードモジュール7のデー
タセグメント7bおよびプログラムが終了するまでに参
照した共有オブジェクト8のデータセグメント8bと、
スタックセグメント9とをダンプしてコアファイル6を
生成するコアファイル生成手段3とから構成されてい
る。
FIG. 1 is a block diagram showing the configuration of a core file generation system according to an embodiment of the present invention. In the core file generation method of this embodiment, the shared object list is provided at the beginning and the end of the machine language string for processing each function in the text segment 8a of each shared object 8 (one shown) referenced by the load module 7. With respect to the jump instruction embedding means 1 for embedding the jump instruction for calling the creating means 2 and the shared object 8 referenced by the load module 7, the depth at which the function included in the shared object 8 is called (hereinafter referred to as the call depth). A shared object list creating means 2 for creating a shared object list 5 for managing the shared object list 5, a text segment 7a of the load module 7 and a text segment 8a of the shared object 8 referred to when the core file 6 was created from within the address space 4, Data segmentation of load module 7 A data segment 8b of the shared object 8 bets 7b and program references to finish,
The stack segment 9 and the core file generating means 3 for generating the core file 6 by dumping.

【0017】共有オブジェクトリスト5の各エントリ
は、共有オブジェクト名および呼出し深さの2つの要素
を持つ。共有オブジェクト名は、ロードモジュール7が
参照する共有オブジェクト8の名称で、呼出し深さは、
その共有オブジェクト8に含まれる関数が呼び出されて
いる深さ(レベル)を示す。例えば、共有オブジェクト
libA.soに関数X,YおよびZが含まれており、
ロードモジュール7から関数Xが呼び出され、関数Xか
らさらに関数Yが呼び出されたとすると、図1の共有オ
ブジェクトリスト5中に例示するように、共有オブジェ
クトlibA.soの呼出し深さは値2となる。
Each entry in the shared object list 5 has two elements, a shared object name and a call depth. The shared object name is the name of the shared object 8 referenced by the load module 7, and the call depth is
The depth (level) at which the function included in the shared object 8 is called is shown. For example, the shared object libA. so contains the functions X, Y and Z,
If the function X is called from the load module 7 and the function Y is further called from the function X, as illustrated in the shared object list 5 in FIG. The calling depth of so is 2.

【0018】図2を参照すると、共有オブジェクトリス
ト作成手段2の処理は、関数先頭判定ステップ201
と、共有オブジェクトエントリ有無判定ステップ202
と、共有オブジェクトリスト呼出し深さ1増加ステップ
203と、エントリ追加・呼出し深さ0設定ステップ2
04と、共有オブジェクトリスト呼出し深さ1減算ステ
ップ205とからなる。
Referring to FIG. 2, the process of the shared object list creating means 2 is performed by the function head determining step 201.
And shared object entry presence / absence determination step 202
And step 203 of increasing the shared object list call depth 1 and step 2 of adding an entry / call depth 0
04 and a shared object list call depth 1 subtraction step 205.

【0019】図3を参照すると、コアファイル生成手段
3の処理は、共有オブジェクトリスト1エントリ取出し
ステップ301と、呼出し深さ判定ステップ302と、
テキストセグメント出力ステップ303と、データセグ
メント出力ステップ304と、エントリ取出し終了判定
ステップ305と、ロードモジュールのテキストセグメ
ントおよびデータセグメントならびにスタックセグメン
ト出力ステップ306とからなる。
Referring to FIG. 3, the processing of the core file generating means 3 includes a shared object list 1 entry extraction step 301, a call depth determination step 302,
It comprises a text segment output step 303, a data segment output step 304, an entry extraction end determination step 305, and a load module text segment and data segment and a stack segment output step 306.

【0020】次に、このように構成された本実施例のコ
アファイル生成方式の動作について説明する。
Next, the operation of the core file generation method of this embodiment having the above-mentioned configuration will be described.

【0021】プログラムが実行されると、まず、ジャン
プ命令埋込み手段1は、このプログラムに対するプロセ
スのアドレス空間4における共有オブジェクト8のテキ
ストセグメント8aに対し、共有オブジェクト8内の各
関数の処理を行う機械語列の先頭および後尾に共有オブ
ジェクトリスト作成手段2を呼び出すためのジャンプ命
令を埋め込む。
When the program is executed, first, the jump instruction embedding unit 1 executes the processing of each function in the shared object 8 on the text segment 8a of the shared object 8 in the address space 4 of the process for this program. A jump instruction for calling the shared object list creating means 2 is embedded at the beginning and the end of the word string.

【0022】ジャンプ命令が埋め込まれた後、プログラ
ムの実行が継続され、埋め込まれたジャンプ命令に達す
ると、共有オブジェクトリスト作成手段2が呼び出され
る。
After the jump instruction is embedded, the execution of the program is continued, and when the embedded jump instruction is reached, the shared object list creating means 2 is called.

【0023】共有オブジェクトリスト作成手段2は、ま
ず、関数の先頭であるかどうかを判定し(ステップ20
1)、関数の先頭である場合には、共有オブジェクト名
をキーとして共有オブジェクトリスト5にその関数を含
む共有オブジェクト8のエントリがあるかどうかを調べ
る(ステップ202)。共有オブジェクトリスト5にそ
の関数を含む共有オブジェクト8のエントリがない場合
は、共有オブジェクトリスト作成手段2は、この共有オ
ブジェクト8のエントリを共有オブジェクトリスト5に
追加し、呼出し深さを0に設定する(ステップ20
4)。ステップ204でエントリの追加後およびステッ
プ202で該当するエントリがあった場合には、共有オ
ブジェクトリスト作成手段2は、このエントリの呼出し
深さを1つ増やして(ステップ203)、処理を終了す
る。
The shared object list creating means 2 first determines whether or not it is the head of the function (step 20).
1) If it is at the beginning of the function, it is checked whether or not there is an entry of the shared object 8 including the function in the shared object list 5 using the shared object name as a key (step 202). If the shared object list 5 does not have an entry for the shared object 8 including the function, the shared object list creating means 2 adds the entry for this shared object 8 to the shared object list 5 and sets the call depth to 0. (Step 20
4). After the entry is added in step 204 and when there is a corresponding entry in step 202, the shared object list creating means 2 increases the calling depth of this entry by one (step 203) and ends the processing.

【0024】一方、ステップ201で関数の後尾である
場合には、共有オブジェクトリスト作成手段2は、共有
オブジェクトリスト5からその関数を含む共有オブジェ
クト8のエントリを探し、呼出し深さを1つ減らして
(ステップ205)、処理を終了する。
On the other hand, if it is the tail of the function in step 201, the shared object list creating means 2 searches the shared object list 5 for the entry of the shared object 8 including the function, and reduces the call depth by one. (Step 205), the process ends.

【0025】このようにして、プログラムの実行が共有
オブジェクト8に埋め込まれたジャンプ命令に達するた
びに、共有オブジェクトリスト5の内容が更新される。
In this way, every time the execution of the program reaches the jump instruction embedded in the shared object 8, the content of the shared object list 5 is updated.

【0026】プログラムの実行中に異常動作が行われて
シグナルが発生し、そのシグナルを受け取ってプロセス
が終了すると、コアファイル生成手段3が呼び出され
る。
When an abnormal operation is performed during the execution of the program and a signal is generated and the signal is received and the process is terminated, the core file generating means 3 is called.

【0027】コアファイル生成手段3は、まず、共有オ
ブジェクトリスト5から1エントリを取り出す(ステッ
プ301)。
The core file generating means 3 first extracts one entry from the shared object list 5 (step 301).

【0028】次に、コアファイル生成手段3は、そのエ
ントリの呼出し深さが0より大きいか否かを判定し(ス
テップ302)、大きい場合のみ、その共有オブジェク
ト8のテキストセグメント8aをコアファイル6に出力
する(ステップ303)。
Next, the core file generating means 3 judges whether the call depth of the entry is larger than 0 (step 302), and only when it is larger, the text segment 8a of the shared object 8 is made to be the core file 6. (Step 303).

【0029】続いて、コアファイル生成手段3は、ステ
ップ302の判定結果の如何にかかわらず、共有オブジ
ェクト8のデータセグメント8bをコアファイル6に出
力する(ステップ304)。
Subsequently, the core file generation means 3 outputs the data segment 8b of the shared object 8 to the core file 6 regardless of the determination result of step 302 (step 304).

【0030】次に、コアファイル生成手段3は、共有オ
ブジェクトリスト5のエントリをすべて取り出したか否
かを判定し(ステップ305)、すべてのエントリを取
り出すまでステップ301〜305を繰り返す。
Next, the core file generating means 3 judges whether or not all the entries of the shared object list 5 have been taken out (step 305), and steps 301 to 305 are repeated until all the entries are taken out.

【0031】ステップ305で共有オブジェクトリスト
5のエントリがすべて取り出されたと判定されると、コ
アファイル生成手段3は、ロードモジュール7のテキス
トセグメント7aおよびデータセグメント7bならびに
スタックセグメント9をコアファイル6に出力して(ス
テップ306)、処理を終了する。
When it is determined in step 305 that all the entries of the shared object list 5 have been taken out, the core file generation means 3 outputs the text segment 7a and the data segment 7b of the load module 7 and the stack segment 9 to the core file 6. Then (step 306), the process ends.

【0032】この結果、図1中に示すように、ロードモ
ジュール7のテキストセグメント7aおよび異常動作時
点で参照している共有オブジェクト8のテキストセグメ
ント8aと、ロードモジュール7のデータセグメント7
bおよび異常動作時点までに参照した共有オブジェクト
8のデータセグメント8bと、スタックセグメント9と
が書き込まれたコアファイル6が生成される。
As a result, as shown in FIG. 1, the text segment 7a of the load module 7, the text segment 8a of the shared object 8 referred to at the time of abnormal operation, and the data segment 7 of the load module 7 are referenced.
The core file 6 in which the data segment 8b of the shared object 8 referred to by b and the abnormal operation time and the stack segment 9 are written is generated.

【0033】なお、上記実施例では、共有オブジェクト
リストに共有オブジェクトの呼出し深さを保持するよう
にして、共有オブジェクトの呼出し深さが初期値以上で
あれば、コアファイルの作成時に参照されていた共有オ
ブジェクトであるので、この共有オブジェクトのテキス
トセグメントおよびロードモジュールのテキストセグメ
ントをコアファイルに出力して、スタックトレースが行
えるようにするとともに、共有オブジェクトリストに参
照された共有オブジェクトのエントリを作成するように
して、共有オブジェクトリストにエントリがあれば、コ
アファイルの作成時までに参照された共有オブジェクト
であるので、このような共有オブジェクトのデータセグ
メントのみをコアファイルに出力するようにして(一度
も参照されていない共有オブジェクトのデータセグメン
トを出力しないようにして)、コアファイルが大きくな
りすぎて完全な内容のコアファイルが生成できない場合
が生じることがないようにしたが、かならずしも両者を
同時に実施しなくても本発明の目的を達成することがで
きる。すなわち、共有オブジェクトリストに共有オブジ
ェクトの呼出し深さを保持するようにして、共有オブジ
ェクトの呼出し深さが初期値以上であれば、コアファイ
ルの作成時に参照されていた共有オブジェクトであるの
で、この共有オブジェクトのテキストセグメントおよび
ロードモジュールのテキストセグメントをコアファイル
に出力して、スタックトレースが行えるようにするだけ
でもよく、また共有オブジェクトリストに参照された共
有オブジェクトのエントリを作成するようにして、共有
オブジェクトリストにエントリがあれば、コアファイル
の作成時までに参照された共有オブジェクトであるの
で、このような共有オブジェクトのデータセグメントの
みをコアファイルに出力するようにして(一度も参照さ
れていない共有オブジェクトのデータセグメントを出力
しないようにして)、コアファイルが大きくなりすぎて
完全な内容のコアファイルが生成できない場合が生じる
ことがないようにするだけでもよい。
In the above embodiment, the shared object call depth is held in the shared object list, and if the shared object call depth is equal to or greater than the initial value, it is referred to when the core file is created. Since it is a shared object, the text segment of this shared object and the text segment of the load module are output to the core file so that a stack trace can be performed and the entry of the referenced shared object in the shared object list is created. If there is an entry in the shared object list, it means that the shared object was referenced by the time the core file was created, so only the data segment of such a shared object should be output to the core file. Not done I tried not to output the shared object's data segment) to prevent the core file from becoming too large to generate a complete core file, but it is not necessary to do both at the same time. The object of the invention can be achieved. That is, the shared object invocation depth is held in the shared object list, and if the shared object invocation depth is equal to or greater than the initial value, it is the shared object that was referenced when the core file was created. You can simply print the object's text segment and the load module's text segment to a core file for stack tracing, or you can make an entry for the referenced shared object in the shared object list to create a shared object. If there is an entry in the list, it is a shared object that was referenced by the time the core file was created, so only the data segment of such a shared object should be output to the core file (a shared object that has never been referenced). Data segment so as not to output), may be simply so does not occur if the core file of the complete contents core file too large can not be generated.

【0034】[0034]

【発明の効果】以上説明したように本発明は、ジャンプ
命令埋込み手段,共有オブジェクトリスト作成手段およ
びコアファイル生成手段を設け、共有オブジェクトリス
トに共有オブジェクトの呼出し深さを保持するようにし
て、共有オブジェクトの呼出し深さが初期値以上であれ
ば、コアファイルの作成時に参照されていた共有オブジ
ェクトであるので、この共有オブジェクトのテキストセ
グメントおよびロードモジュールのテキストセグメント
をコアファイルに出力するようにしたことにより、スタ
ックトレースが行えるようになり、コアファイルが生成
されたときの状況を有効に解析することができる効果が
ある。
As described above, according to the present invention, the jump instruction embedding means, the shared object list creating means, and the core file creating means are provided so that the shared object invocation depth can be held in the shared object list. If the invocation depth of the object is greater than the initial value, it is the shared object that was referenced when the core file was created. Therefore, the text segment of this shared object and the text segment of the load module are output to the core file. As a result, the stack trace can be performed, and there is an effect that the situation when the core file is generated can be effectively analyzed.

【0035】また、共有オブジェクトリストに参照され
た共有オブジェクトのエントリを作成するようにして、
共有オブジェクトリストにエントリがあれば、コアファ
イルの作成時までに参照された共有オブジェクトである
ので、このような共有オブジェクトのデータセグメント
のみをコアファイルに出力するようにした(一度も参照
されていない共有オブジェクトのデータセグメントを出
力しないようにした)ことにより、コアファイルが大き
くなりすぎて完全な内容のコアファイルが生成できない
場合が生じることがないようになり、コアファイルが生
成されたときの状況を確実に解析することができるとい
う効果がある。
Further, the entry of the shared object referred to in the shared object list is created,
If there is an entry in the shared object list, it is a shared object that was referenced by the time the core file was created. Therefore, only the data segment of such a shared object is output to the core file (it is never referenced. By not outputting the data segment of the shared object), it is possible to prevent the core file from becoming too large to generate a complete core file. What happens when the core file is generated? Has the effect that it can be analyzed reliably.

【0036】さらに、共有オブジェクトリストに共有オ
ブジェクトの呼出し深さを保持するようにして、共有オ
ブジェクトの呼出し深さが初期値以上であれば、コアフ
ァイルの作成時に参照されていた共有オブジェクトであ
るので、この共有オブジェクトのテキストセグメントお
よびロードモジュールのテキストセグメントをコアファ
イルに出力するとともに、共有オブジェクトリストに参
照された共有オブジェクトのエントリを作成するように
して、共有オブジェクトリストにエントリがあれば、コ
アファイルの作成時までに参照された共有オブジェクト
であるので、このような共有オブジェクトのデータセグ
メントのみをコアファイルに出力するようにした(一度
も参照されていない共有オブジェクトのデータセグメン
トを出力しないようにした)ことにより、スタックトレ
ースが行えるようになり、コアファイルが生成されたと
きの状況を有効に解析することができるとともに、コア
ファイルが大きくなりすぎて完全な内容のコアファイル
が生成できない場合が生じることがないようになり、コ
アファイルが生成されたときの状況を確実に解析するこ
とができるという効果がある。
Further, the calling depth of the shared object is held in the shared object list, and if the calling depth of the shared object is equal to or larger than the initial value, it means that the shared object was referenced when the core file was created. , The text segment of this shared object and the text segment of the load module are output to the core file, and an entry for the shared object referenced in the shared object list is created. Since it is a shared object that has been referenced by the time of creation, only the data segment of such a shared object is output to the core file (the data segment of a shared object that has never been referenced is not output. By doing so, it becomes possible to perform a stack trace, it is possible to effectively analyze the situation when the core file is generated, and when the core file becomes too large to generate a complete core file. Is prevented from occurring, and it is possible to reliably analyze the situation when the core file is generated.

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

【図1】本発明の一実施例に係るコアファイル生成方式
の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a core file generation method according to an embodiment of the present invention.

【図2】図1中の共有オブジェクトリスト作成手段の処
理を示す流れ図である。
FIG. 2 is a flowchart showing a process of a shared object list creating means in FIG.

【図3】図1中のコアファイル生成手段の処理を示す流
れ図である。
FIG. 3 is a flowchart showing a process of a core file generating means in FIG.

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

1 ジャンプ命令埋込み手段 2 共有オブジェクトリスト作成手段 3 コアファイル生成手段 4 アドレス空間 5 共有オブジェクトリスト 6 コアファイル 7 ロードモジュール 7a テキストセグメント 7b データセグメント 8 共有オブジェクト 8a テキストセグメント 8b データセグメント 9 スタックセグメント 1 jump instruction embedding means 2 shared object list creating means 3 core file creating means 4 address space 5 shared object list 6 core file 7 load module 7a text segment 7b data segment 8 shared object 8a text segment 8b data segment 9 stack segment

フロントページの続き (56)参考文献 特開 平6−290084(JP,A) 特開 平5−313918(JP,A) 特開 平2−294845(JP,A) 特開 平4−364545(JP,A) 特開 平2−165352(JP,A) 特開 平1−112345(JP,A) 特開 平4−242839(JP,A) 特開 平3−216742(JP,A) 特開 昭63−228243(JP,A) 特開 昭63−82528(JP,A) 特開 昭62−212743(JP,A) JUICE I.EGAN,THOM AS TEIXEIRA共著,野中浩 一,大西照代 訳, 「UNIX デバ イスドライバ」,株式会社アスキー, 1989年11月,P.182−197Continuation of the front page (56) Reference JP-A-6-290084 (JP, A) JP-A-5-313918 (JP, A) JP-A-2-294845 (JP, A) JP-A-4-364545 (JP , A) JP-A-2-165352 (JP, A) JP-A 1-112345 (JP, A) JP-A-4-242839 (JP, A) JP-A-3-216742 (JP, A) JP-A 63-228243 (JP, A) JP 63-82528 (JP, A) JP 62-212743 (JP, A) JUICE I. Co-authored by EGAN and THOM AS TEIXEIRA, translated by Koichi Nonaka and Teruyo Onishi, "UNIX Device Driver", ASCII Corporation, November 1989, p. 182-197

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 プログラムの実行中に異常動作が行われ
た場合にシグナルが発生し、そのシグナルが原因でプロ
グラムの動作が終了すると同時にコアファイルが生成さ
れるオペレーティングシステムにおいて、 プログラムが参照する各共有オブジェクトのテキストセ
グメント中にある各関数の処理を行う機械語列の先頭お
よび後尾に共有オブジェクトリスト作成手段を呼び出す
ジャンプ命令を埋め込むジャンプ命令埋込み手段と、 関数の先頭で呼び出されたときに前記共有オブジェクト
リストの該共有オブジェクトのエントリの呼出し深さを
1つ増やし、関数の後尾で呼び出されたときに前記共有
オブジェクトリストの該共有オブジェクトのエントリの
呼出し深さを1つ減らす前記共有オブジェクトリスト作
成手段と、 ロードモジュールのテキストセグメントを前記コアファ
イルに出力するとともに、前記共有オブジェクトリスト
の該共有オブジェクトのエントリの呼出し深さが初期値
よりも大きければ該共有オブジェクトのテキストセグメ
ントを前記コアファイルに出力するコアファイル生成手
段とを有することを特徴とするコアファイル生成方式。
1. In an operating system in which a signal is generated when an abnormal operation is performed during the execution of a program, and the operation of the program ends due to the signal, a core file is generated at the same time. A jump instruction embedding means for embedding a jump instruction for calling a shared object list creating means at the head and tail of a machine language string for processing each function in the text segment of the shared object, and the sharing when called at the head of the function. The shared object list creating means for increasing the calling depth of the entry of the shared object in the object list by one and decreasing the calling depth of the entry of the shared object in the shared object list by one when called at the end of the function. And the load module Core file generation means for outputting a text segment of the shared object to the core file and outputting the text segment of the shared object to the core file when the calling depth of the entry of the shared object in the shared object list is larger than an initial value. A core file generation method comprising:
【請求項2】 プログラムの実行中に異常動作が行われ
た場合にシグナルが発生し、そのシグナルが原因でプロ
グラムの動作が終了すると同時にコアファイルが生成さ
れるオペレーティングシステムにおいて、 プログラムが参照する各共有オブジェクトのテキストセ
グメント中にある各関数の処理を行う機械語列に共有オ
ブジェクトリスト作成手段を呼び出すジャンプ命令を埋
め込むジャンプ命令埋込み手段と、 関数で呼び出されたときに前記共有オブジェクトリスト
に該共有オブジェクトのエントリがなければ該共有オブ
ジェクトのエントリを追加する前記共有オブジェクトリ
スト作成手段と、 前記共有オブジェクトリストに該共有オブジェクトのエ
ントリがあれば該共有オブジェクトのデータセグメント
を前記コアファイルに出力するコアファイル生成手段と
を有することを特徴とするコアファイル生成方式。
2. An operating system in which a signal is generated when an abnormal operation is performed during the execution of a program and the operation of the program ends due to the signal and at the same time a core file is generated Jump instruction embedding means for embedding a jump instruction for calling a shared object list creating means in a machine language string for processing each function in a text segment of the shared object, and the shared object in the shared object list when called by a function If there is no entry for the shared object, the shared object list creating means for adding an entry for the shared object; and if there is an entry for the shared object in the shared object list, a command for outputting the data segment of the shared object to the core file. A core file generation method comprising: a file generation means.
【請求項3】 プログラムの実行中に異常動作が行われ
た場合にシグナルが発生し、そのシグナルが原因でプロ
グラムの動作が終了すると同時にコアファイルが生成さ
れるオペレーティングシステムにおいて、 プログラムが参照する各共有オブジェクトのテキストセ
グメント中にある各関数の処理を行う機械語列の先頭お
よび後尾に共有オブジェクトリスト作成手段を呼び出す
ジャンプ命令を埋め込むジャンプ命令埋込み手段と、 関数の先頭で呼び出されたときに前記共有オブジェクト
リストに該共有オブジェクトのエントリがなければ該共
有オブジェクトのエントリを追加し、該共有オブジェク
トのエントリがあれば該共有オブジェクトのエントリの
呼出し深さを1つ増やし、関数の後尾で呼び出されたと
きに前記共有オブジェクトリストの該共有オブジェクト
のエントリの呼出し深さを1つ減らす前記共有オブジェ
クトリスト作成手段と、 ロードモジュールのテキストセグメントを前記コアファ
イルに出力するとともに、前記共有オブジェクトリスト
に該共有オブジェクトのエントリがあれば該共有オブジ
ェクトのデータセグメントを前記コアファイルに出力
し、該共有オブジェクトのエントリの呼出し深さが初期
値よりも大きければ該共有オブジェクトのテキストセグ
メントを前記コアファイルに出力するコアファイル生成
手段とを有することを特徴とするコアファイル生成方
式。
3. An operating system in which a signal is generated when an abnormal operation is performed during the execution of a program and the operation of the program ends due to the signal and at the same time a core file is generated A jump instruction embedding means for embedding a jump instruction for calling a shared object list creating means at the head and tail of a machine language string for processing each function in the text segment of the shared object, and the sharing when called at the head of the function. When there is no entry for the shared object in the object list, an entry for the shared object is added, and if there is an entry for the shared object, the call depth of the entry for the shared object is incremented by 1, and when called at the end of the function To the shared object list The shared object list creating means for reducing the call depth of the entry of the shared object by one, and outputting the text segment of the load module to the core file, and if there is an entry of the shared object in the shared object list, the shared object Core file generating means for outputting the data segment of the object to the core file and outputting the text segment of the shared object to the core file if the call depth of the entry of the shared object is larger than the initial value. Characterized core file generation method.
JP7161520A 1995-06-05 1995-06-05 Core file generation method Expired - Fee Related JP2679685B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7161520A JP2679685B2 (en) 1995-06-05 1995-06-05 Core file generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7161520A JP2679685B2 (en) 1995-06-05 1995-06-05 Core file generation method

Publications (2)

Publication Number Publication Date
JPH08328913A JPH08328913A (en) 1996-12-13
JP2679685B2 true JP2679685B2 (en) 1997-11-19

Family

ID=15736646

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7161520A Expired - Fee Related JP2679685B2 (en) 1995-06-05 1995-06-05 Core file generation method

Country Status (1)

Country Link
JP (1) JP2679685B2 (en)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JUICE I.EGAN,THOMAS TEIXEIRA共著,野中浩一,大西照代 訳, 「UNIX デバイスドライバ」,株式会社アスキー,1989年11月,P.182−197

Also Published As

Publication number Publication date
JPH08328913A (en) 1996-12-13

Similar Documents

Publication Publication Date Title
US5333032A (en) Logic design system and method in the same
US6888542B1 (en) Error recovery in a computer aided design environment
US7146571B2 (en) System and method for two tier paste buffer and display
US8418122B2 (en) Incorporating functionality from an object file into an existing binary file
CN112905184A (en) Pile-insertion-based industrial control protocol grammar reverse analysis method under basic block granularity
JPH10507016A (en) System, method and compiler preprocessor for conditionally compiling software compilation units
US5946493A (en) Method and system in a data processing system for association of source code instructions with an optimized listing of object code instructions
JP2679685B2 (en) Core file generation method
US7036045B2 (en) Method and system for isolating exception related errors in Java JVM
KR100237642B1 (en) Processor having pipe line stop signal
US9015658B2 (en) Automatic program generation device and automatic program generation method
US6795879B2 (en) Apparatus and method for wait state analysis in a digital signal processing system
US5748965A (en) Language processing method for calculating optimum address of array
KR0160839B1 (en) Sdl graphic edit method
US6957359B2 (en) Data processing apparatus and data processing method
JP2716310B2 (en) Function call / return detection method
JP2932812B2 (en) Language processing program execution device
KR100214129B1 (en) Method for transaction of auto-command in an electronic switching system
US7281166B1 (en) User-customizable input error handling
JP2606658B2 (en) Logic simulator and control method
JPH08286950A (en) Information processor and trace information storage method
JPH0581038A (en) Compiler
JP2581806B2 (en) How to modify the path trace file
KR0175469B1 (en) How to control the visibility of fill program variables
JPH0675957A (en) Restoration mechanism of fault during editing

Legal Events

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

Free format text: PAYMENT UNTIL: 20070801

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20080801

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20080801

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20090801

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20090801

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20100801

Year of fee payment: 13

LAPS Cancellation because of no payment of annual fees