JPH05250210A - Program trace system - Google Patents

Program trace system

Info

Publication number
JPH05250210A
JPH05250210A JP4039943A JP3994392A JPH05250210A JP H05250210 A JPH05250210 A JP H05250210A JP 4039943 A JP4039943 A JP 4039943A JP 3994392 A JP3994392 A JP 3994392A JP H05250210 A JPH05250210 A JP H05250210A
Authority
JP
Japan
Prior art keywords
trace
program
information
file
traced
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
JP4039943A
Other languages
Japanese (ja)
Inventor
Hisayuki Aoki
久幸 青木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP4039943A priority Critical patent/JPH05250210A/en
Publication of JPH05250210A publication Critical patent/JPH05250210A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To collect the program traces and to edit and display them with a trace function itself kept unchanged even if the meaning and the type of a passing point are changed. CONSTITUTION:A trace collecting means 10 is set into a program X to be traced which is loaded into a memory from an executable form file A by a program loader and then carried out. Then the means 10 is called out of the program X and works to collect the trace information and to store them in a trace file B. Meanwhile a trace editing means 20 works after the end of the program X to reads the trace information collected by the means 10 out of the file B and also the information on the meaning of the trace information out of the file A respectively, edits these informations and then outputs these information as the trace editing information.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はプログラムトレース方式
に関し、特に計算機システムにおいて、プログラムの実
行履歴を収集し、実行後にこれを編集表示するトレース
方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program trace method, and more particularly to a trace method for collecting execution history of programs in a computer system and editing and displaying the execution history after execution.

【0002】[0002]

【従来の技術】従来のトレース方式の構成を図4に示
す。トレース情報をトレースファイルBに採取するトレ
ース採取手段30は、被トレースプログラムXの中に埋
め込まれている。この被トレースプログラムXは、プロ
グラムローダによって、実行可能形式ファイルAからメ
モリにロードされ、実行される。被トレースプログラム
Xの中でトレースを取りたいポイントで、トレース採取
手段30を呼び出すことで、被トレースプログラムXの
実行履歴がトレースファイルBの中に蓄積される。被ト
レースプログラムXの実行完了後、トレース編集手段4
0がトレースファイルBからトレース情報を読み出し、
これを分かりやすい文字列に変換して、編集されたトレ
ースファイルC(プリンタやディスプレイなど)に出力
する。
2. Description of the Related Art FIG. 4 shows the configuration of a conventional trace method. The trace collection means 30 for collecting trace information in the trace file B is embedded in the traced program X. The traced program X is loaded into the memory from the executable file A by the program loader and executed. The execution history of the traced program X is accumulated in the trace file B by calling the trace collection means 30 at a point in the traced program X where a trace is desired to be taken. After the execution of the traced program X is completed, the trace editing means 4
0 reads the trace information from trace file B,
This is converted into an easy-to-understand character string and output to the edited trace file C (printer, display, etc.).

【0003】通常、実行履歴(トレース情報)には、ど
のポイントを通過したかを示す情報(以降通過点情報と
略す)と、そのときのシステム状態に関する情報(以降
状態情報と略す)が採取される。ただし、システム状態
は膨大な量があるので、採取されるのはごく一部の情報
に限られる。
Normally, the execution history (trace information) includes information indicating which point has been passed (hereinafter abbreviated as passing point information) and information regarding the system state at that time (hereinafter abbreviated as state information). It However, since the system status is enormous, only a small amount of information is collected.

【0004】プログラムのトレースは、そのプログラム
が実際にどのように動くかを正確に把握するために収集
する。従って、なるべく多くのポイントのトレースを低
オーバーヘッドで採取できるほうが望ましい。このため
に、トレースファイルBに採取されるトレース情報は極
力圧縮された形で記録される。この一環として、有限個
の種類しか存在しない通過点情報はコード化されて通過
点コードとして採取されるのが普通である。
A program trace is collected to gain an accurate picture of how the program actually behaves. Therefore, it is desirable to collect traces of as many points as possible with low overhead. Therefore, the trace information collected in the trace file B is recorded in a compressed form as much as possible. As a part of this, passing point information, which has only a limited number of types, is usually coded and collected as a passing point code.

【0005】トレース編集手段40は、このコード化さ
れた通過点情報である通過点コードを解釈し、人間の分
かりやすい表現に変換するのが主な役目である。従来の
方式では、トレース編集手段40内部に通過点コードか
ら人間に分かりやすい表現の通過点情報へ変換するデー
タベースを持つことで、編集を実現している。
The main function of the trace editing means 40 is to interpret the passing point code, which is the encoded passing point information, and convert it into a human-friendly expression. In the conventional method, the editing is realized by having a database inside the trace editing means 40 for converting the passing point code into the passing point information having a human-friendly expression.

【0006】[0006]

【発明が解決しようとする課題】ところが、上記で説明
した方式では、通過点の種類が変わると、トレース編集
手段を見直し、場合によっては変更しなければならない
という問題点がある。
However, the method described above has a problem that when the type of passing point changes, the trace editing means must be reviewed and changed in some cases.

【0007】プログラムトレースは、プログラムのデバ
ッグ段階で最も頻繁に使われる。プログラムデバッグ時
には、プログラムの構造や機能が徐々に変化していくの
で、必然的にトレースを取りたいポイントも変化する。
トレース採取ポイントが変化すれば、個々の通過点の意
味も変化してくる。つまり、従来のトレース方式をプロ
グラムデバッグのときに使うと、頻繁にトレース編集手
段を変更しなければならなくなる。
Program trace is most often used during the debug phase of a program. When debugging a program, the structure and functions of the program change gradually, so the point at which you want to take a trace also changes.
If the trace collection point changes, the meaning of each passing point also changes. That is, if the conventional trace method is used for program debugging, the trace editing means must be changed frequently.

【0008】デバッグのためにプログラムトレースを取
りたいのに、デバッグの結果生じたプログラムの変更に
よって、トレース編集手段を変更しなければならいのは
不便である。
It is inconvenient to obtain a program trace for debugging, but to change the trace editing means according to the change in the program resulting from the debugging.

【0009】本発明の目的は、プログラムが変更されて
もトレース編集手段を変更しなくても済むようなプログ
ラムトレース方式を提供することにある。
It is an object of the present invention to provide a program trace method that does not require the trace editing means to be changed even if the program is changed.

【0010】なお、通過点の意味に関する情報をトレー
ス編集手段から分離し、データベースとすることもでき
る。しかし、このような構成を採用しても、通過点の種
類が変わる度にそのデータベースを見直す必要が発生
し、同様な問題が発生する。
The information about the meaning of the passing point may be separated from the trace editing means and used as a database. However, even if such a configuration is adopted, it is necessary to review the database every time the type of passing point changes, and the same problem occurs.

【0011】[0011]

【課題を解決するための手段】本発明のプログラムトレ
ース方式は、プログラムローダによって実行可能形式フ
ァイルからメモリにロードされて実行される被トレース
プログラム中に組み込まれ、前記被トレースプログラム
から呼び出されて動作し、トレース情報をトレースファ
イルに採取するトレース採取手段と、前記被トレースプ
ログラム終了後に動作し、前記トレースファイルから前
記トレース採取手段によって採取された前記トレース情
報を、前記実行可能形式ファイルから前記トレース情報
の意味に関する情報とを読み出し、これらを編集しトレ
ース編集情報として出力するトレース編集手段とを備え
る。
The program trace method of the present invention is incorporated into a traced program that is loaded from a executable file into a memory by a program loader and executed, and is called by the traced program to operate. A trace collection unit for collecting trace information in a trace file, and the trace information collected by the trace collection unit operating from the trace file by the trace collection unit that operates after the traced program is terminated. And information relating to the meaning of, and a trace editing means for editing these and outputting them as trace editing information.

【0012】[0012]

【作用】通過点コードから通過点の意味への変換情報が
被トレースプログラムの実行可能形式ファイルに入るよ
うにトレース採取手段を実現し、トレース編集手段はこ
れを参照して編集する。
The trace collection means is implemented so that the conversion information from the passing point code to the meaning of the passing point enters the executable file of the traced program, and the trace editing means edits with reference to this.

【0013】まず、通過点コードから通過点の意味への
変換情報が被トレースプログラムの実行可能形式ファイ
ルに入っているので、通過点の意味が変わっても、トレ
ース編集手段は変更しなくて済むようになる。
First, since the conversion information from the passing point code to the passing point meaning is stored in the executable file of the traced program, the trace editing means does not have to be changed even if the passing point meaning changes. Like

【0014】さらに、トレースポイントを変更すること
は、被トレースプログラムを改造することを意味し、被
トレースプログラムの実行可能形式ファイルを再生成し
なければならない。つまり、元々被トレースプログラム
の実行可能形式ファイルは再生成が必要である。この時
に、通過点コードから通過点の意味への変換情報も同時
に変更し、被トレースプログラムの実行可能形式ファイ
ルに入れてしまえば、他の作業をすることなく、正常に
トレースを編集できるようになる。
Further, changing the trace point means modifying the traced program, and the executable file of the traced program must be regenerated. In other words, the executable file of the traced program originally needs to be regenerated. At this time, if you also change the conversion information from the passing point code to the meaning of the passing point and put it in the executable file of the traced program, you can edit the trace normally without any other work. Become.

【0015】特に被トレースプログラムがC言語で記述
されている場合は、トレースポイントの変更と通過点コ
ードから通過点の意味への変換情報の変更とを同時に行
うことは簡単である。このことを、具体的な例で説明す
る。
Particularly when the traced program is written in C language, it is easy to change the trace point and the conversion information from the passing point code to the meaning of the passing point at the same time. This will be described with a concrete example.

【0016】まず、被トレースプログラムが以下のよう
になっていたとする。 (処理A) TRACE(”point X”); (処理B) (処理C) TRACEは本発明のトレース採取手段の呼び出しであ
る。
First, assume that the traced program is as follows. (Processing A) TRACE ("point X"); (Processing B) (Processing C) TRACE is a call to the trace collecting means of the present invention.

【0017】トレース採取手段TRACEは、パラメー
タの文字列(point Xと言う文字列)の先頭アド
レスを通過点コードとしてトレースファイルに書きだ
す。この場合パラメータの文字列が通過点の意味情報に
なる。そして、トレース編集手段がトレースファイルに
記録された通過点コードに対応する文字列を実行可能形
式ファイルから抽出し、これを編集しトレース編集情報
として出力する。
The trace collecting means TRACE writes the start address of the character string of the parameter (character string called "point X") in the trace file as the passing point code. In this case, the character string of the parameter becomes the semantic information of the passing point. Then, the trace editing means extracts a character string corresponding to the passing point code recorded in the trace file from the executable format file, edits it, and outputs it as trace editing information.

【0018】さて、前記の被トレースプログラムにおい
て、トレースポイントを処理Bと処理Cの間に移動し、
編集後表示されるべき情報も”point Y”に変更
するためには、以下のようにすればよい。 (処理A) (処理B) TRACE(”point Y”); (処理C) このように、被トレースプログラムがC言語で記述され
ている場合は、ここでトレースを取るという指定と、プ
ログラムがそこを通過したときにトレース中に表示させ
たい情報と、その通過点コード(文字列の先頭アドレ
ス)への逆変換とを一行に記述可能であり、トレース編
集手段を一切変更せずに、簡単にトレースポイントを変
更できる。
Now, in the traced program, the trace point is moved between the process B and the process C,
The information to be displayed after editing can be changed to "point Y" as follows. (Processing A) (Processing B) TRACE ("point Y"); (Processing C) When the traced program is written in C language, it is specified that the trace is taken here It is possible to describe the information to be displayed in the trace when passing through and the reverse conversion to the passing point code (start address of the character string) in one line, easily without changing the trace editing means at all. You can change the trace points.

【0019】C言語以外でも、通過点の意味文字列の配
列を被トレースプログラム中に定義し、そのサフィック
スを通過点コードとしてトレースファイルに採取するよ
うにすれば、トレース編集手段を一切変更せずに、トレ
ースポイントを変更できるようになる。ただし、この場
合は、トレース採取手段呼び出し行の他に、通過点の意
味文字列の配列を変更する必要がある。
If a sequence of meaning character strings of passing points is defined in a traced program and the suffix is collected as a passing point code in a trace file other than C language, the trace editing means is not changed at all. You will be able to change the tracepoint. However, in this case, in addition to the trace collection means calling line, it is necessary to change the array of meaning character strings of passing points.

【0020】[0020]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will now be described with reference to the drawings.

【0021】図1は本発明のプログラムトレース方式の
一実施例を示す構成図である。
FIG. 1 is a block diagram showing an embodiment of the program trace system of the present invention.

【0022】本実施例のプログラムトレース方式は、図
1に示すように、プログラムローダによって実行可能形
式ファイルAからメモリにロードされて実行される被ト
レースプログラムX中に組み込まれ、被トレースプログ
ラムXから呼び出されて動作し、トレース情報をトレー
スファイルBに採取するトレース採取手段10と、被ト
レースプログラムX終了後に動作し、トレース採取手段
10によって採取されたトレースファイルBからトレー
ス情報を、実行可能形式ファイルAから各トレースの意
味に関する情報を読み出し、人間の分かりやすい表現に
変換して編集されたトレースファイルCに出力するトレ
ース編集手段20とから構成される。
As shown in FIG. 1, the program trace method of this embodiment is incorporated into a traced program X which is loaded from a executable file A into a memory and executed by a program loader, and the traced program X The trace collection unit 10 that is called and operates to collect the trace information in the trace file B, and the trace collection unit 10 that operates after the traced program X is finished and collects the trace information from the trace file B collected by the trace collection unit 10 into an executable file. The trace editing means 20 reads information about the meaning of each trace from A, converts it into a human-friendly expression, and outputs it to the edited trace file C.

【0023】図2はトレース採取手段10の処理を示す
流れ図である。トレース採取手段10は、ステップ11
で、通過点コードをトレースバッファに設定し、ステッ
プ12で、状態情報をトレースバッファに設定し、ステ
ップ13で、トレースバッファの内容をトレースエント
リとしてトレースファイルBに書き出す。
FIG. 2 is a flow chart showing the processing of the trace sampling means 10. The trace sampling means 10 performs step 11
Then, the passing point code is set in the trace buffer, the state information is set in the trace buffer in step 12, and the contents of the trace buffer are written in the trace file B as trace entries in step 13.

【0024】図3はトレース編集手段20の処理を示す
流れ図である。トレース編集手段20は、ステップ21
で、トレースファイルBからトレースエントリをトレー
スバッファに読み込み、ステップ22で、被トレースプ
ログラムXの実行可能形式ファイルAからトレースバッ
ファ中の通過点コードに対応した通過点の意味情報を編
集バッファに読み込み、ステップ23で、トレースバッ
ファ中の通過点コードと状態情報とからなるトレース情
報、及び編集バッファ中の通過点の意味情報とから目的
とするトレース編集情報を編集出力し、ステップ24
で、トレースファイルBの全トレースエントリを処理し
たかどうかを判定する。ステップ24において、まだ残
りエントリが存在する場合は、次のトレースエントリに
対してステップ21からの処理を繰り返す。ステップ2
4で、残りエントリが無いと判定した場合は、処理を終
了する。
FIG. 3 is a flow chart showing the processing of the trace editing means 20. The trace editing means 20 executes step 21.
In step 22, the trace entry is read from the trace file B into the trace buffer, and in step 22, the semantic information of the passing point corresponding to the passing point code in the trace buffer is read into the edit buffer from the executable format file A of the traced program X, In step 23, the target trace edit information is edited and output from the trace information including the pass point code and the status information in the trace buffer and the meaning information of the pass point in the edit buffer, and step 24
Then, it is determined whether all the trace entries of the trace file B have been processed. If there are still remaining entries in step 24, the processing from step 21 is repeated for the next trace entry. Step two
If it is determined in 4 that there are no remaining entries, the process ends.

【0025】[0025]

【発明の効果】以上説明したように、本発明のプログラ
ムトレース方式は、被トレースプログラムの変更に伴っ
てトレースポイントが変更されても、トレース採取手段
を呼び出す付近を変更するだけで、トレース編集手段は
一切変更しないで、継続的にトレース収集できるように
なる。
As described above, according to the program trace method of the present invention, even if the trace point is changed due to the change of the program to be traced, the trace edit means is simply changed to change the trace collection means. Will be able to continuously collect traces without any changes.

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

【図1】本発明のプログラムトレース方式の一実施例を
示す構成図である。
FIG. 1 is a configuration diagram showing an embodiment of a program trace system of the present invention.

【図2】本実施例におけるトレース採取手段の処理を示
す流れ図である。
FIG. 2 is a flowchart showing a process of a trace collection unit in this embodiment.

【図3】本実施例におけるトレース編集手段の処理を示
す流れ図である。
FIG. 3 is a flow chart showing processing of a trace editing means in the present embodiment.

【図4】従来のプログラムトレース方式を示す構成図で
ある。
FIG. 4 is a configuration diagram showing a conventional program trace method.

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

10 トレース採取手段 20 トレース編集手段 A 実行可能形式ファイル B トレースファイル C 編集されたトレースファイル X 被トレースプログラム 10 Trace collecting means 20 Trace editing means A Executable format file B Trace file C Edited trace file X Traced program

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 プログラムローダによって実行可能形式
ファイルからメモリにロードされて実行される被トレー
スプログラム中に組み込まれ、前記被トレースプログラ
ムから呼び出されて動作し、トレース情報をトレースフ
ァイルに採取するトレース採取手段と、前記被トレース
プログラム終了後に動作し、前記トレースファイルから
前記トレース採取手段によって採取された前記トレース
情報を、前記実行可能形式ファイルから前記トレース情
報の意味に関する情報とを読み出し、これらを編集しト
レース編集情報として出力するトレース編集手段とを備
えることを特徴とするプログラムトレース方式。
1. A trace collection, which is incorporated into a traced program that is loaded from an executable file into a memory by a program loader and executed, and is called and operated by the traced program to collect trace information in a trace file. Means for operating after completion of the traced program, reading the trace information collected by the trace collecting means from the trace file and information about the meaning of the trace information from the executable file, and editing these. A program trace method comprising: a trace edit means for outputting as trace edit information.
JP4039943A 1992-02-27 1992-02-27 Program trace system Pending JPH05250210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4039943A JPH05250210A (en) 1992-02-27 1992-02-27 Program trace system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4039943A JPH05250210A (en) 1992-02-27 1992-02-27 Program trace system

Publications (1)

Publication Number Publication Date
JPH05250210A true JPH05250210A (en) 1993-09-28

Family

ID=12567042

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4039943A Pending JPH05250210A (en) 1992-02-27 1992-02-27 Program trace system

Country Status (1)

Country Link
JP (1) JPH05250210A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07152604A (en) * 1993-11-26 1995-06-16 Nec Corp Device and method for debugging
JP2002236595A (en) * 2001-02-09 2002-08-23 Fujitsu Ten Ltd Electronic equipment and its device and method for debugging assistance

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0267642A (en) * 1988-09-01 1990-03-07 Mitsubishi Electric Corp Program debugging device
JPH0315950A (en) * 1989-06-14 1991-01-24 Nec Corp Program execution path exploring device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0267642A (en) * 1988-09-01 1990-03-07 Mitsubishi Electric Corp Program debugging device
JPH0315950A (en) * 1989-06-14 1991-01-24 Nec Corp Program execution path exploring device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07152604A (en) * 1993-11-26 1995-06-16 Nec Corp Device and method for debugging
JP2002236595A (en) * 2001-02-09 2002-08-23 Fujitsu Ten Ltd Electronic equipment and its device and method for debugging assistance

Similar Documents

Publication Publication Date Title
JP2006012066A (en) Trace analysis apparatus and trace analysis method
JP3205406B2 (en) Reference target variable determination processing method and translation processing system
JPH05250210A (en) Program trace system
JPH07141192A (en) Translation processing method
CN111708572B (en) A method for automatic generation of control flow diagram based on Clang program structure
JPH08129483A (en) Event-driven process controller
JP2811804B2 (en) Variable output range specification method
JPH056272A (en) Software designing device
JPH0264744A (en) Fault analyzing information acquiring system
JP3154790B2 (en) Optical character reader
JPH11154093A (en) Program Compiler and Recording Medium Recording Compiler Program
JPH11327887A (en) Compiler system with automatic parts converting function and recording medium
JPH0272407A (en) Ladder program converter
JPH01140236A (en) Inverse compile system for program
JPH04281528A (en) Software design specification confirmation method
JPS63640A (en) Execution control system for partial unit of data flow
JPS63300325A (en) Setting/reference cross reference list output method
JPH05127885A (en) Processing flow chart conversion system
JPH04107650A (en) Shift system for data base reference structure
JPH05289915A (en) Data conversion processing system
JPH0540638A (en) Vocabulary analyzing/editing system
JPS62237525A (en) Command converting method
JPH03186933A (en) Symbol processing system for language processing system
JPH0358144A (en) System for gathering program run history information
JPH03260828A (en) Information processor

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19980421