JP2009244969A - Program operation comparison device, method, and program - Google Patents

Program operation comparison device, method, and program Download PDF

Info

Publication number
JP2009244969A
JP2009244969A JP2008087886A JP2008087886A JP2009244969A JP 2009244969 A JP2009244969 A JP 2009244969A JP 2008087886 A JP2008087886 A JP 2008087886A JP 2008087886 A JP2008087886 A JP 2008087886A JP 2009244969 A JP2009244969 A JP 2009244969A
Authority
JP
Japan
Prior art keywords
program
function
execution
function block
execution history
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.)
Granted
Application number
JP2008087886A
Other languages
Japanese (ja)
Other versions
JP4763743B2 (en
Inventor
Yoshimi Ichiyanagi
淑美 一柳
Seiji Kihara
誠司 木原
Satoshi Moriai
敏 盛合
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2008087886A priority Critical patent/JP4763743B2/en
Publication of JP2009244969A publication Critical patent/JP2009244969A/en
Application granted granted Critical
Publication of JP4763743B2 publication Critical patent/JP4763743B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To automatically collect information necessary for specifying the causes of an error, degradation, and the like which becomes obvious depending upon a program executing speed and a processing procedure. <P>SOLUTION: This program operation comparison device changes an execution file of such a program so that the program itself can output execution history of a function, acquires the execution history of the executed program by a program execution history collecting means to store the execution history of the program in an execution history storage means, divides the execution history with a local part of a function call sequence as a function block on the basis of the depth of a function call stack of the executed program and an appearance pattern to store the function block in a function block storage means, compares the function block of the function block storage means with the function call sequence of the program under execution acquired by the program execution history collecting means, detects different places and stores them in a comparison result storage means. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、プログラム動作比較装置及び方法及びプログラムに係り、プログラムを実行する環境や、動作するプログラムのバージョンなどのプログラムやその動作環境の違いによって発生するプログラム動作の差異を検出することにより、エラーが発生してからその原因を特定するまでの時間を短縮するためのプログラム動作比較装置及び方法及びプログラムに関する。   The present invention relates to a program operation comparison apparatus, method, and program, and an error is detected by detecting a program operation difference caused by a difference in an environment for executing a program, a version of a program to be operated, or a difference in the operation environment. The present invention relates to a program operation comparison device, method, and program for shortening the time from occurrence of a problem until the cause is identified.

現在のデバッグ技術として、プローブをプログラムに挿入する方法、プロファイラやシステムモニタ、デバッガ、ダンプ、トレーサやロガーが存在する。   Current debugging techniques include methods for inserting probes into programs, profilers and system monitors, debuggers, dumps, tracers and loggers.

プローブをプログラムに挿入することによって、デバッグする場合、プログラムのどこにプローブを挿入するかが問題となる。このとき、エラーが発生してからバグを発見するまでの時間の長さは、プログラム自身と、プローブを挿入したユーザのスキルに依存する。そのため、プローブをプログラムに挿入する方法は、エラーの発生からバグを特定するまでの時間を短くする方法ではない。   When debugging by inserting a probe into a program, the problem is where to insert the probe in the program. At this time, the length of time from when an error occurs until a bug is found depends on the program itself and the skill of the user who inserted the probe. For this reason, the method of inserting a probe into a program is not a method of shortening the time from the occurrence of an error to the identification of a bug.

プロファイラやシステムモニタは、プログラムの計算機資源量の消費量を監視するための方法であるため、プログラムの実行速度の低下といったプログラムの計算機資源消費量に関わるバグを発見する場合には有用だが、プログラムの実行速度、プログラムの処理手順に依存して顕在化するバグ、例えば、競合問題に関するバグを発見することはできない。   A profiler or system monitor is a method for monitoring the amount of computer resources consumed by a program, so it is useful for finding bugs related to the amount of computer resources consumed by the program, such as a decrease in the program execution speed. It is not possible to find a bug that becomes apparent depending on the execution speed of the program and the processing procedure of the program, for example, a bug related to a conflict problem.

デバッガは、ブレークポイントの挿入位置に、エラーが発生してからバグを特定するまでの時間に依存する。具体的には、よりプログラミングスキルのあるユーザがブレークポイントを挿入した方が、エラーが発生してからバグを発見するまでの時間が短くなる傾向にある。   The debugger depends on the time from when an error occurs until a bug is identified at the breakpoint insertion position. Specifically, when a user with more programming skills inserts a breakpoint, the time from when an error occurs until a bug is found tends to be shorter.

また、自動的にブレークポイントを挿入し、ユーザのスキルに依存せず、エラーが発生してからバグを発見するまでの時間を短くする方法もある(例えば、特許文献1参照)しかし、実行中のプログラムの情報を取得する手段として、ブレークポイントを使用する場合、コンテキストスイッチといったオーバヘッドが高い処理が発生するため、プログラムの実行速度が大幅に低下する。   There is also a method of automatically inserting breakpoints and reducing the time from occurrence of an error to finding a bug without depending on the user's skill (for example, see Patent Document 1). When a breakpoint is used as a means for acquiring information on the program, processing with high overhead such as context switching occurs, so that the execution speed of the program is significantly reduced.

ダンプを用いてデバッグする場合、プログラムの情報を取得するタイミングが問題となる。ダンプでは、プログラムが実行不可能となるエラーが発生した時や、特定の外部イベントが発生した時にプログラムの情報を取得する。これらのタイミングにおいて取得したプログラムの情報から、プログラムの実行速度、プログラムの処理手順に依存して顕在化するバグを発見することは困難である。   When debugging using a dump, the timing of acquiring program information becomes a problem. In the dump, program information is acquired when an error that makes the program inexecutable occurs or when a specific external event occurs. From the program information acquired at these timings, it is difficult to find a bug that becomes apparent depending on the execution speed of the program and the processing procedure of the program.

トレーサやロガーは、実行された関数やシステムコールの実行時刻、関数名、引数、返り値などを自動的に取得する。このため、ポータビリティ性が十分に考慮され、モジュール化が進んだプログラムでは、プログラムの処理手順に依存するバグを発見するのに十分な情報が取得できると考えられ、エラーが発生してからバグを発見するまでの時間を短くすることができるため、実行履歴を取得するために必要となる処理時間を低減することができる。しかし、従来のトレーサやロガーは、実行された関数の引数や返り値を正確に取得していない。
特開平7−73070号公報
The tracer and logger automatically acquire the execution time, function name, argument, return value, etc. of the executed function or system call. For this reason, it is considered that sufficient information can be acquired to find bugs that depend on the processing procedure of a program in a program that has been fully modularized and portability has been improved. Since the time until discovery can be shortened, the processing time required to acquire the execution history can be reduced. However, conventional tracers and loggers do not accurately obtain the arguments and return values of executed functions.
JP-A-7-73070

上記のように、従来のデバッグ手法には、エラーが発生してからバグを発見するまでの時間がデバッグを行うユーザのプログラミングスキルに依存している。さらに、デバッグ手法によっては、プログラムの実行速度、プログラムの処理手順に依存して顕在化するバグを発見することができない。   As described above, in the conventional debugging method, the time from when an error occurs until a bug is found depends on the programming skill of the user who performs debugging. Further, depending on the debugging technique, it is not possible to find a bug that becomes apparent depending on the execution speed of the program and the processing procedure of the program.

本発明は、上記の点に鑑みなされたもので、デバッグを行うユーザのプログラミングスキルに依存せず、プログラムの実行速度、プログラムの処理手順に依存して顕在化するバグを発見し、バグを特定するために必要となる情報を自動的に収集するためのプログラム動作比較装置及び方法及びプログラムを提供することを目的とする。   The present invention has been made in view of the above points, and finds and identifies a bug that manifests depending on the execution speed of the program and the processing procedure of the program without depending on the programming skill of the user who performs debugging. It is an object of the present invention to provide a program operation comparison apparatus, method and program for automatically collecting information necessary for the above.

図1は、本発明の原理構成図である。   FIG. 1 is a principle configuration diagram of the present invention.

本発明(請求項1)は、プログラムの動作の差異を発見するためのプログラム動作比較装置であって、
プログラムを実行するプログラム実行手段40と、
プログラム自身が関数の実行履歴を出力可能なように該プログラムの実行ファイルを変更し、プログラム実行手段40により、実行した該プログラムの実行履歴を取得して実行履歴記憶手段180に格納するプログラム実行履歴収集手段100と、
実行履歴記憶手段180のプログラムの実行履歴を、実行された該プログラムの関数コールスタックの深さと、出現パターンに基づいて関数コールシーケンスの局所を関数ブロックとして区切り、関数ブロック記憶手段250に格納するプログラム実行履歴分割手段200と、
関数ブロック記憶手段250の関数ブロックと、プログラム実行手段40により実行中のプログラムの関数コールシーケンスを比較し、異なる箇所を検出し、比較結果記憶手段370に格納する比較手段300と、を有する。
The present invention (Claim 1) is a program operation comparison device for finding a difference in operation of a program,
Program execution means 40 for executing the program;
A program execution history in which an execution file of the program is changed so that the program itself can output a function execution history, and the execution history of the executed program is acquired by the program execution means 40 and stored in the execution history storage means 180 Collecting means 100;
A program that stores the execution history of the program in the execution history storage unit 180 into the function block storage unit 250 by dividing the local area of the function call sequence as a function block based on the depth of the function call stack of the executed program and the appearance pattern. Execution history dividing means 200;
The function block of the function block storage unit 250 is compared with the function call sequence of the program being executed by the program execution unit 40, and a comparison unit 300 that detects a different portion and stores it in the comparison result storage unit 370 is provided.

また、本発明(請求項2)は、プログラム実行履歴収集手段100において、
プログラムの実行履歴として取得する関数について、該関数についての情報を収集するためのプログラムの実行ファイルを変更する実行ファイル変更手段と、
取得する関数について、詳細な情報を取得するために必要となる値を取得するデバッグ情報取得手段と、
プログラムの実行ファイル内で定義されている関数や、ユーザが指定した共有ライブラリの関数について、該プログラムがプログラム実行手段により実行された時刻、関数名、引数、コールスタックの深さの情報を取得し、取得した情報を実行履歴記憶手段180に登録する実行履歴収集手段と、を有する。
Further, the present invention (Claim 2) is provided in the program execution history collecting means 100.
Execution file changing means for changing an execution file of a program for collecting information about the function with respect to a function acquired as an execution history of the program,
About the function to be acquired, debug information acquisition means for acquiring values necessary for acquiring detailed information,
For the functions defined in the execution file of the program and the functions of the shared library specified by the user, information on the time when the program was executed by the program execution means, function name, argument, and call stack depth information is obtained. And an execution history collection means for registering the acquired information in the execution history storage means 180.

また、本発明(請求項3)は、プログラム実行履歴分割手段200において、
実行履歴記憶手段180に格納されている履歴情報を読み込んで、関数の呼び出しのみに着目し、呼び出した関数のコールスタックの深さの値が小さくなったところで区切り、区切られた箇所を1つの関数ブロックとする実行履歴区分手段と、
関数ブロック内の関数がその実行順序も含め同一となる関数ブロックが存在するかを検索し、存在する場合は、その次の関数ブロックについても関数ブロック内の関数がその実行順序も含め、同一であるかを調べる処理を繰り返し、同一である関数ブロックが存在した場合には、その一連の長さが最も長い関数ブロックに対して、複数の関数ブロックを1つの関数ブロックとしてまとめ、関数ブロック記憶手段250に登録する手段と、
関数ブロック内の関数の引数、返り値が、全ての関数において同一か、同一の値を持つ関数が存在するか、全ての関数において異なっているかを関数と関連付けした関数ブロック記憶手段250に登録する手段と、を有する。
Further, the present invention (Claim 3) is provided in the program execution history dividing means 200.
The history information stored in the execution history storage unit 180 is read, and only the function call is focused. The call stack is divided when the call stack depth value becomes small. Execution history classification means as a block;
A search is performed for a function block in which a function in the function block is the same including the execution order. If there is, the function in the function block is also the same in the function block including the execution order. When there is a function block having the same length as a result of repeating the process of checking whether there is a function block, a plurality of function blocks are collected as one function block for the function block having the longest series of lengths, and function block storage means Means for registering in 250;
Whether the arguments and return values of the functions in the function block are the same in all functions, whether there is a function having the same value, or is different in all functions is registered in the function block storage unit 250 associated with the function. Means.

また、本発明(請求項4)は、比較手段300において、
関数ブロック記憶手段250から関数ブロックを読み出して、該関数ブロックとプログラム実行手段により実行中のプログラムの関数コールシーケンスを比較することにより、該実行中のプログラムの動作がユーザの想定した動作と異なる箇所を検出する手段と、
関数コールシーケンスのみの比較では異なる箇所が検出できなかった場合に、関数ブロック内の実行された関数の引数や返り値と、実行中のプログラムが実行した関数の引数や返り値を比較することにより、該実行中のプログラムの動作がユーザの想定した動作と異なる箇所を検出する手段と、を有する。
The present invention (Claim 4) is provided in the comparison means 300.
By reading the function block from the function block storage unit 250 and comparing the function call sequence of the program being executed by the function block and the program execution unit, the operation of the program being executed differs from the operation assumed by the user. Means for detecting
By comparing the function call sequence alone, if a different part cannot be detected, the argument and return value of the executed function in the function block are compared with the argument and return value of the function executed by the executing program. And means for detecting a location where the operation of the program being executed differs from the operation assumed by the user.

図2は、本発明の原理を説明するための図である。   FIG. 2 is a diagram for explaining the principle of the present invention.

本発明(請求項5)は、プログラムの動作の差異を発見するためのプログラム動作比較方法であって、
プログラム自身が関数の実行履歴を出力可能なように該プログラムの実行ファイルを変更し、該プログラムを実行する機能(プログラム実行手段)により、実行した該プログラムの実行履歴を取得して実行履歴記憶手段に格納するプログラム実行履歴収集ステップ(ステップ1)と、
実行履歴記憶手段のプログラムの実行履歴を、実行された該プログラムの関数コールスタックの深さと、出現パターンに基づいて関数コールシーケンスの局所を関数ブロックとして区切り、関数ブロック記憶手段に格納するプログラム実行履歴分割ステップ(ステップ2)と、
関数ブロック記憶手段の関数ブロックと、プログラムを実行する機能により実行中のプログラムの関数コールシーケンスを比較し、異なる箇所を検出し、比較結果記憶手段に格納する比較ステップ(ステップ3)と、を行う。
The present invention (Claim 5) is a program operation comparison method for finding a difference in operation of a program,
The execution file of the executed program is acquired by a function (program execution means) that changes the execution file of the program so that the program itself can output the execution history of the function, and the program is executed. A program execution history collection step (step 1) stored in
A program execution history in which the execution history of the program in the execution history storage means is divided into function blocks based on the depth of the function call stack of the executed program and the appearance pattern, and stored in the function block storage means A division step (step 2);
The function block of the function block storage means is compared with the function call sequence of the program being executed by the function for executing the program, and a comparison step (step 3) is performed in which a different part is detected and stored in the comparison result storage means. .

また、本発明(請求項6)は、プログラム実行履歴収集ステップ(ステップ1)において、
プログラムの実行履歴として取得する関数について、該関数についての情報を収集するためのプログラムの実行ファイルを変更する実行ファイル変更ステップと、
呼ばれた関数から呼び出し元に戻るときの時刻、呼ばれた関数内で変更された引数、返り値を取得するデバッグ情報取得ステップと、
プログラムの実行ファイル内で定義されている関数や、ユーザが指定した共有ライブラリの関数について、該プログラムがプログラムを実行する機能により実行された時刻、関数名、引数、コールスタックの深さの値、返り値を含む情報を取得し、取得した情報を実行履歴記憶手段に登録する実行履歴収集ステップと、を行う。
The present invention (Claim 6) provides a program execution history collection step (Step 1).
An execution file change step for changing an execution file of a program for collecting information about the function for a function acquired as a program execution history;
Debug information acquisition step to acquire the time when returning from the called function to the caller, arguments changed in the called function, return value,
For functions defined in the executable file of the program and functions of the shared library specified by the user, the time when the program was executed by the function that executes the program, the function name, the argument, the value of the depth of the call stack, An execution history collection step of acquiring information including a return value and registering the acquired information in the execution history storage means is performed.

また、本発明(請求項7)は、プログラム実行履歴分割ステップ(ステップ2)において、
実行履歴記憶手段に格納されている履歴情報を読み込んで、関数の呼び出しのみに着目し、呼び出した関数のコールスタックの深さの値が小さくなったところで区切り、区切られた箇所を1つの関数ブロックとする実行履歴区分ステップと、
関数ブロック内の関数がその実行順序も含め同一となる関数ブロックが存在するかを検索し、存在する場合は、その次の関数ブロックについても関数ブロック内の関数がその実行順序も含め、同一であるかを調べる処理を繰り返し、同一である関数ブロックが存在した場合には、その一連の長さが最も長い関数ブロックに対して、複数の関数ブロックを1つの関数ブロックとしてまとめ、関数ブロック記憶手段に登録するステップと、
関数ブロック内の関数の引数、返り値が、全ての関数において同一か、同一の値を持つ関数が存在するか、全ての関数において異なっているかを関数と関連付けした関数ブロック記憶手段に登録するステップと、を行う。
Further, according to the present invention (Claim 7), in the program execution history dividing step (Step 2),
Reads history information stored in the execution history storage means, pays attention only to function calls, delimits when the call stack depth value of the called function becomes smaller, and separates the delimited points into one function block An execution history classification step, and
A search is performed for a function block in which a function in the function block is the same including the execution order. If there is, the function in the function block is also the same in the function block including the execution order. When there is a function block having the same length as a result of repeating the process of checking whether there is a function block, a plurality of function blocks are collected as one function block for the function block having the longest series of lengths, and function block storage means Registering with
A step of registering in a function block storage means associated with a function whether the arguments and return values of the functions in the function block are the same in all functions, whether there is a function having the same value, or different in all functions And do.

また、本発明(請求項8)は、比較ステップ(ステップ3)において、
関数ブロック記憶手段から関数ブロックを読み出して、該関数ブロックとプログラムを実行する機能により実行中のプログラムの関数コールシーケンスを比較することにより、該実行中のプログラムの動作がユーザの想定した動作と異なる箇所を検出するステップと、
関数コールシーケンスのみの比較では異なる箇所が検出できなかった場合に、関数ブロック内の実行された関数の引数や返り値と、実行中のプログラムが実行した関数の引数や返り値を比較することにより、該実行中のプログラムの動作がユーザの想定した動作と異なる箇所を検出するステップと、を行う。
Further, the present invention (Claim 8) provides a comparison step (Step 3).
By reading the function block from the function block storage means and comparing the function call sequence of the program being executed with the function to execute the program with the function block, the operation of the program being executed differs from the operation assumed by the user. Detecting the location;
By comparing the function call sequence alone, if a different part cannot be detected, the argument and return value of the executed function in the function block are compared with the argument and return value of the function executed by the executing program. And detecting a location where the operation of the program being executed differs from the operation assumed by the user.

本発明(請求項9)は、請求項1乃至4のいずれか1項に記載のプログラム動作比較装置を構成する各手段としてコンピュータを機能させるためのプログラム動作比較プログラムである。   The present invention (Claim 9) is a program operation comparison program for causing a computer to function as each means constituting the program operation comparison device according to any one of Claims 1 to 4.

本発明によれば、プログラムが実行中にエラーが発生した場合に、このプログラムの実行情報を自動的に収集することにより、ユーザが能動的にプログラムの動作情報を収集する必要がなくなるため、エラーが発生してからバグを発見するまでの時間を短くすることができる。   According to the present invention, when an error occurs during execution of a program, automatically collecting the execution information of the program eliminates the need for the user to actively collect program operation information. It can shorten the time from occurrence of a bug to finding a bug.

以下、図面と共に本発明の実施の形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

本発明は、プログラム実行履歴収集装置、プログラム実行履歴分割装置、プログラム実行履歴比較装置の各処理を行うことにより、エラーを発見してからそのバグを発見するまでの時間を短くすることを可能とする。具体的には、テストで使用する入力値といった、ユーザが出力結果まで想定できる入力値によって実行した実行履歴を取得し、その実行履歴とエラーが発生した実行履歴を比較することによって、エラーが発生してからバグを発見するまでの時間を短くすることができる。   The present invention makes it possible to shorten the time from the discovery of an error to the discovery of the bug by performing each process of the program execution history collection device, the program execution history division device, and the program execution history comparison device. To do. Specifically, an error occurs by obtaining an execution history executed with input values that can be assumed by the user, such as input values used in the test, and comparing the execution history with the execution history in which an error occurred. You can shorten the time from when you find a bug.

以下、「関数コールシーケンス」とは、プログラムが実行した関数についての実行履歴であり、プログラムが実行されてから終了するまでの間に、実行された関数の順番である。   Hereinafter, the “function call sequence” is an execution history of a function executed by the program, and is an order of the functions executed between the execution of the program and the termination.

「特異性の高い関数」とは、同一プログラムによって作成された関数コールシーケンス内に呼び出し関係が同一となる関数が存在しない、または、最も実行率が低い関数のことである。特異性の高い関数ブロックについても、特異性の高い関数と同意である。   A “highly specific function” is a function in which there is no function having the same calling relationship in a function call sequence created by the same program or the execution rate is the lowest. A highly specific function block is also in agreement with a highly specific function.

[プログラム実行履歴収集装置]
図3は、本発明の一実施の形態におけるプログラム実行履歴収集装置の構成を示す。
[Program execution history collection device]
FIG. 3 shows the configuration of the program execution history collection apparatus according to the embodiment of the present invention.

プログラム実行履歴収集装置100は、プログラム自身が自身のメモリ上のデータを出力するようにメモリにロードされた実行ファイル10を変更する。変更するタイミングは、メモリにロードされた直後(プログラムのmain関数が実行される前)、または、プログラムが実行中の場合は、OSの機能を使用してプログラムを停止させた時である。また、出力するデータは、実行された時刻、関数名、引数、返り値である。   The program execution history collection device 100 changes the execution file 10 loaded in the memory so that the program itself outputs data on its own memory. The timing of the change is immediately after being loaded into the memory (before the main function of the program is executed) or when the program is being executed, when the program is stopped using the function of the OS. The output data includes the time when the function was executed, the function name, the argument, and the return value.

同図に示すプログラム実行履歴収集装置(ロガー装置)100は、実行ファイル変更部110、デバッグ情報取得部120、実行履歴収集部130、実行履歴を取得する実行ファイルリスト140、シンボル情報格納部150、デバッグ情報格納部160、レジスタリスト170、実行履歴格納部180から構成される。また、同図の左側に従来の実行環境を示す。従来の実行環境は、メモリにロードされた実行ファイル10、プログラムの実行ファイル20、ライブラリの実行ファイル30、プログラム実行部40から構成されている。   The program execution history collection device (logger device) 100 shown in FIG. 1 includes an execution file change unit 110, a debug information acquisition unit 120, an execution history collection unit 130, an execution file list 140 that acquires an execution history, a symbol information storage unit 150, It comprises a debug information storage unit 160, a register list 170, and an execution history storage unit 180. The conventional execution environment is shown on the left side of the figure. The conventional execution environment includes an execution file 10 loaded in a memory, a program execution file 20, a library execution file 30, and a program execution unit 40.

まず、実行ファイル変更部110で行う処理手順を説明する。   First, a processing procedure performed by the executable file changing unit 110 will be described.

図4は、本発明の一実施の形態における実行ファイル変更処理のフローチャートである。   FIG. 4 is a flowchart of the execution file change process according to the embodiment of the present invention.

ステップ110) まず、実行ファイル変更部110は、プログラム実行ファイル20内に定義されている関数の実行履歴を記録するか否か、ライブラリ実行ファイル30内のライブラリ関数を記録するか否か、さらに、ライブラリ内で定義されている関数の実行履歴を記録するか否かをユーザに問い合わせ、記録しない場合は、ステップ130に移行し、取得する場合は、ステップ120に移行する。   Step 110) First, the execution file changing unit 110 determines whether to record the execution history of the function defined in the program execution file 20, whether to record the library function in the library execution file 30, and The user is inquired whether to record the execution history of the function defined in the library. If not, the process proceeds to step 130. If acquired, the process proceeds to step 120.

ステップ120) プログラム自身がプログラム実行履歴収集装置100(ロガー)に対して実行した実行ファイル内の関数に関する情報を出力するようにプログラムの実行ファイルを変更する。   Step 120) The execution file of the program is changed so as to output information on the function in the execution file executed by the program itself to the program execution history collection device 100 (logger).

ステップ130) ループAの処理として、まず、初期値i=0(増分1)、終値をユーザから指定されたアプリケーションを監視するライブラリ数とする。   Step 130) As processing of loop A, first, an initial value i = 0 (increment 1), and a closing price is set to the number of libraries for monitoring an application designated by the user.

ステップ140) プログラム自身がプログラム実行履歴収集装置100に対してライブラリのアプリケーションが実行された関数に関する情報を出力するように、プログラムの実行ファイル20を変更する。   Step 140) The program execution file 20 is changed so that the program itself outputs information related to the function executed by the library application to the program execution history collection apparatus 100.

ループAの処理として、i=i+1として、終値になるまで、ステップ140を繰り返す。   As processing of loop A, i is set to i + 1, and step 140 is repeated until the closing price is reached.

ステップ150) ループBとして、初期値i=0(増分1)、終値をユーザから指定されたライブラリ内に記述されている関数を監視するライブラリ数とする。   Step 150) As loop B, the initial value i = 0 (increment 1) and the final value are the number of libraries to monitor the functions described in the library designated by the user.

ステップ160) ユーザにより指定されたライブラリ自身がプログラム実行履歴収集装置100に対して実行したライブラリ内の関数に関する情報を出力するように、ライブラリの実行ファイル30を変更する。   Step 160) The library execution file 30 is changed so that the library itself specified by the user outputs information on the functions in the library executed by the program execution history collection apparatus 100.

ループbの処理として、i=i+1として、終値になるまで、ステップ160を繰り返す。   As processing of loop b, i = i + 1 and step 160 is repeated until the closing price is reached.

図5は、本発明の一実施の形態における実行ファイル変更部の概要動作のフローチャートである。   FIG. 5 is a flowchart of an outline operation of the executable file changing unit in the embodiment of the present invention.

ステップ2010) ディスクからメモリに実行ファイル20をロードする。   Step 2010) The execution file 20 is loaded from the disk into the memory.

ステップ2020) 実行ファイル20内に定義されている関数の実行履歴を取得する場合は、ステップ2030に移行し、取得しない場合は当該処理を終了する。   Step 2020) When the execution history of the function defined in the execution file 20 is acquired, the process proceeds to Step 2030, and when not acquired, the process is terminated.

ステップ2030) ディスクから実行ファイルを読み出す。   Step 2030) The executable file is read from the disk.

ステップ2040) ループA'として、静的にリンクされる関数のシンボルテーブルの各レコードに対しての処理を行う。   Step 2040) As loop A ′, processing is performed for each record in the symbol table of the statically linked function.

ステップ2050) レコードがmain関数である場合は、ステップ2040に戻り、双でない場合は、ステップ2060に移行する。   Step 2050) If the record is a main function, the process returns to Step 2040. If the record is not a pair, the process proceeds to Step 2060.

ステップ2060) シンボル情報をシンボル情報格納部150に登録する。   Step 2060) The symbol information is registered in the symbol information storage unit 150.

ステップ2070) メモリにロードされた実行ファイル中に登録した関数を呼び出す機械語命令があるかを判定し、ある場合は、ステップ2080に移行し、ない場合は、ステップ20120に移行する。   Step 2070) It is determined whether or not there is a machine language instruction for calling the registered function in the execution file loaded in the memory. If there is, the process proceeds to Step 2080, and if not, the process proceeds to Step 20120.

ステップ2080) メモリにロードされた実行ファイルの関数を読み出す機械語命令を実行履歴収集部130を実行する命令と置き換える。   Step 2080) The machine language instruction for reading the function of the execution file loaded in the memory is replaced with an instruction for executing the execution history collecting unit 130.

ステップ2090) シンボル情報格納部150に、メモリ上の実行ファイルを変更した箇所に着いての情報を登録する。   Step 2090) The information about the location where the execution file on the memory is changed is registered in the symbol information storage unit 150.

ステップ20100) メモリにロードされた実行ファイル中に、実行ファイルを変更した箇所へ分岐する機械語命令があるかを判定し、ある場合は、ステップ20110に移行し、ない場合は、ステップ2070に移行する。   Step 20100) It is determined whether there is a machine language instruction for branching to the location where the execution file is changed in the execution file loaded in the memory. If there is, the process proceeds to Step 20110, and if not, the process proceeds to Step 2070. To do.

ステップ20110) 分岐する命令を、変更処理にあわせ、分岐先のアドレスを修正し、ステップ20100に移行する。   Step 20110) The branch instruction is corrected in accordance with the change processing of the branch instruction, and the process proceeds to Step 20100.

ステップ20120) デバッグ情報取得部120(図8)の処理を行う。   Step 20120) The debug information acquisition unit 120 (FIG. 8) performs processing.

これにより、プログラム実行部40がmain関数を実行して処理を終了する。   As a result, the program execution unit 40 executes the main function and ends the process.

上記のプログラム実行履歴収集装置100の実行ファイル変更部110の処理を詳しく説明する。   The processing of the execution file changing unit 110 of the program execution history collection device 100 will be described in detail.

図6は、本発明の一実施の形態における実行ファイル変更部の詳細動作のフローチャートである。   FIG. 6 is a flowchart of detailed operation of the executable file changing unit according to the embodiment of the present invention.

まず、実行ファイル変更部110に、実行履歴を取得する実行ファイルリストが格納されたメモリまたはディスク140から処理対象が選択されると、プログラムの実行ファイル20がロードされるものとする。   First, it is assumed that the execution file 20 of the program is loaded when a processing target is selected from the memory or the disk 140 in which the execution file list for acquiring the execution history is stored in the execution file changing unit 110.

ステップ1210) ユーザがプログラムを起動すると、ディスクからメモリにプログラムをロードする。   Step 1210) When the user starts the program, the program is loaded from the disk into the memory.

ステップ1220) 実行履歴を取得する実行ファイルリスト(メモリ)140から実行ファイル20内に定義されている関数の実行履歴を取得するか否かの情報を取得する。なお、システムの環境変数から、実行ファイル20内に定義された関数を取得するか否かを取得する。このとき、以下の2つの情報も取得する。   Step 1220) Information on whether or not to acquire the execution history of the function defined in the execution file 20 is acquired from the execution file list (memory) 140 for acquiring the execution history. Whether or not to acquire a function defined in the execution file 20 is acquired from the environment variable of the system. At this time, the following two pieces of information are also acquired.

・動的リンク時に使用するライブラリのAPIの実行履歴を取得するライブラリ名;
・動的リンクされるライブラリ内で定義されている関数の実行履歴を取得するライブラリ名:
ディスクに設定ファイルを作成し、設定ファイルからこれらの情報を読み出す方式にすることもできる。
-Library name for acquiring API API execution history for dynamic linking;
-Library name for acquiring the execution history of functions defined in dynamically linked libraries:
It is also possible to create a setting file on the disk and read out this information from the setting file.

ステップ1230) 実行ファイル20内に定義されている関数の実行履歴を取得するか否かの問い合わせとして、実行ファイル20の静的リンク(ELFの.symtabセクションに定義されている)関数の実行履歴を取得するか判定し、取得する場合はステップ1240に移行し、取得しない場合は処理を終了する。   Step 1230) As an inquiry as to whether or not to acquire the execution history of the function defined in the execution file 20, the execution history of the static link function (defined in the .symtab section of the ELF) of the execution file 20 is obtained. It is determined whether or not to acquire. If acquired, the process proceeds to step 1240. If not acquired, the process ends.

ステップ1240) ディスクから実行ファイル20を読み出す。   Step 1240) The executable file 20 is read from the disk.

ステップ1250) 次に、関数の静的シンボル情報についての処理として、ディスクから読み出した実行ファイル20内の静的シンボルテーブル(ELFの.symtabセクション)から関数に関するシンボル数を取得する(symnum←静的リンク関数の数)。   Step 1250) Next, as processing for the static symbol information of the function, the number of symbols related to the function is obtained from the static symbol table (ELF .symtab section) in the executable file 20 read from the disk (symnum ← static Number of link functions).

ステップ1260) 初期値をi=0とし、i=symnumとするループAの処理を行う。   Step 1260) Loop A is processed with i = 0 as the initial value and i = symnum.

ステップ1270) 静的シンボルテーブルのi番目のシンボル情報を取得する(symbol←i番目のシンボル情報)。   Step 1270) The i-th symbol information of the static symbol table is acquired (symbol ← i-th symbol information).

ステップ1280) symbolが関数のシンボル情報かを判定し、そうであればステップ1290に移行し、そうでない場合はステップ1260に移行する。   Step 1280) It is determined whether symbol is symbol information of a function. If so, the process proceeds to Step 1290, and if not, the process proceeds to Step 1260.

ステップ1290) symbol がmain関数のシンボル情報かを判定し、そうであれば、ステップ1260に移行し、そうでなければステップ12100に移行する。   Step 1290) It is determined whether symbol is symbol information of the main function. If so, the process proceeds to Step 1260; otherwise, the process proceeds to Step 12100.

ステップ12100) 取得したシンボル情報をシンボル情報格納部150に登録する。シンボル情報格納部150に登録する情報は、関数名とマッピングされるアドレスである。   Step 12100) The acquired symbol information is registered in the symbol information storage unit 150. Information registered in the symbol information storage unit 150 is an address mapped with a function name.

ステップ12110) メモリにロードされた実行ファイル10のプログラムの機械語命令(ELFの.textセクション)内にシンボル情報格納部150に登録していない、symbolを呼び出す機械語命令(i.e. call命令、jmp命令等)があるかを判定し、ある場合は、ステップ12130に移行する。ない場合はステップ12170に移行する。   Step 12110) A machine language instruction (ie call instruction, jmp instruction) for calling a symbol not registered in the symbol information storage unit 150 in the machine language instruction (ELF .text section) of the program of the execution file 10 loaded in the memory Etc.), and if so, the process proceeds to step 12130. If not, the process proceeds to step 12170.

ステップ12120) メモリにロードされた実行ファイル10のsymbolを呼び出す機械語命令を実行履歴収集部130を実行する命令と置き換える。   Step 12120) The machine language instruction for calling the symbol of the execution file 10 loaded in the memory is replaced with an instruction for executing the execution history collection unit 130.

ステップ12130) シンボル情報格納部150に以下の情報を登録する。   Step 12130) The following information is registered in the symbol information storage unit 150.

・symbolを呼び出す命令のアドレス;
・置き換えた元の機械語命令;
・置き換えた後のリターンアドレス(関数実行履歴取得部を実行する命令の次の命令のアドレス);
ステップ12140) 「置き換えた元の機械語命令」に、「置き換えた元の機械語命令」の次の命令のアドレスにジャンプする命令(jmp)を追加する。
The address of the instruction that calls the symbol;
-Original machine language instruction replaced;
-Return address after replacement (the address of the instruction next to the instruction that executes the function execution history acquisition unit);
Step 12140) An instruction (jmp) for jumping to the address of the instruction next to the “replaced original machine language instruction” is added to the “replaced original machine language instruction”.

ステップ12150) メモリにロードされた実行ファイル10のプログラムの機械語命令(ELFの.textセクション)内に置き換えられた命令にjmpする機械語命令があるかを判定し、ある場合は、ステップ12160に移行し、ない場合は、ステップ12110に移行する。   Step 12150) It is determined whether there is a machine language instruction to jmp in the replaced instruction in the machine language instruction (ELF .text section) of the program of the execution file 10 loaded in the memory. If not, go to Step 12110.

ステップ12160) メモリにロードされた実行ファイル10のジャンプ(jmp)する機械語命令のオペランドとなるアドレスの値を、シンボル情報格納部150に登録した「置き換えた元の機械語命令」のアドレスに置き換え、ステップ12150に戻る。   Step 12160) The value of the address serving as the operand of the machine language instruction to be jumped (jmp) in the execution file 10 loaded in the memory is replaced with the address of the “replaced original machine language instruction” registered in the symbol information storage unit 150. Return to step 12150.

ステップ12170) デバッグ情報取得部120の処理を行い、プログラム実行部40がmain関数を実行して処理を終了する。   Step 12170) The debug information acquisition unit 120 performs processing, and the program execution unit 40 executes the main function and ends the processing.

これにより出力される結果を図7に示す。シンボル情報格納部150には、関数名とマッピングされるアドレスが格納される。ここで、マッピングされるアドレスとしては、
・関数を呼び出す命令のアドレス;
・置き換えた元の機械語命令;
・置き換えた後のリターンアドレス;
等である。
The output result is shown in FIG. The symbol information storage unit 150 stores an address mapped with a function name. Here, as an address to be mapped,
The address of the instruction that calls the function;
-Original machine language instruction replaced;
・ Return address after replacement;
Etc.

次に、プログラム実行履歴収集装置100のデバック情報取得部120の動作を詳細に説明する。デバッグ情報取得部120は、実行された関数の引数、返り値の情報を、正確に取得するために必要となる情報(返り値や引数の型情報、引数の格納場所)を取得する処理部である。   Next, the operation of the debug information acquisition unit 120 of the program execution history collection device 100 will be described in detail. The debug information acquisition unit 120 is a processing unit that acquires information (return value, argument type information, argument storage location) necessary to accurately acquire the argument and return value information of the executed function. is there.

なお、以下の説明における「実行ファイル」とは、プログラムの実行ファイル20、ライブラリの実行ファイル30の両者を指すものとする。   In the following description, “execution file” refers to both the execution file 20 of the program and the execution file 30 of the library.

また、「コンパイルユニット」とは、ソースファイルの情報である。コンパイルユニットは、ソースファイルで定義されている関数、グローバル変数、構造体などについて、名前、型情報、使用するレジスタ、使用するメモリの位置などの情報が関連付けて格納されている。   The “compile unit” is information of a source file. The compile unit stores information such as names, type information, registers to be used, and memory locations to be used in association with functions, global variables, structures, and the like defined in the source file.

当該デバッグ情報取得部120には、プログラムの実行のファイルが入力値となる。図10にデバッグ情報の例を示す。サンプルソースコード(a)をGCCでコンパイルした場合、func()のデバッグ情報は、(b)GCCが付加するfunc()についてのデバッグ情報(DWARF)となる。   In the debug information acquisition unit 120, a program execution file becomes an input value. FIG. 10 shows an example of debug information. When the sample source code (a) is compiled by GCC, the debug information of func () is (b) debug information (DWARF) about func () added by GCC.

図8は、本発明の一実施の形態におけるデバッグ情報取得部の概要動作のフローチャートである。   FIG. 8 is a flowchart of an outline operation of the debug information acquisition unit according to the embodiment of the present invention.

ステップ2110) ディスクから実行ファイル20,30を読み出す。   Step 2110) The executable files 20 and 30 are read from the disk.

ステップ2120) 実行ファイル20,30にデバッグ情報が含まれているかを判定し、含まれている場合には、ステップ2130に移行し、含まれていない場合は当該処理を終了する。   Step 2120) It is determined whether or not debug information is included in the execution files 20 and 30. If included, the process proceeds to Step 2130. If not included, the process is terminated.

ステップ2130) デバッグ情報格納部160にデバッグ位置情報を登録する。   Step 2130) The debug position information is registered in the debug information storage unit 160.

ステップ2140) 登録していないコンパイルユニットの情報があるかを判定し、ある場合はステップ2150に移行し、ない場合は、当該処理を終了する。   Step 2140) It is determined whether there is information on a compile unit that has not been registered. If there is, information is transferred to Step 2150, and if not, the processing is terminated.

ステップ2150) デバッグ情報格納部160に、コンパイルユニットのデバッグ情報を登録する。   Step 2150) The debug information of the compilation unit is registered in the debug information storage unit 160.

ステップ2160) 取得したコンパイルユニットについて、登録していない関数の情報があるかを判定し、ある場合はステップ2170に移行し、無い場合はステップ2140に移行する。   Step 2160) It is determined whether there is information on an unregistered function for the obtained compilation unit. If there is, information is transferred to Step 2170, and if there is not, information is transferred to Step 2140.

ステップ2170) デバッグ情報格納部160に関数のデバッグ情報を登録する。   Step 2170) The function debug information is registered in the debug information storage unit 160.

ステップ2180) 取得した関数について登録していない引数の情報があるかを判定し、ある場合はステップ2190に移行し、無い場合はステップ2160に移行する。   Step 2180) It is determined whether there is argument information that is not registered for the acquired function. If there is, information is transferred to Step 2190. If there is not, information is transferred to Step 2160.

図9は、本発明の一実施の形態におけるデバッグ情報取得部の詳細動作のフローチャートである。   FIG. 9 is a flowchart of detailed operation of the debug information acquisition unit according to the embodiment of the present invention.

ステップ13010) ディスクから実行ファイル20,30を読み出す。   Step 13010) The executable files 20 and 30 are read from the disk.

ステップ13020) 実行ファイル20,30にデバッグ情報が含まれているかを判定する。ここで、デバッグ情報とは、変数などの型情報であり、この情報が含まれているか否かを判定する。含まれている場合はステップ1330に移行し、含まれていない場合はその処理を終了する。   Step 13020) It is determined whether or not the execution files 20 and 30 include debug information. Here, the debug information is type information such as variables, and it is determined whether or not this information is included. If it is included, the process proceeds to step 1330. If it is not included, the process ends.

ステップ1330) 引数の値を正確に取得するため、実行中に格納場所が変更される場合の、引数の格納場所を示す情報を取得するために、実行ファイル20,30のデバッグ位置情報テーブル(.debug_locセクション)にデバッグ情報格納部160に登録されていないレコードがあるかを判定し、ある場合はステップ1340に移行し、ない場合はステップ1360に移行する。   Step 1330) In order to obtain the argument value accurately, in order to obtain information indicating the storage location of the argument when the storage location is changed during execution, the debug location information table (. It is determined whether there is a record that is not registered in the debug information storage unit 160 in the debug_loc section). If there is a record, the process proceeds to step 1340, and if not, the process proceeds to step 1360.

ステップ1340) 登録されていないレコードを取得する。   Step 1340) Acquire records that are not registered.

ステップ1350) デバッグ情報格納部160に取得したレコード内の情報を登録し、ステップ303に戻る。登録する情報は、
・オフセット;
・有効アドレスの範囲;
・格納場所(レジスタ名、ベースポインタからの距離);
である。
Step 1350) The information in the acquired record is registered in the debug information storage unit 160, and the process returns to Step 303. The information to register is
·offset;
-Valid address range;
-Storage location (register name, distance from base pointer);
It is.

ステップ1360) 引数の値を正確に取得するため、引数、返り値の型情報と、引数の格納場所を示す情報を取得する。このとき、実行ファイル20,30のデバッグ情報テーブル(.debug_infoセクション)に、デバッグ情報格納部160に登録していないコンパイルユニットレコードがあるかを判定し、ある場合はステップ1370に移行し、ない場合は処理を終了する。   Step 1360) In order to accurately acquire the value of the argument, the type information of the argument and the return value, and information indicating the storage location of the argument are acquired. At this time, it is determined whether or not there is a compile unit record that is not registered in the debug information storage unit 160 in the debug information table (.debug_info section) of the executable files 20 and 30. Ends the process.

ステップ1370) デバッグ情報テーブルから登録していないコンパイルユニットのレコードを取得する(cu←取得したコンパイルユニットのレコード)。   Step 1370) The record of the compile unit that is not registered is acquired from the debug information table (cu ← record of the acquired compile unit).

ステップ1380) デバッグ情報格納部160に、cu内の情報を登録する。登録する情報は、
・ソースファイル名;
・コンパイル時のディレクトリ名;
である。
Step 1380) The information in the cu is registered in the debug information storage unit 160. The information to register is
-Source file name;
・ Compile directory name;
It is.

ステップ1390) 実行ファイル20,30のデバッグ情報テーブル(.debug_infoセクション)にデバッグ情報格納部160に登録していないcuに関連付けて格納されている関数のレコードがあるかを判定し、ある場合はステップ13100に移行し、ない場合はステップ1360に移行する。   Step 1390) It is determined whether or not there is a record of a function stored in association with the cu not registered in the debug information storage unit 160 in the debug information table (.debug_info section) of the executable files 20 and 30. The process proceeds to step 13100. Otherwise, the process proceeds to step 1360.

ステップ13100) cuに関連付けて格納されている関数のうち、登録していない関数のレコードを取得する(function←取得した関数のレコード)。   Step 13100) Among the functions stored in association with cu, a record of a function that has not been registered is obtained (function ← obtained function record).

ステップ13110) デバッグ情報格納部160にfunction内の情報を登録し、ステップ13120に移行する。登録する情報は、
・関数名;
・マッピングされるアドレス範囲;
・ソースファイルに記述されている位置;
・返り値の型情報;
である。
Step 13110) The information in the function is registered in the debug information storage unit 160, and the process proceeds to Step 13120. The information to register is
・ Function name;
The mapped address range;
-The position described in the source file;
・ Return value type information;
It is.

ステップ13120) 実行ファイル20,30のデバッグ情報テーブル(.debug_infoセクション)にデバッグ情報格納部160に登録していないfunctionの引数のレコードがあるかを判定し、ある場合はステップ13130に移行し、ない場合は、ステップ1390に移行する。   Step 13120) It is determined whether or not there is a function argument record that is not registered in the debug information storage unit 160 in the debug information tables (.debug_info section) of the executable files 20 and 30. If yes, go to Step 1390.

ステップ13130) functionの引数のうち、登録していない引数のレコードを取得する(argument←取得した引数のレコード)。   Step 13130) Among the arguments of function, the record of the argument that is not registered is acquired (argument ← the record of the acquired argument).

ステップ13140) デバッグ情報格納部160にargument内の情報を登録し、ステップ13120に移行する。登録する情報は、
・引数名;
・ソースファイルに記述されている位置;
・型情報;
・値の格納場所(レジスタ名、ベースポインタからの距離、デバッグ位置情報テーブルのオフセット);
である。関数を実行中に格納場所が変更されない変数や引数の「値の格納場所」には、「レジスタ名」、「ベースポインタから距離」がデバッグ情報テーブルに登録されている。変更される変数や引数の「値の格納場所」には、「デバッグ位置情報テーブルのオフセット」がデバッグ情報に登録されている。「レジスタ」は、値が格納されているレジスタを示す。「ベースポインタからの距離」は、ベースポインタから距離、つまり、メモリ上の位置を示す。
Step 13140) The information in the argument is registered in the debug information storage unit 160, and the process proceeds to Step 13120. The information to register is
・ Argument name;
-The position described in the source file;
・ Type information;
-Value storage location (register name, distance from base pointer, offset of debug position information table);
It is. “Register name” and “distance from base pointer” are registered in the debug information table in “value storage location” of variables and arguments whose storage location is not changed during execution of the function. In the “value storage location” of the variable or argument to be changed, “debug position information table offset” is registered in the debug information. “Register” indicates a register in which a value is stored. “Distance from the base pointer” indicates a distance from the base pointer, that is, a position on the memory.

上記の図9に示すデバッグ情報取得部120の処理により、図11に示すデータがデバッグ情報格納部160に格納される。   The data shown in FIG. 11 is stored in the debug information storage unit 160 by the processing of the debug information acquisition unit 120 shown in FIG.

次に実行ファイル20,30を変更した後に、プログラムを実行し、実行履歴収集部130が実行履歴を取得する処理について説明する。   Next, a process of executing the program after the execution files 20 and 30 are changed, and the execution history collection unit 130 acquiring the execution history will be described.

図12は、本発明の一実施の形態における実行履歴収集部の概要動作のフローチャートである。   FIG. 12 is a flowchart of an outline operation of the execution history collection unit in the embodiment of the present invention.

ステップ2210) レジスタリスト170にプログラムの実行状態を保持する。   Step 2210) The program execution state is held in the register list 170.

ステップ2220) 実行しているプログラムにデバッグ情報が付加されているかを判定し、付加されている場合には、ステップ2260に移行し、付加されていない場合はステップ2230に移行する。   Step 2220) It is determined whether debug information is added to the program being executed. If it is added, the process proceeds to Step 2260, and if not, the process proceeds to Step 2230.

ステップ2230) 実行履歴格納部180に実行した関数の情報を登録する。   Step 2230) Information of the executed function is registered in the execution history storage unit 180.

ステップ2240) 保持したプログラムの状態を復元する。   Step 2240) The state of the retained program is restored.

ステップ2250) フックした関数に対してjmp命令を実行し、処理を終了する。   Step 2250) The jmp instruction is executed for the hooked function, and the process is terminated.

ステップ2260) ステップ2220において、実行しているプログラムにデバッグ情報が付加されている場合は、実行しようとした関数について、引数を取得する。   Step 2260) When debug information is added to the program being executed in Step 2220, an argument is acquired for the function to be executed.

ステップ2270) 実行履歴格納部180に実行された引数の情報を登録する。   Step 2270) The information of the executed argument is registered in the execution history storage unit 180.

ステップ2280) 保持したプログラムの状態を保持する。   Step 2280) The state of the retained program is retained.

ステップ2290) フックした関数に対してcall命令を実行する。   Step 2290) A call instruction is executed for the hooked function.

ステップ22100) レジスタリスト170にプログラムの実行状態を保持する。   Step 22100) The program execution state is held in the register list 170.

ステップ22110) 実行履歴格納部180に実行した関数についての情報を登録する。   Step 22110) Information on the executed function is registered in the execution history storage unit 180.

ステップ22120) 保持したプログラムの状態を復元する。   Step 22120) The stored program state is restored.

ステップ22130) ret命令を実行し、当該処理を終了し、プログラム実行部に制御を移行する。   Step 22130) The ret instruction is executed, the process is terminated, and control is transferred to the program execution unit.

図13は、本発明の一実施の形態における実行履歴収集部の詳細動作のフローチャートである。   FIG. 13 is a flowchart of detailed operation of the execution history collection unit according to the embodiment of the present invention.

ステップ1410) プログラム実行部40が履歴を取得する関数を実行すると、実行履歴収集部130は、メモリ上のレジスタリスト170に汎用レジスタとインデックスレジスタを退避し、現状のプログラムの実行状態を保持する。   Step 1410) When the program execution unit 40 executes a function for acquiring a history, the execution history collection unit 130 saves the general-purpose registers and index registers in the register list 170 on the memory, and holds the current program execution state.

例えば、Intel x86アーキテクチャでは「汎用レジスタ」は、
−eax,ebx,ecx,edx
であり、「インデックスレジスタ」は、
−esi,edi
である。
For example, in the Intel x86 architecture, “general-purpose registers”
−eax, ebx, ecx, edx
And the “index register”
−esi, edi
It is.

ステップ1420) デバッグ情報がプログラムに付加されていたかを確認するために、デバッグ情報格納部160にフックされた関数のレコードが登録されているかを判定し、登録されている場合はステップ14110に移行し、登録されていない場合は、ステップ1430に移行する。   Step 1420) In order to confirm whether or not the debug information has been added to the program, it is determined whether or not the record of the hooked function is registered in the debug information storage unit 160. If registered, the process proceeds to Step 14110. If not registered, the process proceeds to step 1430.

ステップ1430) シンボル情報格納部150からフックされた関数のレコードを読み出す。   Step 1430) The record of the hooked function is read from the symbol information storage unit 150.

ステップ1440) 実行された関数に関する情報として、情報を実行履歴格納部180に登録するために、読み出したレコードの関数名、マッピングされるアドレスを実行履歴格納部180に登録する。   Step 1440) In order to register information on the executed function in the execution history storage unit 180, the function name of the read record and the mapped address are registered in the execution history storage unit 180.

ステップ1450) スタックレジスタ、ベースレジスタをSTART時の状態に戻す。   Step 1450) The stack register and base register are returned to the state at the time of START.

ステップ1460) レジスタリスト170から汎用レジスタとインデックスレジスタを復元する。   Step 1460) The general-purpose register and the index register are restored from the register list 170.

ステップ1470) 「置き換えた元の機械語命令」が2命令以上である場合は、ステップ1480に移行し、そうでない場合は、ステップ1490に移行する。   Step 1470) If the “replaced original machine language instruction” is 2 instructions or more, the process proceeds to step 1480, and if not, the process proceeds to step 1490.

ステップ1480) メモリ上のスタックの戻り値を「置き換えた元の機械語命令」の実行履歴取得部を実行する命令の次の命令に変更する。   Step 1480) The return value of the stack on the memory is changed to the instruction next to the instruction that executes the execution history acquisition unit of the “replaced original machine language instruction”.

ステップ1490) フックした関数に対してjmp命令を実行する。これにより特定のプログラムの実行状態を復元する。   Step 1490) The jmp instruction is executed for the hooked function. As a result, the execution state of the specific program is restored.

ステップ14110) ステップ1420において、デバッグ情報格納部160にフックされた関数のレコードが登録されている場合は、実行された関数の引数の値を取得するために、デバッグ情報格納部160から、フックした関数のレコード、フックした関数の引数のレコードを取得する。   Step 14110) In step 1420, when the record of the hooked function is registered in the debug information storage unit 160, the hook information is hooked from the debug information storage unit 160 to obtain the argument value of the executed function. Get function record and argument record of hooked function.

ステップ14120) 値を取得していない引数のレコードがあるかを判定し、ある場合は、ステップ14130に移行し、ない場合はステップ14140に移行する。   Step 14120) It is determined whether or not there is an argument record for which a value has not been obtained. If there is an argument record, the process proceeds to Step 14130.

ステップ14130) 取得した引数のレコードの情報を用いて、メモリ、または、レジスタリスト170から引数の値を取得し、ステップ14120に戻る。   Step 14130) Using the acquired argument record information, the value of the argument is acquired from the memory or register list 170, and the process returns to Step 14120.

ステップ14140) 実行された関数に関する情報を実行履歴格納部180に登録する。登録される情報は、
・フックした関数の関数名;
・フックした関数のマッピングされるアドレス;
・取得した引数;
である。
Step 14140) The information regarding the executed function is registered in the execution history storage unit 180. Information to be registered
-Function name of hooked function;
The address to which the hooked function is mapped;
-Obtained arguments;
It is.

ステップ14150) 取得した引数のうち、「値の格納場所」がメモリ上となる引数があるかを判定し、ある場合は、ステップ14160に移行し、ない場合はステップ14180に移行する。   Step 14150) Among the acquired arguments, it is determined whether there is an argument whose “value storage location” is in the memory. If there is, the process proceeds to Step 14160. Otherwise, the process proceeds to Step 14180.

ステップ14160) スタックポインタレジスタの値を引数が格納されるサイズだけずらす。   Step 14160) The value of the stack pointer register is shifted by the size in which the argument is stored.

ステップ14170) スタックポインタレジスタから次に関数を呼び出した後のベースポインタレジスタの値を推定し、メモリに保存する。   Step 14170) The value of the base pointer register after the next function call is estimated from the stack pointer register and stored in the memory.

ステップ14180) 実行履歴取得部130がメモリに格納していない「値の格納場所」がメモリとなる引数があるかを判定し、ある場合はステップ14190に移行し、ない場合はステップ14200に移行する。   Step 14180) The execution history acquisition unit 130 determines whether there is an argument that becomes a “value storage location” that is not stored in the memory. If there is an argument, the process proceeds to Step 14190, and if not, the process proceeds to Step 14200. .

ステップ14190) 「値の格納場所」と、推定したベースポインタレジスタの値から、メモリの適切なアドレスに、取得した引数の値を格納し、ステップ14180に戻る。   Step 14190) Stores the value of the argument obtained from “value storage location” and the estimated value of the base pointer register at an appropriate address in the memory, and returns to Step 14180.

ステップ14200) メモリ上のレジスタリスト170から汎用レジスタとインデックスレジスタを復元する。   Step 14200) The general-purpose register and the index register are restored from the register list 170 on the memory.

ステップ14210) フックした関数に対してcall命令を実行する。   Step 14210) A call instruction is executed for the hooked function.

ステップ14220) 現状のプログラムの実行状態を保持するため、メモリ上のレジスタリスト170に、汎用レジスタとインデックスレジスタを退避する。   Step 14220) In order to hold the current execution state of the program, the general-purpose registers and index registers are saved in the register list 170 on the memory.

ステップ14230) 取得した関数のレコードを用いて、汎用レジスタ、または、浮動小数点レジスタから関数の返り値を取得する。   Step 14230) The return value of the function is acquired from the general-purpose register or the floating-point register using the acquired function record.

ステップ14240) プログラム実行履歴格納部180に、実行した関数を登録する。詳しくは、返り値を、ステップ14140で登録したレコードと関連付けて、プログラム実行履歴格納部180に登録する。   Step 14240) The executed function is registered in the program execution history storage unit 180. Specifically, the return value is registered in the program execution history storage unit 180 in association with the record registered in step 14140.

ステップ14250) メモリ上のスタックの戻り値を「置き換えた元の機械語命令」の2番目の命令に変更する。
ステップ14260) シンボル情報格納部150からフックされた関数のレコードを読み出す。
Step 14250) The return value of the stack on the memory is changed to the second instruction of the “original machine language instruction to be replaced”.
Step 14260) The hooked function record is read from the symbol information storage unit 150.

ステップ14270) 保持したプログラムの実行状態を復元するために、メモリ上のレジスタリスト170から汎用レジスタとインデックスレジスタを復元する。   Step 14270) In order to restore the execution state of the stored program, the general-purpose register and the index register are restored from the register list 170 on the memory.

ステップ14280) ret命令を実行し、プログラム実行部40に制御を移行する。   Step 14280) The ret instruction is executed, and control is transferred to the program execution unit 40.

さらに、図4では、プログラム起動時にプログラムを変更しているが、実行中のプログラムに対しても、メモリにロードされた実行ファイル10に実行履歴を取得する処理を挿入することができる。挿入する処理を以下に示す。   Further, in FIG. 4, the program is changed when the program is started, but a process of acquiring an execution history can be inserted into the execution file 10 loaded in the memory even for the program being executed. The process to insert is shown below.

図14は、本発明の一実施の形態における実行中のプログラムの実行ファイルを変更する処理のフローチャートである。   FIG. 14 is a flowchart of processing for changing an execution file of a program being executed according to an embodiment of the present invention.

ステップ1910) まず、実行ファイル変更部110が、プログラムに対してシグナル(SIGSTOP)を配送することにより、実行プログラムを停止する。   Step 1910) First, the execution file changing unit 110 stops the execution program by delivering a signal (SIGSTOP) to the program.

ステップ1920) メモリにロードされた実行プログラムを変更する。   Step 1920) The execution program loaded in the memory is changed.

ステップ1930) 実行ファイル変更部110が、プログラムに対してシグナル(SIGCONT)を配送し、実行プログラムを継続する。   Step 1930) The execution file changing unit 110 delivers a signal (SIGCONT) to the program and continues the execution program.

このとき、従来のデバッガでは、実行ファイルにブレークポイントを設定し、制御をデバッガに強制的に移行させる。しかし、本発明は、プログラム自身が関数の実行履歴を出力するように、プログラムの実行ファイルを変更することにより、ブレークポイントを設定して関数の実行履歴を出力するより、出力に必要となる時間を短くすることができる。   At this time, in the conventional debugger, a breakpoint is set in the execution file, and control is forcibly transferred to the debugger. However, the present invention changes the execution file of the program so that the program itself outputs the function execution history, thereby setting the breakpoint and outputting the function execution history. Can be shortened.

[プログラム実行履歴分割装置]
次に、プログラム実行履歴分割装置について説明する。
[Program execution history dividing device]
Next, the program execution history dividing device will be described.

ユーザが出力結果まで想定できる入力値を用いて、プログラムを実行し、実行履歴を取得する。この取得した実行履歴を実行された関数のコールスタックの深さと、出現パターンに着目し、関数コールシーケンスの局所を関数ブロックと定義する。   The program is executed using the input value that the user can assume up to the output result, and the execution history is acquired. Focusing on the call stack depth and appearance pattern of the executed function in the acquired execution history, the function call sequence local is defined as a function block.

以下に実行履歴の区分処理について説明する。   The execution history classification process will be described below.

図15は、本発明の一実施の形態におけるプログラム実行履歴分割装置の構成を示す。   FIG. 15 shows the configuration of the program execution history dividing apparatus according to one embodiment of the present invention.

プログラム実行履歴分割装置200は、実行履歴を区分する処理を行う。この区分は、関数のコールスタックの深さの値が小さくなる箇所に着目している。それは、スタックのコールスタックの深さの値が、前後と比較し、最も大きくなる関数というのは、実行しているプログラムのサービスを提供するための処理であると言える。その前のコールスタックの深さの値が大きくなっていく部分の関数コールシーケンスは、このサービスを提供する関数の前処理をしている箇所であるといえる。そのため、関数のコールスタックの深さが小さくなる部分で区切り、これを関数ブロックとして扱う。このとき、関数ブロックのシーケンスにおいて、同一のシーケンスが存在した場合、同一のものが存在するシーケンスを1つの関数ブロックとする。当該関数ブロックをプログラムの出力パターンとする。   The program execution history dividing device 200 performs a process of dividing the execution history. This category focuses on the locations where the value of the function call stack depth is small. It can be said that the function in which the value of the depth of the call stack of the stack becomes the largest compared to before and after is the process for providing the service of the program being executed. The part of the function call sequence where the depth value of the previous call stack increases can be said to be a part where the function providing the service is pre-processed. For this reason, the function call stack is divided at a portion where the depth of the call stack becomes small, and this is handled as a function block. At this time, if the same sequence exists in the sequence of function blocks, the sequence having the same one is defined as one function block. The function block is set as an output pattern of the program.

プログラム実行履歴分割装置200は、実行履歴読込み部210、実行履歴区分部220、関数ブロック生成部230、関数ブロック登録部240から構成される。   The program execution history dividing apparatus 200 includes an execution history reading unit 210, an execution history sorting unit 220, a function block generation unit 230, and a function block registration unit 240.

図16は、本発明の一実施の形態における実行履歴区分部の概要動作のフローチャートである。   FIG. 16 is a flowchart of an outline operation of the execution history sorting unit in the embodiment of the present invention.

ステップ2310) ループC'として、実行履歴格納部180から各実行履歴を読み出す。   Step 2310) As the loop C ′, each execution history is read from the execution history storage unit 180.

ステップ2320) サービスを提供している処理を検索し、検索できた場合は、ステップ2330に移行し、検索できない場合は、次の実行履歴を読み出す。   Step 2320) The process providing the service is searched. If the search is successful, the process proceeds to Step 2330. If the search is not possible, the next execution history is read.

ステップ2330) 検索されたサービスを提供している処理と、その前処理を1つの処理として関数ブロックテーブル250に登録する。   Step 2330) The process providing the searched service and the pre-process are registered in the function block table 250 as one process.

ステップ2340) ループC'が終了したら、最後の処理を関数ブロックテーブル250に登録する。   Step 2340) When the loop C ′ ends, the last process is registered in the function block table 250.

図17は、本発明の一実施の形態における実行履歴区分部の詳細動作のフローチャートである。   FIG. 17 is a flowchart of the detailed operation of the execution history classification unit according to the embodiment of the present invention.

ステップ310) 初期値として、id=0,head=0とする。   Step 310) As initial values, id = 0 and head = 0.

ステップ320) 初期値i=0(増分1)、終値を、取得したプログラムの実行履歴に含まれる関数の個数とし、以下のループ(ループC)処理を行う。   Step 320) The initial value i = 0 (increment 1) and the final value are the number of functions included in the acquired program execution history, and the following loop (loop C) processing is performed.

ステップ330) 実行履歴格納部180から実行履歴が読み込まれると、実質的にサービスを提供している処理を検索するために、関数のi番目に呼ばれた関数より(i+1)番目に呼ばれた関数の方がコールスタックの深さが浅いかを判定し、浅い場合はステップ340に移行し、深い場合は、終値(取得したプログラムの実行履歴に含まれる関数の個数)になるまでステップ320に移行する。   Step 330) When the execution history is read from the execution history storage unit 180, the function is called (i + 1) th from the function called i-th in order to search for a process that substantially provides the service. It is determined whether the call stack of the function is shallower. If the call stack is shallow, the process proceeds to step 340. If deep, the process proceeds to step 320 until the closing price (the number of functions included in the acquired program execution history) is reached. Transition.

ステップ350) id=id+1,head=i+1とし、ステップ330の処理を繰り返す。   Step 350) Set id = id + 1, head = i + 1, and repeat the process of Step 330.

ステップ360) head番目からi番目に呼ばれた関数を1つのブロックとし、関数ブロックID番号をidとして、関数ブロックテーブル250に登録する。   Step 360) The function called head to i is registered as one block in the function block table 250 with the function block ID number as id.

上記の具体例として、サンプルソースコードと、このコードを実行したときの関数コールシーケンスの区切り方を図18に示す。このとき、関数コールシーケンスを区切った箇所を関数ブロックとする。   As a specific example of the above, FIG. 18 shows a sample source code and how to divide a function call sequence when this code is executed. At this time, a place where the function call sequence is separated is defined as a function block.

関数ブロック生成部230は、比較対象となる関数パターンを生成する。上記で作成した関数ブロックについて、複数回実行される処理を検索し、比較対象となる関数パターンを1つの関数ブロックにすることによって、関数パターンを削減する。また、複数回繰り返される処理を関数ブロックにすることにより、その処理が一連の処理であるという信頼性を高めることができる。   The function block generation unit 230 generates a function pattern to be compared. The function block created above is searched for a process executed multiple times, and the function pattern to be compared is made one function block, thereby reducing the function pattern. In addition, by making a process repeated a plurality of times into a function block, the reliability that the process is a series of processes can be improved.

関数ブロック同士を比較し、関数ブロック内の関数が順序も含め同一である関数ブロックを検索する。さらに、一致した関数ブロックの次の関数ブロックについても関数ブロック内の関数が順序も含め同一の関数ブロックであるか調べ、この調べる処理を同一の関数ブロックである間、繰り返す。同一の関数ブロックが存在する場合、同一であった一連の関数ブロックを1つの関数ブロックとして扱う。さらに、作成した関数ブロックには、関数ブロックを一意に特定できる関数ブロックIDを付与する。この処理を図19、20に示す。   The function blocks are compared, and a function block in which the functions in the function block are the same including the order is searched. Further, with respect to the function block next to the matched function block, it is checked whether the functions in the function block are the same function block including the order, and this checking process is repeated while the function block is the same. When the same function block exists, a series of function blocks that are the same are treated as one function block. Furthermore, a function block ID that can uniquely identify the function block is assigned to the created function block. This process is shown in FIGS.

図19は、本発明の一実施の形態における関数ブロック生成部の概要動作のフローチャートである。   FIG. 19 is a flowchart of an outline operation of the function block generation unit in the embodiment of the present invention.

ステップ2410) ループD'として、図16で作成した各関数ブロックに対しての処理を行う。   Step 2410) As loop D ', processing is performed for each function block created in FIG.

ステップ2420) 関数の実行パターンとして、関数ブロックを作成する。   Step 2420) A function block is created as a function execution pattern.

ステップ2430) 作成した関数ブロックを関数ブロックテーブル250に登録する。   Step 2430) The created function block is registered in the function block table 250.

全ての関数ブロックを処理するまで、ループD'として、上記の処理を繰り返す。   The above processing is repeated as a loop D ′ until all function blocks are processed.

上記の動作を以下で詳細に説明する。   The above operation will be described in detail below.

図20は、本発明の一実施の形態における関数ブロック生成部の詳細動作のフローチャートである。以下では、関数ブロック生成部230内のメモリに、図21(b)に示すような関数ブロック一致リストを有するものとする。   FIG. 20 is a flowchart of detailed operation of the function block generation unit according to the embodiment of the present invention. In the following, it is assumed that the memory in the function block generation unit 230 has a function block match list as shown in FIG.

ステップ410) id=関数ブロックの個数とする。   Step 410) Let id = the number of function blocks.

ステップ420) 初期値としてi=0(増分1)、終値をidとする。   Step 420) The initial value is i = 0 (increment 1), and the final value is id.

ステップ430) 関数ブロック一致リストを初期化する。   Step 430) Initialize the function block match list.

ステップ440) ループEの初期値としてk=i(増分1)、終値をidとする。   Step 440) As the initial value of the loop E, k = i (increment 1) and the final value is id.

ステップ450) 関数ブロックID番号がiの関数ブロックと、関数ブロックID番号がkの関数ブロックを比較し、ブロック内の関数名が順序も含め、完全に一致するか判定し、一致する場合は、ステップ460に移行し、ループEの処理を繰り返す。   Step 450) The function block whose function block ID number is i and the function block whose function block ID number is k are compared, and it is determined whether the function names in the block are completely matched including the order. Control goes to step 460 and loop E is repeated.

ステップ460) ループFの初期値としてnum=1(増分1)、終値=(k−1)とする。   Step 460) As the initial value of the loop F, num = 1 (increment 1) and the final value = (k-1).

ステップ470)関数ブロックID番号が(i+num)の関数ブロックと関数ブロックID番号が(k+num)の関数ブロックを比較し、ブロック内の関数名が順序も含め、完全に一致するか判定し、一致する場合は、num=num+1とし、ループFの処理を終値(num=k-1)になるまで繰り返し、不一致の場合はステップ480に移行する。   Step 470) The function block whose function block ID number is (i + num) and the function block whose function block ID number is (k + num) are compared, and it is determined whether the function names in the block completely match, including the order. In this case, num = num + 1 is set, and the processing of loop F is repeated until the final value (num = k−1) is reached.

ステップ480) 関数ブロック一致リストにIDがkの関数ブロックと、一致したブロック個数であるnumの値を登録したノードを追加し、ループEの処理をk=idとなるまで繰り返す。   Step 480) A node having registered therein a function block having an ID of k and a value of num that is the number of matched blocks is added to the function block match list, and the process of loop E is repeated until k = id.

ステップ490) 関数ブロック一致リストにノードがあるかを判定し、ある場合は、ステップ4100に移行し、ない場合は、ループDの処理をi=idになるまで繰り返す。   Step 490) It is determined whether or not there is a node in the function block match list. If there is a node, the process proceeds to Step 4100. If not, the process of Loop D is repeated until i = id.

ステップ4100) 関数ブロック一致リストの各ノードを比較し、関数ブロックID番号がiの関数ブロックと、最も長く一致した関数ブロックについて、一致したブロック数を1つのブロックとして連結させたものを1つのブロックとする。   Step 4100) Each node in the function block match list is compared, and the function block with the function block ID number i and the longest matched function block are connected with the number of matched blocks as one block. And

ステップ4110) 連結したブロックに対応するブロックを削除し、作成したブロックを関数ブロックテーブル250に登録する。 ループDの処理として、i=i+1とし、i=idとなるまで、ループDの処理を繰り返す。   Step 4110) The block corresponding to the connected block is deleted, and the created block is registered in the function block table 250. As processing of loop D, i = i + 1 is set, and processing of loop D is repeated until i = id.

図21(b)に示す関数ブロック一致リストは、この検索した結果が登録されたものである。この関数ブロック一致リストを用いて、複数の関数ブロックを1つに纏めるか否かを判断する。図21(a)のシーケンス2は、関数ブロック一致リストを用いて、複数のブロックを1つのブロックに纏めた結果となる関数ブロックシーケンスであり、これが関数ブロック登録部240を介して関数ブロックテーブル250に登録される。   In the function block match list shown in FIG. 21B, the search result is registered. Using this function block match list, it is determined whether or not a plurality of function blocks are combined into one. Sequence 2 in FIG. 21A is a function block sequence that is a result of combining a plurality of blocks into one block using a function block match list, and this is a function block table 250 via the function block registration unit 240. Registered in

上記のプログラム実行履歴分割装置200では、プログラムが実行した関数コールシーケンスをユーザにとって意味のある処理単位で区切ることにより、どの処理にバグが存在するのか、ユーザに知らせることができる。そのため、デバッグのためにユーザがソースコードを見る範囲を絞らせることができ、バグを発見するまでの時間を短くすることの手助けとなる。   In the program execution history dividing apparatus 200 described above, the function call sequence executed by the program is divided into processing units that are meaningful to the user, so that the user can be informed of which process has a bug. Therefore, it is possible to narrow the range of the user to view the source code for debugging, and to help shorten the time until a bug is found.

[プログラム実行履歴比較装置]
上記のプログラム実行履歴分割装置200によって作成した関数ブロックが、ユーザが想定しているプログラムの実行結果であると定義する。このため、エラーが発生したプログラムの関数コールシーケンスに、作成した関数ブロックとは異なる関数が実行されている箇所、これらの箇所においても、関数の呼び出し関係が同一となる関数が存在しない関数、特異性が高い関数にバグが存在する可能性が高い。これは、プログラムのバグとは、開発者の想定していない入力値がプログラムに入力されることによって、顕在化するためである。さらに、プログラムの開発や検証で使用している計算機の性能と、このプログラムを実行している計算機の性能が異なることによっても顕在化する。
[Program execution history comparison device]
The function block created by the program execution history dividing device 200 is defined as the execution result of the program assumed by the user. For this reason, in the function call sequence of the program in which an error occurred, a function that is different from the created function block is executed, and even in these places, there is no function that has the same function calling relationship, There is a high possibility that bugs exist in highly functional functions. This is because a program bug becomes apparent when an input value that is not assumed by the developer is input to the program. Furthermore, it becomes apparent when the performance of the computer used for program development and verification differs from the performance of the computer executing this program.

以下、特異性が高い関数を検索するためのプログラム実行履歴比較装置について説明する。   Hereinafter, a program execution history comparison apparatus for searching for a function having high specificity will be described.

プログラム実行履歴比較装置は、プログラム実行履歴分割装置200で作成したプログラムの出力パターンと、エラーが発生したプログラムの出力を比較する。このとき、出力パターンが存在せず、かつ、エラーが発生したプログラムの出力中にも、複数存在しないコールパターンを検索し、出現頻度が低い関数コールパターンを、強調して表示する。   The program execution history comparison device compares the output pattern of the program created by the program execution history dividing device 200 with the output of the program in which an error has occurred. At this time, even in the output of the program in which no output pattern exists and an error has occurred, a plurality of call patterns that do not exist are searched, and the function call pattern with a low appearance frequency is highlighted and displayed.

図22は、本発明の一実施の形態におけるプログラム実行履歴比較装置の構成を示す。   FIG. 22 shows the configuration of the program execution history comparison apparatus in one embodiment of the present invention.

同図に示すプログラム実行履歴比較装置300は、関数ブロック読込み部310、プログラム実行履歴収集部320、実行履歴データ格納部330、関数ブロックと実行履歴の比較部340、関数ブロック登録部350、関数登録部360、比較結果格納テーブル370から構成される。   The program execution history comparison apparatus 300 shown in the figure includes a function block reading unit 310, a program execution history collection unit 320, an execution history data storage unit 330, a function block and execution history comparison unit 340, a function block registration unit 350, and a function registration. Part 360 and a comparison result storage table 370.

図23は、本発明の一実施の形態におけるプログラム実行履歴比較装置の動作を示す図である。   FIG. 23 is a diagram illustrating the operation of the program execution history comparison apparatus according to the embodiment of the present invention.

ステップ810) 関数ブロック読込み部310は、関数ブロックテーブル250から作成したテーブルを読み込む。   Step 810) The function block reading unit 310 reads a table created from the function block table 250.

ステップ820) 次に、プログラム実行部40で関数ブロックを作成したプログラムと同一のプログラムが実行されると、プログラム実行履歴収集部320は、プログラムの実行履歴を取得できるかを判定し、できる場合はステップ830に移行し、取得でできない場合は、プログラムの実行履歴と関数ブロックの比較処理を終了する。   Step 820) Next, when the same program as the program that created the function block is executed by the program execution unit 40, the program execution history collection unit 320 determines whether or not the execution history of the program can be acquired. The process proceeds to step 830, and if the acquisition is not possible, the program execution history and function block comparison processing is terminated.

ステップ830) プログラム実行履歴収集部320は、プログラムの実行履歴を取得する。   Step 830) The program execution history collection unit 320 acquires a program execution history.

ステップ840) 実行履歴データ格納部330は、取得した実行履歴の、実行された時刻、関数名、引数、返り値、コールスタックの深さを取得し、格納する。   Step 840) The execution history data storage unit 330 acquires and stores the execution time, function name, argument, return value, and call stack depth of the acquired execution history.

ステップ850) 関数ブロックと実行履歴の比較部340は、読み込んだ関数ブロックと、実行履歴データ格納部330から取得した関数実行シーケンスを比較し、一致する場合は、ステップ860に移行し、一致しない場合は、ステップ870に移行する。   Step 850) The function block / execution history comparison unit 340 compares the read function block with the function execution sequence acquired from the execution history data storage unit 330. If they match, the process proceeds to step 860. Proceeds to step 870.

ステップ860) 一致する場合は、一致した関数ブロックと関数ブロック内の関数に関する情報を比較結果格納テーブルに370に格納する。   Step 860) If they match, information about the matched function block and the functions in the function block is stored in the comparison result storage table 370.

ステップ870) 一致しない場合は、実行された関数に関する情報(コールスタックの深さ、関数名、引数、返り値)を比較結果格納テーブル370に格納する。   Step 870) If they do not match, information related to the executed function (call stack depth, function name, argument, return value) is stored in the comparison result storage table 370.

これにより、実行中のプログラムにプログラムエラーが発生した場合は、この比較結果格納テーブル370から特異性の高い関数、または、関数ブロックを選択し、ユーザに提示する。   As a result, when a program error occurs in the program being executed, a highly specific function or function block is selected from the comparison result storage table 370 and presented to the user.

次に、比較結果格納テーブル370に、関数と関数ブロックが登録された場合と関数ブロックのみが登録された場合について説明する。   Next, a case where functions and function blocks are registered in the comparison result storage table 370 and a case where only function blocks are registered will be described.

図24は、本発明の一実施の形態における比較結果格納テーブルに関数と関数ブロックが登録された場合の例を示す。   FIG. 24 shows an example when functions and function blocks are registered in the comparison result storage table according to the embodiment of the present invention.

図24では、関数ブロックと関数実行シーケンスを比較した結果、一致する関数ブロックと、関数ブロックに一致しなかった関数に分類された場合の特異性の高い関数の発見手段である。特異性の高い関数は、関数ブロックと一致しない箇所にあると考えられる。そのため、関数ブロックと一致しなかった関数の中から、特異性の高い関数を選択する。これらの関数の中においても、呼び出し関係が同一となる実行パスが存在するか否かを検索する。図24では、関数A⇒関数Bという実行パスが同一となる箇所と、関数Cのみがブロックの間に挟まれて存在する箇所がある。このとき、複数実行されている関数A⇒関数Bという実行パスより、1回のみ実行されている関数Cの特異性の方が低いと考えられる。ユーザに特異性が低い箇所から順に提示することよって、バグが存在する関数をより早く提示することができる。   In FIG. 24, the function block and the function execution sequence are compared, and as a result, the function is found with high specificity when classified into a function block that matches and a function that does not match the function block. A function with high specificity is considered to be in a location that does not match the function block. Therefore, a highly specific function is selected from functions that do not match the function block. Also in these functions, it is searched whether or not there are execution paths having the same calling relationship. In FIG. 24, there are a part where the execution path of function A → function B is the same and a part where only function C is sandwiched between blocks. At this time, it is considered that the specificity of the function C executed only once is lower than the execution path of the function A⇒function B executed plural times. By presenting to the user in order from the part with the low specificity, the function having the bug can be presented more quickly.

図25は、本発明の一実施の形態における比較結果格納テーブルに関数ブロックのみが登録された場合の例を示す。   FIG. 25 shows an example when only the function block is registered in the comparison result storage table in the embodiment of the present invention.

図25の例は、関数ブロックと関数実行シーケンスを比較した結果、その結果が関数ブロックのみに分類された場合における、特異性の高い関数の発見手段である。実行回数が最小値となる関数ブロックを検索する。図25では、関数ブロックA,B,Cのうち、関数ブロックCが実行回数が最も少ない。そのため、関数ブロックCの特異性が高いと定義できる。関数ブロックC内のどの関数の特異性が高いかの判断は、引数、返り値を比較し、それぞれの値が、関数ブロックテーブル250に登録されていた値と同一であるか否かによってその特異性の高さを判断する。   The example of FIG. 25 is a means for finding a highly specific function when a result of comparing a function block and a function execution sequence results in classification of the function block only. Search for the function block with the minimum number of executions. In FIG. 25, among the function blocks A, B, and C, the function block C has the smallest number of executions. Therefore, it can be defined that the specificity of the function block C is high. The determination of which function in the function block C has high specificity is made by comparing arguments and return values, and determining whether each value is the same as the value registered in the function block table 250 or not. Judge the height of sex.

上記のプログラム実行履歴分割装置200は、ユーザが出力結果まで想定できる入力値によって実行した実行履歴を取得し、プログラムの実行履歴の出力パターンを検出する。次に、プログラム実行履歴比較装置300において、プログラム実行履歴分割装置200で作成されたプログラムの出力パターンと、エラーが発生したプログラムの出力中にも、出現頻度の低い関数コールパターンを検索し、該関数コールパターンを強調して表示する。これにより、デバッグを行うユーザのスキルに依存せず、エラーが発生してから、このエラーに対応するソースコード上のバグを発見するまでの時間を短くできる。   The program execution history dividing apparatus 200 acquires an execution history executed by an input value that can be assumed by the user up to an output result, and detects an output pattern of the program execution history. Next, the program execution history comparison apparatus 300 searches for the output pattern of the program created by the program execution history dividing apparatus 200 and the function call pattern having a low appearance frequency even during the output of the program in which an error has occurred. Highlight function call patterns. As a result, the time from when an error occurs until a bug in the source code corresponding to the error is found can be shortened without depending on the skill of the user who performs debugging.

なお、上記のプログラム実行履歴収集装置、プログラム実行履歴分割装置、プログラム実行履歴比較装置を一つのデバッグ支援装置として構築することが可能である。   Note that the program execution history collection device, the program execution history division device, and the program execution history comparison device can be constructed as one debug support device.

また、プログラム実行履歴収集装置、プログラム実行履歴分割装置、プログラム実行履歴比較装置の動作をプログラムとして構築し、プログラム実行履歴収集装置、プログラム実行履歴分割装置、プログラム実行履歴比較装置からなる装置として利用されるコンピュータにインストールして実行させる、または、ネットワークを介して流通させることが可能である。   Also, the operations of the program execution history collection device, the program execution history division device, and the program execution history comparison device are constructed as a program and used as a device comprising the program execution history collection device, the program execution history division device, and the program execution history comparison device. It can be installed on a computer and executed, or distributed via a network.

また、構築されたプログラムをハードディスク装置や、フレキシブルディスク・CD−ROM等の可搬記憶媒体に格納し、コンピュータにインストールする、または、配布することが可能である。   Further, the constructed program can be stored in a portable storage medium such as a hard disk device or a flexible disk / CD-ROM, and can be installed or distributed in a computer.

なお、本発明は、上記の実施の形態に限定されることなく、特許請求の範囲内において種々変更・応用が可能である。   The present invention is not limited to the above-described embodiment, and various modifications and applications can be made within the scope of the claims.

本発明は、プログラムの開発・実行におけるデバッグに適用可能である。   The present invention is applicable to debugging in program development / execution.

また、プログラムのバージョンアップの前と後や、プログラムの動作環境変更の前と後のプログラムの動作の差異を検出して、デグレーションの発生を自動検出する技術等にも適用可能である。   Further, the present invention can also be applied to a technique for automatically detecting occurrence of degration by detecting a difference in the program operation before and after the program version upgrade, or before and after the program operating environment change.

本発明の原理構成図である。It is a principle block diagram of this invention. 本発明の原理を説明するための図である。It is a figure for demonstrating the principle of this invention. 本発明の一実施の形態におけるプログラム実行履歴収集装置の構成図である。It is a block diagram of the program execution log | history collection apparatus in one embodiment of this invention. 本発明の一実施の形態における実行ファイル変更処理のフローチャートである。It is a flowchart of the execution file change process in one embodiment of this invention. 本発明の一実施の形態における実行ファイル変更部の概要動作のフローチャートである。It is a flowchart of outline | summary operation | movement of the executable file change part in one embodiment of this invention. 本発明の一実施の形態における実行ファイル変更部の詳細動作のフローチャートである。It is a flowchart of detailed operation | movement of the executable file change part in one embodiment of this invention. 本発明の一実施の形態におけるシンボル情報格納部に格納されるデータの例である。It is an example of the data stored in the symbol information storage part in one embodiment of this invention. 本発明の一実施の形態におけるデバッグ情報取得部の概要動作のフローチャートである。It is a flowchart of outline | summary operation | movement of the debug information acquisition part in one embodiment of this invention. 本発明の一実施の形態におけるデバッグ情報取得部の詳細動作のフローチャートである。It is a flowchart of detailed operation | movement of the debug information acquisition part in one embodiment of this invention. 本発明の一実施の形態における付加されるデバッグ情報(図9に対する入力値)の例である。It is an example of the debug information (input value with respect to FIG. 9) added in one embodiment of the present invention. 本発明の一実施の形態におけるデバッグ情報格納部に格納されるデータである。It is the data stored in the debug information storage part in one embodiment of this invention. 本発明の一実施の形態における実行履歴収集部の概要動作のフローチャートである。It is a flowchart of outline | summary operation | movement of the execution history collection part in one embodiment of this invention. 本発明の一実施の形態における実行履歴収集部の詳細動作のフローチャートである。It is a flowchart of detailed operation | movement of the execution log | history collection part in one embodiment of this invention. 本発明の一実施の形態における実行中のプログラムの実行ファイルを変更する処理のフローチャートである。It is a flowchart of the process which changes the execution file of the program in execution in one embodiment of this invention. 本発明の一実施の形態におけるプログラム実行履歴分割装置の構成図である。It is a block diagram of the program execution history division | segmentation apparatus in one embodiment of this invention. 本発明の一実施の形態における実行履歴区分部の概要動作のフローチャートである。It is a flowchart of the outline | summary operation | movement of the execution log | history classification part in one embodiment of this invention. 本発明の一実施の形態における実行履歴区分部の詳細動作のフローチャートである。It is a flowchart of detailed operation | movement of the execution log | history classification part in one embodiment of this invention. 本発明の一実施の形態における実行履歴区分部の関数コールシーケンスの区切り方の例である。It is an example of how to divide the function call sequence of the execution history section in one embodiment of the present invention. 本発明の一実施の形態における関数ブロック生成部の概要動作のフローチャートである。It is a flowchart of outline | summary operation | movement of the function block generation part in one embodiment of this invention. 本発明の一実施の形態における関数ブルック生成部の詳細動作のフローチャートである。It is a flowchart of detailed operation | movement of the function Brook production | generation part in one embodiment of this invention. 本発明の一実施の形態における関数ブロック生成の例である。It is an example of the function block production | generation in one embodiment of this invention. 本発明の一実施の形態におけるプログラム実行履歴比較装置の構成図である。It is a block diagram of the program execution log | history comparison apparatus in one embodiment of this invention. 本発明の一実施の形態におけるプログラム実行履歴比較装置の概要動作のフローチャートである。It is a flowchart of outline | summary operation | movement of the program execution log | history comparison apparatus in one embodiment of this invention. 本発明の一実施の形態における比較結果格納テーブルに関数と関数ブロックが登録された場合の例である。It is an example at the time of a function and a function block being registered into the comparison result storage table in one embodiment of this invention. 本発明の一実施の形態における比較結果格納テーブルに関数ブロックのみが登録された場合の例である。It is an example when only a function block is registered in the comparison result storage table in one embodiment of the present invention.

符号の説明Explanation of symbols

10 メモリにロードされた実行ファイル
20 プログラムの実行ファイル
30 ライブラリの実行ファイル
40 プログラム実行手段、プログラム実行部
100 プログラム実行履歴収集手段、プログラム実行履歴収集装置
110 実行ファイル変更部
120 デバッグ情報取得部
130 実行履歴収集部
140 実行履歴を取得する実行ファイルリスト(メモリまたはディスク)
150 シンボル情報格納部(メモリ)
160 デバッグ情報格納部(メモリ)
170 レジスタリスト(メモリ)
180 実行履歴記憶手段、実行履歴格納部
200 プログラム実行履歴分割手段、プログラム実行履歴分割装置
210 実行履歴読込み部
220 実行履歴区分部
230 関数ブロック生成部
240 関数ブロック登録部
250 関数ブロック記憶手段、関数ブロックテーブル
300 比較手段、プログラム実行履歴比較装置
310 関数ブロック読込み部
320 プログラム実行履歴収集部
330 実行履歴データ格納部
340 関数ブロックと実行履歴の比較部
350 関数ブロック登録部
360 関数登録部
370 比較結果記憶手段、比較結果格納テーブル
DESCRIPTION OF SYMBOLS 10 Execution file loaded in memory 20 Program execution file 30 Library execution file 40 Program execution means, program execution section 100 Program execution history collection means, program execution history collection apparatus 110 Execution file change section 120 Debug information acquisition section 130 Execution History collection unit 140 Executable file list (memory or disk) for acquiring execution history
150 Symbol information storage (memory)
160 Debug information storage (memory)
170 Register list (memory)
180 execution history storage unit, execution history storage unit 200 program execution history division unit, program execution history division unit 210 execution history reading unit 220 execution history division unit 230 function block generation unit 240 function block registration unit 250 function block storage unit, function block Table 300 Comparison means, program execution history comparison device 310 Function block reading unit 320 Program execution history collection unit 330 Execution history data storage unit 340 Function block and execution history comparison unit 350 Function block registration unit 360 Function registration unit 370 Comparison result storage unit Comparison result storage table

Claims (9)

プログラムの動作の差異を発見するためのプログラム動作比較装置であって、
プログラムを実行するプログラム実行手段と、
プログラム自身が関数の実行履歴を出力可能なように該プログラムの実行ファイルを変更し、前記プログラム実行手段により、実行した該プログラムの実行履歴を取得して実行履歴記憶手段に格納するプログラム実行履歴収集手段と、
前記実行履歴記憶手段のプログラムの実行履歴を、実行された該プログラムの関数コールスタックの深さと、出現パターンに基づいて関数コールシーケンスの局所を関数ブロックとして区切り、関数ブロック記憶手段に格納するプログラム実行履歴分割手段と、
前記関数ブロック記憶手段の前記関数ブロックと、前記プログラム実行手段により実行中のプログラムの関数コールシーケンスを比較し、異なる箇所を検出し、比較結果記憶手段に格納する比較手段と、
を有することを特徴とするプログラム動作比較装置。
A program operation comparison device for finding a difference in program operation,
Program execution means for executing the program;
Program execution history collection for changing the execution file of the program so that the program itself can output the function execution history, and acquiring the execution history of the executed program by the program execution means and storing it in the execution history storage means Means,
Program execution in which the execution history of the program in the execution history storage means is stored in the function block storage means by dividing the local area of the function call sequence as a function block based on the depth of the function call stack of the executed program and the appearance pattern History dividing means;
A comparison means for comparing the function block of the function block storage means with a function call sequence of a program being executed by the program execution means, detecting a different location, and storing the comparison result in the comparison result storage means;
A program operation comparison device comprising:
前記プログラム実行履歴収集手段は、
プログラムの実行履歴として取得する関数について、該関数についての情報を収集するためのプログラムの実行ファイルを変更する実行ファイル変更手段と、
取得する関数について詳細な情報を取得するために必要となる値を取得するデバッグ情報取得手段と、
プログラムの実行ファイル内で定義されている関数や、ユーザが指定した共有ライブラリの関数について、該プログラムが前記プログラム実行手段により実行された時刻、関数名、引数、コールスタックの深さの値、返り値を含む情報を取得し、取得した情報を実行履歴記憶手段に登録する実行履歴収集手段と、
を有する請求項1記載のプログラム動作比較装置。
The program execution history collection means includes
Execution file changing means for changing an execution file of a program for collecting information about the function with respect to a function acquired as an execution history of the program,
Debug information acquisition means for acquiring values necessary for acquiring detailed information about the function to be acquired;
For functions defined in the execution file of the program or functions of the shared library specified by the user, the time when the program was executed by the program execution means, function name, argument, call stack depth value, return Execution history collection means for acquiring information including a value and registering the acquired information in the execution history storage means;
The program operation comparison apparatus according to claim 1, comprising:
前記プログラム実行履歴分割手段は、
前記実行履歴記憶手段に格納されている履歴情報を読み込んで、関数の呼び出しのみに着目し、呼び出した関数のコールスタックの深さの値が小さくなったところで区切り、区切られた箇所を1つの関数ブロックとする実行履歴区分手段と、
前記関数ブロック内の関数がその実行順序も含め同一となる関数ブロックが存在するかを検索し、存在する場合は、その次の関数ブロックについても関数ブロック内の関数がその実行順序も含め、同一であるかを調べる処理を繰り返し、同一である関数ブロックが存在した場合には、その一連の長さが最も長い関数ブロックに対して、複数の関数ブロックを1つの関数ブロックとしてまとめ、前記関数ブロック記憶手段に登録する手段と、
前記関数ブロック内の関数の引数、返り値が、全ての関数において同一か、同一の値を持つ関数が存在するか、全ての関数において異なっているかを関数と関連付けした前記関数ブロック記憶手段に登録する手段と、
を有する請求項1記載のプログラム動作比較装置。
The program execution history dividing means is
Read the history information stored in the execution history storage means, pay attention only to the function call, delimit when the call stack depth value of the called function becomes small, and separate the delimited position into one function Execution history classification means as a block;
A search is performed to determine whether there is a function block in which the function in the function block is the same including its execution order. If there is, the function in the function block is the same including the execution order for the next function block. If there is a function block that is identical, a plurality of function blocks are grouped as one function block with respect to the function block having the longest series of lengths. Means for registering in the storage means;
Registers in the function block storage means associated with a function whether the function argument and return value in the function block are the same in all functions, whether there is a function having the same value, or is different in all functions Means to
The program operation comparison apparatus according to claim 1, comprising:
前記比較手段は、
前記関数ブロック記憶手段から前記関数ブロックを読み出して、該関数ブロックと前記プログラム実行手段により実行中のプログラムの関数コールシーケンスを比較することにより、該実行中のプログラムの動作がユーザの想定した動作と異なる箇所を検出する手段と、
前記関数コールシーケンスのみの比較では異なる箇所が検出できなかった場合に、関数ブロック内の実行された関数についての情報と、前記実行中のプログラムが実行した関数についての情報を比較することにより、該実行中のプログラムの動作がユーザの想定した動作と異なる箇所を検出する手段と、
を有する請求項1記載のプログラム動作比較装置。
The comparison means includes
By reading the function block from the function block storage unit and comparing the function block with the function call sequence of the program being executed by the program execution unit, the operation of the program being executed is assumed to be an operation assumed by the user. Means for detecting different locations;
By comparing the information about the executed function in the function block with the information about the function executed by the program being executed when a different part cannot be detected by comparing only the function call sequence, the Means for detecting a location where the operation of the program being executed differs from the operation assumed by the user;
The program operation comparison apparatus according to claim 1, comprising:
プログラムの動作の差異を発見するためのプログラム動作比較方法であって、
プログラム自身が関数の実行履歴を出力可能なように該プログラムの実行ファイルを変更し、該プログラムを実行する機能により、実行した該プログラムの実行履歴を取得して実行履歴記憶手段に格納するプログラム実行履歴収集ステップと、
前記実行履歴記憶手段のプログラムの実行履歴を、実行された該プログラムの関数コールスタックの深さと、出現パターンに基づいて関数コールシーケンスの局所を関数ブロックとして区切り、関数ブロック記憶手段に格納するプログラム実行履歴分割ステップと、
前記関数ブロック記憶手段の前記関数ブロックと、前記プログラムを実行する機能により実行中のプログラムの関数コールシーケンスを比較し、異なる箇所を検出し、比較結果記憶手段に格納する比較ステップと、
を行うことを特徴とするプログラム動作比較方法。
A program operation comparison method for finding a difference in program operation,
Program execution that changes the execution file of the program so that the program itself can output the function execution history, and acquires the execution history of the executed program and stores it in the execution history storage means by the function of executing the program A history collection step;
Program execution in which the execution history of the program in the execution history storage means is stored in the function block storage means by dividing the local area of the function call sequence as a function block based on the depth of the function call stack of the executed program and the appearance pattern History splitting step;
A comparison step of comparing the function block of the function block storage unit with a function call sequence of a program being executed by a function of executing the program, detecting a different portion, and storing the comparison result in the comparison result storage unit;
The program operation comparison method characterized by performing.
前記プログラム実行履歴収集ステップにおいて、
プログラムの実行履歴として取得する関数について、該関数を取得するためのプログラムの実行ファイルを変更する実行ファイル変更ステップと、
呼ばれた関数から呼び出し元に戻るときの時刻、呼ばれた関数内で変更された引数、返り値を取得するデバッグ情報取得ステップと、
プログラムの実行ファイル内で定義されている関数や、ユーザが指定した共有ライブラリの関数について、該プログラムが前記プログラムを実行する機能により実行された時刻、関数名、引数、コールスタックの深さの値、返り値を含む情報を取得し、取得した情報を実行履歴記憶手段に登録する実行履歴収集ステップと、
を行う請求項5記載のプログラム動作比較方法。
In the program execution history collection step,
For a function acquired as a program execution history, an execution file change step for changing a program execution file for acquiring the function;
Debug information acquisition step to acquire the time when returning from the called function to the caller, arguments changed in the called function, return value,
The time, function name, argument, and call stack depth values when the program is executed by the function that executes the program for the functions defined in the execution file of the program or the functions of the shared library specified by the user , An execution history collection step of acquiring information including a return value and registering the acquired information in an execution history storage unit;
6. The program operation comparison method according to claim 5, wherein:
プログラム実行履歴分割ステップにおいて、
前記実行履歴記憶手段に格納されている履歴情報を読み込んで、関数の呼び出しのみに着目し、呼び出した関数のコールスタックの深さの値が小さくなったところで区切り、区切られた箇所を1つの関数ブロックとする実行履歴区分ステップと、
前記関数ブロック内の関数がその実行順序も含め同一となる関数ブロックが存在するかを検索し、存在する場合は、その次の関数ブロックについても関数ブロック内の関数がその実行順序も含め、同一であるかを調べる処理を繰り返し、同一である関数ブロックが存在した場合には、その一連の長さが最も長い関数ブロックに対して、複数の関数ブロックを1つの関数ブロックとしてまとめ、前記関数ブロック記憶手段に登録するステップと、
前記関数ブロック内の関数の引数、返り値が、全ての関数において同一か、同一の値を持つ関数が存在するか、全ての関数において異なっているかを関数と関連付けした前記関数ブロック記憶手段に登録するステップと、
を行う請求項5記載のプログラム動作比較方法。
In the program execution history division step,
Read the history information stored in the execution history storage means, pay attention only to the function call, delimit when the call stack depth value of the called function becomes small, and separate the delimited position into one function Execution history classification step to be a block;
A search is performed to determine whether there is a function block in which the function in the function block is the same including its execution order. If there is, the function in the function block is the same including the execution order for the next function block. If there is a function block that is identical, a plurality of function blocks are grouped as one function block with respect to the function block having the longest series of lengths. Registering in the storage means;
Registers in the function block storage means associated with a function whether the function argument and return value in the function block are the same in all functions, whether there is a function having the same value, or is different in all functions And steps to
6. The program operation comparison method according to claim 5, wherein:
前記比較ステップにおいて、
前記関数ブロック記憶手段から前記関数ブロックを読み出して、該関数ブロックと前記プログラムを実行する機能により実行中のプログラムの関数コールシーケンスを比較することにより、該実行中のプログラムの動作がユーザの想定した動作と異なる箇所を検出するステップと、
前記関数コールシーケンスのみの比較では異なる箇所が検出できなかった場合に、関数ブロック内の実行された関数の引数や返り値と、前記実行中のプログラムが実行した関数の引数や返り値を比較することにより、該実行中のプログラムの動作がユーザの想定した動作と異なる箇所を検出するステップと、
を行う請求項5記載のプログラム動作比較方法。
In the comparison step,
By reading the function block from the function block storage unit and comparing the function call sequence of the program being executed by the function to execute the program with the function block, the operation of the program being executed is assumed by the user. Detecting a point different from the movement;
When a different part cannot be detected by comparing only the function call sequence, the argument and return value of the executed function in the function block are compared with the argument and return value of the function executed by the executing program. A step of detecting a location where the operation of the program being executed differs from the operation assumed by the user;
6. The program operation comparison method according to claim 5, wherein:
請求項1乃至4のいずれか1項に記載のプログラム動作比較装置を構成する各手段としてコンピュータを機能させるためのプログラム動作比較プログラム。   The program operation comparison program for functioning a computer as each means which comprises the program operation comparison apparatus of any one of Claims 1 thru | or 4.
JP2008087886A 2008-03-28 2008-03-28 Program operation comparison apparatus and method and program Expired - Fee Related JP4763743B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008087886A JP4763743B2 (en) 2008-03-28 2008-03-28 Program operation comparison apparatus and method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008087886A JP4763743B2 (en) 2008-03-28 2008-03-28 Program operation comparison apparatus and method and program

Publications (2)

Publication Number Publication Date
JP2009244969A true JP2009244969A (en) 2009-10-22
JP4763743B2 JP4763743B2 (en) 2011-08-31

Family

ID=41306815

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008087886A Expired - Fee Related JP4763743B2 (en) 2008-03-28 2008-03-28 Program operation comparison apparatus and method and program

Country Status (1)

Country Link
JP (1) JP4763743B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014032447A (en) * 2012-08-01 2014-02-20 Hitachi Systems Ltd Degradation test support system, degradation test support method, and degradation test support program
JP2019528515A (en) * 2016-07-29 2019-10-10 クアルコム,インコーポレイテッド Update the virtual memory address of the target application function for the updated version of the application binary code
KR20220085290A (en) * 2020-12-15 2022-06-22 현대오토에버 주식회사 Method for verifying software and apparatus therefor

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014032447A (en) * 2012-08-01 2014-02-20 Hitachi Systems Ltd Degradation test support system, degradation test support method, and degradation test support program
JP2019528515A (en) * 2016-07-29 2019-10-10 クアルコム,インコーポレイテッド Update the virtual memory address of the target application function for the updated version of the application binary code
KR20220085290A (en) * 2020-12-15 2022-06-22 현대오토에버 주식회사 Method for verifying software and apparatus therefor
KR102496539B1 (en) * 2020-12-15 2023-02-06 현대오토에버 주식회사 Method for verifying software and apparatus therefor
KR20230019191A (en) * 2020-12-15 2023-02-07 현대오토에버 주식회사 Method for verifying software and apparatus therefor
KR102588856B1 (en) * 2020-12-15 2023-10-12 현대오토에버 주식회사 Method for verifying software and apparatus therefor

Also Published As

Publication number Publication date
JP4763743B2 (en) 2011-08-31

Similar Documents

Publication Publication Date Title
Sridharan et al. Thin slicing
US10019240B2 (en) Method and apparatus for detecting code change
US6430741B1 (en) System and method for data coverage analysis of a computer program
Blazytko et al. {AURORA}: Statistical crash analysis for automated root cause explanation
Scott et al. Minimizing faulty executions of distributed systems
US8806436B2 (en) Systems and methods for debugging applications using dual code generation
US7536678B2 (en) System and method for determining the possibility of adverse effect arising from a code change in a computer program
WO2016138953A1 (en) A method for identifying a cause for a failure of a test
JP6342129B2 (en) Source code error position detection apparatus and method for mixed mode program
CN103559123A (en) Function call stack analyzing method and device based on VxWorks operation system
JP6303749B2 (en) Method and system for analyzing a software program and non-transitory computer readable medium
CN107220175B (en) Application program endless loop positioning method and device, computer equipment and storage medium
JP6559600B2 (en) Information processing apparatus, information processing program, and inspection system
US9189372B2 (en) Trace coverage analysis
JP4763743B2 (en) Program operation comparison apparatus and method and program
KR102165747B1 (en) Lightweight crash report based debugging method considering security
CN112433706A (en) Compiling option tuning method and device, processor chip and server
Bai et al. Effective detection of sleep-in-atomic-context bugs in the Linux kernel
Xin et al. An automation-assisted empirical study on lock usage for concurrent programs
JP2005338987A (en) Exception test support program and device
TWI484413B (en) Function-based software comparison method
Mahmud et al. Acid: an api compatibility issue detector for android apps
JP5891976B2 (en) Compile execution / management method, apparatus, and program
JP4869581B2 (en) Coverage measurement system and program thereof
JP2017041196A (en) Stub object determination device, method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100208

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110531

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110607

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110609

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

Free format text: PAYMENT UNTIL: 20140617

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees