JPS63205740A - Program executing trace processing system - Google Patents

Program executing trace processing system

Info

Publication number
JPS63205740A
JPS63205740A JP62038921A JP3892187A JPS63205740A JP S63205740 A JPS63205740 A JP S63205740A JP 62038921 A JP62038921 A JP 62038921A JP 3892187 A JP3892187 A JP 3892187A JP S63205740 A JPS63205740 A JP S63205740A
Authority
JP
Japan
Prior art keywords
program
symbolic
object program
correspondence table
tracer
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
JP62038921A
Other languages
Japanese (ja)
Inventor
Kaoru Gojo
五條 薫
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP62038921A priority Critical patent/JPS63205740A/en
Publication of JPS63205740A publication Critical patent/JPS63205740A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To efficiently execute a symbolic debug by retrieving a line number of a source program from a correspondence table and outputting it, with respect to an instruction address of an object program in case an interruption has been generated. CONSTITUTION:A symbolic tracer 3 loads an object program 2 and a correspondence table 4, and executes the object program 2 by setting a computer to a debug mode. The correspondence table 4 is constituted so as to show an address of the object program 2, and a line number of a source program corresponding thereto. An interruption processing part 1 monitors a branch of the object program 2, and shifts a control to the symbolic tracer 3, when a branch execution is detected in a program which is being executed by the debug mode. The symbolic tracer 3 retrieves the correspondence table 4 by a branch destination instruction address of the object program 2, and outputs the corresponding number to a list 5. In such a way, the symbolic debug can be executed efficiently.

Description

【発明の詳細な説明】 〔概 要〕 プログラムデバッグのための、実行トレースの改良した
処理方式である。
[Detailed Description of the Invention] [Summary] This is an improved execution trace processing method for program debugging.

原始プログラムの行番号とオブジェクトプログラムの命
令番地との対応表を設け、オブジェクトプログラム実行
のいわゆるブランチトレースにおいて、分岐命令で割込
が起こったとき、対応表によってその命令アドレスに対
応する行番号を検索して出力する。対応表は例えば原始
プログラムをオブジェクトプログラムに翻訳する際に作
る。
A correspondence table is created between source program line numbers and object program instruction addresses, and when an interrupt occurs at a branch instruction in so-called branch tracing of object program execution, the correspondence table is used to search for the line number corresponding to that instruction address. and output it. A correspondence table is created, for example, when a source program is translated into an object program.

以上により、いわゆるシンボリックデバッグが効率よく
行われる。
As described above, so-called symbolic debugging can be performed efficiently.

〔産業上の利用分野〕[Industrial application field]

本発明は、計算機におけ2る、プログラムデバッグのた
めの実行トレースの処理方式に関する。
The present invention relates to an execution trace processing method for program debugging in a computer.

プログラムを実行させて実行された命令の経路を追跡す
る、いわゆる実行トレースは、プログラムデバッグの有
力な手段として使用される。
So-called execution tracing, which traces the path of executed instructions by running a program, is used as an effective means of program debugging.

〔従来の技術と発明が解決しようとする問題点〕プログ
ラムの実行トレースは、実行した命令のアドレスを知る
ことが直接の目的であるが、命令がアドレス順にシーケ
ンシャルに実行されている部分については、逐−各命令
アドレスを知らなくてもよいので、公知のようにプログ
ラムの分岐が行われたときの、分岐先命令のアドレスの
みを出力し、例えばブランチトレースと呼ばれる。
[Prior art and problems to be solved by the invention] The direct purpose of program execution tracing is to know the addresses of executed instructions. Since it is not necessary to know the address of each instruction, as is well known, only the address of the branch destination instruction when a program is branched is output, which is called, for example, branch tracing.

多くの計算機の処理装置には、上記のブランチトレース
をサポートする等のために、分岐命令による分岐の発生
を検出して、所定の割込を生起する機能が設けられてい
る。
Many computer processing units are provided with a function of detecting the occurrence of a branch due to a branch instruction and generating a predetermined interrupt in order to support the above-mentioned branch trace.

そのような処理装置では、処理装置で実行されるプログ
ラムの状態を、例えば公知のプログラム状態語の所定制
御ビットを設定することによって、所定の例えばデバッ
グモードに設定することにより、そのプログラムの実行
についてブランチトレース割込が有効になる。
In such a processing device, the state of a program being executed on the processing device can be controlled with respect to the execution of the program by setting it in a predetermined, e.g., debug mode, e.g. by setting predetermined control bits of a known program state word. Branch trace interrupts are enabled.

又、割込発生によって適当なトレーサプログラムを起動
するようにすれば、割込時の被デバツグプログラムの命
令アドレスレジスタにある、次命令アドレス即ち分岐先
命令アドレスを読み出して出力することができるので、
比較的効率よくトレース情報を取得できる。
Furthermore, by activating an appropriate tracer program when an interrupt occurs, it is possible to read and output the next instruction address, that is, the branch destination instruction address, in the instruction address register of the debugged program at the time of the interrupt. ,
Trace information can be acquired relatively efficiently.

しかし、このトレース情報は、当然処理装置で直接実行
可能ないわゆる機械語命令のプログラムのアドレスであ
り、いわゆる高級プログラミング言語で記述された原始
プログラムのプログラム文とは対応しないので、利用者
において原始プログラムとの対応付けが必要となり、デ
バッグの効率が上がらないという問題がある。
However, this trace information is of course the address of a so-called machine language instruction program that can be directly executed by a processing device, and does not correspond to the program statements of a source program written in a so-called high-level programming language. There is a problem that debugging efficiency cannot be improved because it is necessary to make a correspondence with

このために実行トレースの結果を、原始プログラムに対
応した情報で出力する、いわゆるシンボリックデバッガ
等と呼ばれるデバッグプログラムがある。
For this purpose, there are debug programs called symbolic debuggers that output execution trace results as information corresponding to the source program.

シンボリック・デバッガでデバッグを行う場合には、原
始プログラムをいわゆるコンパイラ等で、機械語のオブ
ジェクトプログラムに翻訳する処理の際に、デバッグモ
ードのオブジェクトプログラムを生成するように指定し
、それによって所要個所にデバッグ用の情報が挿入され
たオブジェクトプログラムを作成するようにする。
When debugging with a symbolic debugger, you can specify that a so-called compiler generate an object program in debug mode when translating the source program into a machine language object program. Create an object program with debugging information inserted.

そのようなオブジェクトプログラムを実行すると、前記
のデバッグ用情報部分の命令の実行によって、例えば分
岐によってシンボリックデバッガに制御を移すようにし
、シンボリック・デバッガはそのデバッグ用情報から、
原始プログラムの行番号等を出力する。
When such an object program is executed, control is transferred to the symbolic debugger by executing the instructions in the debugging information part, for example, by branching, and the symbolic debugger uses the debugging information to
Outputs the line number etc. of the source program.

このために、デバッグが終了して、そのプログラムを実
運用する場合には、完成した原始プログラムから、デバ
ッグ用情報の挿入の無いオブジェクトプログラムを改め
て生成する必要があり、且つその結果デバッグ時と実運
用時のプログラムの大きさの相違等がトラブルの原因に
なり得るという問題がある。
For this reason, when debugging is finished and the program is to be used in actual operation, it is necessary to generate a new object program from the completed source program without inserting debugging information, and as a result, debugging and execution There is a problem in that differences in the size of programs during operation can cause trouble.

〔問題点を解決するための手段〕[Means for solving problems]

第1図は、本発明の計算機の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing the configuration of a computer according to the present invention.

図において、1は実行中のオブジェクトプログラム2の
分岐を監視して割込を発生し、シンボリックトレーサ3
に制御を渡す割込処理部、4はシンボリックトレーサ3
が割込発生アドレスに対応する原始プログラムの行番号
をリスト5に出力するために参照する対応表である。
In the figure, 1 monitors the branch of the object program 2 that is being executed and generates an interrupt, and the symbolic tracer 3
4 is the symbolic tracer 3
is a correspondence table that is referred to in order to output the line number of the source program corresponding to the interrupt generation address to List 5.

〔作 用〕[For production]

シンボリックトレーサ3は、オブジェクトプログラム2
と対応表4をロードし、計算機をデバッグモードにして
オブジェクトプログラム2を実行させる。
Symbolic tracer 3 is object program 2
and correspondence table 4, put the computer in debug mode, and execute object program 2.

対応表4はオブジェクトプログラム2のアドレスと、そ
れに対応する原始プログラムの行番号を示すように構成
される。
The correspondence table 4 is constructed to show addresses of the object program 2 and line numbers of the source program corresponding thereto.

割込処理部1はオブジェクトプログラム2の分岐を監視
し、デバッグモードで実行しているプログラムにおいて
分岐実行を検出すると、シンボリックトレーサ3に制御
を移す。
The interrupt processing unit 1 monitors branches of the object program 2, and transfers control to the symbolic tracer 3 when branch execution is detected in a program running in debug mode.

シンボリックトレーサ3はオブジェクトプログラム2の
分岐先命令アドレスで対応表4を検索し、対応する行番
号をリスト5に出力する。
The symbolic tracer 3 searches the correspondence table 4 using the branch destination instruction address of the object program 2, and outputs the corresponding line number to the list 5.

この方式により、シンボリックデバッグを効率よく行う
ことができ、且つデバッグ時と運用時で同一のオブジェ
クトプログラムが使用できる。
With this method, symbolic debugging can be performed efficiently, and the same object program can be used during debugging and operation.

〔実施例〕〔Example〕

原始プログラムによるデバッグのために、シンボリック
トレーサ3を起動すると、シンボリックトレーサ3は、
指定のオブジェクトプログラム2と対応表4をロードし
、例えば前記と同様に、プログラム2のプログラム状態
語の所定制御ビットにより、計算機をデバッグモードに
設定して、オブジェクトプログラム2の実行を開始する
When you start symbolic tracer 3 for debugging with a source program, symbolic tracer 3 will do the following:
The specified object program 2 and the correspondence table 4 are loaded, and the computer is set to the debug mode using a predetermined control bit of the program status word of the program 2, for example, as described above, and execution of the object program 2 is started.

対応表4は、例えば第2図に示すように、高級プログラ
ミング言語で記述された原始プログラム10を、コンパ
イラ11によって翻訳して、オブジェクトプログラム2
を生成する際に、コンパイラ11によって作成する。
For example, as shown in FIG. 2, the correspondence table 4 shows that a source program 10 written in a high-level programming language is translated by a compiler 11 to create an object program 2.
is created by the compiler 11 when generating.

対応表4は、例えば図示のように行番号槽とアドレス欄
からなる各項に、原始プログラム10に記述された行番
号と、その行番号に関連するプログラム文から生成され
るオブジェクトプログラム2の命令のアドレスとを示す
構成とする。
In the correspondence table 4, for example, each item consisting of a line number tank and an address column as shown in the figure shows the line numbers written in the source program 10 and the instructions of the object program 2 generated from the program statements related to the line numbers. The configuration is such that the address of

割込処理部1は実行中の命令を監視して、分岐命令の分
岐実行を検出し、デバッグモードが指定されている場合
には割込を発生することによって、現実行中のプログラ
ムの実行を中断して、シンボリックトレーサ3に制御を
渡すようする。
The interrupt processing unit 1 monitors the instructions being executed, detects branch execution of a branch instruction, and generates an interrupt if debug mode is specified, thereby interrupting the execution of the program currently being executed. The process is interrupted and control is passed to the symbolic tracer 3.

従って割込処理部1が、デバッグモードで実行中のオブ
ジェクトプログラム2の分岐実行を検出すると、シンボ
リックトレーサ3を起動する。
Therefore, when the interrupt processing unit 1 detects branch execution of the object program 2 being executed in the debug mode, the symbolic tracer 3 is activated.

シンボリックトレーサ3はオブジェクトプログラム2の
プログラム状態語等から次に実行する分岐先命令のアド
レスを知り、そのアドレスによって対応表4を検索し、
対応する行番号を得て、行番号をリスト5に出力する。
The symbolic tracer 3 learns the address of the next branch destination instruction to be executed from the program status word of the object program 2, and searches the correspondence table 4 using that address.
Obtain the corresponding line number and output the line number to Listing 5.

従って、リスト5は原始プログラム10上の行番号が、
実行順に配列されたリストとなり、利用者は原始プログ
ラム上で実行経路を容易に追跡することができる。
Therefore, in Listing 5, the line number on the source program 10 is
The list is arranged in the order of execution, allowing the user to easily trace the execution path on the source program.

〔発明の効果〕〔Effect of the invention〕

以上の説明から明らかなように、本発明によれば、計算
機における、原始プログラム上でプログラムの実行経路
を追跡する、いわゆる−シンボリックトレーサを効率よ
く行うことができ、又デバッグと実運用のオブジェクト
プログラムが異なることによるトラブル発生のおそれも
無いので、プログラムデバッグの効率を向上するという
著しい工業的効果がある。
As is clear from the above description, according to the present invention, it is possible to efficiently perform a so-called symbolic tracer that traces the execution path of a program on a source program in a computer, and it is also possible to efficiently perform an object program for debugging and actual operation. Since there is no risk of trouble occurring due to differences in the numbers, there is a significant industrial effect of improving the efficiency of program debugging.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の構成を示すブロック図、第2図は対応
表の説明図である。 図において、 1は割込処理部、 2はオブジェクトプログラム、 3はシンボリックトレーサ、 4は対応表、      5はリスト、10は原始プロ
グラム、 11はコンパイラを示す。 本発明の構成を示すブロック図 第1図 対応表の説明図 第2図
FIG. 1 is a block diagram showing the configuration of the present invention, and FIG. 2 is an explanatory diagram of a correspondence table. In the figure, 1 is an interrupt processing unit, 2 is an object program, 3 is a symbolic tracer, 4 is a correspondence table, 5 is a list, 10 is a source program, and 11 is a compiler. Figure 1 is a block diagram showing the configuration of the present invention. Figure 2 is an explanatory diagram of the correspondence table.

Claims (1)

【特許請求の範囲】 原始プログラムを翻訳して生成されたオブジェクトプロ
グラムを実行し、該オブジェクトプログラムの分岐を検
出して割込を生起する機能を有する計算機において、 該原始プログラムのプログラム文に付された行番号と、
該オブジェクトプログラム(2)の命令アドレスとの対
応を示す対応表(4)と、 該割込が発生した場合の該オブジェクトプログラム(2
)の命令アドレスに対する、該原始プログラムの行番号
を該対応表(4)から検索して出力する手段(3)とを
設けたことを特徴とするプログラム実行トレース処理方
式。
[Claims] In a computer having a function of executing an object program generated by translating a source program, detecting a branch of the object program, and generating an interrupt, line number and
A correspondence table (4) showing the correspondence with the instruction address of the object program (2), and a correspondence table (4) showing the correspondence with the instruction address of the object program (2) when the interrupt occurs.
) A program execution trace processing method characterized by comprising means (3) for searching and outputting a line number of the source program from the correspondence table (4) for the instruction address of ().
JP62038921A 1987-02-20 1987-02-20 Program executing trace processing system Pending JPS63205740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62038921A JPS63205740A (en) 1987-02-20 1987-02-20 Program executing trace processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62038921A JPS63205740A (en) 1987-02-20 1987-02-20 Program executing trace processing system

Publications (1)

Publication Number Publication Date
JPS63205740A true JPS63205740A (en) 1988-08-25

Family

ID=12538683

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62038921A Pending JPS63205740A (en) 1987-02-20 1987-02-20 Program executing trace processing system

Country Status (1)

Country Link
JP (1) JPS63205740A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02191046A (en) * 1989-01-20 1990-07-26 Nec Corp Tracing system for program
JPH04289923A (en) * 1991-03-19 1992-10-14 Nec Corp Program converter

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02191046A (en) * 1989-01-20 1990-07-26 Nec Corp Tracing system for program
JPH04289923A (en) * 1991-03-19 1992-10-14 Nec Corp Program converter

Similar Documents

Publication Publication Date Title
JPS63205740A (en) Program executing trace processing system
JPH0581070A (en) Programmable controller and user program execution method in programmable controller
JPH03113648A (en) Program debug system
JPH0262639A (en) Interruption system for language debugger
JP2785606B2 (en) Debugger for pipelined computer programs
KR100231692B1 (en) A generation method of chill debugging information
JP2751423B2 (en) Program debug processing method
JPS63231640A (en) Program debugging system
JP2659366B2 (en) Debugging method and device
JPS59202548A (en) Debugging device
JPH06242943A (en) Source code level debugging device
JPS63178343A (en) System for setting interrupting point
JPH02191046A (en) Tracing system for program
JPH0239332A (en) Software break system
JPH07191873A (en) Transition output system for value of variable at debugger
US7627859B2 (en) Method for configuring non-script language library files to be run as scripts
JPH0659929A (en) Computer device
JPS63178341A (en) Program debugging system
JPS5844543A (en) Trigger tracing circuit
JPH0644101A (en) Program debug processing method
JPH03290739A (en) Dynamic analysis system for program
JPS63153648A (en) Program maintenance equipment
JPH04333146A (en) Program execution control system for debugging
JPH04367902A (en) Programmable controller
JPH02242442A (en) Program debugging system