[go: up one dir, main page]

JP2004252684A - Program debugging method and system - Google Patents

Program debugging method and system Download PDF

Info

Publication number
JP2004252684A
JP2004252684A JP2003041983A JP2003041983A JP2004252684A JP 2004252684 A JP2004252684 A JP 2004252684A JP 2003041983 A JP2003041983 A JP 2003041983A JP 2003041983 A JP2003041983 A JP 2003041983A JP 2004252684 A JP2004252684 A JP 2004252684A
Authority
JP
Japan
Prior art keywords
information
time
execution history
history information
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003041983A
Other languages
Japanese (ja)
Inventor
Shunichi Akita
俊一 秋田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2003041983A priority Critical patent/JP2004252684A/en
Publication of JP2004252684A publication Critical patent/JP2004252684A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

【課題】従来のデバッグ方法ではプログラムが異常終了した場合、原因の特定を行なう為に、異常終了時データを使用しての調査や、プログラムの実行時に出力していた実行履歴情報での調査を行っていた。しかし、これらの情報はそれぞれ独立しており、関連付けて調査する為の方法が存在していなかった。
【解決手段】実行履歴情報を取得するのと同時に、デバッグ情報も取得し、2つの情報を関連付けてデバッガにて解析し、実行履歴情報による処理の流れや、各実行履歴情報出力時の情報の表示、任意の実行履歴情報取得時点からのプログラムの再実行と言った機能をサポートしたデバッグシステムを構成する事によって、異常終了原因の特定を容易にする。
【選択図】 図1
In a conventional debugging method, when a program terminates abnormally, an investigation using data at the time of abnormal termination and an investigation using execution history information output at the time of program execution are performed to identify the cause. I was going. However, these pieces of information are independent of each other, and there is no method for associating and investigating them.
At the same time as acquiring execution history information, debug information is also acquired, and two pieces of information are analyzed by a debugger in association with each other. By configuring a debugging system that supports a function of displaying and re-executing a program from the time when arbitrary execution history information is acquired, it is easy to specify the cause of the abnormal termination.
[Selection diagram] Fig. 1

Description

【0001】
【発明の属する技術分野】
本発明はコンピュータシステムにおいてプログラム実行を行っている際に発生した異常終了原因の特定を行なう事を目的としたデバッグ技術に関する。
【0002】
【従来の技術】
プログラムが異常終了した場合、異常終了時におけるデータを使用し、デバッガを使用して異常終了時におけるレジスタの内容・メモリの内容・関数遷移等の情報を用いて原因の調査を行っていた。このような技術は特開平5−241888号に開示されている。また、プログラム実行時に実行履歴情報を取得しておき、異常終了後に参照・解析を行なう事によって、そのプログラムの実行状況と言った情報を把握していた。このような技術は、ロギングツールとして存在しているものがあることが知られている。
【0003】
【特許文献1】
特開平5−241888号
【0004】
【発明が解決しようとする課題】
従来の異常終了時点のデータを使用しての調査では、異常終了した時点でのデータは解るものの、そこに行き付くまでの情報については解析を行なう者が考察しなければならなかった。また、実行履歴情報を使用した調査では、処理遷移はある程度特定できるものの、メモリの内容と言った情報が取得できない為、異常な遷移になった場合、原因の特定を行なう事は難しかった。またこれら二つの情報を結びつける為の手段は存在しておらず、有効な調査を行なう事は難しかった。
【0005】
【課題を解決するための手段】
実行履歴情報を取得するのと同時にその時点におけるプログラムのデバッグ情報を取得し、2つの情報を関連付けて解析し、実行履歴情報による処理の流れや、各実行履歴情報出力時における情報の表示、任意の実行履歴情報取得時点からのプログラムの再実行と言った機能を有したデバッグシステムを構成する事によって、異常終了原因の特定を容易にする。
【0006】
【発明の実施の形態】
図1は本発明の概念図を表すものである。
プログラム101を動作させることによって、そのプログラム実行中に埋め込まれた実行履歴情報出力関数によって、実行履歴情報及びデバッグ情報102を出力する。プログラムが異常終了した場合、出力される異常終了時情報103と実行履歴情報及びデバッグ情報102をデバッガ104にて解析し、各実行履歴情報時点での情報の表示を行なう機能105と、同様に情報を解析し、過去状態の再現表示、再実行を行なう機能106を有する。
【0007】
図2は本発明の構成図である。
プログラム201で実行履歴情報を出力しようとすると、情報取得部202が呼び出され、その中のトレースデータ取得部203で実行履歴情報205が、デバッグ情報取得部204でデバッグ情報206が出力される。
【0008】
また、異常終了時には異常終了時情報207が出力される。
デバッガ部208ではこれらの情報を入力として、情報解析部209で情報の解析・編集を行い、情報表示部210を介して出力を行なう。
【0009】
図3は図2における情報取得部の処理手順である。
最初に実行履歴情報を出力する(301)。
次にデバッグ情報を出力する(302)。
その後、デバッグ情報の出力が初めてかどうかの判定を行なう(303)。
【0010】
その結果、出力がはじめてでない場合、以下の処理を行なう。
・一つ前のデバッグ情報と、現状のデバッグ情報の差分情報を作成する(304)。
・一つ前のデバッグ情報を削除する(305)。
デバッグ情報の出力が初めての場合や、初めてでない場合でも上記処理が終了した場合、実行履歴情報をデバッグ情報の関連付け情報を出力(306)し、処理を終了する。
【0011】
なお、デバッグ情報取得時に、前回とのデバッグ情報との差分データを取得して、前回のデバッグデータを削除するのは、データの保存領域を少なく抑える為で有る。データの保存領域に付いて気にしなくても良い場合は、全てデバッグ情報のまま保存しておく方法も考えられる。
【0012】
図4は実行履歴情報、デバッグ情報の関連図である。
実行履歴情報ファイル(401)内の各トレースに与えられた通し番号(402)と各トレース出力時に出力されたデバッグ情報(403)または、差分情報(404)のファイル名を関連付け情報ファイル(405)で対応付けて管理する。
なお、ここで示した方法は関連付けを行なう為の一例で有り、情報と情報の関連付けを行なう事が可能であれば、本発明はその方法に依存しない。
また、デバッグ情報やトレース情報についても同様であり、これらの情報の形式に本発明は依存しない。
【0013】
図5は図2における情報解析部の機能の内、特定実行履歴情報出力時の状態の再現手順である。
まず、情報解析部では、再現しようとしている状態が異常終了時の状態かどうか判定する(501)。
判定結果が真の場合、異常終了時情報を使用して状態の再現を行なう(502)。この場合、状態の再現が終了した時点で、本処理は終了する。
【0014】
判定結果が偽だった場合、異常終了一つ前の状態データを使用して状態の再現を行なう(503)。
その後、現状再現されているデータで状態の再現を終了して良いか判定する(504)。
【0015】
判定結果が真だった場合、本処理は終了する。
判定結果が偽だった場合、更に一つ前の状態との差分データを現状の状態に反映(505)し、以下504の判定を繰り返す。
【0016】
図6は図2における情報解析部の機能の内、トレース内の指定されたレジスタの内容一覧を取得する手順。
まず、異常終了時情報から指定されたレジスタの情報を取得し、データ保存領域(一覧データ)の先頭に保存する(601)。
次に、異常終了一つ前の状態データから、指定されたレジスタの情報を取得し、一覧データの2番目に保存する。また、現状データ領域にも保存する(602)。
現状要素数(n)に2を代入する(603)。
現在、操作を行っているデータが最初に取得されたデータか判定する(604)。
判定結果が真ならば、処理を終了する。
判定結果が偽ならば、一つ前の差分データ内に指定されたレジス一つ前の差分データ内に指定されたレジスタの情報が存在しているか判定する(605)。
判定結果が真ならば、差分データから指定されたレジスタの情報を取得し、一覧データのn番目に保存する。また同時に現状データにも同じ内容を保存する(606)。
判定結果が偽ならば、現状データを一覧データのn番目に保存する(607)。
どちらの場合でも、現状要素数を更新(608)し、終了判定処理に戻り、処理を繰り返す。
【0017】
図7は図2における情報解析部の機能の内、指定されたレジスタの内容が異常終了時の内容に変わった時点を検索する手順。
まず、異常終了時情報から指定されたレジスタの情報を取得し、被比較データとする(701)。
異常終了一つ前の状態データからし呈されたレジスタの情報を取得し、比較データとする(702)。
被比較データと比較データが同じ値か判定する(703)。
判定結果が真であれば、そこで処理は終了。
判定結果が偽であれば、一つ前の差分データ内に、指定されたレジスタの情報が存在するか判定する(704)。
判定結果が真であれば、差分データから指定されたレジスタの情報を取得し、比較データに保存(705)し、被比較データと比較データの比較(703)に戻り処理を繰り返す。
判定結果が偽であれば、一つ前の差分データ内に指定されたレジスタの情報が有るかの判定(704)に戻り、処理を繰り返す。
【0018】
図8は各実行履歴情報における指定レジスタの一覧表示機能のイメージ図であり、図9は指定されたレジスタの内容が異常終了時の内容に変わった時点を検索する機能のイメージ図である。また 図10は特定実行履歴情報を指定して、その時点での情報を表示させる機能のイメージ図である。
【0019】
【発明の効果】
本発明によって、実行履歴情報から大まかな処理の遷移状況が確認でき、デバッグ情報から実行履歴情報取得時点でのレジスタ等の情報が確認出来る。また、実行履歴情報出力時点での状態を再現し、そこから再実行を行なわせる事によって、より詳細なデータを取得することが出来る。また、「どこまで遡るのか?」と言う指定に実行履歴情報の出力タイミングを使用する事により、指定の簡易化を計ることが出来る。これらの事によって、不良調査にかかる時間の短縮が図れると考える。
【図面の簡単な説明】
【図1】本発明の概念図を表すものである。
【図2】本発明の構成図である。
【図3】情報の取得手順。
【図4】データ関連図
【図5】特定実行履歴情報出力時の状態の再現手順。
【図6】トレース内の指定されたレジスタの内容一覧を取得手順。
【図7】異常終了時の内容に変わった時点を検索する手順。
【図8】特定レジスタ一覧表示機能イメージ図。
【図9】異常終了時内容検索機能イメージ図
【図10】特定実行履歴情報時データ表示機能イメージ図
【符号の説明】
101 プログラム
102 デバッグ情報
103 異常終了時情報
104 デバッガ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a debugging technique for identifying a cause of abnormal termination that has occurred during execution of a program in a computer system.
[0002]
[Prior art]
When a program terminates abnormally, the cause was investigated using the data at the time of the abnormal termination and using information such as register contents, memory contents, and function transitions at the time of the abnormal termination using a debugger. Such a technique is disclosed in JP-A-5-241888. In addition, the execution history information is acquired at the time of executing the program, and the information such as the execution status of the program is grasped by performing the reference and analysis after the abnormal termination. It is known that such a technique exists as a logging tool.
[0003]
[Patent Document 1]
JP-A-5-241888
[Problems to be solved by the invention]
In a conventional investigation using data at the time of abnormal termination, although the data at the time of abnormal termination is known, the information to be reached there must be considered by the person performing the analysis. Further, in the investigation using the execution history information, although the processing transition can be specified to some extent, information such as the contents of the memory cannot be obtained, so that it is difficult to specify the cause in the case of an abnormal transition. In addition, there was no means for connecting these two pieces of information, and it was difficult to conduct an effective survey.
[0005]
[Means for Solving the Problems]
At the same time as acquiring the execution history information, the debug information of the program at that time is acquired, the two pieces of information are analyzed in association with each other, the processing flow based on the execution history information, the display of information at the time of outputting each execution history information, optional. By configuring a debugging system having a function of re-executing a program from the time when the execution history information is acquired, it is easy to specify the cause of the abnormal termination.
[0006]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 shows a conceptual diagram of the present invention.
By operating the program 101, the execution history information and the debug information 102 are output by the execution history information output function embedded during the execution of the program. When the program terminates abnormally, the debugger 104 analyzes the abnormal termination information 103, the execution history information, and the debug information 102 that are output, and displays information at the time of each execution history information. , And a function 106 for reproducing and displaying the past state and re-executing it.
[0007]
FIG. 2 is a configuration diagram of the present invention.
When the program 201 attempts to output the execution history information, the information acquisition unit 202 is called, and the trace data acquisition unit 203 outputs the execution history information 205 and the debug information acquisition unit 204 outputs the debug information 206.
[0008]
At the time of abnormal termination, abnormal termination information 207 is output.
The debugger unit 208 receives and inputs the information, analyzes and edits the information with the information analysis unit 209, and outputs the information via the information display unit 210.
[0009]
FIG. 3 shows a processing procedure of the information acquisition unit in FIG.
First, execution history information is output (301).
Next, debug information is output (302).
Thereafter, it is determined whether the output of the debug information is the first time (303).
[0010]
As a result, if the output is not the first time, the following processing is performed.
Create difference information between the previous debug information and the current debug information (304).
Delete the previous debug information (305).
When the output of the debug information is for the first time, or when the output is not the first time, the process is terminated, the execution history information is output as the debug information association information (306), and the process is terminated.
[0011]
Note that the reason for acquiring the difference data from the previous debug information and deleting the previous debug data at the time of acquiring the debug information is to reduce the data storage area. If there is no need to worry about the data storage area, a method of storing all debug information as it is may be considered.
[0012]
FIG. 4 is a related diagram of the execution history information and the debug information.
The serial number (402) given to each trace in the execution history information file (401) and the file name of the debug information (403) or difference information (404) output at the time of output of each trace are associated with an association information file (405). Manage by associating.
Note that the method described here is an example for performing the association, and the present invention does not depend on the method as long as the information can be associated with each other.
The same applies to debug information and trace information, and the present invention does not depend on the format of such information.
[0013]
FIG. 5 shows a procedure of reproducing a state when specific execution history information is output, among the functions of the information analysis unit in FIG.
First, the information analysis unit determines whether the state to be reproduced is the state at the time of abnormal termination (501).
If the determination result is true, the state is reproduced using the abnormal end time information (502). In this case, this processing ends when the reproduction of the state ends.
[0014]
If the judgment result is false, the state is reproduced using the state data immediately before the abnormal end (503).
Thereafter, it is determined whether the state reproduction can be ended with the data reproduced at present (504).
[0015]
If the result of the determination is true, this processing ends.
When the determination result is false, the difference data from the immediately preceding state is further reflected in the current state (505), and the determination of 504 is repeated thereafter.
[0016]
FIG. 6 shows a procedure for acquiring a list of contents of a designated register in a trace among functions of the information analysis unit in FIG.
First, the information of the designated register is acquired from the abnormal end information, and is stored at the head of the data storage area (list data) (601).
Next, the information of the designated register is acquired from the status data immediately before the abnormal end, and is stored as the second list data. It is also stored in the current data area (602).
Substitute 2 for the current number of elements (n) (603).
It is determined whether the data currently being operated is the first acquired data (604).
If the determination result is true, the process ends.
If the determination result is false, it is determined whether the information of the specified register exists in the previous differential data specified in the previous differential data (605).
If the determination result is true, the information of the designated register is obtained from the difference data and stored in the n-th list data. At the same time, the same contents are stored in the current data (606).
If the determination result is false, the current data is stored in the n-th list data (607).
In either case, the current number of elements is updated (608), the process returns to the end determination process, and the process is repeated.
[0017]
FIG. 7 shows a procedure for searching for a point in time when the contents of the designated register have changed to the contents at the time of abnormal termination, among the functions of the information analysis unit in FIG.
First, the information of the designated register is acquired from the abnormal end time information, and is set as the compared data (701).
The information of the register presented from the status data immediately before the abnormal end is obtained and used as comparison data (702).
It is determined whether the compared data and the comparison data have the same value (703).
If the determination result is true, the process ends there.
If the determination result is false, it is determined whether the information of the designated register exists in the immediately preceding difference data (704).
If the determination result is true, the information of the designated register is acquired from the difference data, stored in the comparison data (705), and the process returns to the comparison of the data to be compared with the comparison data (703) to repeat the processing.
If the determination result is false, the process returns to the determination (704) as to whether the information of the designated register exists in the immediately preceding difference data, and the processing is repeated.
[0018]
FIG. 8 is an image diagram of a function of displaying a list of designated registers in each execution history information, and FIG. 9 is an image diagram of a function of searching for a point in time when the contents of the designated register have changed to the contents at the time of abnormal termination. FIG. 10 is an image diagram of a function of designating specific execution history information and displaying the information at that time.
[0019]
【The invention's effect】
According to the present invention, a rough transition state of a process can be confirmed from execution history information, and information such as a register at the time of acquisition of execution history information can be confirmed from debug information. Further, by reproducing the state at the time of execution history information output and performing re-execution therefrom, more detailed data can be obtained. In addition, by using the output timing of the execution history information to specify "How far back?", The specification can be simplified. It is thought that the time required for the defect investigation can be reduced by these things.
[Brief description of the drawings]
FIG. 1 shows a conceptual diagram of the present invention.
FIG. 2 is a configuration diagram of the present invention.
FIG. 3 is an information acquisition procedure.
FIG. 4 is a data relation diagram. FIG. 5 is a procedure for reproducing a state when specific execution history information is output.
FIG. 6 is a procedure for acquiring a list of contents of a specified register in a trace.
FIG. 7 is a procedure for searching for a point in time when the content has changed to the content at the time of abnormal termination.
FIG. 8 is an image diagram of a specific register list display function.
FIG. 9 is an image diagram of a function for retrieving contents at abnormal termination. FIG. 10 is an image diagram of a data display function at the time of specific execution history information.
101 Program 102 Debug information 103 Abnormal termination information 104 Debugger

Claims (2)

プログラム実行時に実行履歴情報を出力する機能と、後からプログラムの実行を行なう為に必要とするデバッグ情報を取得する機能と、実行履歴情報とデバッグ情報を関連付ける為の情報を出力する機能を有する情報取得機能を有し、この情報取得機能で取得した情報を使用して、任意の実行履歴情報出力時データの表示を行なう機能と、任意の実行履歴情報出力時の状態を再現し、プログラムを再実行する機能を有するデバッグ方法。Information having a function of outputting execution history information at the time of program execution, a function of acquiring debug information necessary for executing the program later, and a function of outputting information for associating the execution history information with the debug information It has an acquisition function, uses the information acquired by this information acquisition function to display data at the time of output of any execution history information, reproduces the state at the time of output of any execution history information, and re-executes the program. A debugging method that has a function to execute. プログラム実行時に実行履歴情報を出力する手段と、後からプログラムの実行を行なう為に必要とするデバッグ情報を取得する手段と、実行履歴情報とデバッグ情報を関連付ける為の情報を出力する機能を有する情報取得手段と、前記情報取得手段で取得した情報を使用して任意の実行履歴情報出力時データの表示を行なう手段と、任意の実行履歴情報出力時の状態を再現してプログラムを再実行する手段とを備えたことを特徴とするデバッグシステム。Means for outputting execution history information at the time of program execution, means for acquiring debug information required for executing the program later, and information having a function of outputting information for associating the execution history information with debug information Acquiring means, means for displaying data at the time of output of any execution history information using the information acquired by the information acquiring means, means for reproducing the state at the time of output of any execution history information and re-executing the program A debugging system comprising:
JP2003041983A 2003-02-20 2003-02-20 Program debugging method and system Pending JP2004252684A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003041983A JP2004252684A (en) 2003-02-20 2003-02-20 Program debugging method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003041983A JP2004252684A (en) 2003-02-20 2003-02-20 Program debugging method and system

Publications (1)

Publication Number Publication Date
JP2004252684A true JP2004252684A (en) 2004-09-09

Family

ID=33025382

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003041983A Pending JP2004252684A (en) 2003-02-20 2003-02-20 Program debugging method and system

Country Status (1)

Country Link
JP (1) JP2004252684A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8429615B2 (en) 2007-09-26 2013-04-23 Renesas Electronics Corporation Semiconductor integrated circuit
US9740592B2 (en) 2011-10-27 2017-08-22 International Business Machines Corporation Supporting debugging of program and graphical user interface for supporting debugging

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8429615B2 (en) 2007-09-26 2013-04-23 Renesas Electronics Corporation Semiconductor integrated circuit
US9740592B2 (en) 2011-10-27 2017-08-22 International Business Machines Corporation Supporting debugging of program and graphical user interface for supporting debugging

Similar Documents

Publication Publication Date Title
US20130055205A1 (en) Filtering source code analysis results
US20130036330A1 (en) Execution difference identification tool
JP2004252684A (en) Program debugging method and system
JP2001282578A (en) Device and method for supporting program test and storage medium storing program on method
JP2007249949A (en) Device for storing variable value to provide context for test result to be formatted
JP2004110267A (en) Test conducting device, method, and program
CN117827563A (en) Processor function verification method, device and medium
JP2000215082A (en) Playback test method for distributed object environment
JP2000181942A (en) Automatic i/o buffer operation power source check system
JP3206096B2 (en) Input data processing device
JPH10149246A (en) User's interface device, operation string generating method for the device and recording medium stored with operation string generating program
JP3833626B2 (en) Test case generation apparatus and test case generation method
CN113591147A (en) Data extraction method and device, computer equipment and storage medium
CN115729557B (en) Script processing method and device
JPH11327967A (en) Log file analyzer
CN113608998B (en) Method, device, computer equipment and storage medium for automatic optimization of test activities
JP2525393B2 (en) Logic simulation test coverage method
CN118711011A (en) Editing effect testing method, device, equipment and medium based on data drive
JP2910548B2 (en) Data check device
JP2001202272A (en) Debugging method, debugging device using this method and recording medium with debugging method recorded thereon
JP2001202391A (en) Logic circuit simulation method
JPH10254914A (en) Logic simulated result analyzer
TWI448965B (en) Method for analyzing program code
JP2011039902A (en) Apparatus and method for processing data, and program
JP2002092045A (en) Dxf analysis svg preserving method