[go: up one dir, main page]

JP2785606B2 - Debugger for pipelined computer programs - Google Patents

Debugger for pipelined computer programs

Info

Publication number
JP2785606B2
JP2785606B2 JP4254444A JP25444492A JP2785606B2 JP 2785606 B2 JP2785606 B2 JP 2785606B2 JP 4254444 A JP4254444 A JP 4254444A JP 25444492 A JP25444492 A JP 25444492A JP 2785606 B2 JP2785606 B2 JP 2785606B2
Authority
JP
Japan
Prior art keywords
machine language
address
memory address
source
language instruction
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.)
Expired - Lifetime
Application number
JP4254444A
Other languages
Japanese (ja)
Other versions
JPH05224987A (en
Inventor
洋彦 小野
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
Nippon Electric Co 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP4254444A priority Critical patent/JP2785606B2/en
Publication of JPH05224987A publication Critical patent/JPH05224987A/en
Application granted granted Critical
Publication of JP2785606B2 publication Critical patent/JP2785606B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明はシンボリック・ステップ
・デバッガ、特にパイプライン処理方式を採用したコン
ピュータ用のソースプログラムを行単位にデバッグする
デバッガに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a symbolic step debugger, and more particularly to a debugger for debugging a source program for a computer employing a pipeline processing method in units of lines.

【0002】[0002]

【従来の技術】プログラムに誤りがあると正しくない結
果や回復できない状態に陥ることになる。たとえば、数
を0で割るとか、存在しないメモリ番地を参照したり、
そこに書き込もうとしたりする場合である。こうした原
因となるプログラムの誤りをバグといい、バグを除去す
る作業をデバッグという。
2. Description of the Related Art An error in a program leads to an incorrect result or an irrecoverable state. For example, dividing the number by zero, referring to a non-existent memory address,
This is the case when trying to write there. The error in the program that causes this is called a bug, and the work to remove the bug is called debugging.

【0003】完全なデバッグは、プログラムがプログラ
ム開発者の意図どおりに作成されていることを確かめる
検証をしなければ終了しない。しかし、完全なプログラ
ムを書くのは極めて難しく、また机上デバッグには膨大
な工数を要する。
[0003] Complete debugging does not end without verifying that the program is created as intended by the program developer. However, writing a complete program is extremely difficult, and debugging on a desk takes a lot of work.

【0004】そこで、そのプログラムを実行してエラー
の原因を探り、プログラムが実際に使われる範囲で正し
く作動するようにプログラムを手直しするという対症療
法的なデバッグを採用するのが通例である。このような
デバッグを効率的にできるようにするシステムがデバッ
ガであり、特に記号的なソースプログラムのレベルでデ
バッグを行うデバッガをシンボリック・デバッガと称す
る。
[0004] Therefore, it is customary to employ symptomatic debugging in which the program is executed to find the cause of the error, and the program is modified so that the program operates correctly within the range actually used. A system that enables such debugging to be performed efficiently is a debugger. In particular, a debugger that performs debugging at a symbolic source program level is called a symbolic debugger.

【0005】デバッガには、プログラムの実行過程をバ
ッチ的に記録するトレーサと、プログラムを1ステップ
ずつ実行しながら、その実行状態を調べるステッパとが
あり、適時に使い分けられる。本発明はステッパ、すな
わちステップ・デバッガに関する。
[0005] The debugger includes a tracer for recording the execution process of the program in a batch, and a stepper for checking the execution state of the program while executing the program one step at a time. The present invention relates to a stepper, a step debugger.

【0006】ところで、パイプライン制御方式を採用し
たコンピュータにおいては、周知のように、ソースプロ
グラムの複数の行にそれぞれ対応する複数の機械語命令
の各々は、複数の所定の位相で連続して並列的に実行さ
れるが、ソースプログラムにより定まる機械語命令の並
び方によっては命令実行の待ち状態が発生することがあ
る。この待ち状態を回避するべく、異なるソース行対応
の機械語命令間でその並び方を予め変更してプログラム
実行時間を短縮する技法がオブジェクト最適化と称せら
れる。
In a computer employing a pipeline control method, as is well known, each of a plurality of machine language instructions corresponding to a plurality of lines of a source program is continuously executed in a plurality of predetermined phases. However, depending on the arrangement of machine language instructions determined by the source program, a wait state for instruction execution may occur. In order to avoid this waiting state, a technique of changing the arrangement of machine instructions corresponding to different source lines in advance and shortening the program execution time is called object optimization.

【0007】オブジェクト最適化処理前のプログラム例
の一部を示す図5を参照すると、本プログラム例は、メ
モリアドレスaの内容とメモリアドレスbの内容を加算
してメモリアドレスcに格納するというソース行番号5
1が“1”のソース行52(以下ソース行1と記す)
と、メモリアドレスeの内容に即値“1”を加算してメ
モリアドレスdに格納するというソース行番号51が
“2”のソース行52(ソース行2)から成る。
Referring to FIG. 5, which shows a part of a program example before the object optimizing process, this program example adds a content of a memory address a and a content of a memory address b and stores the sum at a memory address c. Line number 5
Source line 52 in which 1 is “1” (hereinafter referred to as source line 1)
And a source row 52 (source row 2) having a source row number 51 of "2", which is to add an immediate value "1" to the contents of the memory address e and store the result at the memory address d.

【0008】ソース行1の演算代入文c=a+bは、図
の機械語命令番号の欄53に番号1,2および3で示さ
れるとおり、3つの機械語命令に翻訳される。機械語命
令番号“1”の第1の機械語命令(以下機械語命令1と
記す。“2”,“3”についても同じ。)は、メモリア
ドレスaの内容を読み出してレジスタ1に転送し、機械
語命令2はレジスタ1の内容にメモリアドレスbの内容
を加算してレジスタ1に保持し、機械語命令3はレジス
タ1の内容をメモリアドレスcに転送するものである。
The operation assignment statement c = a + b in the source line 1 is translated into three machine instructions as shown by numbers 1, 2 and 3 in the machine instruction number column 53 of FIG. A first machine language instruction having a machine language instruction number “1” (hereinafter referred to as machine language instruction 1; the same applies to “2” and “3”) reads out the contents of the memory address a and transfers it to the register 1. The machine instruction 2 adds the contents of the memory address b to the contents of the register 1 and holds the result in the register 1, and the machine instruction 3 transfers the contents of the register 1 to the memory address c.

【0009】同様に、ソース行2の演算代入文d=e+
1も3つの機械語命令に翻訳される。機械語命令4はメ
モリアドレスeの内容を読み出してレジスタ2に転送
し、機械語命令5はレジスタ2の内容に即値“1”を加
算してレジスタ2に保持し、機械語命令6はレジスタ2
の内容をメモリアドレスdに転送するものである。
Similarly, the operation assignment statement d = e +
1 is also translated into three machine language instructions. The machine language instruction 4 reads the contents of the memory address e and transfers them to the register 2. The machine language instruction 5 adds an immediate value “1” to the contents of the register 2 and holds the same in the register 2.
Is transferred to the memory address d.

【0010】いま、機械語命令の語長を2メモリアドレ
ス文のビット数と等しく選んであるので、機械語命令
1,2,3,…および6のメモリアドレスは欄54に図
示されるとおり、それぞれ0,2,4,…および10に
なる。
Since the word length of the machine language instruction is selected to be equal to the number of bits of the two-memory address statement, the memory addresses of the machine language instructions 1, 2, 3,. .. And 10 respectively.

【0011】一方、パイプライン処理方式を採用したコ
ンピュータにおいては、機械語命令1,2,3,…は、
図6に示すとおり、互いにずれたタイミングで連続して
並列的に実行処理される。図6は4段パイプライン処理
の例を示し、機械語命令1,2,3,…の各々につい
て、1クロックサイクルごとに、機械語命令語の読み込
み、必要なメモリ内容の読み込み、命令の実行及び実行
結果の書き出しが順次連続して行われる。
On the other hand, in a computer employing the pipeline processing method, machine language instructions 1, 2, 3,.
As shown in FIG. 6, the processing is executed continuously and in parallel at timings shifted from each other. FIG. 6 shows an example of the four-stage pipeline processing. For each of the machine language instructions 1, 2, 3,..., The machine language instruction word is read, the necessary memory contents are read, and the instruction execution is performed every clock cycle. The writing of the execution result is sequentially and continuously performed.

【0012】図5のプログラムは、機械語命令の実行が
待ち状態に陥る一例を示し、機械語命令1によるレジス
タ1への「書き出し」終了後でなければ、機械語命令2
における「実行」ができない。従って、図5のプログラ
ム例においては、機械語命令2以下は1クロックサイク
ル分だけ遅延することになる。
The program shown in FIG. 5 shows an example in which the execution of a machine language instruction falls into a wait state. Unless "write" to register 1 by machine language instruction 1 is completed, machine language instruction 2 is executed.
Cannot be executed in Therefore, in the example of the program shown in FIG. 5, machine language instructions 2 and below are delayed by one clock cycle.

【0013】この処理の遅れは、機械語命令の並び変え
を行うことにより回避することが可能である。図5のプ
ログラム例においては、機械語命令4は機械語命令1,
2及び3とは無関係な命令であるので、機械語命令1と
機械語命令2の間に移動すれば、機械語命令2が機械語
命令1の「実行」を待つ間に機械語命令4の「実行」を
することになり、命令実行性能の向上を図ることができ
る。図7は、図5のプログラム例に対するオブジェクト
最適処理後のプログラムを示す。
This processing delay can be avoided by rearranging the machine language instructions. In the example of the program shown in FIG.
Since instructions 2 and 3 are irrelevant instructions, if the instruction is moved between machine instruction 1 and machine instruction 2, machine instruction 2 waits for “execution” of machine instruction 1 while machine instruction 4 The execution is performed, and the instruction execution performance can be improved. FIG. 7 shows a program after the object optimization processing with respect to the program example of FIG.

【0014】さて、従来のシンボリック・ステップ・デ
バッガは、デバッグ情報として、ソースプログラムのソ
ース行ごとに、その行番号と、このソース行の翻訳結果
である機械語命令列の先頭メモリアドレスとを格納した
行番号・アドレス情報テーブルを使用している。
The conventional symbolic step debugger stores, for each source line of a source program, its line number and the head memory address of a machine language instruction string as a translation result of this source line, as debug information. Using the specified row number / address information table.

【0015】図5のプログラム例に対する、このような
行番号・アドレス情報テーブル80を示す図8におい
て、シンボリック・ステップ・デバッガは、欄51に記
載のソース行番号1(ソース行1と表示、以下同じ)の
デバッグを行うとき、ソース行1の行番号“1”と先頭
メモリアドレス“0”、並びにソース行2の行番号
“2”と先頭メモリアドレス“6”を読み込む。そし
て、先ず機械語命令1を実行後に、停止メモリアドレス
は“2”となるが、この停止メモリアドレスはソース行
2の先頭メモリアドレス“6”より小さいので、次にメ
モリアドレス“2”の機械語命令が実行される。
In FIG. 8, which shows such a line number / address information table 80 for the program example in FIG. 5, the symbolic step debugger operates as follows: source line number 1 (displayed as source line 1; When debugging the same, the line number “1” and the head memory address “0” of the source line 1 and the line number “2” and the head memory address “6” of the source line 2 are read. First, after executing the machine language instruction 1, the stop memory address becomes "2". Since this stop memory address is smaller than the head memory address "6" of the source row 2, the next machine address of the memory address "2" A word instruction is executed.

【0016】以下、同様にして停止メモリアドレスが
“6”となる迄、機械語命令が実行される。停止メモリ
アドレスが“6”となれば、オブジェクト最適化がされ
ていない図5の場合ソース行1を完全に実行したことに
なるのに対して、オブジェクト最適化がされている図7
の場合は、ソース行1の機械語命令列のうち機械語命令
3の実行が未達である。すなわち、それだけ処理に遅れ
を生ずる。
Thereafter, the machine language instruction is similarly executed until the stop memory address becomes "6". If the stop memory address is "6", it means that the source line 1 has been completely executed in the case of FIG. 5 where the object optimization has not been performed, whereas FIG. 7 where the object optimization has been performed
In the case of, execution of the machine language instruction 3 in the machine language instruction sequence of the source line 1 has not been reached. That is, the processing is delayed accordingly.

【0017】[0017]

【発明が解決しようとする課題】上述した従来のシンボ
リック・ステップ・デバッガでは、デバッグ情報には先
頭メモリアドレスしか含んでいないため、ソース行の末
尾メモリアドレスは次のソース行の先頭メモリアドレス
と同一のメモリアドレスであるとの前提のもとに、ソー
ス行レベルでのステップ実行の終了を判断している。し
かしオブジェクト最適化がされたプログラムにおいて
は、機械語命令の実行順序が2つのソース行にわたるの
で、この前提は不実なものとなり、ソース行レベルでの
ステップ実行の終了を正しく判断することができないこ
とになる。このため、従来は、オブジェクト最適化を行
わないプログラムプログラムのソースレベルでのステッ
プ・デバッグと、オブジェクト最適化を行ったプログラ
ムのオブジェクトレベルでのステップ・デバッグとのい
ずれか、又は両方を行っていた。しかし、前者によると
運用時におけるのと異なるプログラムをデバッグするこ
とになり、また後者によるとデバッグ作業に多くの時間
がとられ、効率的デバッグ作業が行えないという問題点
がある。
In the above-mentioned conventional symbolic step debugger, since the debug information includes only the head memory address, the end memory address of the source line is the same as the head memory address of the next source line. The end of the step execution at the source line level is determined based on the premise that the memory address is the memory address. However, in an object-optimized program, the execution order of machine language instructions extends over two source lines, so this assumption is false, and it is not possible to correctly judge the end of step execution at the source line level. become. For this reason, conventionally, one or both of step debugging at the source level of a program program without object optimization and step debugging at the object level of a program with object optimization have been performed. . However, according to the former, there is a problem that a program different from that at the time of operation is debugged, and according to the latter, a large amount of time is required for the debugging work, so that efficient debugging cannot be performed.

【0018】本発明の目的はパイプライン制御方式を採
用したコンピュータ用の最適化処理後のプログラムのデ
バッグを可能にするシンボリック・ステップ・デバッガ
を提供することにある。
It is an object of the present invention to provide a symbolic step debugger for a computer employing a pipeline control system, which can debug a program after optimization processing.

【0019】[0019]

【課題を解決するための手段】本発明のシンボリック・
ステップ・デバッガは、ソースプログラムの一行ごとに
ソース行番号とこのソース行の翻訳結果である機械語命
令列のメモリアドレス範囲を格納したテーブルを用意し
ておき、これをデバッグ情報として使用する。機械語命
令列は、指示に従ってオブジェクト最適化が実行された
結果のものであってもよい。ステップ・デバッグ実行時
には、当該ソース行と次のソース行に対するデバッグ情
報を読み込み1機械語命令を実行するごとに、次の機械
語命令アドレスが上述のメモリアドレス範囲内に留って
いるか否かをチェックしながら進行し、否となれば当該
ソース行のデバッグが終了する。
According to the present invention, there is provided a symbolic communication system comprising:
The step debugger prepares, for each line of the source program, a table storing a source line number and a memory address range of a machine language instruction string which is a translation result of the source line, and uses this as debug information. The machine language instruction sequence may be a result of executing the object optimization according to the instruction. At the time of executing the step / debug, the debug information for the source line and the next source line are read, and each time one machine instruction is executed, it is determined whether or not the next machine instruction address is within the above-mentioned memory address range. The process proceeds while checking, and if not, debugging of the source line ends.

【0020】[0020]

【実施例】本発明の一実施例を示す図1を参照すると、
本実施例は、ソースファイル1から入力したソースプロ
グラムを解析する解析手段21,この解析結果を機械語
命令列情報に変換する翻訳手段22,機械語命令の移動
を伴うオブジェクト最適化を行う最適化手段23及び行
番号・アドレス範囲情報テーブル出力手段24を含む言
語処理部2と、言語処理部2が出力する機械語命令列フ
ァイル31を入力する機械語命令列ファイル入力手段4
1,行番号・アドレス範囲情報テーブル出力手段24か
らの行番号・アドレス範囲情報テーブル32の供給を受
ける行番号・アドレス範囲情報テーブル入力手段42及
び最適化された機械語命令列に対してソースレベルのス
テップ実行を行うソースレベルステップ実行手段43を
含むデバッグ処理部4とで構成される。
FIG. 1 shows an embodiment of the present invention.
In the present embodiment, an analyzing unit 21 for analyzing a source program input from a source file 1, a translating unit 22 for converting the analysis result into machine language instruction sequence information, and an optimization for performing object optimization involving movement of a machine language instruction A language processing unit 2 including a unit 23 and a line number / address range information table output unit 24; and a machine language instruction sequence file input unit 4 for inputting a machine language instruction sequence file 31 output by the language processing unit 2.
1. Source level for the line number / address range information table input means 42 supplied with the line number / address range information table 32 from the line number / address range information table output means 24 and the optimized machine language instruction sequence And a debug processing unit 4 including a source level step executing means 43 for performing step execution.

【0021】図2は行番号・アドレス範囲情報テーブル
32の一例を示す説明図であり、各エントリは欄32a
へのソース行番号1,2,3,…、欄32bへの先頭ア
ドレス0,2,12,…、および欄32cへの末尾アド
レス7,11,14,…から成る。図中における先頭ア
ドレスと末尾アドレス内容は図7に示したオブジェクト
最適化処理後の機械語命令に対応し、図8に示した行番
号・アドレス情報テーブル80とを比較すると、末尾ア
ドレス欄32cが追加されており、また先頭アドレス欄
32bの値も異なっていることがわかる。
FIG. 2 is an explanatory diagram showing an example of the row number / address range information table 32, where each entry is a column 32a.
., A starting address 0, 2, 12,... To the column 32b, and a ending address 7, 11, 14,. The contents of the start address and the end address in the figure correspond to the machine language instruction after the object optimization processing shown in FIG. 7, and when compared with the line number / address information table 80 shown in FIG. It can be seen that the value has been added and the value of the head address column 32b is also different.

【0022】次に、本実施例の動作を言語処理とデバッ
グ処理とに分け、それぞれ図3と図4のフローチャート
を参照して説明する。
Next, the operation of this embodiment is divided into language processing and debugging processing, and will be described with reference to the flowcharts of FIGS. 3 and 4, respectively.

【0023】先ず、言語処理部2の解釈手段21はソー
スプログラム1を読み込み、その解析を行う(ステップ
S1)。翻訳手段22はソースファイル1の情報を機械
語命令列に翻訳する(ステップS2)。最適化手段23
は、言語処理プログラムの使用者がオブジェクト最適化
処理指定をしたか否かの判定を行う(ステップS3)。
この指定は、具体的には例えばジョブ制御言語カードの
入力によって可能である。
First, the interpreter 21 of the language processor 2 reads the source program 1 and analyzes it (step S1). The translation means 22 translates the information of the source file 1 into a machine language instruction sequence (step S2). Optimizing means 23
Determines whether the user of the language processing program has designated the object optimization processing (step S3).
This specification can be made, for example, by inputting a job control language card.

【0024】ステップS3における判定の結果、オブジ
ェクト最適化処理指定が行われていると判明した場合に
は、最適化手段23は機械語命令を移動して最適化処理
を行う(ステップS4)。図5に示したプログラム例で
は、機械語命令2において、前述のとおり、機械語命令
の実行待ち状態が存在するので図7に示すように機械語
命令4を機械語命令1と機械語命令2の間に移動してい
る。
If the result of determination in step S3 is that object optimization processing has been specified, the optimization means 23 performs optimization processing by moving the machine language instruction (step S4). In the example of the program shown in FIG. 5, the machine language instruction 2 has a machine language instruction execution waiting state as described above, so that the machine language instruction 4 is replaced with the machine language instruction 1 and the machine language instruction 2 as shown in FIG. Have moved between.

【0025】最適化処理を行うが否かに拘わらず、行番
号・アドレス範囲情報テーブル出力手段24は図2に示
した行番号・アドレス範囲情報テーブル32を出力する
(ステップS5)。最適化処理が行われなかった場合に
は、行番号・アドレス範囲情報テーブル32における先
頭アドレスの内容は行番号・アドレス情報テーブル80
(図8)における欄82の先頭アドレス内容と変わるこ
とがなく、末尾アドレスの内容は、欄81記載のソース
行番号に対する欄82の先頭アドレスの内容より1つ小
さい値となる。
The row number / address range information table output means 24 outputs the row number / address range information table 32 shown in FIG. 2 irrespective of whether or not the optimization process is performed (step S5). If the optimization process has not been performed, the contents of the head address in the line number / address range information table 32 are set in the line number / address information table 80.
The contents of the end address are the same as the contents of the start address of the column 82 in FIG. 8, and the contents of the end address are one smaller than the contents of the start address of the column 82 with respect to the source line number described in the column 81.

【0026】一方、最適化処理が行われた場合には、図
2に示すように、ソース行1の翻訳結果である機械語命
令1,2及び3のメモリアドレス範囲は、機械語命令1
の先頭アドレスである0番地から機械語命令3の終了ア
ドレスである7番地までである。また、ソース行2の翻
訳結果である機械語命令4,5及び6のメモリアドレス
範囲は、機械語命令4の先頭アドレスである2番地から
機械語命令6の終了アドレスである11番地までであ
る。最後に、翻訳手段22は機械語命令列を機械語命令
列ファイル3に書き出す(ステップS6)。次に、デバ
ッグ処理部4の動作について説明する。
On the other hand, when the optimization processing is performed, as shown in FIG. 2, the memory address ranges of the machine language instructions 1, 2, and 3 which are the translation results of the source line 1 are changed to the machine language instruction 1
From the start address 0 to the end address 7 of the machine language instruction 3. Further, the memory address range of the machine language instructions 4, 5 and 6 which are the translation result of the source line 2 is from address 2 which is the head address of the machine language instruction 4 to address 11 which is the end address of the machine language instruction 6. . Finally, the translation means 22 writes the machine language instruction sequence into the machine language instruction sequence file 3 (step S6). Next, the operation of the debug processing unit 4 will be described.

【0027】デバッグ処理プログラムの使用者が、ソー
スレベルのステップ実行指示を行うと、デバッグ処理部
4の機械語命令列ファイル入力手段41は機械語命令列
ファイル3、行番号・アドレス範囲情報テーブル入力手
段42は行番号・アドレス範囲情報テーブル32をそれ
ぞれメモリ(図示省略)に読み込む。この後、ソースレ
ベルステップ実行手段43は、図4のフローチャートに
示すように、以下の処理を行う。 (1)デバッグ対象の機械語命令列の現在の停止アドレ
スと、行番号・アドレス範囲情報テーブル32における
先頭アドレス32bを比較して同じ場合か又は次のソー
ス行の先頭アドレス32bより少ない場合は、そのソー
ス行の行番号を求める(ステプS11)。現在の停止ア
ドレスが0番地の場合、ソース行1の先頭アドレス0番
地と同じであるから求めるソース行番号は“1”とな
る。
When the user of the debug processing program gives a source level step execution instruction, the machine language instruction sequence file input means 41 of the debug processing unit 4 inputs the machine language instruction sequence file 3, line number / address range information table input. The means 42 reads the row number / address range information table 32 into a memory (not shown). Thereafter, the source level step executing means 43 performs the following processing as shown in the flowchart of FIG. (1) If the current stop address of the machine language instruction string to be debugged is compared with the start address 32b in the line number / address range information table 32 and the same or less than the start address 32b of the next source line, The line number of the source line is obtained (step S11). If the current stop address is address 0, the source line number to be obtained is "1" because it is the same as the start address 0 of source line 1.

【0028】(2)求めたソース行の先頭アドレスxと
末尾アドレスyを求める(ステップS12)。ソース行
1に対してはx=0,y=7である。
(2) The start address x and end address y of the obtained source line are obtained (step S12). For source row 1, x = 0 and y = 7.

【0029】(3)1つの機械語命令を実行する(ステ
ップS13)。
(3) One machine language instruction is executed (step S13).

【0030】(4)プログラムの停止アドレスが(2)
で求めた先頭アドレスxと末尾アドレスyの間に留まっ
ていれば(3)に戻り機械語命令のステップ実行を繰り
返す(ステップS14,S13)。停止アドレスが先頭
アドレスxと末尾アドレスyとで定まる範囲外になった
場合は、ソースレベルのステップ実行が終了したので、
当該ソース行についての機械語命令のステップ実行を終
了する(ステップS14)。図7に示したプログラム例
では、ソース行1の末尾アドレスは7番地であるので、
停止アドレスが8番地になるとソース行1のステップ実
行が終了することになる。
(4) The stop address of the program is (2)
If it stays between the start address x and the end address y obtained in step (3), the process returns to (3) and the step execution of the machine language instruction is repeated (steps S14 and S13). If the stop address is outside the range defined by the start address x and the end address y, the step execution at the source level has been completed.
The step execution of the machine language instruction for the source line ends (step S14). In the example of the program shown in FIG. 7, the end address of the source line 1 is 7, so that
When the stop address reaches address 8, the step execution of the source line 1 ends.

【0031】(5)ソースレベルのステップ実行が終了
すると、現在のプログラムの停止アドレスと、行番号・
アドレス範囲情報テーブル32の欄32bの先頭アドレ
スを比較し、同じ場合か又は次のソース行の先頭アドレ
スより少ない場合の欄32aのソース行番号を求める
(S15)。停止アドレスが8番地である場合、図2か
ら明らかなように、ソース行3の先頭アドレスである1
2番地以内であるため、求めるソース行番号は第2行と
なる。
(5) When the step execution at the source level is completed, the stop address of the current program, the line number,
The head addresses of the column 32b of the address range information table 32 are compared, and the source line number of the column 32a is determined when they are the same or less than the head address of the next source line (S15). When the stop address is address 8, as is clear from FIG.
Since it is within address 2, the source line number to be obtained is the second line.

【0032】(6)(5)で求めたソース行番号をデバ
ッグ実行者に対して通知するためコンソール等の表示装
置に停止ソース行番号を表示する(ステップS16)。
(6) The stopped source line number is displayed on a display device such as a console to notify the debugger of the source line number obtained in (5) (step S16).

【0033】本実施例においては、ソース行の末尾アド
レスを図2に示したように絶対値で表わしているが、先
頭アドレスに対する相対値で表わすようにした実施例も
容易に実現できる。
In the present embodiment, the end address of the source line is represented by an absolute value as shown in FIG. 2, but an embodiment in which the end address is represented by a relative value to the start address can be easily realized.

【発明の効果】上述のとおり、本発明によると、パイプ
ライン制御方式のコンピュータにおいてオブジェクト最
適化処理を行なった場合においてもソース行に対する機
械語命令のメモリアドレス範囲を正確に表示する行番号
・アドレス範囲情報テーブルを使用するため、ソースレ
ベルのデバッグ実行が可能になる。
As described above, according to the present invention, even when object optimization processing is performed in a computer of a pipeline control system, a line number and an address that accurately display a memory address range of a machine language instruction for a source line. Since the range information table is used, source-level debugging can be performed.

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

【図1】本発明の一実施例の要部を示すブロック構成図
である。
FIG. 1 is a block diagram showing a main part of an embodiment of the present invention.

【図2】本発明のシンボリック・ステップ・デバッガに
おける行番号・アドレス範囲情報テーブル例を示す説明
図である。
FIG. 2 is an explanatory diagram showing an example of a line number / address range information table in a symbolic step debugger of the present invention.

【図3】本発明のシンボリック・ステップ・デバッガに
おける言語処理部の処理手順を示すフローチャートであ
る。
FIG. 3 is a flowchart showing a processing procedure of a language processing unit in the symbolic step debugger of the present invention.

【図4】本発明のシンボリック・ステップ・デバッガに
おけるデバッグ処理部の処理手順を示すフローチャート
である。
FIG. 4 is a flowchart showing a processing procedure of a debug processing unit in the symbolic step debugger of the present invention.

【図5】最適化処理前のプログラム例の一部を示す説明
図である。
FIG. 5 is an explanatory diagram showing a part of a program example before an optimization process;

【図6】図1に示したプログラムのパイプライン処理例
を示す説明図である。
FIG. 6 is an explanatory diagram showing an example of pipeline processing of the program shown in FIG. 1;

【図7】図1に示したプログラム例に最適化処理を施し
た後のプログラムを示す説明図である。
FIG. 7 is an explanatory diagram showing a program after an optimization process is performed on the program example shown in FIG. 1;

【図8】従来のシンボリック・ステップ・デバッガにお
ける行番号・アドレス情報テーブル例を示す説明図であ
る。
FIG. 8 is an explanatory diagram showing an example of a line number / address information table in a conventional symbolic step debugger.

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

1 ソースファイル 2 言語処理部 21 解析手段 22 翻訳手段 23 最適化手段 24 行番号・アドレス範囲情報テーブル出力手段 31 機械語命令列ファイル 32 行番号・アドレス範囲情報テーブル 32a ソース行番号 32b 先頭アドレス 32c 末尾アドレス 4 デバッグ処理部 41 機械語命令列ファイル入力手段 42 行番号・アドレス範囲情報テーブル入力手段 43 ソースレベルステップ実行手段 51 ソース行番号 52 ソース行 53 機械語命令番号 54 メモリアドレス 55 機械語命令 80 行番号・アドレス情報テーブル 81 ソース行番号 82 先頭アドレス 1 Source file 2 Language processing unit 21 Analysis unit 22 Translation unit 23 Optimization unit 24 Line number / address range information table output unit 31 Machine language instruction sequence file 32 Line number / address range information table 32a Source line number 32b Start address 32c End Address 4 Debug processing unit 41 Machine language instruction string file input unit 42 Line number / address range information table input unit 43 Source level step execution unit 51 Source line number 52 Source line 53 Machine language instruction number 54 Memory address 55 Machine language instruction 80 line Number / address information table 81 Source line number 82 Start address

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 パイプライン制御方式を採用したコンピ
ュータ用のソースプログラムを行単位にデバッグするシ
ンボリック・ステップ・デバッガにおいて、 前記ソースプログラムを構成する機械語命令の実行順序
を実行待ち時間が最小になるように最適化する最適化手
段と、 前記最適化の結果により、前記ソースプログラムのソー
ス行ごとに、当該行番号及び当該ソース行に対する機械
語命令後のメモリアドレス範囲を表示した行番号・アド
レス範囲情報テーブルを作成する行番号・アドレス範囲
情報テーブル出力手段と、 機械語命令実行の停止メモリアドレスが前記メモリアド
レス範囲にあるか否かをチェックしながら前記機械語命
令を実行し、前記否の場合に当該ソース行のデバッグ終
了と判断するソースレベルステップ実行手段とを有する
ことを特徴とするシンボリック・ステップ・デバッガ。
1. A symbolic step debugger for debugging a source program for a computer adopting a pipeline control system in units of lines, wherein an execution order of machine language instructions constituting the source program is minimized. Number and address range displaying, for each source line of the source program, the line number and the memory address range after the machine language instruction for the source line, based on the result of the optimization. A line number / address range information table output means for creating an information table, and the machine language instruction is executed while checking whether or not a memory address for stopping execution of the machine language instruction is in the memory address range; Source level step execution means for determining that the debugging of the source line has been completed. A symbolic step debugger.
【請求項2】 前記メモリアドレス範囲を当該ソース行
に対する機械語命令後の先頭メモリアドレスと末尾メモ
リアドレスの絶対値とで表わしたことを特徴とする請求
項1記載のシンボリック・ステップ・デバッガ。
2. The symbolic step debugger according to claim 1, wherein the memory address range is represented by an absolute value of a head memory address and a tail memory address after a machine language instruction for the source line.
【請求項3】 前記メモリアドレス範囲を当該ソース行
に対する機械語命令後の先頭メモリアドレスと、該先頭
メモリアドレスから末尾アドレスまでの差分情報とで表
わしたことを特徴とする請求項1記載のシンボリック・
ステップ・デバッガ。
3. The symbolic according to claim 1, wherein the memory address range is represented by a head memory address after a machine language instruction for the source line and difference information from the head memory address to the end address.・
Step debugger.
JP4254444A 1991-10-11 1992-09-24 Debugger for pipelined computer programs Expired - Lifetime JP2785606B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4254444A JP2785606B2 (en) 1991-10-11 1992-09-24 Debugger for pipelined computer programs

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP3-263943 1991-10-11
JP26394391 1991-10-11
JP4254444A JP2785606B2 (en) 1991-10-11 1992-09-24 Debugger for pipelined computer programs

Publications (2)

Publication Number Publication Date
JPH05224987A JPH05224987A (en) 1993-09-03
JP2785606B2 true JP2785606B2 (en) 1998-08-13

Family

ID=26541685

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4254444A Expired - Lifetime JP2785606B2 (en) 1991-10-11 1992-09-24 Debugger for pipelined computer programs

Country Status (1)

Country Link
JP (1) JP2785606B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08171499A (en) * 1994-12-20 1996-07-02 Nec Software Ltd Debug device
JP2001034504A (en) 1999-07-19 2001-02-09 Mitsubishi Electric Corp Source level debugger

Also Published As

Publication number Publication date
JPH05224987A (en) 1993-09-03

Similar Documents

Publication Publication Date Title
JP2795244B2 (en) Program debugging system
EP0241946B1 (en) Information processing system
US9342437B2 (en) Backward post-execution software debugger
US7653899B1 (en) Post-execution software debugger with performance display
US8914777B2 (en) Forward post-execution software debugger
US8584097B2 (en) Post-execution software debugger with event display
US8015552B1 (en) Post-execution software debugger with coverage display
JP2785606B2 (en) Debugger for pipelined computer programs
JP2004192139A (en) Debug device, debug method and recording medium
JP3892873B2 (en) Programmable controller
JP2552738B2 (en) Data processing device
JPS5894041A (en) Debug backup device for high-class language
JPH05127945A (en) Program execution situation analysis system
JP2000250779A (en) Programmable controller
JP2526710B2 (en) Programmable controller programming method
JPH05108372A (en) System for outputting compiler optimization processing content
JPH05108404A (en) Debugger system
JP2001067245A (en) Simulation method and simulation device
JPH0468446A (en) Debugging supporting device
JP2000305806A (en) Method and device for detecting incorrect memory access error
JPH09160806A (en) Method for supporting debugging and its device
JPS63205740A (en) Program execution trace processing method
JP2003015907A (en) Debugging device, debugger and program recording medium
JPH04270422A (en) Precompile processing system
JPH05204698A (en) Debugger processing system

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980428