JPH09179753A - Stack information collecting system using timing of return processing - Google Patents

Stack information collecting system using timing of return processing

Info

Publication number
JPH09179753A
JPH09179753A JP7339361A JP33936195A JPH09179753A JP H09179753 A JPH09179753 A JP H09179753A JP 7339361 A JP7339361 A JP 7339361A JP 33936195 A JP33936195 A JP 33936195A JP H09179753 A JPH09179753 A JP H09179753A
Authority
JP
Japan
Prior art keywords
stack information
stack
information
function
storage area
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
JP7339361A
Other languages
Japanese (ja)
Inventor
Satoshi Mizushima
聡 水嶋
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 Solution Innovators Ltd
Original Assignee
NEC Solution Innovators 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 NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP7339361A priority Critical patent/JPH09179753A/en
Publication of JPH09179753A publication Critical patent/JPH09179753A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To make it possible to collect program stacking information to which reference is usually disabled due to overwriting caused by the repetition of function calls and returns by integrating a storing function inside by using the timing of a return at the time of compiling. SOLUTION: When a source 11 is compiled by a compiler 12, a stack information processing routine is integrated in a text part of an object 10. The routine is read out from each function immediately before a return instruction to transfer stack information to a stack information storing area 6. When the area 6 is filled with the stored stack information or a program 1 has ended, the stack information stored in the area 6 is outputted to an output device 9. Since stack information to be communicated with respective functions can be referred to at the occurance of a fault in the program 1, the program 1 can easily be analyzed.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はプログラムのスタッ
ク情報収集に関し、特に関数コールとリターンの繰り返
しによりオーバーライトされて参照不能になるプログラ
ムのスタック情報を収集し参照可能にするリターン処理
を契機とするスタック情報収集方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to collection of stack information of a program, and more particularly, it is triggered by return processing that collects stack information of a program that is overwritten due to repeated function calls and returns and becomes unreferenceable, and makes it available for reference. Regarding the stack information collection method.

【0002】[0002]

【従来の技術】従来のプログラムのスタック情報収集
は、プログラム解析等の目的でスタックを参照する場
合、動作中のプログラムをデバッガを用いて参照する
か、ソースに情報収集用のロジックを追加することによ
り行っていた。
2. Description of the Related Art When collecting stack information of a conventional program, when referring to the stack for the purpose of program analysis, etc., refer to a running program by using a debugger or add a logic for collecting information to the source. Was going by.

【0003】[0003]

【発明が解決しようとする課題】上述した従来のシステ
ムでスタックを参照しようとすると、ソースプログラム
にデバッグ用のロジックを組み込むなどして再コンパイ
ルしなければならないという欠点を有している。
When referring to the stack in the above-mentioned conventional system, there is a drawback in that the source program must be recompiled by incorporating the logic for debugging.

【0004】本発明の目的は、リターン命令の拡張機能
としリターンするとき関数が使用したスタック情報を出
力装置に収集するリターン処理を契機とするスタック情
報収集方式を提供することにある。
An object of the present invention is to provide a stack information collecting method which is an extended function of a return instruction and which is triggered by a return process of collecting stack information used by a function at the time of returning to an output device.

【0005】[0005]

【課題を解決するための手段】第1の発明のリターン処
理を契機とするスタック情報収集方式は、スタック情報
の収集を行うための主記憶装置と、ソースプログラムお
よびオブジェクトプログラムが格納される補助記憶装置
と、ソースプログラムのコンパイル時にスタック情報処
理ルーチンを組み込む機能を持つコンパイラと、利用者
が前記スタック情報の収集の指定をシステムに与えるた
めの入力装置と、前記入力装置から入力された収集の指
定の設定情報を認識するシステム設定認識手段と、前記
設定情報が前記システム設定認識手段を介して設定され
るシステム設定情報テーブルと、前記スタック情報を格
納するためのスタック情報格納域と、前記スタック情報
格納域の格納位置を管理する格納域管理テーブルと、前
記スタック情報を格納する出力装置と、前記スタック情
報格納域に格納された前記スタック情報を前記出力装置
に出力するためのデータ出力手段と、を備えて構成され
ている。
A stack information collection method triggered by a return process of the first invention is a main storage device for collecting stack information, and an auxiliary storage for storing a source program and an object program. A device, a compiler having a function of incorporating a stack information processing routine at the time of compiling a source program, an input device for a user to specify the collection of the stack information to the system, and a specification of the collection input from the input device System setting recognizing means for recognizing the setting information, a system setting information table in which the setting information is set through the system setting recognizing means, a stack information storage area for storing the stack information, and the stack information. The storage area management table that manages the storage location of the storage area and the stack information An output device for pay, and is configured with the stack information stored in the stack information storage area provided with a data output means for outputting to the output device.

【0006】また、第2の発明のリターン処理を契機と
するスタック情報収集方式は、第1の発明において前記
スタック情報は関数を呼び出し処理を実行したときに関
数への因数と関数の呼び出しアドレスと内部変数と返却
値と例外処理時のレジスタ情報等とを備えて構成されて
いる。
Further, the stack information collection method triggered by the return process of the second invention is the stack information in the first invention, which is a factor to the function and a call address of the function when the function call process is executed. It is configured to include internal variables, return values, register information at the time of exception processing, and the like.

【0007】さらに、第3の発明のリターン処理を契機
とするスタック情報収集方式は、第1の発明において前
記システム設定認識手段はシステムの利用者の前記スタ
ック情報を収集する指定を判断し収集する指定のとき収
集モードを前記システム設定情報テーブルに設定するこ
とを備えて構成されている。
Further, in the stack information collecting method triggered by the return process of the third invention, in the first invention, the system setting recognizing means judges and collects the designation of collecting the stack information of the system user. It is configured to set the collection mode in the system setting information table when specified.

【0008】さらに、第4の発明のリターン処理を契機
とするスタック情報収集方式は、第1の発明において前
記格納域管理テーブルは前記スタック情報格納域の先頭
位置を示す開始アドレストと前記スタック情報の格納終
了した位置を示す終了アドレスとを備えて構成されてい
る。
Further, in the stack information collecting method triggered by the return process of the fourth invention, in the first invention, the storage area management table has a start address indicating the top position of the stack information storage area and the stack information. And an end address indicating the storage end position of

【0009】さらに、第5の発明のリターン処理を契機
とするスタック情報収集方式は、第4の発明において前
記終了アドレスの初期値は前記開始アドレスと同値であ
ることを備えて構成されている。
Further, the stack information collecting method triggered by the return process of the fifth invention is configured such that the initial value of the end address is the same value as the start address in the fourth invention.

【0010】さらに、第6の発明のリターン処理を契機
とするスタック情報収集方式は、第1の発明において前
記スタック情報格納域は前記スタック情報の格納開始位
置を示す次領域ポインタと情報格納域と前記次領域ポイ
ンタの示す位置に規定文字を格納したストッパとを備え
て構成されている。
Further, in the stack information collecting method triggered by the return process of the sixth invention, in the first invention, the stack information storage area includes a next area pointer indicating a storage start position of the stack information and an information storage area. A stopper storing a prescribed character is provided at the position indicated by the next area pointer.

【0011】[0011]

【発明の実施の形態】次に、本発明の一つの実施の形態
について図面を参照して説明する。
Next, an embodiment of the present invention will be described with reference to the drawings.

【0012】図1は本発明の実施の形態を示すブロック
図である。
FIG. 1 is a block diagram showing an embodiment of the present invention.

【0013】本実施の形態は、図1に示すようにソース
11をコンパイラ12でコンパイルするときにオブジェ
クト10のテキスト部にスタック情報処理ルーチンが組
み込まれる。コンパイラ12はソース11の各リターン
命令の直前でスタック情報処理ルーチンが呼び出される
ようにオブジェクト10を生成する。
In this embodiment, a stack information processing routine is incorporated in the text portion of the object 10 when the source 11 is compiled by the compiler 12 as shown in FIG. The compiler 12 creates the object 10 so that the stack information processing routine is called immediately before each return instruction of the source 11.

【0014】オブジェクト10を起動すると補助記憶装
置14から主記憶装置13にプログラム1としてローデ
ィングされスタックエリア5が割り当てられる。
When the object 10 is activated, the auxiliary storage device 14 loads the program 1 into the main storage device 13 and allocates the stack area 5.

【0015】プログラム1はスタック情報処理ルーチン
によってシステム設定情報テーブルをチェックし使用し
たスタックエリア5のスタック情報を収集するかを判別
する。(スタック情報の収集または非収集の指定はプロ
グラム1が起動される前にシステムの利用者が入力装置
8から行ない、システム設定認識手段3を介して収集モ
ードまたは非収集モードの設定情報がシステム設定情報
テーブル2に設定される) システム設定情報テーブル2が非収集モードのときは即
時にリターンし、収集モードのときは格納域管理テーブ
ル4の終了アドレス42を取得しこのアドレスに従って
スタックエリア5のスタック情報をスタック情報格納域
6へ転送する。
The program 1 checks the system setting information table by the stack information processing routine to determine whether to collect the stack information of the used stack area 5. (The collection or non-collection of stack information is designated by the user of the system from the input device 8 before the program 1 is started, and the setting information of the collecting mode or the non-collecting mode is set by the system setting recognizing means 3. (Set in the information table 2) When the system setting information table 2 is in the non-collection mode, it immediately returns, and when in the collection mode, the end address 42 of the storage area management table 4 is acquired and the stack of the stack area 5 is followed according to this address The information is transferred to the stack information storage area 6.

【0016】スタック情報格納域6のスタック情報はデ
ータ出力手段7を介して出力装置9に出力される。
The stack information in the stack information storage area 6 is output to the output device 9 via the data output means 7.

【0017】次にスタック情報収集処理ルーチンの実行
例を説明する。
Next, an execution example of the stack information collection processing routine will be described.

【0018】プログラム1はスタックエリア5へアクセ
スするためのポインタとして、スタックポインタを関数
単位で持つている。関数をコールすると使用されるロー
カル変数、因数等の個数に応じてスタックポインタは移
動し、コールされた関数にスタックが割当られる。各関
数毎のスタックのサイズは隣接する関数のスタックポイ
ンタ値との差を取ることで計算できる。
The program 1 has a stack pointer for each function as a pointer for accessing the stack area 5. When a function is called, the stack pointer moves according to the number of local variables and factors used, and the stack is allocated to the called function. The stack size for each function can be calculated by taking the difference from the stack pointer value of the adjacent function.

【0019】次に、図2(a)に示す関数の流れにおい
て図2(b)、図2(c)、図2(d)を参照して動作
を説明する。
Next, the operation of the function flow shown in FIG. 2A will be described with reference to FIGS. 2B, 2C and 2D.

【0020】図2(a)において、main関数はその
処理中でa関数を呼び出し、さらにa関数はa1関数を
呼び出し、a1関数からa関数にリターン(リターン
1)し、a関数はmain関数にリターン(リターン
2)する。
In FIG. 2A, the main function calls the a function during its processing, and the a function calls the a1 function and returns from the a1 function to the a function (return 1), and the a function becomes the main function. Return (return 2).

【0021】次に、main関数はb関数を呼び出し、
b関数からmain関数にリターン(リターン3)し各
リターン1,2,3のスタック情報を収集する例とす
る。
Next, the main function calls the b function,
In this example, the b function returns to the main function (return 3) and the stack information of the returns 1, 2, and 3 is collected.

【0022】図2(b)において、main関数はその
処理中でa関数を呼び出し、a関数はa1関数を呼び出
し、a1関数からa関数にリターン(リターン1)する
とき、入力装置から情報の収集モードの指定がされたか
を管理しているシステム設定情報テーブル2をチェック
する。ここの例では収集モードなのでスタック情報格納
域6の書込みアドレスを管理している格納域管理テーブ
ル4を参照し前にスタック情報を書込みを終了し次に書
込むアドレスを示す終了アドレス42を取得する。この
終了アドレス42の初期値は開始アドレス41のptr
0と同値が設定されているのでここでは格納域管理テー
ブル4の終了アドレス42は初期値のptr0を取得す
る。
In FIG. 2B, the main function calls the a function during its processing, the a function calls the a1 function, and when the a1 function returns to the a function (return 1), information is collected from the input device. The system setting information table 2 which manages whether the mode is designated is checked. In this example, since the mode is the collection mode, the storage area management table 4 that manages the write address of the stack information storage area 6 is referred to, and the end address 42 indicating the address to be written next and the stack information written before is acquired. . The initial value of the end address 42 is ptr of the start address 41.
Since the same value as 0 is set, the end address 42 of the storage area management table 4 acquires the initial value ptr0 here.

【0023】次に、a1関数が使用したスタック情報
(stk−a1)のサイズを終了アドレス42(ptr
0)に加算し終了アドレス(ptr1)を求め、このp
tr1がスタック情報格納域6の範囲を超えていたらス
タック情報域が不足するため前に書込んだスタック情報
を出力装置9に出力する。
Next, the size of the stack information (stk-a1) used by the a1 function is set to the end address 42 (ptr).
0) to obtain the end address (ptr1),
If tr1 exceeds the range of the stack information storage area 6, the stack information area is insufficient, so the previously written stack information is output to the output device 9.

【0024】ここでは超えていないので、スタック情報
格納域6の書込の開始アドレスptr0番地に次スタッ
ク情報を書込む位置を示す次領域ポインタにptr1を
セット後、次領域ポインタの示すptr1番地にストッ
パとして規定文字を設定後、a1関数が使用したスタッ
ク情報(stk−a1)を格納域管理テーブル4の終了
アドレス(初期値のptr0)の次領域ポインタを格納
している直後から転送する。次に、格納域管理テーブル
4の終了アドレス42(初期値のptr0)をptr1
に更新する。
Since it has not exceeded here, after setting ptr1 to the next area pointer indicating the position to write the next stack information at the write start address ptr0 of the stack information storage area 6, after setting ptr1 to the address ptr1 indicated by the next area pointer. After setting the prescribed character as the stopper, the stack information (stk-a1) used by the a1 function is transferred immediately after the next area pointer of the end address (initial value ptr0) of the storage area management table 4 is stored. Next, the end address 42 (initial value ptr0) of the storage area management table 4 is set to ptr1.
To update.

【0025】図2(c)において、a関数からmain
関数にリターン(リターン2)するとき、リターン1の
ときと同様に入力装置から収集モードの指定がされたか
を管理しているシステム設定情報テーブル2をチェック
する。ここの例では収集モードなのでスタック情報格納
域6の書込みアドレスを管理している格納域管理テーブ
ル4を参照し終了アドレス42(ptr1)を取得す
る。
In FIG. 2 (c), a function to main
When returning to the function (return 2), as in the case of return 1, the system setting information table 2 that manages whether the collection mode is designated by the input device is checked. In this example, since it is the collection mode, the end address 42 (ptr1) is acquired by referring to the storage area management table 4 that manages the write address of the stack information storage area 6.

【0026】次に、a関数が使用したスタック情報(s
tk−a)のサイズを終了アドレス42(ptr1)に
加算し終了アドレス(ptr2)を求め、このptr2
がスタック情報格納域6の範囲を超えていたらスタック
情報域が不足するため前に書込んだスタック情報を出力
装置9に出力する。
Next, the stack information (s
The size of tk-a) is added to the end address 42 (ptr1) to obtain the end address (ptr2), and this ptr2
If the stack information storage area 6 exceeds the stack information storage area 6, the stack information area is insufficient and the previously written stack information is output to the output device 9.

【0027】ここでは超えていないとし、スタック情報
格納域6の書込アドレスptr1番地に次スタック情報
を書込む位置を示す次領域ポインタにptr2をセット
後、次領域ポインタの示すptr2番地にストッパとし
て規定文字を設定後、a関数が使用したスタック情報
(stk−a)を格納域管理テーブル4の終了アドレス
42(ptr1)の次領域ポインタを格納している直後
から転送する。次に、格納域管理テーブル4の終了アド
レス42(ptr1)をptr2に更新する。
Here, it is assumed that it has not exceeded, after setting ptr2 to the next area pointer indicating the position to write the next stack information in the write address ptr1 of the stack information storage area 6, as a stopper at the address ptr2 indicated by the next area pointer. After setting the prescribed character, the stack information (stk-a) used by the a function is transferred immediately after the next area pointer of the end address 42 (ptr1) of the storage area management table 4 is stored. Next, the end address 42 (ptr1) of the storage area management table 4 is updated to ptr2.

【0028】図2(d)において、main関数はその
処理中でb関数を呼び出し、b関数はからmain関数
にリターン(リターン3)するとき、リターン2のとき
と同様に入力装置8から収集モードの指定がされたかを
管理しているシステム設定情報テーブル2をチェックす
る。ここの例では収集モードなのでスタック情報格納域
6の書込みアドレスを管理している格納域管理テーブル
4を参照し終了アドレス42(ptr2)を取得する。
In FIG. 2D, the main function calls the b function during its processing, and when the b function returns from the input function 8 to the main function (return 3), the input mode is collected from the input device 8 as in the case of the return 2. Check the system setting information table 2 which manages whether or not is specified. In this example, since it is the collection mode, the end address 42 (ptr2) is acquired by referring to the storage area management table 4 that manages the write address of the stack information storage area 6.

【0029】次に、b関数が使用しているスタック情報
(stk−b)のサイズを終了アドレス42(ptr
2)に加算し終了アドレス(ptr3)を求め、このp
tr3がスタック情報格納域6の範囲を超えていたらス
タック情報域が不足するため前に書込んだスタック情報
を出力装置に出力する。
Next, the size of the stack information (stk-b) used by the b function is set to the end address 42 (ptr).
2) is added to obtain the end address (ptr3), and this p
If tr3 exceeds the range of the stack information storage area 6, the stack information area is insufficient, so the previously written stack information is output to the output device.

【0030】ここでは超えていないとし、スタック情報
格納域6の書込アドレスptr2番地に次スタック情報
を書込む位置を示す次領域ポインタにptr3をセット
後、次領域ポインタの示すptr3番地にストッパとし
て規定文字を格納後、b関数が使用したスタック情報
(stk−b)を格納域管理テーブル4の終了アドレス
42(ptr2)の次領域ポインタを格納している直後
から転送する。次に、格納域管理テーブル4の終了アド
レス42(ptr2)をptr3に更新する。
Here, it is assumed that it has not exceeded, and after setting ptr3 to the next area pointer indicating the position to write the next stack information in the write address ptr2 of the stack information storage area 6, as a stopper at the address ptr3 indicated by the next area pointer. After storing the specified character, the stack information (stk-b) used by the b function is transferred immediately after the next area pointer of the end address 42 (ptr2) of the storage area management table 4 is stored. Next, the end address 42 (ptr2) of the storage area management table 4 is updated to ptr3.

【0031】次に、図3のフローチャートでリターン処
理時の動作を説明する。
Next, the operation during the return process will be described with reference to the flowchart of FIG.

【0032】ステップ1は呼び出された関数の処理を終
了し呼び出し元にリターンするときこの関数で使用した
スタック情報を収集する収集モードか非収集モードかを
システム設定情報テーブル2を参照し判定する。収集モ
ードのときはステップ2の処理を行ない、非収集モード
のときはステップ11の処理を行なう。
Step 1 refers to the system setting information table 2 to determine whether the collecting mode or the non-collecting mode for collecting the stack information used in this function when the processing of the called function is completed and the process returns to the calling source. The processing of step 2 is performed in the collection mode, and the processing of step 11 is performed in the non-collection mode.

【0033】ステップ2は格納域管理テーブル4を参照
しスタック情報をスタック情報格納域6へ書込むアドレ
ス(終了アドレス42)を取得しステップ3の処理を行
なう。
In step 2, the storage area management table 4 is referenced to obtain the address (end address 42) for writing the stack information into the stack information storage area 6, and the processing of step 3 is performed.

【0034】ステップ3は取得した終了アドレス42に
スタックエリア5に格納されているスタック情報の使用
サイズを加算しスタック情報格納域6の範囲を超えてい
るかをチェックし超えて空きがないときステップ4の処
理を行ない、空きがあるときはステップ5の処理を行な
う。
In step 3, the used size of the stack information stored in the stack area 5 is added to the obtained end address 42, and it is checked whether or not it exceeds the range of the stack information storage area 6, and when there is no free space, step 4 Process is performed, and if there is a space, the process of step 5 is performed.

【0035】ステップ4はステップ2で取得した終了ア
ドレス42までスタック情報格納域6に格納しているス
タック情報を出力装置9に出力後、終了アドレス42を
初期値にリセットしステップ5の処理をする。
In step 4, after the stack information stored in the stack information storage area 6 up to the end address 42 obtained in step 2 is output to the output device 9, the end address 42 is reset to the initial value and the process of step 5 is performed. .

【0036】ステップ5は終了アドレス42の示すスタ
ック情報格納域6の次領域ポインタに、終了アドレス4
2にスタック情報の使用サイズを加算したアドレスをセ
ットしステップ6の処理をする。
In step 5, the end address 4 is set to the next area pointer of the stack information storage area 6 indicated by the end address 42.
An address obtained by adding the used size of the stack information to 2 is set, and the process of step 6 is performed.

【0037】ステップ6はステップ5でセットした次領
域ポインタの示す位置にストッパの規定文字を設定しス
テップ7の処理をする。
In step 6, the specified character of the stopper is set at the position indicated by the next area pointer set in step 5, and the process of step 7 is performed.

【0038】ステップ7はスタックエリア5のスタック
情報を格納域管理テーブル4の終了アドレス42の次領
域ポインタを格納している直後から転送しステップ8の
処理をする。
In step 7, the stack information of the stack area 5 is transferred immediately after the next area pointer of the end address 42 of the storage area management table 4 is stored, and the processing of step 8 is performed.

【0039】ステップ8は終了アドレス42にステップ
5でセットした次領域ポインタのアドレスをセットしス
テップ9の処理をする。
In step 8, the address of the next area pointer set in step 5 is set in the end address 42 and the processing in step 9 is performed.

【0040】ステップ9はスタックエリア5のスタック
情報が最終スタック情報かをチェックし最終のときはス
テップ10の処理をする。まだ最終スタック情報に到達
していなければステップ11の処理をする。
In step 9, it is checked whether the stack information in the stack area 5 is the final stack information, and when it is the final stack information, the processing in step 10 is performed. If the final stack information has not been reached, the process of step 11 is performed.

【0041】ステップ10は終了アドレス42までスタ
ック情報格納域6に格納しているスタック情報を出力装
置9に出力後、終了アドレス42を初期値にリセットし
ステップ11の処理をする。
In step 10, after the stack information stored in the stack information storage area 6 up to the end address 42 is output to the output device 9, the end address 42 is reset to the initial value and the process of step 11 is performed.

【0042】ステップ11はリターン命令を実行して呼
び出し元にリターンする。
Step 11 executes the return instruction and returns to the caller.

【0043】[0043]

【発明の効果】以上説明したように、本発明のリターン
処理を契機とするスタック情報収集方式は、スタックに
書き込まれたデータが保存されることにより、プログラ
ムの実行履歴の詳細およびすでに終了した関数で使用し
たスタック情報が参照できるので、プログラムのデバッ
グの効果とともに、システム利用者の設定により任意の
タイミングで情報収集ができ情報不要箇所でのオーバー
ヘッドが少ないという効果を有している。
As described above, in the stack information collecting method of the present invention triggered by the return processing, the data written in the stack is saved, so that the details of the execution history of the program and the already completed function are Since the stack information used in the above can be referred to, it has the effect of debugging the program and the effect that the information can be collected at an arbitrary timing according to the setting of the system user and the overhead at the information unnecessary portion is small.

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

【図1】本発明のリターン処理を契機とするスタック情
報収集方式の実施の形態を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a stack information collection method triggered by return processing of the present invention.

【図2】本実施の形態における動作の一例において図2
(a)は関数の遷移を示す図であり、図2(b)、図2
(c)および図2(d)は各関数リターン時のデータの
状態を示す図である。
FIG. 2 shows an example of an operation in this embodiment.
FIG. 2A is a diagram showing a transition of a function, and FIG.
FIG. 2C and FIG. 2D are diagrams showing the state of data at the time of returning each function.

【図3】本実施の形態の図1のプログラム内のスタック
情報収集処理ルーチンの動作の一例を示すフローチャー
トである。
3 is a flowchart showing an example of the operation of a stack information collection processing routine in the program of FIG. 1 according to the present embodiment.

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

1 プログラム 2 システム設定情報テーブル 3 システム設定認識手段 4 格納域管理テーブル 5 スタックエリア 6 スタック情報格納域 7 データ出力手段 8 入力装置 9 出力装置 10 オブジェクト 11 ソース 12 コパイラ 13 主記憶装置 14 補助記憶装置 41 開始アドレス 42 終了アドレス 1 Program 2 System Setting Information Table 3 System Setting Recognition Means 4 Storage Area Management Table 5 Stack Area 6 Stack Information Storage Area 7 Data Output Means 8 Input Device 9 Output Device 10 Objects 11 Source 12 Copiler 13 Main Storage Device 14 Auxiliary Storage Device 41 Start address 42 End address

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 プログラムが関数を呼び出して前記関数
からリターンするときスタック情報を収集するリターン
処理を契機とするスタック情報収集方式において、 スタック情報の収集を行うための主記憶装置と、ソース
プログラムおよびオブジェクトプログラムが格納される
補助記憶装置と、ソースプログラムのコンパイル時にス
タック情報処理ルーチンを組み込む機能を持つコンパイ
ラと、利用者が前記スタック情報の収集の指定をシステ
ムに与えるための入力装置と、 前記入力装置から入力された収集の指定の設定情報を認
識するシステム設定認識手段と、 前記設定情報が前記システム設定認識手段を介して設定
されるシステム設定情報テーブルと、前記スタック情報
を格納するためのスタック情報格納域と、前記スタック
情報格納域の格納位置を管理する格納域管理テーブル
と、前記スタック情報を格納する出力装置と、 前記スタック情報格納域に格納された前記スタック情報
を前記出力装置に出力するためのデータ出力手段と、を
備えることを特徴とするリターン処理を契機とするスタ
ック情報収集方式。
1. A stack information collection method triggered by a return process of collecting stack information when a program calls a function and returns from the function, a main storage device for collecting stack information, a source program, and An auxiliary storage device in which an object program is stored, a compiler having a function of incorporating a stack information processing routine at the time of compiling a source program, an input device for a user to give the system a designation to collect the stack information, and the input A system setting recognition unit for recognizing collection-specified setting information input from the device, a system setting information table in which the setting information is set via the system setting recognition unit, and a stack for storing the stack information. Information storage area and the stack information storage area A storage area management table for managing storage locations; an output device for storing the stack information; and a data output means for outputting the stack information stored in the stack information storage area to the output device. A stack information collection method triggered by the return process.
【請求項2】 前記スタック情報は関数を呼び出し処理
を実行したときに関数への因数と関数の呼び出しアドレ
スと内部変数と返却値と例外処理時のレジスタ情報等と
を備えることを特徴とする請求項1記載のリターン処理
を契機とするスタック情報収集方式。
2. The stack information includes a factor to the function when the function is called, a call address of the function, an internal variable, a return value, register information at the time of exception processing, and the like. A stack information collection method triggered by the return processing described in item 1.
【請求項3】 前記システム設定認識手段はシステムの
利用者の前記スタック情報を収集する指定を判断し収集
する指定のとき収集モードを前記システム設定情報テー
ブルに設定することを特徴とする請求項1記載のリター
ン処理を契機とするスタック情報収集方式。
3. The system setting recognizing means judges the designation of collecting the stack information of a system user and sets a collection mode in the system setting information table when the collection is designated. Stack information collection method triggered by the described return processing.
【請求項4】 前記格納域管理テーブルは前記スタック
情報格納域の先頭位置を示す開始アドレストと前記スタ
ック情報の格納終了した位置を示す終了アドレスとから
構成されることを特徴とする請求項1記載のリターン処
理を契機とするスタック情報収集方式。
4. The storage area management table is composed of a start address indicating the top position of the stack information storage area and an end address indicating the storage end position of the stack information. Stack information collection method triggered by the described return processing.
【請求項5】 前記終了アドレスの初期値は前記開始ア
ドレスと同値であることを特徴とする請求項4記載のリ
ターン処理を契機とするスタック情報収集方式。
5. The stack information collection method triggered by return processing according to claim 4, wherein the initial value of the end address is the same value as the start address.
【請求項6】 前記スタック情報格納域は前記スタック
情報の格納開始位置を示す次領域ポインタと情報格納域
と前記次領域ポインタの示す位置に規定文字を格納した
ストッパとから構成されることを特徴とする請求項1記
載のリターン処理を契機とするスタック情報収集方式。
6. The stack information storage area comprises a next area pointer indicating a storage start position of the stack information, an information storage area, and a stopper storing a prescribed character at a position indicated by the next area pointer. The stack information collection method triggered by the return process according to claim 1.
JP7339361A 1995-12-26 1995-12-26 Stack information collecting system using timing of return processing Pending JPH09179753A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7339361A JPH09179753A (en) 1995-12-26 1995-12-26 Stack information collecting system using timing of return processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7339361A JPH09179753A (en) 1995-12-26 1995-12-26 Stack information collecting system using timing of return processing

Publications (1)

Publication Number Publication Date
JPH09179753A true JPH09179753A (en) 1997-07-11

Family

ID=18326745

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7339361A Pending JPH09179753A (en) 1995-12-26 1995-12-26 Stack information collecting system using timing of return processing

Country Status (1)

Country Link
JP (1) JPH09179753A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007286656A (en) * 2006-04-12 2007-11-01 Ntt Docomo Inc Software operation modeling device, software operation monitoring device, software operation modeling method, and software operation monitoring method

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61202241A (en) * 1985-03-06 1986-09-08 Fujitsu Ltd Debug system for high-level language program
JPH03223938A (en) * 1989-04-24 1991-10-02 Mitsubishi Electric Corp Return address monitoring circuit for debugging device
JPH03235135A (en) * 1990-02-13 1991-10-21 Nec Corp Automatic inspection system for program
JPH03260742A (en) * 1990-03-12 1991-11-20 Hitachi Ltd Program trace display method
JPH03273346A (en) * 1990-03-22 1991-12-04 Nec Corp Dynamic call relation analyzing system by symbolic debugger
JPH03282632A (en) * 1990-03-29 1991-12-12 Nec Corp Static data recording mechanism
JPH0477840A (en) * 1990-07-16 1992-03-11 Nec Corp Collection system for fault analysis system
JPH04307630A (en) * 1991-04-04 1992-10-29 Nippon Denki Micom Technol Kk Compiler with simple debugging option
JPH0659931A (en) * 1992-08-12 1994-03-04 Nec Corp Debugging device
JPH0667942A (en) * 1992-08-17 1994-03-11 Mitsubishi Electric Corp Log extraction system
JPH07168738A (en) * 1993-12-16 1995-07-04 Toshiba Eng Co Ltd Program inspecting device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61202241A (en) * 1985-03-06 1986-09-08 Fujitsu Ltd Debug system for high-level language program
JPH03223938A (en) * 1989-04-24 1991-10-02 Mitsubishi Electric Corp Return address monitoring circuit for debugging device
JPH03235135A (en) * 1990-02-13 1991-10-21 Nec Corp Automatic inspection system for program
JPH03260742A (en) * 1990-03-12 1991-11-20 Hitachi Ltd Program trace display method
JPH03273346A (en) * 1990-03-22 1991-12-04 Nec Corp Dynamic call relation analyzing system by symbolic debugger
JPH03282632A (en) * 1990-03-29 1991-12-12 Nec Corp Static data recording mechanism
JPH0477840A (en) * 1990-07-16 1992-03-11 Nec Corp Collection system for fault analysis system
JPH04307630A (en) * 1991-04-04 1992-10-29 Nippon Denki Micom Technol Kk Compiler with simple debugging option
JPH0659931A (en) * 1992-08-12 1994-03-04 Nec Corp Debugging device
JPH0667942A (en) * 1992-08-17 1994-03-11 Mitsubishi Electric Corp Log extraction system
JPH07168738A (en) * 1993-12-16 1995-07-04 Toshiba Eng Co Ltd Program inspecting device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007286656A (en) * 2006-04-12 2007-11-01 Ntt Docomo Inc Software operation modeling device, software operation monitoring device, software operation modeling method, and software operation monitoring method

Similar Documents

Publication Publication Date Title
CN110413521B (en) Write-crossing detection method and device for heap memory
US6279120B1 (en) Method for storing computer status data given a malfunction that requires a subsequent restarting of the computer
EP0933706A1 (en) Language processing system and language processing method enabling reduction of memory region and overhead in profile information collection of computer
CN109426606A (en) Kernel failure diagnosis information processing method, device, storage medium and electronic equipment
CN101192192A (en) Task abnormity diagnosis method and system for real-time operating system
Lawson Programming-language-oriented instruction streams
KR940000992A (en) How Digital Data Processors Work
Bartussek et al. Using traces to write abstract specifications for software modules
US5963741A (en) Information processor which rewrites instructions in program to dynamically change program structure and method therefor
EP0875825A2 (en) High speed assemble processing system
JPH09179753A (en) Stack information collecting system using timing of return processing
JP3049814B2 (en) Microcomputer language processor
WO2018226460A1 (en) Asynchronous operation query
Kiczales et al. Semantics-based crosscutting in AspectJ
JPH0731617B2 (en) Program runaway detection method
US7441254B1 (en) Simulation of memory-mapped I/O
JPS6051947A (en) Instruction prefetching system in virtual storage computer
JPH05181702A (en) Soft debugger
JP3085309B2 (en) Debug system
JP2932812B2 (en) Language processing program execution device
JP2002351695A (en) Debugging method for program, debugging device and recording medium for program debugging
KR930014002A (en) How to match operating system with other kernels in real time operating system
CN115964278A (en) Method, device and system for memory tracing, electronic equipment and storage medium
JPH03282935A (en) Compile processor and compile processing system
JPH0667942A (en) Log extraction system

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19980707