JP2004038312A - Log acquisition method, program, and storage medium - Google Patents

Log acquisition method, program, and storage medium Download PDF

Info

Publication number
JP2004038312A
JP2004038312A JP2002191128A JP2002191128A JP2004038312A JP 2004038312 A JP2004038312 A JP 2004038312A JP 2002191128 A JP2002191128 A JP 2002191128A JP 2002191128 A JP2002191128 A JP 2002191128A JP 2004038312 A JP2004038312 A JP 2004038312A
Authority
JP
Japan
Prior art keywords
function
log
program
predetermined processing
address
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
JP2002191128A
Other languages
Japanese (ja)
Other versions
JP4125054B2 (en
JP2004038312A5 (en
Inventor
Makoto Mihara
三原 誠
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2002191128A priority Critical patent/JP4125054B2/en
Priority to US10/600,843 priority patent/US7086034B2/en
Priority to EP03254035A priority patent/EP1376366A3/en
Priority to CNB031493319A priority patent/CN1251062C/en
Publication of JP2004038312A publication Critical patent/JP2004038312A/en
Publication of JP2004038312A5 publication Critical patent/JP2004038312A5/ja
Application granted granted Critical
Publication of JP4125054B2 publication Critical patent/JP4125054B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a log acquisition method for easily acquiring a processing log of software and reducing the manhour for analyzing a bug. <P>SOLUTION: This log acquisition method for acquiring the log under execution in a program 91 having a function FuncAA is provided with a process of rewriting the address of the loaded function FuncAA into the address of a function 92 for acquiring the log. The function 92 for acquiring the log is provided with a process 101 of calling 96 the address of the function FuncAA, implementing 97 a prescribed process, and delivering the received implementation result 98 to the program 91; a process of determining whether or not pointer parameters are defined by a prescribed definition method in a function definition in the program 91; and a process of, when they are defined, recording the contents of a memory specified by the pointer parameters as the log based on the definition method. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、複数にモジュール分けされたソフトウェアの処理ログを取得するための技術に関するものである。
【0002】
【従来の技術】
従来より、再現率の低いソフトウェアの障害に対しては、ソフトウェアの処理ログを取得し、当該処理ログを解析することによって、障害の原因をつきとめ、その対策を講じてきた。
【0003】
【発明が解決しようとする課題】
しかし、上記従来の処理ログの取得には以下のような問題点がある。
(1)ユーザの動作環境でもログを取得しつづけるためには、ソフトウェアのモジュール自体に手を加え、処理ログ取得ルーチンを追加しなければならず、処理ログ取得のための作業負荷が大きかった。
(2)処理ログ取得はモジュール毎に行うため、生成されたログはモジュール単位のものとなってしまい、ソフトウェア全体の処理を、完全に時間順のログとして取得するのが困難である。このため、全体の処理ログとしての見通しが悪く、ログを解析して障害の原因を発見するまでのプロセスに工数がかかっていた。
【0004】
本発明は、上記課題を鑑みてなされたものであり、複数にモジュール分けされたソフトウェアの処理ログを容易に取得でき、かつ、ソフトウェアの障害の原因の解析のための工数を削減することが可能なログ取得方法、ならびに該方法をコンピュータによって実現させるためのプログラム、および該プログラムを格納した記憶媒体を提供することを目的とする。
【0005】
【課題を解決するための手段】
上記の目的を達成するために本発明に係るログ取得方法は以下のような構成を備える。即ち、
所定の処理を行う関数を備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行う関数のアドレスを、ログ取得のための関数のアドレスに書き換える工程を備え、
前記ログ取得のための関数は、
前記所定の処理を行う関数を呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義において、ポインタ・パラメータが所定の定義方法で定義されているか否かを判断する工程と、
ポインタ・パラメータが所定の定義方法で定義されていた場合、該定義方法に基づいて該ポインタ・パラメータの指すメモリの内容をログとして記録する工程とを備える。
【0006】
【発明の実施の形態】
【第1の実施形態】
本実施形態は、あるモジュールから別のモジュール内に存在する関数の呼び出しが行われる際の仕組みである、メモリに保持されたインポート関数アドレス、または仮想関数アドレステーブル(Virtual Address Table)を利用して、モジュール間の関数呼び出しをフックしてログに記録することで、ソフトウェアのモジュール自体に手を加えることなく、ソフトウエア全体の処理を、時間順のログとして取得することを可能にするものである。以下に具体的に説明する。
【0007】
<システム構成>
図1は、本発明の各実施形態にかかるログ取得方法を実現するコンピュータ(ソフトウェア評価システム)の構成をあらわす図である。説明を簡略化するために、本実施形態では、本ソフトウェア評価システムが1台のPC内部に構築されるものとするが、本発明のログ取得方法の特徴は1台のPC内部に構築されるか、あるいは複数のPCにネットワークシステムとして構築されるかによらず有効である。
【0008】
本ソフトウェア評価システムを搭載するコンピュータには、CPU1、チップセット2、RAM3、ハードディスクコントローラ4、ディスプレイコントローラ5、ハードディスクドライブ6、CD−ROMドライブ7、ディスプレイ8が搭載されている。また、CPUとチップセットを繋ぐ信号線11、チップセット2とRAM3とを繋ぐ信号線12、チップセット2と各種周辺機器とを繋ぐ周辺機器バス13、ハードディスクコントローラ4とハードディスクドライブ6とを繋ぐ信号線14、ハードディスクコントローラ4とCD−ROMドライブ7とを繋ぐ信号線15、ディスプレイコントローラ5とディスプレイ8とを繋ぐ信号線16が搭載されている。
【0009】
<関数処理に対する処理ログ取得>
本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムを説明するために、まず図2によって、複数のモジュールに分かれたソフトウェアが、通常の状態でどのようにメモリにロードされるかを説明する。
【0010】
通常、複数のモジュールに分かれたソフトウェアは、全体の制御を行う実行ファイルEXE(23)と、モジュールとして存在しEXEの補完的な役割を担うダイナミックリンクライブラリDLL(27)とに分かれており、メモリにはEXEとDLLの両方がロードされる。EXEはコードセグメント(28)とデータセグメント(29)、そしてインポート関数アドレステーブル(22)から成っている。更に、インポート関数アドレステーブルは、関数の所属するDLLによって分かれており(21, 24)、DLLごとにそれぞれの関数がロードされたアドレスが書かれている(30〜35)。DLLの関数の実体は、DLLごとに分かれて(25, 26)ロードされ、それぞれの関数は該当するDLLの一部としてロードされる(36〜41)。この図では、1本のEXEがA.DLL及びB.DLLの2つのダイナミックリンクライブラリ内の関数を使用している例を示しており、実際に使用される関数はFunc AA, Func AB, Func AC, Func BA, Func BB, Func BCの6個となっている。
【0011】
EXEのコードセグメント内にあるコードが関数Func AAを呼び出す場合には、まずインポート関数アドレステーブル内に書かれたFunc AAのアドレス(30)が読み込まれる。ここには実際にはA.DLLの一部として読み込まれたFunc AAコード(36)のアドレスが書かれており、そのアドレスをコールすることによって、EXEのコードはA.DLLのFunc AAを呼び出すことができる。
【0012】
図3は、本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのメモリ構成をあらわす図であり、図2とは、ログ取得用のコードに対してIAT Patch(Import Address Table Patch)という手法を用いて、関数呼び出しをリダイレクトしているという点で異なっている。
【0013】
ログ取得が開始されると、メモリ内にはIAT Patch用のDLLであるC.DLL(58)がロードされる。C.DLLはインポート関数アドレステーブル(52)内に書かれた関数のアドレスを、C.DLL内のログ取得コードであるFunc CAA, Func CAB, Func CAC, Func CBA,Func CBB, Func CBCのアドレスに書き換える(61〜66)。C.DLL内のFunc CAA, Func CAB, Func CAC, Func CBA, Func CBB, Func CBCのコード(73〜78)は、ログを記録すると共に、元々の関数呼び出しを受けるべくメモリにロードされている、該当する関数であるFunc AA, Func AB, Func AC, Func BA, Func BB, Func BC(67〜72)を呼び出す。
【0014】
図4Aは、図3におけるIAT Patchの処理をあらわす図、図4Bはログ取得処理の流れを示すフローチャートである。説明を簡略化するために、この図ではEXEがA.DLL内のFunc AAを呼び出す際に、IAT Patchによるログ取得コードがどのように動作するかの例をあらわしている。
【0015】
EXE(図4Aの91)がFunc AAをコールすると(図4Aの94)、C.DLL内にあるログ取得コードがDLL名/関数名をメモリに保存し(図4BのステップS402)、呼び出し時刻をメモリに保存し、呼び出し時のパラメータをメモリに保存し、呼び出し時のポインタパラメータの指すメモリ内容を、別メモリに保存する(図4Aの95、図4BのステップS403)。その後C.DLLは本来呼び出されるはずであった、A.DLL(図4Aの93)内のFunc AAをコールする(図4Aの96、図4BのステップS404)。A.DLLのFunc AA処理(図4Aの97)が終了し、C.DLLに制御がリターンすると(図4Aの98)、C.DLLはリターン時の時刻をメモリに保存し、戻り値をメモリに保存し、リターン時にポインタパラメータが指すメモリ内容を、別メモリに保存する(図4Aの99)。その後、C.DLLは保存したログ情報をファイルに書き込み(図4Aの100、図4BのステップS405)、あたかもA.DLLのFunc AAが通常通りに終了したかのように、EXEにリターンする(101)。
【0016】
図5は、本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの内部構成をあらわす図である。通常は実行形式のEXE(113)が、DLL−1(116)やDLL−2(117)内の関数を呼び出すが、ここではAPIトレーサと呼ばれるログ取得コードを埋め込み(114)、処理ログを生成している(115)。APIトレーサは、DLL−1やDLL−2の関数定義を記述したファイル(111)と、どのDLLのどの関数のインポート関数テーブルを書き換えてログを取得するかの設定シナリオ(トレースシナリオ112)を元に動作する。
【0017】
<メソッド処理に対する処理ログ取得>
次に、本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、実行ファイルEXE(118)がCOM(Component Object Model)サーバでエクスポートされているインターフェースのインスタンス作成時に、どのようにメモリにロードされるかを説明するために、まず、図6によって、通常の状態でどのようにメモリにロードされるかを説明する。
【0018】
通常、インターフェースのインスタンス作成を行うと、COMサーバ内で、要求されたインターフェース(121, 122)と、そのメソッド(:オブジェクト指向プログラミングにおいて、オブジェクトの実行する手続きを記述したプログラム、130〜135)が作成され、それらは、メモリ上に両方がロードされる。ここで、virtual address table(仮想アドレステーブル)は作成された各インターフェース毎に作られ(118, 120)、作成要求を行ったEXEに渡される。このvirtual addres tableには各メソッドの作成されたアドレスが書かれている(124〜129)。EXEはこれら情報を利用し、各インターフェースに対して呼び出しを行う。この図では、1本のEXEがInterface A及びInterface Bの2つのインターフェースのインスタンスを作成しており、そのインターフェース内部のメソッドを使用している例を示しており、実際に使用されているメソッドは、Method AA, Method AB, Method AC, Method BA, Method BB, Method BCとなっている。
【0019】
EXEのコードが関数Method AAを呼び出す場合には、まずvirtual address table内に書かれたMethod AAのアドレス(124)が読み込まれる。ここには実際にはCOMサーバのInterface Aの一部として作成されたMethod AAコード(130)のアドレスが書かれており、そのアドレスをコールすることによって、EXEのコードはInterface AのMethod AAを呼び出すことができる。
【0020】
図7は、本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのメモリ構成をあらわす図であり、図6とは、ログ取得用のコードに対してVTable Patch(virtual address table Patch)という手法を用いて、メソッド呼び出しをリダイレクトしているという点で異なっている。
【0021】
ログ取得が開始されると、メモリ内にはVTable Patch用のDLL(143)がロードされる。このDLLはvirtual address table(136, 138)内に書かれたメソッドのアドレスを、DLL内のログ取得コードであるMethod A’A, Method A’B, MethodA’C, Method B’A, Method B’B, Method B’Cのアドレスに書き換える(145〜150)。DLL内のMethod A’A,Method A’B, Method A’C, Method B’A, Method B’B, Method B’Cのコード(157〜162)は、ログを記録すると共に、元々のメソッド呼び出しを受けるべくメモリにロードされている、該当するメソッドであるMethod AA, Method AB, Method AC, Method BA, Method BB, Method
BC(157〜162)を呼び出す。
【0022】
図8Aは、図7におけるVTable Patchの処理をあらわす図、図8Bはログ取得処理の流れを示すフローチャートである。説明を簡略化するために、この図ではEXEがCOMサーバ内のInterface AのMethodAAを呼び出す際に、VTable Patchによるログ取得コードがどのように動作するかの例をあらわしている。
【0023】
EXE(図8Aの163)がMethod AAをコールすると(図8Aの166)、DLL内にあるログ取得コードがモジュール名/インターフェース名/メソッド名をメモリに保存し(図8BのステップS802)、呼び出し時刻をメモリに保存し、呼び出し時のパラメータをメモリに保存し、呼び出し時のポインタパラメータの指すメモリ内容を、別メモリに保存する(図8Aの167、図8BのステップS803))。その後DLLは本来呼び出されるはずであった、COMサーバ(図8Aの165)内のMethod AAをコールする(図8Aの168、図8BのステップS804))。COMサーバのMethod AA処理(図8Aの169)が終了し、DLLに制御がリターンすると(図8Aの170)、DLLはリターン時の時刻をメモリに保存し、戻り値をメモリに保存し、リターン時にポインタパラメータが指すメモリ内容を、別メモリに保存する(図8Aの171)。その後、DLLは保存したログ情報をファイルに書き込み(図8Aの172、図8BのステップS805)、あたかもCOMサーバのMethod AAが通常通りに終了したかのように、EXEにリターンする(図8Aの173)。
【0024】
図9は、本発明の第1の実施形態にかかるソフトウェア評価システムの内部構成をあらわす図である。通常は実行形式のEXE(176)が、COMサーバ1(179)やCOMサーバ2(180)内のメソッドを呼び出すが、ここではAPIトレーサと呼ばれるログ取得コードを埋め込み(177)、処理ログを生成している(178)。APIトレーサは、COMサーバ1(179)やCOMサーバ2の関数定義を記述したファイル(174)と、どのCOMサーバのどのインターフェースのどのメソッドのvirtual address tableを書き換えてログを取得するかの設定シナリオ(175)を元に動作する。
【0025】
以上の説明から明らかなように、本実施形態にかかるログ取得方法によれば、複数にモジュール分けされたソフトウエアの処理ログの取得において、モジュール自体に変更を加えることなく、モジュール内に用意された関数/メソッドの呼び出しをログとして記録することが可能となり、処理ログ取得のための作業負荷を低減することが可能となる。また、生成されるログは、時間順のログとして取得することができ、ログの解析が容易となるため、ソフトウェアの障害の原因の解析のための工数を削減することが可能となる。
【0026】
【第2の実施形態】
本実施形態では、通常では、取得しきれないポインタ・パラメータのデータをバイナリとしてログ取得する場合について述べる。
【0027】
図10は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義の一例であり、一般的に広く用いられているIDLにより、記述されている。本実施形態にかかるログ取得方法を実現するソフトウェア評価システムに於いては、このIDLをトークン化したタイプライブラリファイルを関数定義ファイルとして使用する。
【0028】
図11は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて、ポインタ・パラメータに対してバイナリ取得を指定することで、ポインタ・パラメータのデータの実体をログとして取得する為のIDLによる記述である。
【0029】
FuncBinidId関数の定義に於いて、long* lplParamに対してcustum(PAT_PARAM_ATTR_ID, ”binid_is()”)と宣言している(201)。ここで、PAT_PARAM_ATTR_ID(200)はIDLの中で本ソフトウェア評価システムが利用するための識別子である。ここで、”binid_is()”と定義することにより、このパラメータが指すポインタからパラメータのデータ型サイズ(ここではlong型)分のデータを、バイナリデータとしてログに保存する。
【0030】
FuncSizeIs関数の定義に於いて、int* lplParamに対してcustum(PAT_PARAM_ATTR_ID, ”size_is(dwCount)”)と宣言している(202)。ここで、”size_is(dwCount)”と定義することにより、このパラメータは第一パラメータであるdwCount個分のデータが有ると扱われる。そして、このパラメータが指すポインタから、(dwCount×パラメータのデータ型サイズ(ここでは、int型))分のデータをバイナリデータとしてログに保存する。
【0031】
FuncLengthIs関数の定義に於いて、char* lpszParamに対してcustum(PAT_PARAM_ATTR_ID, ”length_is(dwLength)”)と宣言している(203)。ここで、”length_is(dwLength)”と定義することにより、このパラメータは第一パラメータであるdwLength個分のデータが有ると扱われる。そして、このパラメータが指すポインタから、(dwLength×パラメータのデータ型サイズ(ここではchar型))分のデータをバイナリデータとしてログに保存する。
【0032】
FuncBytesIs関数の定義に於いて、void* lpParamに対してcustum(PAT_PARAM_ATTR_ID, ”bytes_is(dwSize)”)と宣言している(204)。ここで、”bytes_is(dwSize)”と定義することにより、このパラメータは第一パラメータであるdwSizesバイト分のデータが有ると扱われる。そして、このパラメータが指すポインタから、dwSizeバイト分のデータをバイナリデータとしてログに保存する。
【0033】
FuncBytesIs1関数の定義に於いて、void* lpParamに対してcustum(PAT_PARAM_ATTR_ID, ”bytes_is(12)”)と宣言している(205)。ここで、”bytes_is(12)”と定義することにより、このパラメータは指定された12バイト分のデータが有ると扱われる。そして、このパラメータが指すポインタから、12バイト分のデータをバイナリデータとしてログに保存する。
【0034】
図12は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図11の様に関数定義されている時のログを取得する場合の流れを示す図である。
【0035】
処理が開始されると(ステップS1)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をHDDに保存する(ステップS2)。次にログ取得コードは、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS3)。そして、関数定義にバイナリ取得の設定が存在するか判別し(ステップS4)、存在する場合には、保存するメモリサイズを各定義方法(binid_is, size_is, length_is, bytes_is)毎に計算し(ステップS5)、ポインタ・パラメータの指すメモリの内容を算出したサイズ分HDDに保存する(ステップS6)。続いて、元の関数を呼び出す(ステップS7)。関数からリターンすると、ログ取得コードはリターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS8)。そして、関数定義にバイナリ取得の設定が存在するか判別し(ステップS9)、存在する場合には、保存するメモリサイズを各定義方法(binid_is, size_is,length_is, bytes_is)毎に計算し(ステップS10)、ポインタ・パラメータの指すメモリの内容を算出したサイズ分HDDに保存する(ステップS11)。この処理はユーザから終了の命令があると(ステップS12)終了される。
【0036】
図13は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図11の定義により取得されたログデータの図である。
【0037】
関数定義により、バイナリ取得の設定がない場合に取得できるログ(210)は、DataIDを除いた部分である。そして、バイナリ取得の設定を行った場合には、DataID及び、バイナリデータのログ(211)が取得できる。例えばFuncSizeIsのログを比較すると、バイナリ取得の設定がない場合には、ポインタ・パラメータlpParamが指し示すデータをint型で1個分だけは取得可能である。しかし、実際にはこのデータは10個のint型データの配列を指し示す。そのためバイナリ取得の設定を行った場合には、int型データのサイズである4バイト×10個分、計40バイトのデータを取得可能となる。
【0038】
以上の説明から明らかなように、本実施形態によれば、サイズとポインタ・パラメータを関連付けることにより、通常では、取得しきれないポインタ・パラメータのデータをバイナリとしてログ取得可能となる。
【0039】
【第3の実施形態】
本実施形態では、コールバック関数等のエクスポートされていない関数をログとして取得する場合について述べる。
【0040】
図14は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いてコールバック関数等のエクスポートされていない関数をログとして取得するためのIDLによる記述である。
【0041】
FuncSetCallBack関数の定義に於いて、DWORD pfnFuncCallBackに対してcustom(PAT_PARAM_ATTR_ID, ”funcname_is(FuncCallBack)”)と宣言している(221)。FuncSetCallBack関数は、モジュールに対してコールバック関数を設定する関数であり、DWORD pfnFuncCallBackは、そのコールバック関数のアドレスを設定するためのパラメータである。ここで、”funcname_is(FuncCallBack)”と定義することにより、ログ取得処理は、このパラメータに渡された値をFuncCallBack関数(222)のアドレスとして認識し、ログ取得処理のアドレスに置換する。また、ログ取得処理時に本来のコールバック関数を呼ぶためにオリジナルの値を保存する。これにより、エクスポートされていないコールバック関数のログが取得可能となる。
【0042】
GetFuncPointer関数の定義に於いて、DWORD pfnFuncInternalに対してcustom(PAT_PARAM_ATTR_ID, ”funcname_is(FuncInternal”)と宣言している(223)。GetFuncPointer関数は、モジュール内部のエクスポートされていない関数のポインタを取得する関数であり、DWORD pfnFuncInternalは、その非エクスポート関数のポインタをを取得するためのパラメータである。ここで、”funcname_is(FuncInternal)”と定義することにより、ログ取得処理は、このパラメータに渡された値をFuncInternal関数(224)のアドレスとして認識し、ログ取得処理のアドレスに置換する。また、ログ取得処理時に本来の非エクスポート関数を呼ぶためにオリジナルの値を保存する。これにより、エクスポートされていないモジュール内部の関数のログが取得可能となる。
【0043】
GetFuncPointeArray関数(225)は、モジュール内部のエクスポートされていない関数群のアドレスをFUNCPOINTERARRAY構造体(220)に取得するための関数である。ここで、FUNCPOINTERARRAYの各メンバの定義に対してcustom(PAT_PARAM_ATTR_ID, ”funcname_is(FuncInternal1〜4)”)と宣言している。ここで、”funcname_is(FuncInternal1〜4)”)と定義することにより、この構造体のメンバに渡された値をFuncInternal1〜4関数(226)のアドレスとして認識し、ログ取得処理のアドレスに置換する。また、ログ取得処理時に本来の非エクスポート関数を呼ぶためにオリジナルの値を保存する。これにより、エクスポートされていないモジュール内部の関数群のログを取得可能となる。
【0044】
図15は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムのメモリ構成をあらわす図であり、図3とは、隠し関数のログ取得用のコードが追加されている点で異なっている。A.DLLにある、FuncAD(231)は、エクスポートされていない関数であり、そのため、Import Address Table(230)にも、存在しない。この時funcname_isをFuncADに対して定義すると、C.DLLにログ取得のためのFuncCAD(232)が生成され、本来FuncADのアドレスが返されるfuncname_isで定義されたパラメータの値を置換する場合に、FuncCADのアドレスが使用される。
【0045】
図16は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【0046】
処理が開始されると(ステップS21)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をHDDに保存する(ステップS22)。次にログ取得コードは、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS23)。そして、関数定義にfuncname_isの設定が存在するか判別し(ステップS24)、存在する場合には、funcname_isによって定義されている関数定義を関数定義ファイルから取得し、その定義に基づいてログ取得処理用のコードを生成する(ステップS25)。そして、funcname_isが定義されている値を保存し、生成したログ取得コードのアドレスに置換する(ステップS26)。
【0047】
続いて、元の関数を呼び出す(ステップS27)。関数からリターンすると、ログ取得コードはリターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS28)。そして、関数定義にfuncname_isの設定が存在するか判別し(ステップS29)、存在する場合には、funcname_isによって定義されている関数の定義を関数定義ファイルから取得し、その定義に基づいてログ取得処理用のコードを生成する(ステップS30)。そして、funcname_isが定義されている値を保存し、生成したログ取得コードのアドレスに置換する(ステップS31)。この処理はユーザから終了の命令があると(ステップS32)終了される。
【0048】
funcname_isで設定されているパラメータが生成されたログ取得コードのアドレスに置換されると、その後そのアドレスを使用して呼び出される元の関数は、通常のログと同様に処理されるようになる(つまり、生成されたログ取得コードは、エクスポートされていない関数を呼び出し、処理を実行させ、受け取った実行結果を渡すとともに、エクスポートされていない関数を呼び出す際の所定の情報と、実行結果を受け取った際の所定の情報とをログとして記録する)。
【0049】
図17は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の定義を行わない場合に取得されたログデータの図である。関数定義ファイルに於いて設定を行わない場合は、コールバック関数、エクスポートされていない内部関数のログは取得できない。
【0050】
図18は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の定義より取得されたログデータの図である。関数定義ファイルに於いて、コールバック関数、エクスポートされていない内部関数を取得するように設定しているので、FuncCallBack関数や、FuncInternal関数、FuncInternal4関数等の非エクスポート関数のログが取得可能となる。
【0051】
このように本実施形態によれば、通常の方法では取得できない非エクスポート関数のログを取得可能になるという効果が得られる。
【0052】
【第4の実施形態】
本実施形態では、通常の方法では取得できない関数のログとして、可変長配列のパラメータのログを取得する場合について述べる。
【0053】
図19は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて可変長配列のパラメータをログとして取得するためのIDLによる記述である。
【0054】
FuncArrayIs関数の定義に於いて、int* lpnParamに対してcustum(PAT_PARAM_ATTR_ID, ”array_is(dwCount)”)と宣言している(240)。ここで、” array_is(dwCount)”と定義することにより、このポインタ・パラメータは第一パラメータであるdwCount個分のint型配列であると扱われる。そして、このポインタ・パラメータが指すポインタをint型のdwCount個の配列とし、データをログに保存する。
【0055】
図20は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図19の様に関数が定義されている時のログを取得する場合の流れ図である。
【0056】
処理が開始されると(ステップS41)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をHDDに保存する(ステップS42)。次に関数定義に可変長配列取得(array_is)の設定が存在するか判別し(ステップS43)、存在する場合には、ポインタ・パラメータで定義されているパラメータを配列の定義として扱い(ステップS44)、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS45)。そして、続いて、元の関数を呼び出す(ステップS46)。関数からリターンすると、ログ取得コードは関数定義に可変長配列取得(array_is)の設定が存在するか判別し(S47)、存在する場合には、ポインタ・パラメータで定義されているパラメータを配列の定義として扱い(ステップS48)、リターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS49)。この処理はユーザから終了の命令があると(ステップS50)終了される。
【0057】
図21は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図19の定義を行わない場合に取得されたログデータ(250)と、図19の定義により取得されたログデータ(251)の図である。関数定義ファイルに於いて設定を行わない場合は、ポインタ・パラメータは配列としては扱えないので、先頭のデータのみが取得されているが、関数定義ファイルに於いて設定が行われている場合では、ポインタ・パラメータは配列として扱われるため、配列の全データが取得されている。
【0058】
このように本実施形態によれば、通常の方法では取得できない関数のログとして、可変長配列のパラメータのログが取得可能になるという効果が得られる。
【0059】
【第5の実施形態】
本実施形態では、通常の関数定義では、パラメータを取得できない関数について、ログを取得する場合について説明する。
【0060】
図22は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、通常の関数定義では、パラメータを取得できない関数の例である。
【0061】
構造体として、STRUCTSIZE1, STRUCTSIZE2, STRUCTSIZE3の3種類が定義されており、各構造体のDWORD dwSizeメンバには、自分自身の構造体のサイズを入れる必要がある。FuncGetData関数は、第一パラメータdwKindと、第二パラメータlpBufに上記3種類のどの構造体のポインタが渡されているかを設定する。FuncGetData関数は、第一パラメータが1の場合には、lpBufをSTRUCTSIZE1のポインタとして扱って処理を行い、第一パラメータが2の場合には、lpBufをSTRUCTSIZE2のポインタとして扱って処理を行い、第一パラメータが3の場合には、lpBufをSTRUCTSIZE3のポインタとして扱って処理を行う。この場合、通常の関数定義により、FuncGetDataを定義すると、lpBufはvoid型のポインタとなり、データを取得することはできない。
【0062】
図23は、図22に於いて、STRUCTSIZE1, STRUCTSIZE2, STRUCTSIZE3の各構造体がどのようにメモリを使用するかのメモリ図である。構造体STRUCTSIZE1(260)の、各メンバは、オフセット0x000にDWORD dwSize(261)、0x0004にDWORD dwParam1(262)、0x0008にDWORD dwParam2、0x000CにDWORD dwParam3が存在する。構造体STRUCTSIZE2(265)はDWORD dwSize〜DWORDdwParam3(266〜269)までは、STRUCTSIZE1と同様であり、0x0010にDWORD dwParam4(270)が存在する。STRUCTSIZE3(271)はDWORD dwSize〜DWORD dwParam4(272〜276)までは、STRUCTSIZE2と同様であり、0x0014にDWORD dwParam5(277)が存在する。このように、STRUCTSIZE3のdwSize〜dwParam4までのメモリ配置は、STRUCTSIZE2と同様であり、STRUCTSIZE2のdwSize〜dwParam3までのメモリ配置は、STRUCTSIZE1と同様になっている。
【0063】
図24は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図22の様な関数のパラメータのログを取得するためのIDLによる記述である。
【0064】
本来の関数では、STRUCTSIZE1, STRUCTSIZE2, STRUCTSIZE3と分かれていた構造体をSTRUCTSIZEという1個の構造体として定義する(291)。この定義はSTRUCTSIZE3と同様であり、これは、図23でのメモリ配置から、STRUCTSIZE3は、STRUCTSIZE1、STRUCTSIZE2と同様のメモリ配置部分を持つからである。そして、この構造体のメンバであり、構造体のサイズを表す、DWORD dwSizeに対して、[custum(PAT_PARAM_ID, ”structsize_is()”)]を設定する。この事で、ログ取得処理は構造体のデータ解析を行う場合に、構造体のサイズを知ることが可能となる。また、FuncGetData関数において、第二パラメータのlpBufをSTRUCTSIZE型として定義しておく。こうすることで、このパラメータをログとして保存する場合には、STRUCTSIZE型として処理が行われる。仮に、本手法を用いず、STRUCTSIZE3のデータを取得するように関数定義ファイルに記述した場合には、GetFuncDataがdwKind=1や2で呼ばれた場合には、STRUCTSIZE1やSTRUCTSIZE2のデータが存在することになり、dwParam3やdwParam4のデータをログに取得しようとしてしまうために、メモリ例外が発生する。
【0065】
図25は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【0066】
処理が開始されると(ステップS61)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をHDDに保存する(ステップS62)。次に関数定義に構造体のサイズ指定(structsize_is)の設定が存在するか判別し(ステップS63)、存在する場合には、設定されている構造体パラメータのデータをサイズ指定(structsize_is)の設定で定義されているデータサイズ範囲内で解析する(ステップS64)。そして、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS65)。そして、続いて、元の関数を呼び出す(ステップS66)。関数からリターンすると、関数定義に構造体のサイズ指定(structsize_is)の設定が存在するか判別し(ステップS67)、存在する場合には、設定されている構造体パラメータのデータをサイズ指定(structsize_is)の設定で定義されているデータサイズ範囲内で解析する(ステップS68)。そして、リターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS69)。この処理はユーザから終了の命令があると(ステップS70)終了される。
【0067】
図26は、図25で行われる構造体パラメータ解析の詳細をメモリ配置を基に表した図である。
【0068】
実際のプログラムでGetFuncDataがdwKind=1で使用された場合には、STRUCTSIZE1構造体(300)が使用され、その時の各メンバ(301〜304)のメモリ使用は、図のようになっている。図24の様に関数定義がなされている場合には、本ソフトウェア評価システムでは、STRUCTSIZE構造体(305)として認識され、その時の各メンバ(306〜311)のメモリ使用は図のようになると推測する。そして、サイズ指定(structsize_is)の設定が存在する場合には、dwSizeの値を調べることで、構造体のサイズがdwSizeバイトであると知ることが可能となり、STRUCTSIZE構造体のうち、dwSizeバイト分(312)のデータのみをログとして取得する。
【0069】
図27は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図24の定義により取得されたログデータの図である。通常の関数定義では、void*となり、ポインタのみしか取得できない構造体のデータが、使用される構造体の種類により、その構造体のデータがログとして取得されている。
【0070】
このように、本実施形態によれば、通常の方法では取得できないパラメータのログを取得可能になるという効果が得られる。
【0071】
【第6の実施形態】
図28は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、通常の関数定義では、パラメータを取得できない関数の例である。
【0072】
構造体として、STRUCTKIND1, STRUCTKIND2, STRUCTKIND3の3種類が定義されている。GetFuncData関数は、第一パラメータdwKindに第二パラメータlpBufに上記3種類のどの構造体のポインタが渡されているかを設定する。FuncGetData関数は、第一パラメータが1の場合には、lpBufをSTRUCTKIND1のポインタとして扱って処理を行い、第一パラメータが2の場合には、lpBufをSTRUCTKIND2のポインタとして扱って処理を行い、第一パラメータが3の場合には、lpBufをSTRUCTKIND3のポインタとして扱って処理を行う。この場合、通常の関数定義により、FuncGetDataを定義すると、lpBufはvoid型のポインタとなり、データを取得することはできない。
【0073】
図29は、図28に於いて、STRUCTKIND1, STRUCTKIND2, STRUCTKIND3の各構造体がどのようなメモリ配置になるかを示した図である。構造体STRUCTKIND1(330)の、各メンバは、オフセット0x0000にchar chParam(331)、0x0001にDWORD dwParam(332)、0x0005にshort shParam(333)が存在する。構造体STRUCTKIND2(334) の、各メンバは、オフセット0x0000にshort shParam(335)、0x0002にDWORD dwParam(336)、0x0006にchar chParam(337)が存在する。構造体STRUCTKIND3(338) の、各メンバは、オフセット0x0000にchar chParam(339)、0x0001にshort shParam(340)、0x0003にDWORD dwParam(341)、0x0007にlong lParam(342)、0x000Bにint nParamが存在する。このように、各構造体にサイズの情報が無く、構造体データのメモリ構造も異なるため、第5の実施形態で示した方法は使用できない。
【0074】
図30は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図28の様な関数のパラメータのログを取得するためのIDLによる記述である。
【0075】
各構造体は、通常の方法で定義されている。FuncGetData関数の第二パラメータvoid* lpBufに対して[custum(PAT_PARAM_ID, ”structkind_is(dwKind:1:STRUCTKIND1*, 2:STRUCTKIND2*, 3:STRUCTKIND3*)”)]と設定している。これによりlpBufのデータ型は、第一パラメータdwKindの値が1の場合には、STRUCTKIND1*として、2の場合には、STRUCTKIND2*として、3の場合には、STRUCTKIND3*として扱われ、ログとして保存される。
【0076】
図31は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図30の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【0077】
処理が開始されると(ステップS81)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をメモリに保存する(ステップS82)。次に関数定義に構造体の種類指定(structkind_is)の設定が存在するか判別し(ステップS83)、存在する場合には、設定されている構造体パラメータのデータを種類指定(structkind_is)の設定で定義されているデータ型として解析する(ステップS84)。そして、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をメモリに保存する(ステップS85)。そして、続いて、元の関数を呼び出す(ステップS86)。関数からリターンすると、関数定義に構造体の種類指定(structkind_is)の設定が存在するか判別し(ステップS87)、存在する場合には、設定されている構造体パラメータのデータを種類指定(structkind_is)の設定で定義されているデータ型として解析する(ステップS88)。そして、リターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をメモリに保存する(ステップS89)。この処理はユーザから終了の命令があると(ステップS90)終了される。
【0078】
図32は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図30の定義により取得されたログデータの図である。通常の関数定義では、void*となり、ポインタのみしか取得できない構造体のデータが、使用される構造体の種類により、その構造体のデータがログとして取得されている。
【0079】
このように本実施形態によれば、通常の方法では取得できないパラメータのログを取得可能になるという効果が得られる。
【0080】
【他の実施形態】
なお、本発明は、複数の機器(例えばホストコンピュータ,インタフェイス機器、リーダ、プリンタなど)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機、ファクシミリ装置など)に適用してもよい。
【0081】
また、本発明の目的は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読出し実行することによっても、達成されることは言うまでもない。
【0082】
この場合、記憶媒体から読出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。
【0083】
プログラムコードを供給するための記憶媒体としては、例えば、フロッピ(登録商標)ディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、CD−R、磁気テープ、不揮発性のメモリカード、ROMなどを用いることができる。
【0084】
また、コンピュータが読出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているOS(オペレーティングシステム)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0085】
さらに、記憶媒体から読出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0086】
【発明の効果】
以上説明したように本発明によれば、複数にモジュール分けされたソフトウェアの処理ログを容易に取得でき、かつ、ソフトウェアの障害の原因の解析のための工数を削減することが可能となる。
【図面の簡単な説明】
【図1】本発明の第1の実施形態にかかるログ取得方法を実現するコンピュータ(ソフトウェア評価システム)の構成をあらわす図である。
【図2】本発明の第1の実施形態にかかるログ取得方法を説明するためにあらわした、関数ロード時の通常のメモリ構成をあらわす図である。
【図3】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのIAT Patch使用時のメモリ構成をあらわす図である。
【図4A】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのIAT Patchを使用時の状態を示す図である。
【図4B】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのログ取得処理の流れを示す図である。
【図5】本発明の第1の実施形態にかかるソフトウェア評価システムのIAT Patchを使用時の内部構成をあらわす図である。
【図6】本発明の第1の実施形態にかかるログ取得方法を説明するためにあらわした、COMサーバのインターフェースのインスタンス作成時の通常のメモリ構成をあらわす図である。
【図7】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのVTable Patch使用時のメモリ構成をあらわす図である。
【図8A】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのVTable Patchを使用時の状態を示す図である。
【図8B】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのログ取得処理の流れを示す図である。
【図9】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの、内部構成をあらわす図である。
【図10】本発明の第2の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義の一例を示す図である。
【図11】本発明の第2の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて、ポインタ・パラメータに対してバイナリ取得を指定することで、ポインタ・パラメータのデータの実体をログとして取得する為のIDLによる記述を示す図である。
【図12】本発明の第2の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図11の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図13】本発明の第2の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図11の定義により取得されたログデータの図である。
【図14】本発明の第3の本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて、コールバック関数等のエクスポートされていない関数をログとして取得するためのIDLによる記述を示す図である。
【図15】本発明の第3の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのメモリ構成をあらわす図である。
【図16】本発明の第3の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図17】本発明の第3の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の定義を行わない場合に取得されたログデータの図である。
【図18】本発明の第3の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の定義より取得されたログデータの図である。
【図19】本発明の第4の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて、可変長配列のパラメータをログとして取得するためのIDLによる記述を示す図である。
【図20】本発明の第4の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図19の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図21】本発明の第4の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図19の定義を行わない場合に取得されたログデータ(250)と、図19の定義により取得されたログデータ(251)の図である。
【図22】本発明の第5の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、通常の関数定義では、パラメータを取得できない関数の例を示す図である。
【図23】図22に於いて、STRUCTSIZE1, STRUCTSIZE2, STRUCTSIZE3の各構造体がどのようにメモリを使用するかを示す図である。
【図24】本発明の第5の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図22の様な関数のパラメータのログを取得するためのIDLによる記述を示す図である。
【図25】本発明の第5の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図26】図25で行われる構造体パラメータ解析の詳細をメモリ配置をもとに表した図である。
【図27】本発明の第5の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図24の定義により取得されたログデータの図である。
【図28】本発明の第6の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、通常の関数定義では、パラメータを取得できない関数の例を示す図である。
【図29】図28に於いて、STRUCTKIND1, STRUCTKIND2, STRUCTKIND3の各構造体がどのようなメモリ配置になるかを示した図である。
【図30】本発明の第6の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図28の様な関数のパラメータのログを取得するためのIDLによる記述を示す図である。
【図31】本発明の第6の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図30の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図32】本発明の第6の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図30の定義により取得されたログデータの図である。
【符号の説明】
1:CPU
2:チップセット
3:RAM
4:ハードディスクコントローラ
5:ディスプレイコントローラ
6:ハードディスクドライブ
7:CD−ROMドライブ
8:ディスプレイ
11:CPUとチップセットを繋ぐ信号線
12:チップセットとRAMを繋ぐ信号線
13:チップセットと各種周辺機器とを繋ぐ周辺機器バス
14:ハードディスクコントローラとハードディスクドライブを繋ぐ信号線
15:ハードディスクコントローラとCD−ROMドライブを繋ぐ信号線
16:ディスプレイコントローラとディスプレイを繋ぐ信号線
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a technique for acquiring a processing log of software divided into a plurality of modules.
[0002]
[Prior art]
Conventionally, for a software failure with a low recall rate, a processing log of the software has been acquired, and the processing log has been analyzed to determine the cause of the failure and take countermeasures.
[0003]
[Problems to be solved by the invention]
However, the conventional processing log acquisition has the following problems.
(1) In order to continue to get the even log in the user's operating environment, tweaked to the module itself software must be added the process log acquisition routine, the workload for processing log acquisition is large.
(2) Since the processing log is obtained for each module, the generated log is for each module, and it is difficult to obtain the processing of the entire software as a completely chronological log. For this reason, the prospect of the entire processing log is poor, and the process of analyzing the log and finding the cause of the failure requires a lot of man-hours.
[0004]
The present invention has been made in view of the above problems, to get the processing log software that the plurality of modules divided easily and can reduce the man-hours for analysis of causes of the failure of the software It is an object of the present invention to provide a simple log acquisition method, a program for realizing the method by a computer, and a storage medium storing the program.
[0005]
[Means for Solving the Problems]
Log acquisition method according to the present invention in order to achieve the above object has the following arrangement. That is,
A log acquisition method for acquiring a log during the execution of a program with a function for performing predetermined processing,
Rewriting the address of the loaded function for performing the predetermined processing to the address of a function for obtaining a log,
The log acquisition function is
Calling a function for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
Determining in the function definition in the program whether or not the pointer parameter is defined by a predetermined definition method;
Recording the contents of the memory pointed to by the pointer parameter as a log based on the definition method when the pointer parameter is defined by a predetermined definition method.
[0006]
BEST MODE FOR CARRYING OUT THE INVENTION
[First Embodiment]
This embodiment is a mechanism when a function call that exists from one module within another module takes place, by using the import function address stored in the memory or virtual function address table, (Virtual Address Table) By hooking function calls between modules and recording them in a log, it is possible to acquire the processing of the entire software as a log in chronological order without changing the software module itself. . This will be specifically described below.
[0007]
<System configuration>
Figure 1 is a diagram showing the configuration of the computer (software evaluation system) that implements the log acquisition method according to the embodiments of the present invention. For simplicity of explanation, in the present embodiment, the software evaluation system is built inside one PC, but the feature of the log acquisition method of the present invention is built inside one PC. or, alternatively it is effective regardless of the plurality of PC to either constructed as a network system.
[0008]
A computer on which the software evaluation system is mounted includes a CPU 1, a chip set 2, a RAM 3, a hard disk controller 4, a display controller 5, a hard disk drive 6, a CD-ROM drive 7, and a display 8. Further, a signal line 11 connecting the CPU and the chipset, a signal line 12 connecting the chipset 2 and the RAM 3, a peripheral device bus 13 connecting the chipset 2 and various peripheral devices, and a signal connecting the hard disk controller 4 and the hard disk drive 6. A line 14, a signal line 15 connecting the hard disk controller 4 and the CD-ROM drive 7, and a signal line 16 connecting the display controller 5 and the display 8 are mounted.
[0009]
<Acquisition of processing log for function processing>
In order to explain a software evaluation system for realizing the log acquisition method according to the first embodiment of the present invention, first, referring to FIG. 2, how the software divided into a plurality of modules is loaded into the memory in a normal state. Explain.
[0010]
Usually, the software divided into a plurality of modules is divided into an executable file EXE (23) for controlling the whole and a dynamic link library DLL (27) which exists as a module and plays a complementary role of EXE, and Is loaded with both EXE and DLL. EXE consists of a code segment (28), a data segment (29), and an import function address table (22). Furthermore, import function address table is divided by the DLL belonging function (21, 24), addresses each of the function for each DLL is loaded is written (30-35). The entity of the DLL function is loaded separately (25, 26) for each DLL, and each function is loaded as a part of the corresponding DLL (36-41). In this figure, one EXE is A.D. DLL and B.I. Shows an example using the functions in two dynamic link libraries DLL, actually function used is turned Func AA, Func AB, Func AC, Func BA, Func BB, and six Func BC ing.
[0011]
When a code in the EXE code segment calls the function Func AA, first, the address (30) of the Func AA written in the import function address table is read. Here, A. The address of the Func AA code (36) read as a part of the DLL is written, and by calling the address, the code of EXE becomes A.D. The DLL Func AA can be called.
[0012]
FIG. 3 is a diagram illustrating a memory configuration of a software evaluation system that implements the log acquisition method according to the first embodiment of the present invention. FIG. 2 illustrates an IAT Patch (Import Address) for a log acquisition code. The difference is that the function call is redirected using a method called “Table Patch”.
[0013]
When logging is started, the memory is a DLL for IAT Patch C. DLL (58) is loaded. C. DLL is the address of a function written in the import function address in the table (52), C. The log acquisition code in the DLL is rewritten with the addresses of Func CAA, Func CAB, Func CAC, Func CBA, Func CBB, and Func CBC (61 to 66). C. Func CAA in DLL, Func CAB, Func CAC, Func CBA, Func CBB, Func CBC code (73 to 78), as well as logging, has been loaded into the memory to receive the original function call, the appropriate Function Func AA, Func AB, Func AC, Func BA, Func BB, Func BC (67-72).
[0014]
Figure 4A is a diagram representing the processing of the IAT Patch in FIG. 3, FIG. 4B is a flow chart showing the flow of a log acquisition process. For simplicity of explanation, EXE in FIG. An example of how the log acquisition code by IAT Patch operates when calling Func AA in the DLL is shown.
[0015]
When EXE (91 in FIG. 4A) calls Func AA (94 in FIG. 4A), C.I. The log acquisition code in the DLL saves the DLL name / function name in the memory (step S402 in FIG. 4B), saves the call time in the memory, saves the parameter at the time of the call in the memory, and stores the pointer parameter at the time of the call. The content of the memory pointed to is stored in another memory (95 in FIG. 4A, step S403 in FIG. 4B). Thereafter, C.I. The DLL was supposed to be called. DLL calls the Func AA in (93 in FIG. 4A) (96 in Fig. 4A, step S404 in FIG. 4B). A. Func AA process DLL (97 in FIG. 4A) is completed, C. When control returns to the DLL (98 in FIG. 4A), C. The DLL saves the time at the time of return to the memory, saves the return value to the memory, and saves the memory contents indicated by the pointer parameter to another memory at the time of return (99 in FIG. 4A). Thereafter, C.I. DLL writes the saved log information to a file (100 in FIG. 4A, step S405 in FIG. 4B), though A. The program returns to EXE as if the Func AA of the DLL ended normally (101).
[0016]
Figure 5 is a diagram showing the internal configuration of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention. Normally, the executable EXE (113) calls a function in DLL-1 (116) or DLL-2 (117). Here, a log acquisition code called an API tracer is embedded (114), and a processing log is generated. (115). API tracer, a file that describes the function definition of DLL-1 and DLL-2 (111), which DLL throat function import function of setting the scenario to retrieve log by rewriting the table (Trace scenario 112) based on Works.
[0017]
<Process log acquisition for method processing>
Next, in the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention, when the instance creation interface being exported by executable EXE (118) is COM (Component Object Model) server, which In order to explain how the memory is loaded, first, how the memory is loaded in a normal state will be described with reference to FIG.
[0018]
Normally, when an instance of an interface is created, the required interface (121, 122) and its method (: a program describing a procedure to be executed by an object in object-oriented programming, 130 to 135) are created in the COM server. Created, they are both loaded into memory. Here, a virtual address table (virtual address table) is created for each created interface (118, 120), and is passed to the EXE that made the creation request. In the virtual address table, addresses where the respective methods are created are written (124 to 129). EXE uses these information to call each interface. In this figure, one EXE has created instances of two interfaces Interface A and Interface B, shows an example using the method of internal its interfaces, methods that are actually used , Method AA, Method AB, Method AC, Method BA, Method BB, and Method BC.
[0019]
When the EXE code calls the function Method AA, first, the address (124) of the Method AA written in the virtual address table is read. Here actually it is written the address of created as part the Method AA code (130) of the Interface A of COM server by calling the address, the Method AA of the EXE Code Interface A Can be called.
[0020]
FIG. 7 is a diagram illustrating a memory configuration of a software evaluation system that implements the log acquisition method according to the first embodiment of the present invention. FIG. 6 illustrates a VTable Patch (virtual address) for a log acquisition code. The method is different in that the method call is redirected using a method called “table patch”.
[0021]
When the log acquisition is started, the DLL (143) for VTable Patch is loaded into the memory. This DLL virtual address table the address of the method written in (136, 138), a log acquisition code in the DLL Method A'A, Method A'B, MethodA'C, Method B'A, Method B 'B, rewrites the address of Method B'C (145~150). Method A'A in DLL, Method A'B, Method A'C, Method B'A, Method B'B, Method B'C code (157-162), as well as logging, original method The corresponding methods, Method AA, Method AB, Method AC, Method BA, Method BB, Method, which are loaded in memory to receive the call
Call the BC (157~162).
[0022]
FIG. 8A is a diagram showing the process of VTable Patch in FIG. 7, and FIG. 8B is a flowchart showing the flow of the log acquisition process. For simplicity of the description, this figure shows an example of how the log acquisition code by VTable Patch operates when EXE calls MethodA of Interface A in the COM server.
[0023]
When the EXE (163 in FIG. 8A) calls the Method AA (166 in FIG. 8A), the log acquisition code stored in the DLL saves the module name / interface name / method name in the memory (step S802 in FIG. 8B) and calls it. Save the time in the memory, to save the parameters of time of the call in the memory, the memory content pointed to parameters of time of the call, is stored in a separate memory (167 in FIG. 8A, step S803 in FIG. 8B)). After that, the DLL calls the Method AA in the COM server (165 in FIG. 8A), which should have been called originally (168 in FIG. 8A, step S804 in FIG. 8B). When the Method AA processing of the COM server (169 in FIG. 8A) is completed and control returns to the DLL (170 in FIG. 8A), the DLL saves the time at the time of return in the memory, saves the return value in the memory, and returns. the sometimes memory contents pointer parameter points, is stored in another memory (171 in FIG. 8A). Thereafter, DLL writes the saved log information in a file (in FIG. 8A 172, step S805 in FIG. 8B), as if Method AA of COM server terminates normally, the process returns to the EXE (in FIG. 8A 173).
[0024]
FIG. 9 is a diagram illustrating an internal configuration of the software evaluation system according to the first embodiment of the present invention. Normally, the executable EXE (176) calls a method in the COM server 1 (179) or the COM server 2 (180). Here, a log acquisition code called an API tracer is embedded (177), and a processing log is generated. (178). The API tracer sets a file (174) in which the function definitions of the COM server 1 (179) and the COM server 2 are described, and a setting scenario of rewriting the virtual address table of which method of which interface of which COM server to acquire the log. It operates based on (175).
[0025]
As apparent from the above description, according to the log acquisition method according to the present embodiment, the acquisition module Graded software processing log plurality in, without making changes to the module itself, are provided in the module were it becomes possible to record a call function / method as a log, it is possible to reduce the workload for processing log acquisition. Further, the generated log can be acquired as a log in chronological order, and the log can be easily analyzed. Therefore, the number of steps for analyzing the cause of the software failure can be reduced.
[0026]
[Second embodiment]
In the present embodiment, in the normal, describe the case of logging data pointer parameters that can not be acquired as a binary.
[0027]
FIG. 10 is an example of a function definition of a software evaluation system for realizing the log acquisition method according to the present embodiment, which is described in IDL, which is generally widely used. In a software evaluation system that realizes the log acquisition method according to the present embodiment, a type library file obtained by tokenizing the IDL is used as a function definition file.
[0028]
11, in the function definition of the software evaluation system that implements the log acquisition method according to the present embodiment, by specifying the binary obtained for pointer parameter, obtains the actual data of the pointer parameter as a log This is a description by IDL for performing the operation.
[0029]
In the definition of the FuncbinidId function, custom (PAT_PARAM_ATTR_ID, "binid_is ()") is declared for long * lplParam (201). Here, PAT_PARAM_ATTR_ID (200) is an identifier for use by the present software evaluation system in IDL. Here, by defining “binid_is ()”, data of the data type size (here, long type) of the parameter from the pointer pointed to by this parameter is stored in the log as binary data.
[0030]
In the definition of the FuncSizeIs function, custom (PAT_PARAM_ATTR_ID, "size_is (dwCount)") is declared for int * lplParam (202). Here, by defining “size_is (dwCount)”, this parameter is treated as having dwCount data as the first parameter. Then, from the pointer pointed to by this parameter, data of (dwCount × the data type size of the parameter (here, int type)) is stored in the log as binary data.
[0031]
In the definition of FuncLengthIs function, it has been declared custum (PAT_PARAM_ATTR_ID, "length_is (dwLength)") to the char * lpszParam (203). Here, by defining “length_is (dwLength)”, this parameter is treated as having dwLength data as the first parameter. Then, data corresponding to (dwLength × data type size of parameter (char type in this case)) from the pointer indicated by this parameter is stored in the log as binary data.
[0032]
In the definition of FuncBytesIs function, has been declared custum (PAT_PARAM_ATTR_ID, "bytes_is (dwSize)") with respect to void * lpParam (204). Here, by defining “bytes_is (dwSize)”, this parameter is treated as having dwSize bytes of data as the first parameter. Then, dwSize bytes of data are stored in the log as binary data from the pointer indicated by this parameter.
[0033]
In the definition of FuncBytesIs1 function, has been declared custum (PAT_PARAM_ATTR_ID, "bytes_is (12)") with respect to void * lpParam (205). Here, by defining "bytes_is (12)", this parameter is treated as having the specified data of 12 bytes. Then, from the pointer pointed to by this parameter, 12 bytes of data are stored in the log as binary data.
[0034]
FIG. 12 is a diagram showing a flow of acquiring a log when a function is defined as shown in FIG. 11 in the software evaluation system for realizing the log acquisition method according to the present embodiment.
[0035]
When the process is started (step S1), log acquisition is started, and the module name, interface name, and function / method name are stored in the HDD (step S2). Then log acquisition code stores the call time, the contents of the memory pointed to parameters and pointer parameter to HDD (step S3). Then, it is judged whether the setting of the binary acquisition function definition exists (step S4), and if present, each defining the memory size to store calculated (binid_is, size_is, length_is, bytes_is) for each (step S5 ), The contents of the memory pointed to by the pointer parameter are stored in the HDD by the calculated size (step S6). Subsequently, the original function is called (step S7). When returning from the function, the log acquisition code saves the time at the time of return, the return value, and the contents of the memory indicated by the pointer parameter in the HDD (step S8). Then, it is judged whether the setting of the binary acquisition function definition exists (step S9), and if present, each defining the memory size to store calculated (binid_is, size_is, length_is, bytes_is) for each (step S10 ), The contents of the memory pointed to by the pointer parameter are stored in the HDD by the calculated size (step S11). The process when there is an instruction of termination from the user (step S12) is terminated.
[0036]
Figure 13 is the software evaluation system that implements the log acquisition method according to the present embodiment, a diagram of the acquired log data by the definition of FIG.
[0037]
The function definition, logs can be obtained when there is no set of binary acquisition (210) is a portion excluding the DataID. Then, when performing the setting of the binary acquisition, DataID and binary data log (211) can be obtained. For example, comparing the log FuncSizeIs, when there is no set of binary acquisition, the data pointed to by the pointer parameter lpParam only one minute in an int can be acquired. However, in practice this data points to the array of ten int type data. Therefore, when the setting of binary acquisition is performed, it is possible to acquire a total of 40 bytes of data of 4 bytes × 10, which is the size of int type data.
[0038]
As apparent from the above description, according to this embodiment, by associating the size and pointer parameter, in normal, the log can acquire data pointer parameters that can not be acquired as a binary.
[0039]
[Third Embodiment]
In the present embodiment, a case will be described in which a function that is not exported, such as a callback function, is acquired as a log.
[0040]
FIG. 14 is a description by IDL for acquiring a function that is not exported, such as a callback function, as a log in the function definition of the software evaluation system that implements the log acquisition method according to the present embodiment.
[0041]
In the definition of the FuncSetCallBack function, DWORD pfnFuncCallBack is declared to be custom (PAT_PARAM_ATTR_ID, "funcname_is (FuncCallBack)") (221). The FuncSetCallBack function is a function for setting a callback function for a module, and the DWORD pfnFuncCallBack is a parameter for setting the address of the callback function. Here, by defining a "funcname_is (FuncCallBack)", the log acquisition process recognizes the value passed in the parameter as FuncCallBack address of the function (222) is replaced with the address of the log acquisition process. Also, to save the original value to call the original callback function when the log acquisition process. As a result, the log of the callback function that is not exported it is possible to get.
[0042]
In the definition of the GetFuncPointer function, DWORD pfnFuncInternal is declared as custom (PAT_PARAM_ATTR_ID, “funcname_is (FuncInternal))” (223). The GetFuncPointer function, which does not acquire a pointer inside the module, is a function that does not obtain the pointer inside the module. in and, DWORD PfnFuncInternal is a parameter for obtaining the pointer to the non-export function. here, by defining a "funcname_is (FuncInternal)", the log acquisition process is passed to the parameter value It was recognized as the address of FuncInternal function (224), the address of the log acquisition process To conversion. Further, stores the original values in order to call the original non-exported function when the log acquisition process. Thus, the log of the function of the internal module which is not exported is obtainable.
[0043]
GetFuncPointeArray function (225) is a function for obtaining the exported non address of the function groups of the internal modules FUNCPOINTERARRAY structure (220). Here, custom (PAT_PARAM_ATTR_ID, “funcname_is (FuncInternational1 to 4)”) is declared for the definition of each member of FUNCPOINTERARRAY. Here, by defining a "funcname_is (FuncInternal1~4)"), the value passed to members of this structure is recognized as the address of FuncInternal1~4 function (226), substituting the address of the log acquisition process . Also, to save the original value to call the original non-exported functions during log acquisition process. This allows obtaining a log of the function group of internal modules that are not exported.
[0044]
Figure 15 is a diagram showing the memory configuration of the software evaluation system that implements the log acquisition method according to the present embodiment, and FIG. 3, with the difference that the log code for obtaining the hidden function is added . A. The FuncAD (231) in the DLL is an unexported function, and therefore does not exist in the Import Address Table (230). At this time, if funcname_is is defined for FuncAD, C.I. The FuncCAD (232) for log acquisition is generated in the DLL, and the address of the FuncCAD is used when replacing the value of the parameter defined by funcname_is that returns the address of the FuncAD.
[0045]
FIG. 16 is a diagram illustrating a flow of acquiring a log when a function is defined as shown in FIG. 14 in the software evaluation system that implements the log acquisition method according to the present embodiment.
[0046]
When the process is started (step S21), log acquisition is started, and the module name, interface name, and function / method name are stored in the HDD (step S22). Next, the log acquisition code saves the time at the time of calling, the parameter, and the contents of the memory indicated by the pointer parameter in the HDD (step S23). Then, it is determined whether the setting of funcname_is exists in the function definition (step S24). If so, the function definition defined by funcname_is is acquired from the function definition file, and the log acquisition processing is performed based on the definition. Is generated (step S25). Then, the value in which funcname_is is defined is stored and replaced with the address of the generated log acquisition code (step S26).
[0047]
Subsequently, the original function is called (step S27). Upon return from the function, the log acquisition code saves the time at the time of return, the return value, and the contents of the memory indicated by the pointer parameter in the HDD (step S28). Then, it is determined whether the setting of funcname_is exists in the function definition (step S29). If so, the definition of the function defined by funcname_is is acquired from the function definition file, and the log acquisition processing is performed based on the definition. Is generated (step S30). Then, to save the value funcname_is is defined, it replaced the generated log acquisition code address (step S31). The process when there is an instruction of termination from the user (step S32) is terminated.
[0048]
When the parameter set in funcname_is is replaced with the address of the generated log acquisition code, the original function that is subsequently called using that address will be processed in the same way as a normal log (ie, , generated log acquisition code, calls a function that is not exported, the process is running, with pass execution results received, the predetermined information when calling a function that is not exported, when receiving the execution result Is recorded as a log).
[0049]
FIG. 17 is a diagram of log data acquired when the definition of FIG. 14 is not performed in the software evaluation system that implements the log acquisition method according to the present embodiment. If you do not want to set at the function definition file, callback function, the internal functions that are not export the log can not be retrieved.
[0050]
FIG. 18 is a diagram of log data acquired from the definition of FIG. 14 in the software evaluation system that implements the log acquisition method according to the present embodiment. In function definition file, the callback function, since the set to obtain an internal function that is not exported, and FuncCallBack function, FuncInternal function, log non exported functions such FuncInternal4 function is obtainable.
[0051]
According to this embodiment, effects are obtained that it becomes possible to acquire a log of the non-exported functions that can not be acquired in the usual way.
[0052]
[Fourth embodiment]
In the present embodiment, as the log of the functions that can not be acquired in the usual way, we described a case of acquiring a log of the parameters of the variable-length sequences.
[0053]
FIG. 19 is a description by IDL for obtaining a variable-length array parameter as a log in the function definition of the software evaluation system that realizes the log obtaining method according to the present embodiment.
[0054]
In the definition of the FuncArrayIs function, it is declared that int * lpnParam is custom (PAT_PARAM_ATTR_ID, "array_is (dwCount)") (240). Here, by defining "array_is (dwCount)", this pointer parameter is treated as an int type array for dwCount which is the first parameter. Then, a pointer to this pointer parameter and dwCount pieces of type int and stores data in a log.
[0055]
FIG. 20 is a flowchart for acquiring a log when a function is defined as shown in FIG. 19 in the software evaluation system that realizes the log acquisition method according to the present embodiment.
[0056]
When the processing is started (step S41), log acquisition is started, and the module name, interface name, and function / method name are stored in the HDD (step S42). Next, it is determined whether or not the setting of variable length array acquisition (array_is) exists in the function definition (step S43), and if so, the parameter defined by the pointer parameter is treated as an array definition (step S44). stores the call time, the contents of the memory pointed to parameters and pointer parameter to HDD (step S45). And, subsequently, call the original function (step S46). Upon returning from the function, the log acquisition code determines whether the setting of variable-length array acquisition (array_is) exists in the function definition (S47). If so, the parameter defined by the pointer parameter is defined in the array definition. (Step S48), and the time at the time of return, the return value, and the contents of the memory pointed to by the pointer parameter are stored in the HDD (step S49). The process when there is an instruction of termination from the user (step S50) is terminated.
[0057]
FIG. 21 shows log data (250) obtained when the definition of FIG. 19 is not performed and log data (250) obtained by the definition of FIG. 19 in the software evaluation system that realizes the log obtaining method according to the present embodiment. 251) is a view of. If the setting is not performed in the function definition file, only the first data is obtained because the pointer parameter cannot be handled as an array, but if the setting is performed in the function definition file, since the pointer parameter is treated as an array, all the data sequences have been acquired.
[0058]
As described above, according to the present embodiment, an effect is obtained that a log of a parameter of a variable length array can be obtained as a log of a function that cannot be obtained by a normal method.
[0059]
[Fifth Embodiment]
In the present embodiment, in a normal function definition, the function can not obtain the parameter, the case of acquiring the log.
[0060]
FIG. 22 is a software evaluation system that realizes the log acquisition method according to the present embodiment, and is an example of a function for which parameters cannot be acquired with a normal function definition.
[0061]
Three types of structures, STRUCTSIZE1, STRUCTSIZE2, and STRUCTSIZE3, are defined, and the DWORD dwSize member of each structure needs to include the size of its own structure. The FuncGetData function sets which of the above three types of structure pointers is passed to the first parameter dwKind and the second parameter lpBuf. When the first parameter is 1, the FuncGetData function performs processing by treating lpBuf as a pointer of STRUCTURESIZE1, and when the first parameter is 2, performs processing by treating lpBuf as a pointer of STRUCTSIZE2. if the parameter is 3, performs processing deals with lpBuf as a pointer STRUCTSIZE3. In this case, if FuncGetData is defined by a normal function definition, lpBuf becomes a void-type pointer, and data cannot be acquired.
[0062]
FIG. 23 is a memory diagram showing how each structure of STRUCTURESIZE1, STRUCTSIZE2, and STRUCTSIZE3 uses a memory in FIG. Structure STRUCTSIZE1 of (260), each member is to offset 0x000 DWORD dwSize (261), DWORD dwParam1 (262) to 0x0004, DWORD dwParam3 is present in the DWORD DwParam2,0x000C to 0x0008. The structure STRUCTURESIZE2 (265) is the same as the STRUCTURESIZE1 from DWORD dwSize to DWORD dwParam3 (266 to 269), and a DWORD dwParam 4 (270) exists at 0x0010. STRUCTSIZE3 (271) is the same as STRUCTSIZE2 from DWORD dwSize to DWORD dwParam4 (272 to 276), and DWORD dwParam5 (277) exists at 0x0014. As described above, the memory arrangement from dwSize to dwParam4 of STRUCTSIZE3 is the same as that of STRUCTSIZE2, and the memory arrangement from dwSize to dwParam3 of STRUCTSIZE2 is the same as that of STRUCTSIZE1.
[0063]
FIG. 24 is a software evaluation system for realizing the log acquisition method according to the present embodiment, which is a description in IDL for acquiring a log of function parameters as shown in FIG.
[0064]
In the original function, a structure separated from Structsize1, Structsize2, and Structsize3 is defined as one structure called Structsize (291). This definition is the same as that of STRUCTURESIZE3 because, from the memory arrangement in FIG. 23, STRUCTURESIZE3 has the same memory arrangement part as STRUCTSIZE1 and STRUCTSIZE2. Then, [custom (PAT_PARAM_ID, "structsize_is ()")] is set for DWORD dwSize, which is a member of this structure and indicates the size of the structure. In this, log acquisition process when performing data analysis of the structure, it is possible to know the size of the structure. Further, in FuncGetData function, you define lpBuf second parameter as STRUCTSIZE type. Thereby, in the case of storing the parameter as a log processing is performed as STRUCTSIZE type. If the function definition file is described so as to acquire the data of STRUCTURESIZE3 without using this method, if GetFuncData is called with dwKind = 1 or 2, the data of STRUCTSIZE1 or STRUCTSIZE2 must exist. now, in order to result in trying to get the data of dwParam3 and dwParam4 in the log, the memory exception occurs.
[0065]
FIG. 25 is a diagram illustrating a flow of acquiring a log when a function is defined as illustrated in the software evaluation system that realizes the log acquisition method according to the present embodiment.
[0066]
When the process is started (step S61), log acquisition is started, and the module name, interface name, and function / method name are stored in the HDD (step S62). Next, it is determined whether or not the setting of the structure size designation (structsize_is) exists in the function definition (step S63). If there is, the data of the set structure parameter is set by the size designation (structsize_is) setting. analyzing in a data size range defined (step S64). Then, to save the call time, the contents of the memory pointed to parameters and pointer parameter to HDD (step S65). And, subsequently, call the original function (step S66). When returning from the function, it is determined whether or not the setting of the structure size specification (structsize_is) exists in the function definition (step S67). If so, the data of the set structure parameter is specified by the size specification (structsize_is). is in the set defined analyzed in the data size range is (step S68). Then, to save the return time, the contents of the memory pointed return value and pointer parameter to HDD (step S69). The process when there is an instruction of termination from the user (step S70) is terminated.
[0067]
Figure 26 is a diagram showing the details of the structure parameter analysis performed in FIG. 25 based on the memory configuration.
[0068]
When GetFuncData is used with dwKind = 1 in an actual program, a STRUCTURESIZE1 structure (300) is used, and the memory usage of each member (301 to 304) at that time is as shown in the figure. When the function is defined as shown in FIG. 24, the software evaluation system recognizes the function as a STRUCTURESIZE structure (305), and estimates that the memory usage of each member (306 to 311) at that time is as shown in the figure. to. Then, when the size specification (structsize_is) setting exists, by checking the value of dwSize, it is possible to know that the size of the structure is dwSize bytes. only the data of 312) to get as a log.
[0069]
Figure 27 is the software evaluation system that implements the log acquisition method according to the present embodiment, a diagram of the acquired log data by the definition of FIG. 24. In a normal function definition, data of a structure that is void * and data of only a pointer can be obtained is obtained as a log depending on the type of the structure used.
[0070]
Thus, according to this embodiment, effects are obtained that it becomes possible to acquire the log can not be acquired parameter in the usual way.
[0071]
[Sixth embodiment]
FIG. 28 is a software evaluation system that realizes the log acquisition method according to the present embodiment, and is an example of a function for which parameters cannot be acquired with a normal function definition.
[0072]
Three types of structures, STRUCTKIND1, STRUCTKIND2, and STRUCTKIND3, are defined. The GetFuncData function sets which of the above three types of structure pointers is passed to the second parameter lpBuf for the first parameter dwKind. When the first parameter is 1, the FuncGetData function handles lpBuf as a pointer to STRUCTKIND1, and when the first parameter is 2, handles lpBuf as a pointer to STRUCTKIND2. if the parameter is 3, performs processing deals with lpBuf as a pointer STRUCTKIND3. In this case, if FuncGetData is defined by a normal function definition, lpBuf becomes a void-type pointer, and data cannot be acquired.
[0073]
FIG. 29 is a diagram showing the memory arrangement of each structure of STRUCTKIND1, STRUCTKIND2, and STRUCTKIND3 in FIG. Each member of the structure STRUCTKIND1 (330) has a charParam (331) at offset 0x0000, a DWORD dwParam (332) at 0x0001, and a short shParam (333) at 0x0005. Each member of the structure STRUCTKIND2 (334) has a short shParam (335) at offset 0x0000, a DWORD dwParam (336) at 0x0002, and a char chParam (337) at 0x0006. Structure STRUCTKIND3 of (338), each member is to offset 0x0000 char chParam (339), short shParam to 0x0001 (340), DWORD dwParam to 0x0003 (341), long lParam to 0x0007 (342), is int nParam the 0x000B exist. As described above, since there is no size information in each structure and the memory structure of the structure data is different, the method described in the fifth embodiment cannot be used.
[0074]
FIG. 30 is a software evaluation system for realizing the log acquisition method according to the present embodiment, which is a description by IDL for acquiring a log of function parameters as shown in FIG.
[0075]
Each structure is defined in the usual way. [Custum (PAT_PARAM_ID, "structkind_is (dwKind: 1: STRUCTKIND1 *, 2: STRUCTKIND2 *, 3: STRUCTKIND3 *)")] for the second parameter void * 1pBuf of FuncGetData function to be set. As a result, the data type of lpBuf is treated as STRUCTKIND1 * when the value of the first parameter dwKind is 1, as STRUCTKIND2 * when it is 2, and as STRUCTKIND3 * when it is 3, and saved as a log. It is.
[0076]
FIG. 31 is a diagram showing a flow of acquiring a log when a function is defined as shown in FIG. 30 in a software evaluation system for realizing the log acquisition method according to the present embodiment.
[0077]
When the process is started (step S81), log acquisition is started, and the module name, interface name, and function / method name are stored in the memory (step S82). Next, it is determined whether or not the setting of the structure type designation (structkind_is) exists in the function definition (step S83). If so, the data of the set structure parameter is determined by the type designation (structkind_is) setting. analyzing the data types defined (step S84). Then, to save the call time, the contents of the memory pointed to parameters and pointer parameter in memory (step S85). And, subsequently, call the original function (step S86). When returning from the function, it is determined whether or not the setting of the structure type designation (structkind_is) exists in the function definition (step S87). If there is, the data of the set structure parameter is designated (structkind_is). analyzing the data types defined in the set (step S88). Then, to save the return time, the contents of the memory pointed return value and pointer parameter in memory (step S89). The process when there is an instruction of termination from the user (step S90) is terminated.
[0078]
Figure 32 is the software evaluation system that implements the log acquisition method according to the present embodiment, a diagram of the acquired log data by the definition of FIG. 30. In a normal function definition, data of a structure that is void * and data of only a pointer can be obtained is obtained as a log depending on the type of the structure used.
[0079]
According to this embodiment, effects are obtained that it becomes possible to acquire the log can not be acquired parameter in the usual way.
[0080]
[Other embodiments]
Note that the present invention is applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), but a device including one device (for example, a copying machine, a facsimile machine, etc.) it may be applied to.
[0081]
Further, an object of the present invention is to provide a storage medium storing a program code of software for realizing the functions of the above-described embodiments to a system or an apparatus, and a computer (or CPU or MPU) of the system or apparatus to store the storage medium. It is needless to say that the present invention can also be achieved by reading and executing the program code stored in the program.
[0082]
In this case, the program code itself read from the storage medium realizes the function of the above-described embodiment, and the storage medium storing the program code constitutes the present invention.
[0083]
As a storage medium for supplying the program code, for example, a floppy (registered trademark) disk, hard disk, optical disk, magneto-optical disk, CD-ROM, CD-R, magnetic tape, nonvolatile memory card, ROM, or the like is used. be able to.
[0084]
When the computer executes the readout program code, not only the functions of the above-described embodiments are realized, but also an OS (Operating System) running on the computer based on the instruction of the program code. It goes without saying that a part or all of the actual processing is performed and the functions of the above-described embodiments are realized by the processing.
[0085]
Further, after the program code read from the storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. It goes without saying that a CPU or the like provided in the board or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.
[0086]
【The invention's effect】
As described above, according to the present invention, a processing log of software divided into a plurality of modules can be easily obtained, and the number of steps for analyzing the cause of a software failure can be reduced.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a configuration of a computer (software evaluation system) that implements a log acquisition method according to a first embodiment of the present invention.
FIG. 2 is a diagram illustrating a normal memory configuration at the time of loading a function, for explaining a log acquisition method according to the first embodiment of the present invention;
FIG. 3 is a diagram illustrating a memory configuration when an IAT Patch is used in a software evaluation system that implements the log acquisition method according to the first embodiment of the present invention.
FIG. 4A is a diagram showing a state when using the IAT Patch of the software evaluation system for realizing the log acquisition method according to the first embodiment of the present invention.
FIG. 4B is a diagram showing a flow of a log acquisition process of the software evaluation system for realizing the log acquisition method according to the first embodiment of the present invention.
FIG. 5 is a diagram illustrating an internal configuration when using the IAT Patch of the software evaluation system according to the first embodiment of the present invention.
FIG. 6 is a diagram illustrating a normal memory configuration at the time of creating an instance of a COM server interface, for explaining a log acquisition method according to the first embodiment of the present invention.
FIG. 7 is a diagram illustrating a memory configuration when a VTable Patch is used in a software evaluation system that implements the log acquisition method according to the first embodiment of the present invention.
8A is a diagram showing a state during use VTable Patch first software evaluation system that implements such a log acquisition method in the embodiment of the present invention.
FIG. 8B is a diagram showing a flow of a log acquisition process of the software evaluation system for realizing the log acquisition method according to the first embodiment of the present invention.
FIG. 9 is a diagram illustrating an internal configuration of a software evaluation system that implements the log acquisition method according to the first embodiment of the present invention.
10 is a diagram showing an example of a function definition software evaluation system that implements the log acquisition method according to a second embodiment of the present invention.
FIG. 11 is a diagram showing a function definition of a software evaluation system for realizing a log acquisition method according to a second embodiment of the present invention. it is a diagram illustrating a description in IDL for acquiring the entity as a log.
FIG. 12 is a diagram illustrating a flow of acquiring a log when a function is defined as shown in FIG. 11 in a software evaluation system that implements a log acquisition method according to the second embodiment of the present invention. .
FIG. 13 is a diagram of log data acquired according to the definition in FIG. 11 in the software evaluation system that implements the log acquisition method according to the second embodiment of the present invention.
FIG. 14 is a diagram showing a function definition of a software evaluation system for realizing a log acquisition method according to the third embodiment of the present invention, in which IDL for acquiring a function not exported such as a callback function as a log is used. it is a diagram illustrating a description.
15 is a diagram representing the memory configuration of the software evaluation system that implements such a log acquisition method in the third embodiment of the present invention.
FIG. 16 is a diagram illustrating a flow of acquiring a log when a function is defined as shown in FIG. 14 in a software evaluation system that implements a log acquisition method according to the third embodiment of the present invention. .
FIG. 17 is a diagram of log data acquired when the definition in FIG. 14 is not performed in the software evaluation system that implements the log acquisition method according to the third embodiment of the present invention.
FIG. 18 is a diagram of log data acquired from the definition in FIG. 14 in the software evaluation system that implements the log acquisition method according to the third embodiment of the present invention.
[19] In the fourth function definition software evaluation system that implements such a log acquisition method in the embodiment of the present invention, is a diagram illustrating a description in IDL for acquiring the parameters of the variable-length sequences as a log .
FIG. 20 is a diagram showing a flow of acquiring a log when a function is defined as shown in FIG. 19 in a software evaluation system for realizing a log acquisition method according to the fourth embodiment of the present invention; .
FIG. 21 shows log data (250) obtained when the definition in FIG. 19 is not performed and the log data obtained by the definition in FIG. is a diagram of the log data (251) that is.
FIG. 22 is a diagram illustrating an example of a function for which a parameter cannot be obtained by a normal function definition in a software evaluation system that realizes a log obtaining method according to a fifth embodiment of the present invention.
FIG. 23 is a diagram showing how each structure of STRUCTURESIZE1, STRUCTSIZE2, and STRUCTSIZE3 uses a memory in FIG. 22;
FIG. 24 is a diagram showing a description by IDL for acquiring a log of a parameter of a function as shown in FIG. 22 in a software evaluation system for realizing a log acquisition method according to a fifth embodiment of the present invention;
FIG. 25 is a diagram illustrating a flow of acquiring a log when a function is defined as illustrated in the software evaluation system that implements the log acquisition method according to the fifth embodiment of the present invention.
The [26] Figure 25 details carried out of a structure parameter analysis with a view showing based memory arrangement.
FIG. 27 is a diagram of log data acquired according to the definition in FIG. 24 in the software evaluation system that implements the log acquisition method according to the fifth embodiment of the present invention.
FIG. 28 is a diagram illustrating an example of a function for which a parameter cannot be acquired with a normal function definition in a software evaluation system that implements a log acquisition method according to the sixth embodiment of the present invention.
In FIG. 29 FIG. 28 is a diagram showing how STRUCTKIND1, STRUCTKIND2, each structure STRUCTKIND3 will look like memory arrangement.
FIG. 30 is a diagram showing a description by IDL for acquiring a log of a parameter of a function as shown in FIG. 28 in a software evaluation system for realizing a log acquisition method according to a sixth embodiment of the present invention;
FIG. 31 is a diagram showing a flow of acquiring a log when a function is defined as shown in FIG. 30 in a software evaluation system for realizing a log acquisition method according to a sixth embodiment of the present invention; .
FIG. 32 is a diagram of log data acquired according to the definition in FIG. 30 in the software evaluation system that implements the log acquisition method according to the sixth embodiment of the present invention.
[Explanation of symbols]
1: CPU
2: Chipset
3: RAM
4: Hard disk controller
5: Display controller
6: Hard disk drive
7: CD-ROM drive
8: Display
11: signal line connecting the CPU and chip set
12: signal line which connects the chipset and RAM
13: peripheral bus that connects the chip set and the various peripheral devices
14: signal line that connects the hard disk controller and hard disk drive
15: signal line that connects the hard disk controller and the CD-ROM drive
16: signal line connecting the display controller and the display

Claims (14)

所定の処理を行う関数を備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行う関数のアドレスを、ログ取得のための関数のアドレスに書き換える工程を備え、
前記ログ取得のための関数は、
前記所定の処理を行う関数を呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義において、ポインタ・パラメータが所定の定義方法で定義されているか否かを判断する工程と、
ポインタ・パラメータが所定の定義方法で定義されていた場合、該定義方法に基づいて該ポインタ・パラメータの指すメモリの内容をログとして記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program with a function for performing predetermined processing,
Rewriting the address of the loaded function for performing the predetermined processing to the address of a function for obtaining a log,
The log acquisition function is
Calling a function for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
Determining in the function definition in the program whether or not the pointer parameter is defined by a predetermined definition method;
Recording the contents of the memory pointed to by the pointer parameter based on the definition method when the pointer parameter is defined by a predetermined definition method.
前記ログ取得のための関数は、前記定義方法に基づいてメモリサイズを算出する工程を更に備え、前記記録する工程は、前記ポインタ・パラメータの指すメモリの内容を、該算出したメモリサイズ分、記録することを特徴とする請求項1に記載のログ取得方法。The function for acquiring a log further includes a step of calculating a memory size based on the definition method, and the recording step includes recording the contents of the memory pointed to by the pointer parameter by the calculated memory size. 2. The log acquisition method according to claim 1, wherein: 所定の処理を行う関数を備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行う関数のアドレスを、ログ取得のための関数のアドレスに書き換える工程を備え、
前記ログ取得のための関数は、
前記所定の処理を行う関数を呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記所定の処理を行う関数を呼び出す際の所定の情報と、前記実行結果を受け取った際の所定の情報とを記録する工程と、
前記プログラム内の関数定義に基づいて、エクスポートされていない関数の有無を判断する工程と、
エクスポートされていない関数があった場合、該関数に対応するログ取得のための関数を新たに生成し、該エクスポートされていない関数のアドレスを、該新たに生成された関数のアドレスに書き換える工程と、を備え、
前記新たに生成された関数は、
前記エクスポートされていない関数を呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記エクスポートされていない関数を呼び出す際の所定の情報と、前記実行結果を受け取った際の所定の情報とを記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program with a function for performing predetermined processing,
Rewriting the address of the loaded function for performing the predetermined processing to the address of a function for obtaining a log,
The log acquisition function is
Calling a function for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
A step of recording predetermined information when calling a function for performing the predetermined processing, and predetermined information when receiving the execution result,
A step of determining the presence or absence of a function which has not been exported based on a function defined in said program,
If there is a function that has not been exported, a new function for acquiring a log corresponding to the function is newly generated, and the address of the function that has not been exported is rewritten with the address of the newly generated function. ,
The newly generated function is
Calling the non-exported function, executing the predetermined process, and passing the received execution result to the program;
Recording a predetermined information when calling the function not exported and a predetermined information when receiving the execution result.
所定の処理を行う関数を備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行う関数のアドレスを、ログ取得のための関数のアドレスに書き換える工程を備え、
前記ログ取得のための関数は、
前記所定の処理を行う関数を呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義において、可変長配列としてポインタ・パラメータが定義されているか否かを判断する工程と、
可変長配列としてポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指すメモリの内容を該指定された配列で記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program with a function for performing predetermined processing,
Rewriting the address of the loaded function for performing the predetermined processing to the address of a function for obtaining a log,
The log acquisition function is
Calling a function for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
Determining whether or not a pointer parameter is defined as a variable-length array in a function definition in the program;
Recording the contents of the memory pointed to by the pointer parameter in the specified array when the pointer parameter is defined as a variable length array.
所定の処理を行う関数を備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行う関数のアドレスを、ログ取得のための関数のアドレスに書き換える工程を備え、
前記ログ取得のための関数は、
前記所定の処理を行う関数を呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義に、構造体としてポインタ・パラメータが指定されているか否かを判断する工程と、
構造体としてポインタ・パラメータが指定されていた場合、該ポインタ・パラメータの指すメモリの内容について、前記プログラム内の関数定義において定義された構造体のサイズ分ログとして記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program with a function for performing predetermined processing,
Rewriting the address of the loaded function for performing the predetermined processing to the address of a function for obtaining a log,
The log acquisition function is
Calling a function for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
Determining whether a pointer parameter is specified as a structure in a function definition in the program;
Recording the contents of the memory pointed to by the pointer parameter as a log of the size of the structure defined in the function definition in the program when the pointer parameter is specified as the structure. Log acquisition method.
所定の処理を行う関数を備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行う関数のアドレスを、ログ取得のための関数のアドレスに書き換える工程を備え、
前記ログ取得のための関数は、
前記所定の処理を行う関数を呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義において、構造体として種類指定がなされたポインタ・パラメータが定義されているか否かを判断する工程と、
構造体として種類指定がなされたポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指すメモリの内容を、種類指定がなされたデータ型として記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program with a function for performing predetermined processing,
Rewriting the address of the loaded function for performing the predetermined processing to the address of a function for obtaining a log,
The log acquisition function is
Calling a function for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
In a function definition in the program, a step of determining whether a pointer parameter whose type is specified as a structure is defined,
Recording a content of a memory pointed to by the pointer parameter as a type-specified data type when a pointer parameter whose type is specified as a structure is defined. Method.
所定の処理を行うメソッドを備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行うメソッドのアドレスを、ログ取得のためのメソッドのアドレスに書き換える工程を備え、
前記ログ取得のためのメソッドは、
前記所定の処理を行うメソッドを呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義において、ポインタ・パラメータが所定の定義方法で定義されているか否かを判断する工程と、
ポインタ・パラメータが所定の定義方法で定義されていた場合、該定義方法に基づいて該ポインタ・パラメータの指すメモリの内容をログとして記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program comprising a method for performing predetermined processing,
Rewriting the address of the loaded method for performing the predetermined process to the address of a method for acquiring a log,
The method for acquiring the log is
Calling a method for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
Determining in the function definition in the program whether or not the pointer parameter is defined by a predetermined definition method;
Recording the contents of the memory pointed to by the pointer parameter based on the definition method when the pointer parameter is defined by a predetermined definition method.
前記ログ取得のためのメソッドは、前記定義方法に基づいてメモリサイズを算出する工程を更に備え、前記記録する工程は、前記ポインタ・パラメータの指すメモリの内容を、該算出したメモリサイズ分、記録することを特徴とする請求項7に記載のログ取得方法。The method for acquiring a log further includes a step of calculating a memory size based on the definition method, and the recording step includes recording the contents of the memory pointed to by the pointer parameter by the calculated memory size. 8. The log acquisition method according to claim 7, wherein 所定の処理を行うメソッドを備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行うメソッドのアドレスを、ログ取得のためのメソッドのアドレスに書き換える工程を備え、
前記ログ取得のためのメソッドは、
前記所定の処理を行うメソッドを呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記所定の処理を行うメソッドを呼び出す際の所定の情報と、前記実行結果を受け取った際の所定の情報とを記録する工程と、
前記プログラム内の関数定義に基づいて、エクスポートされていないメソッドの有無を判断する工程と、
エクスポートされていないメソッドがあった場合、該メソッドに対応するログ取得のためのメソッドを新たに生成し、該エクスポートされていないメソッドのアドレスを、該新たに生成されたメソッドのアドレスに書き換える工程と、を備え、
前記新たに生成されたメソッドは、
前記エクスポートされていないメソッドを呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記エクスポートされていないメソッドを呼び出す際の所定の情報と、前記実行結果を受け取った際の所定の情報とを記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program comprising a method for performing predetermined processing,
Rewriting the address of the loaded method for performing the predetermined process to the address of a method for acquiring a log,
The method for acquiring the log is
Calling a method for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
A step of recording predetermined information when calling a method for performing the predetermined processing, and predetermined information when receiving the execution result,
Based on the function definition in the program, determining whether there is a method that is not exported,
If there is a method that has not been exported, a method for newly generating a method for acquiring a log corresponding to the method, and rewriting the address of the method that has not been exported to the address of the newly generated method; ,
The newly created method is
Calling the non-exported method, executing the predetermined process, and passing the received execution result to the program;
Log acquisition method characterized by comprising the step of recording the predetermined information when calling a method that is not the export, the predetermined information when having received the execution result.
所定の処理を行うメソッドを備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行うメソッドのアドレスを、ログ取得のためのメソッドのアドレスに書き換える工程を備え、
前記ログ取得のためのメソッドは、
前記所定の処理を行うメソッドを呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義において、可変長配列としてポインタ・パラメータが定義されているか否かを判断する工程と、
可変長配列としてポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指すメモリの内容を該指定された配列で記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program comprising a method for performing predetermined processing,
Rewriting the address of the loaded method for performing the predetermined process to the address of a method for acquiring a log,
The method for acquiring the log is
Calling a method for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
Determining whether or not a pointer parameter is defined as a variable-length array in a function definition in the program;
Recording the contents of the memory pointed to by the pointer parameter in the specified array when the pointer parameter is defined as a variable length array.
所定の処理を行うメソッドを備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行うメソッドのアドレスを、ログ取得のためのメソッドのアドレスに書き換える工程を備え、
前記ログ取得のためのメソッドは、
前記所定の処理を行うメソッドを呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義に、構造体としてポインタ・パラメータが指定されているか否かを判断する工程と、
構造体としてポインタ・パラメータが指定されていた場合、該ポインタ・パラメータの指すメモリの内容について、前記プログラム内の関数定義において定義された構造体のサイズ分ログとして記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program comprising a method for performing predetermined processing,
Rewriting the address of the loaded method for performing the predetermined process to the address of a method for acquiring a log,
The method for acquiring the log is
Calling a method for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
Determining whether a pointer parameter is specified as a structure in a function definition in the program;
Recording the contents of the memory pointed to by the pointer parameter as a log of the size of the structure defined in the function definition in the program when the pointer parameter is specified as the structure. Log acquisition method.
所定の処理を行うメソッドを備えるプログラムの実行中のログを取得するログ取得方法であって、
ロードされた前記所定の処理を行うメソッドのアドレスを、ログ取得のためのメソッドのアドレスに書き換える工程を備え、
前記ログ取得のためのメソッドは、
前記所定の処理を行うメソッドを呼び出し、該所定の処理を実行させ、受け取った実行結果を前記プログラムに渡す工程と、
前記プログラム内の関数定義において、構造体として種類指定がなされたポインタ・パラメータが定義されているか否かを判断する工程と、
構造体として種類指定がなされたポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指すメモリの内容を、種類指定がなされたデータ型として記録する工程と
を備えることを特徴とするログ取得方法。
A log acquisition method for acquiring a log during the execution of a program comprising a method for performing predetermined processing,
Rewriting the address of the loaded method for performing the predetermined process to the address of a method for acquiring a log,
The method for acquiring the log is
Calling a method for performing the predetermined processing, causing the predetermined processing to be executed, and passing the received execution result to the program;
In a function definition in the program, a step of determining whether a pointer parameter whose type is specified as a structure is defined,
Recording a content of a memory pointed to by the pointer parameter as a type-specified data type when a pointer parameter whose type is specified as a structure is defined. Method.
請求項1乃至12のいずれか1つに記載のログ取得方法をコンピュータによって実現させるための制御プログラムを格納した記憶媒体。A storage medium storing a control program for causing a computer to implement the log acquisition method according to any one of claims 1 to 12. 請求項1乃至12のいずれか1つに記載のログ取得方法をコンピュータによって実現させるための制御プログラム。A control program for causing a computer to implement the log acquisition method according to any one of claims 1 to 12.
JP2002191128A 2002-06-28 2002-06-28 Log acquisition method Expired - Fee Related JP4125054B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2002191128A JP4125054B2 (en) 2002-06-28 2002-06-28 Log acquisition method
US10/600,843 US7086034B2 (en) 2002-06-28 2003-06-23 Method, program, and storage medium for acquiring logs
EP03254035A EP1376366A3 (en) 2002-06-28 2003-06-25 Method for acquiring logs for program debugging
CNB031493319A CN1251062C (en) 2002-06-28 2003-06-27 Operating journal obtaining method, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002191128A JP4125054B2 (en) 2002-06-28 2002-06-28 Log acquisition method

Publications (3)

Publication Number Publication Date
JP2004038312A true JP2004038312A (en) 2004-02-05
JP2004038312A5 JP2004038312A5 (en) 2007-03-01
JP4125054B2 JP4125054B2 (en) 2008-07-23

Family

ID=31700842

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002191128A Expired - Fee Related JP4125054B2 (en) 2002-06-28 2002-06-28 Log acquisition method

Country Status (1)

Country Link
JP (1) JP4125054B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104704475A (en) * 2012-10-04 2015-06-10 阿尔卡特朗讯 Data logs management in a multi-client architecture
CN113722002A (en) * 2020-05-26 2021-11-30 网神信息技术(北京)股份有限公司 Method and system for obtaining command line parameters, electronic device and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104704475A (en) * 2012-10-04 2015-06-10 阿尔卡特朗讯 Data logs management in a multi-client architecture
US10007685B2 (en) 2012-10-04 2018-06-26 Alcatel Lucent Data logs management in a multi-client architecture
CN113722002A (en) * 2020-05-26 2021-11-30 网神信息技术(北京)股份有限公司 Method and system for obtaining command line parameters, electronic device and storage medium

Also Published As

Publication number Publication date
JP4125054B2 (en) 2008-07-23

Similar Documents

Publication Publication Date Title
US9727436B2 (en) Adding a profiling agent to a virtual machine to permit performance and memory consumption analysis within unit tests
US6662359B1 (en) System and method for injecting hooks into Java classes to handle exception and finalization processing
US8959490B2 (en) Optimizing heap memory usage
JP4436036B2 (en) Information processing apparatus, trace processing method, program, and recording medium
US7086034B2 (en) Method, program, and storage medium for acquiring logs
US20100153693A1 (en) Code execution with automated domain switching
CN1648863A (en) Portable software application method
US20130125096A1 (en) Systems and Methods for Dynamic Collection of Probe Call Sites
US20040199903A1 (en) Log acquisition method and its control program and storage medium
US7188279B2 (en) Method, program, and storage medium for acquiring logs
US7426660B2 (en) Method, program, and storage medium for acquiring logs
JP4681868B2 (en) Information processing apparatus and control method therefor, computer program, and storage medium
CN100472469C (en) Operation logbook obtaining method
JP4125055B2 (en) Log acquisition method
CN112612697A (en) Software defect testing and positioning method and system based on byte code technology
JP4125054B2 (en) Log acquisition method
JP4125053B2 (en) Log acquisition method
JP4125056B2 (en) Log acquisition method
US7519868B2 (en) Information processing apparatus, information processing method, computer program, and storage medium
CN114780409A (en) Breakpoint setting method based on program running process, electronic device and storage medium
US8191050B2 (en) Information processor, control method therefor, computer program and storage medium
CN114048125A (en) Test case determination method and device, computing equipment and storage medium
JP4886188B2 (en) Information processing apparatus and control method therefor, computer program, and storage medium
US7743244B2 (en) Computer system model generation with tracking of actual computer system configuration
JP2006031248A (en) Software evaluation system for generating log by hooking function call

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050615

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070117

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071001

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071225

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080225

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: 20080414

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: 20080507

R150 Certificate of patent or registration of utility model

Ref document number: 4125054

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110516

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130516

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140516

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees