JP2607976B2 - Debug method - Google Patents

Debug method

Info

Publication number
JP2607976B2
JP2607976B2 JP2300301A JP30030190A JP2607976B2 JP 2607976 B2 JP2607976 B2 JP 2607976B2 JP 2300301 A JP2300301 A JP 2300301A JP 30030190 A JP30030190 A JP 30030190A JP 2607976 B2 JP2607976 B2 JP 2607976B2
Authority
JP
Japan
Prior art keywords
line
statement
patch
information
attribute information
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
JP2300301A
Other languages
Japanese (ja)
Other versions
JPH04171544A (en
Inventor
昭範 野口
真 太刀掛
Original Assignee
日立電子エンジニアリング株式会社
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 日立電子エンジニアリング株式会社 filed Critical 日立電子エンジニアリング株式会社
Priority to JP2300301A priority Critical patent/JP2607976B2/en
Publication of JPH04171544A publication Critical patent/JPH04171544A/en
Application granted granted Critical
Publication of JP2607976B2 publication Critical patent/JP2607976B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は、デバック方式に関し、詳しくは、ソース
プログラム(原始プログラム)のレベルでパッチ(言語
の一部分の修正)ができ、それをオブジェクトプログラ
ム(コンピュータが実行可能な状態の実行用プログラ
ム、いわゆる機械語のプログラム)に持ち込むことがで
きるデバック方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention relates to a debugging method, and more particularly, to a patch (modification of a part of a language) at a source program (original program) level, which can be converted into an object program ( The present invention relates to a debugging method that can be brought into an execution program (a so-called machine language program) that can be executed by a computer.

[従来の技術] 従来、パルカル準拠のプログラムやC言語準拠のプロ
グラム等の高級言語を用いてプログラムを作成した場合
にそのパッチを高級言語で行い、高級言語からオブジェ
クトプログラムを持ち込む機能はなく、通常、パッチ機
能は、機械語レベルのオブジェクトプログラムに対して
設けられていて、これを直接修正する機能として用いら
れている。
[Prior Art] Conventionally, when a program is created using a high-level language such as a program conforming to Palkar or a program conforming to the C language, the patch is performed in a high-level language, and there is no function of bringing in an object program from the high-level language. The patch function is provided for an object program at a machine language level, and is used as a function for directly modifying the object program.

[解決しようとする課題] しかし、機械語レベルのオブジェクトプログラムをパ
ッチ機能で修正するとなると、機械語の命令構造を理解
しなければならず、一般のプログラム作成者にとっては
扱い難い。
[Problem to be Solved] However, if an object program at the machine language level is modified by the patch function, it is necessary to understand the instruction structure of the machine language, which is difficult for a general program creator.

一般的には、パスカルやC言語準拠のプログラムのよ
うな高級言語を使用してプログラムを作成した場合にス
クリーンエディタ機能を利用してステートメントの修正
は可能である。しかし、スクリーンエディタの修正は、
ソースプログラムの1行に複数のステートメントがある
場合には、その行番号対応となり、1つのステートメン
トが複数の行に亙る場合には、そのステートメント対応
となる。そして、複数の行に1つのステートメントが亙
り、かつ、その行に複数のステートメントがある場合に
はそのようなステートメント全体になる。
Generally, when a program is created using a high-level language such as a program conforming to Pascal or C language, the statement can be corrected using a screen editor function. However, the screen editor fixes
If there are a plurality of statements in one line of the source program, it corresponds to the line number, and if one statement extends over a plurality of lines, it corresponds to the statement. Then, when one statement extends over a plurality of lines and there are a plurality of statements on the line, the statement becomes the whole.

このような関係からステートメント修正によるスクリ
ーンエディタの実際の内部修正処理は、多くのステート
メントについて行わなければならず、場合によっては、
ある単位のファイル全体に及ぶこともある。しかも、プ
ログラム開発は、設計→制作(編集)→デバック→制作
(編集)→デバックとデバック→制作(編集)の繰り返
しであるので、高級言語ではソースプログラムの修正と
翻訳とを繰り返さなければならず、スクリーンエディタ
機能を利用してもデバックに手間がかかる。
Due to such a relationship, the actual internal correction processing of the screen editor by the statement correction must be performed for many statements, and in some cases,
It can span an entire file in a unit. In addition, since program development involves design → production (edit) → debug → production (edit) → debug and debug → production (edit), the modification and translation of the source program must be repeated in high-level languages. However, even if the screen editor function is used, it takes time to debug.

この発明は、このような従来技術の問題点を解決する
ものであって、パスカル準拠のプログラム等の高級言語
のソースプログラムレベルでのパッチが容易にできるよ
うなデバック方式を提供することを目的とする。
An object of the present invention is to solve such a problem of the prior art, and an object of the present invention is to provide a debugging system which can easily patch a high-level language such as a Pascal-compliant program at a source program level. I do.

[課題を解決するための手段] このような目的を達成するこの発明のデバック方式の
特徴は、スクリーンエディタ部と、パッチ修正部と、ソ
ースプログラムからオブジェクトプログラムを生成する
言語翻訳処理部とを備えていて、スクリーンエディタ部
又は言語翻訳処理部がソースプログラムの各行に対応し
て行属性情報を付加したスクリーンエディト対象となる
ステートメントのリストファイルをソースプログラムか
ら生成し、言語翻訳処理部がこのリストファイルからオ
ブジェクトプログラムのファイルを生成する。また、行
属性情報には実行文の先頭か、継続文か等のその行の先
頭ステートメントについての行属性を識別する識別情報
とソースプログラムの行番号情報とその行のステートメ
ントの修正を管理するためのパッチ枝番号情報とが設け
られる。そして、スクリーンエディタ部が行番号情報の
番号を上位としパッチ番号情報を下位とした行番号表示
部とリストファイルのステートメントを表示するステー
トメント表示部とをディスプレイの画面を分割して行番
号情報とそれに対応するステートメントを対応させて表
示し、行属性情報に従って表示画面上で指定された修正
対象のステートメントを検索し、この修正対象のステー
トメントについて表示画面の入力に応じた修正を行う。
さらに、パッチ修正部がスクリーンエディタ部により修
正されたステートメントをリストファイルの後ろの空き
の行に追加してその行の行属性情報を修正前の行属性情
報に対応させてかつその枝番をパッチ枝番号情報に加え
た行属性情報を発生させて記憶し、修正されたステート
メントとそのパッチ枝番号とを行番号表示部とステート
メント表示部のその番号の順位の位置に表示させかつ行
番号表示部に表示された行番号に対応してその行番号に
さらにパッチ枝番号情報が入力されたときにはその枝番
号の行番号をその順位に応じた位置に挿入させて画面上
に表示し、それに対応する前記行属性情報とパッチ枝番
号とをを持つ行をリストファイル上に確保して挿入され
た行に修正ステートメントを挿入できるようにする。ま
た、言語翻訳処理部が行属性情報についてはパッチ枝番
号情報とに応じて同じ行番号の行属性情報についてはパ
ッチ枝番号順に順次言語翻訳して修正されたステートメ
ントに応じて修正されたオブジェクトプログラムのファ
イルを生成するものである。
[Means for Solving the Problems] A feature of the debugging system of the present invention that achieves the above object includes a screen editor unit, a patch correction unit, and a language translation processing unit that generates an object program from a source program. The screen editor unit or the language translation processing unit generates from the source program a list file of statements to be screen edited to which line attribute information is added corresponding to each line of the source program, and the language translation processing unit Generate an object program file from. In addition, the line attribute information includes identification information for identifying the line attribute of the first statement of the line, such as the beginning of an executable statement or a continuation statement, line number information of the source program, and modification of the statement on the line. And patch branch number information. The screen editor divides the screen of the display into a line number display unit that sets the line number information number higher and the patch number information lower, and a statement display unit that displays the statement of the list file. Corresponding statements are displayed in correspondence with each other, a specified statement to be corrected is searched on the display screen in accordance with the line attribute information, and the statement to be corrected is corrected according to the input on the display screen.
Further, the patch correction unit adds the statement corrected by the screen editor unit to an empty line after the list file, associates the line attribute information of the line with the line attribute information before correction, and patches the branch number. Generates and stores line attribute information in addition to the branch number information, and displays the corrected statement and its patch branch number in the line number display section and the statement display section at the position of that number, and the line number display section When the patch branch number information is further input to the line number corresponding to the line number displayed in, the line number of the branch number is inserted at a position corresponding to the order and displayed on the screen, and the corresponding line number is displayed. A line having the line attribute information and the patch branch number is secured in a list file so that a correction statement can be inserted into the inserted line. In addition, the language translation processing unit corrects the line attribute information in accordance with the patch branch number information and the line attribute information of the same line number in the order of the patch branch number and sequentially corrects the language according to the corrected statement. Is generated.

[作用] このように、ソースプログラムから生成したスクリー
ンエディト対象となるリストファイルのプログラムの各
行に対応してリスト先頭部に行属性情報を配置したリス
トを生成し、各行属性情報にパッチ枝番号情報を記憶で
きるようにすることで、言語翻訳の際に同じ行番号につ
いてはパッチ枝番順にコンパイルすることがきるので、
ステートメント対応に修正分をパッチ枝番号を採ってリ
ストファイルに記憶することによりソースプログラムに
おけるパッチをステートメント対応にすることができ
る。
[Operation] As described above, a list is generated in which line attribute information is arranged at the head of the list corresponding to each line of the program of the list file to be screen-edited generated from the source program, and patch branch number information is included in each line attribute information. Can be stored so that the same line numbers can be compiled in the order of patch branch numbers during language translation.
The patch in the source program can be made to correspond to the statement by storing the correction portion corresponding to the statement in the list file by taking the patch branch number.

さらに、表示画面上において通常の行番号のほか、行
番号に加えてパッチ枝番号を識別表示するように、その
パッチ枝番号が行番号に対応して入力されたときに、そ
のパッチ枝番号に対応するステートメントの行をパッチ
枝番号情報欄の情報を利用して画面上及びリストファイ
ル上に確保するこができる。
Furthermore, when the patch branch number is input in correspondence with the line number, the patch branch number is displayed so that the patch branch number is displayed in addition to the normal line number on the display screen in addition to the line number. The line of the corresponding statement can be secured on the screen and in the list file using the information in the patch branch number information column.

[実施例] 以下、この発明の一実施例について図面を参照して詳
細に説明する。
Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.

第1図(a)は、この発明のデバック方式を適用した
デバックシステムのリストファイルの情報形態の説明図
であり、第1図(b)は、その各行の先頭に配置される
行属性情報のフォーマットの説明図、第1図(c)は、
そのソースプログラムのディスプレイ表示状態の説明
図、第2図は、そのデバックシステムの全体的な説明
図、第3図は、そのディスプレイのステートメントの表
示状態とリストファイルの行属性情報との関係の説明図
である。
FIG. 1A is an explanatory diagram of an information form of a list file of a debugging system to which the debugging method of the present invention is applied, and FIG. 1B is a diagram of line attribute information arranged at the head of each line. FIG. 1 (c) is an explanatory diagram of the format.
FIG. 2 is an explanatory diagram of the display display state of the source program, FIG. 2 is an overall explanatory view of the debug system, and FIG. 3 is a description of a relation between a display state of a statement on the display and line attribute information of a list file. FIG.

第2図において、1は、ソースプログラムファイル
(以下ソースファイル)であり、キーボードからの行指
定に応じてコンピュータ2の内部に設けられた言語翻訳
処理部3(又はスクリーンエディタ部8)により抽出さ
れた所定の行分のソースプログラムのステートメントに
ついて行属性情報10(第1図(b)参照)を各行に有す
るリストファイル4が生成され、それが例えばコンピュ
ータ2の内部メモリにロードされる。この内容に応じて
ディスプレイ7に転送されて各ステートメント6がソー
スプログラムの行番号対応にディスプレイ7の画面上7a
に第3図に示すような形態で順次表示される。
In FIG. 2, reference numeral 1 denotes a source program file (hereinafter, a source file) which is extracted by a language translation processing unit 3 (or a screen editor unit 8) provided inside the computer 2 in accordance with a line designation from a keyboard. A list file 4 having line attribute information 10 (see FIG. 1 (b)) on each line for the statements of the source program for the predetermined lines is generated and loaded into, for example, the internal memory of the computer 2. According to the contents, the statements are transferred to the display 7 and each statement 6 is displayed on the screen of the display 7 in correspondence with the line number of the source program.
Are sequentially displayed in the form shown in FIG.

コンピュータ2には、言語翻訳処理部3のほかにスク
リーンエディタ部8とパッチ修正部9とが設けられてい
て、このうちカーソル7b(第3図参照)が位置するステ
ートメントについてそれが訂正された場合にスクリーン
エディタ部8とパッチ修正部9に従ってその修正内容を
リストファイル4に記憶する。そして、この修正された
内容に応じてオブジェクトプログラムファイル(以下オ
ブジェクトファイル)5が生成される。なお、このとき
同時にソースファイル1も修正に応じて更新される。
The computer 2 is provided with a screen editor section 8 and a patch correction section 9 in addition to the language translation processing section 3, and when a statement in which the cursor 7b (see FIG. 3) is located is corrected. Then, the contents of the correction are stored in the list file 4 according to the screen editor unit 8 and the patch correction unit 9. Then, an object program file (hereinafter referred to as an object file) 5 is generated according to the corrected contents. At this time, the source file 1 is also updated according to the modification.

この場合、編集対象として表示されるリストファイル
4は、カーソル7bのスクロール処理あるいは表示領域指
定処理に応じてソースファイル1からそのプログラムに
おける対象の行番号のものが順次抽出されてリストファ
イル4が生成されていく。また、修正の必要のない行番
号のステートメントについては、リストファイル4によ
ることなく、キーボード(図示せず)等からの指示によ
り、言語翻訳処理部3によって直接ソースファイル1か
らオブジェクトファイル5が生成されていく。
In this case, the list file 4 to be displayed as an object to be edited is sequentially extracted from the source file 1 in accordance with the scroll processing of the cursor 7b or the display area designating processing, from the source file 1 to generate the list file 4. Will be done. Regarding the statement of the line number that does not need to be modified, the object file 5 is directly generated from the source file 1 by the language translation processing unit 3 according to an instruction from a keyboard (not shown) or the like without using the list file 4. To go.

ここで、リストファイル4は、第1図(a)に示され
るようい、ソースファイル1のプログラムの各行をそれ
ぞれ1行に対応させてそのステートメントを記憶し、そ
の各行に対応して各行の先頭に10文字分の行属性情報10
が設けられている。これは、同図(b)に示されるよう
なフォーマットとなっている。
Here, as shown in FIG. 1 (a), the list file 4 stores the statement by associating each line of the program of the source file 1 with one line, and stores the statement corresponding to the line. 10 line attribute information for 10 characters
Is provided. This has a format as shown in FIG.

スクリーンエディタ部8は、行属性情報10を参照して
これに従って実行文の先頭と各ステートメントの終わり
の位置を抽出し、修正対象ステートメントを抽出する。
そして、画面入力に応じた修正ステートメントを生成す
る。
The screen editor unit 8 refers to the line attribute information 10 and extracts the positions of the head of the executable statement and the end of each statement according to the line attribute information 10, and extracts the statement to be modified.
Then, a correction statement according to the screen input is generated.

パッチ修正部9は、修正された後のステートメントに
ついてそれをリストファイル4の後ろの空き行の部分に
記憶する。そして、この記憶するアドレスの行の行属性
情報10のパッチ枝番情報15(第1図(b)参照)にパッ
チ枝番号を書込み、それ以外は前と同じ行属性情報を生
成する。さらに、修正前のステートメントがあった元の
行のステートメントの位置には、言語翻訳処理部3に対
して修正ステートメントの記憶位置にジャンプすること
ができる情報を書込む。これによりソースプログラムの
ステートメントを機械語コードに変換する場合に修正さ
れたステートメントが記憶されたアドレスに移ることが
できる。そして、修正されたステートメントが記憶され
ている行の最後の情報の後ろには、言語翻訳処理部3が
ジャンプ元へとリターンして次のステートメントのコン
パイルができるような情報が記憶される。
The patch correction unit 9 stores the corrected statement in a free line portion after the list file 4. Then, the patch branch number is written in the patch branch number information 15 (see FIG. 1B) of the line attribute information 10 of the row of the stored address, and otherwise the same line attribute information as before is generated. Further, information that allows the language translation processing unit 3 to jump to the storage position of the corrected statement is written in the statement position of the original line where the statement before the correction was located. Thereby, when the statement of the source program is converted into the machine language code, it is possible to move to the address where the corrected statement is stored. After the last information on the line where the corrected statement is stored, information is stored so that the language translation processing unit 3 returns to the jump source and compiles the next statement.

このようにしてパッチのときには、その行にある行属
性情報10のパッチ枝番情報15に枝番号を記憶する行属性
情報10を発生させ、それ以外の行属性情報10の情報はジ
ャンプ前の行番号のものと同じものとしてその行に修正
されたステートメントを記憶し、修正されたステートメ
ントをリストファイル4に追加していく。
In this way, in the case of a patch, the line attribute information 10 for storing the branch number is generated in the patch branch number information 15 of the line attribute information 10 in the line, and the other information of the line attribute information 10 is the line before the jump. The corrected statement is stored in the line as the same as the numbered statement, and the corrected statement is added to the list file 4.

なお、言語翻訳部3にジャンプやリターンの特別な処
理命令の制御機能が付加できない場合には、単に、リス
トファイル4について行番号順及び同じ行番号の場合に
はパッチ枝番号順にソートをかけてから翻訳すればよ
い。さらに、ソートをかけない場合には、修正された元
の行属性情報10のパッチ枝番号情報15の位置に枝番号が
ある旨のコードを挿入してリストファイル4の後部に設
けられた修正ステートメント領域を検索するようにして
もよい。ただし、以上の処理場合に、1行に複数のステ
ートメントがあれば、パッチされたステートメントの後
のステートメントは、修正されたステートメントが記憶
された行に移されて記憶される。したがって、この修正
されたステートメントより後のステートメントが修正対
象となり修正されたときには枝番号はさらに更新されて
修正され、次に更新されたパッチ枝番号を持つ行属性情
報10が生成されてそれとともに修正ステートメントがリ
ストファイル4に追加記憶されていく。
If the language translation unit 3 cannot be provided with a control function for a special processing instruction such as a jump or return, the list file 4 is simply sorted in the order of line numbers or, if the line numbers are the same, in the order of patch branch numbers. You can translate from Further, when sorting is not performed, a code indicating that a branch number is present at the position of the patch branch number information 15 of the corrected original line attribute information 10 is inserted, and a correction statement provided at the back of the list file 4 is provided. The area may be searched. However, in the above processing, if there are a plurality of statements in one line, the statement after the patched statement is moved to the line where the corrected statement is stored and stored. Therefore, when a statement after the corrected statement is to be corrected and is corrected, the branch number is further updated and corrected, and the line attribute information 10 having the next updated patch branch number is generated and corrected together therewith. Statements are additionally stored in the list file 4.

第1図(b)に示す行属性情報10は、ここでは、10文
字(20バイト)分であって、最初の1バイトが行識別子
11であり、リストファイル4の各行の先頭位置にあっ
て、第3図に示すように、各ステートメント(実行文)
6の先頭であか、続きであるか、コメント文6aであか、
などを示すコードが挿入される。これによりこれ以降10
文字分がその行に表示されたステートメントについての
行属性情報10であることを示す。
The line attribute information 10 shown in FIG. 1B is 10 characters (20 bytes) here, and the first byte is a line identifier.
11, which is at the beginning of each line of the list file 4, and as shown in FIG. 3, each statement (executable statement)
Whether it is the beginning of 6, the continuation, the comment sentence 6a,
Is inserted. As a result, 10
Indicates that the character is the line attribute information 10 for the statement displayed on that line.

この行識別子11は、各行の先頭におけるステートメン
トの解釈の状態に基づいて言語翻訳部3(又はスクリー
ンエディタ部8)が編集対象となるリストファイル4の
先頭から順次ステートメントの作成規約に従って発生さ
せて行属性情報10の先頭に記憶していく。
The line identifier 11 is generated by the language translating unit 3 (or the screen editor unit 8) sequentially from the beginning of the list file 4 to be edited in accordance with the statement creation rules based on the state of statement interpretation at the beginning of each line. It is stored at the beginning of the attribute information 10.

例えば、パスカルでは、ファイルの先頭をまずみて、
それがコメント文か否かを「(*」であるか否かで判定
し、そうでなければ実行文の先頭の識別子のコードを発
生して行識別子として行識別子11に記憶する。以下、
「CR」キー対応のコード毎にその手前に「;」や
「*)」があるか否かを検出し、さらに次の行の先頭が
「(*」であるか否かを検出して、次の行の実行文が継
続しているか否かを各行の先頭について判定していく。
これによりコメント文の先頭か実行文の先頭か、あるい
は継続文かが分かり、それに応じた行識別子11の位置に
記憶していく。
For example, in Pascal, first look at the beginning of the file,
It is determined whether or not it is a comment statement based on whether or not it is "(*". If not, a code of the head identifier of the executable statement is generated and stored in the row identifier 11 as a row identifier.
For each code corresponding to the "CR" key, it detects whether there is ";" or "*)" in front of it, and detects whether the beginning of the next line is "(*" It is determined whether or not the execution statement of the next line is continued at the beginning of each line.
As a result, it is possible to determine whether the head of the comment statement, the head of the executable statement, or the continuation statement, and stores it at the position of the line identifier 11 according to that.

次の欄は、インサートファイル番号情報12であり、イ
ンサート命令の出現順にインサートされたステートメン
トが増加するごとにそのインサートされるステートメン
トの行の行属性情報10においてそのインサートファイル
番号情報12の番号が更新されていく。なお、元の行のイ
ンサート命令には、インサートされるステートメントの
ジャンプ先が記憶される。
The next column is the insert file number information 12, and the number of the insert file number information 12 is updated in the row attribute information 10 of the inserted statement line every time the inserted statement increases in the order of appearance of the insert instruction. Will be done. The jump destination of the inserted statement is stored in the insert instruction of the original line.

その次の欄は、ソースファイル1に実際に付加されて
いるプログラムについての行番号13であり、4バイトの
情報として設けられていて言語翻訳処理部3によりデコ
ードされる。次は、マクロ展開情報14であり、マクロ展
開のときには、マクロ展開される各ステートメントに対
してその行の行属性情報10のマクロ展開14にマクロ展開
のための情報が記憶される。また、プログラムの行番号
の1行に複数のステートメントがあるときに、そのステ
ートメントを1つ1つの文として認識するための番号と
して先頭ステートメントのソースプログラム上における
文番号が記憶される。なお、この欄は、2バイト設けら
れていて言語翻訳処理部3によりデコードされる。そし
て、最後の欄には、パッチ枝番情報15が2バイト設けら
れている。
The next column is the line number 13 for the program actually added to the source file 1, provided as 4-byte information, and decoded by the language translation processing unit 3. Next is the macro expansion information 14. At the time of macro expansion, information for macro expansion is stored in the macro expansion 14 of the line attribute information 10 of the line for each statement to be macro expanded. When there are a plurality of statements in one line of the program line number, the statement number of the first statement in the source program is stored as a number for recognizing each statement as one statement. This column is provided with 2 bytes and is decoded by the language translation processing unit 3. In the last column, two bytes of patch branch number information 15 are provided.

パッチ枝番情報15は、この発明において特に追加され
た欄であり、パッチ追加される修正ステートメントに対
して付加する番号情報であって、言語翻訳処理部3の内
部に設けられたパッチ修正部9により修正が加えられる
ごとに各行対応で枝番が更新されて採られ、ここにその
枝番号が記憶される。この枝番に従って言語翻訳処理部
3が順次修正文を抽出して修正されたステートメントに
対して同じ行番号の命令として処理し、機械語コードを
生成してオブジェクトファイル5に加えていく。
The patch branch number information 15 is a column particularly added in the present invention, and is number information to be added to a correction statement to be added with a patch, and is a patch correction unit 9 provided inside the language translation processing unit 3. Each time a correction is made, the branch number is updated and taken for each row, and the branch number is stored here. The language translation processing unit 3 sequentially extracts the corrected sentence according to the branch number, processes the corrected statement as an instruction having the same line number, generates a machine language code, and adds it to the object file 5.

なお、ステートメントの削除やソースプログラムの行
番号の命令文全体の削除については、単に、その部分の
削除処理をするのでリストファイル4上における対応す
る部分を削除するだけで対応でき、コンパイル上におけ
る挿入の場合のパッチのような問題はない。また、以上
のようなフォーマットでは、ソースプログラムにおける
実行文の先頭についての行番号は、行番号13により示さ
れていてパッチの処理とは無関係であるので、パッチに
よるソースプログラムの行番号のずれは生じない。した
がって、ソースプログラム全体に対する影響はない。
The deletion of the statement and the deletion of the entire statement of the line number of the source program can be dealt with simply by deleting the corresponding part in the list file 4, and can be inserted in the compilation. There is no problem like a patch in case. Also, in the above format, the line number at the beginning of the executable statement in the source program is indicated by line number 13 and has nothing to do with the processing of the patch. Does not occur. Therefore, there is no effect on the entire source program.

ところで、スクリーンエディタ部8は、リストファイ
ル4の内容をディスプレイ7の画面上7a上に第1図
(c)に示すように画面分割してウィンドウ処理にて表
示する。
By the way, the screen editor unit 8 divides the contents of the list file 4 on the screen 7a of the display 7 as shown in FIG.

70.71は、ぞれぞれウィンドウ分割ラインであって、
エリア73がソースプログラムのタイトル表示部であり、
エリア74が行番号表示部、そしてエリア75がソースファ
イル1のステートメント表示部である。
70.71 is a window dividing line respectively,
Area 73 is the title display of the source program,
Area 74 is a line number display section, and area 75 is a statement display section of source file 1.

ここで、ソースファイル1のプログラムの各ステート
メントは、その行番号対応で表示されるが、行番号表示
部74における各行番号が小数点で区分けされていて、小
数点以上の5桁がソースプログラムに付与されている行
番号となっている。小数点以下4桁がパッチの枝番号に
従って表示される枝番号桁である。
Here, each statement of the program of the source file 1 is displayed corresponding to its line number, but each line number in the line number display section 74 is divided by a decimal point, and five digits after the decimal point are added to the source program. Line number. Four digits after the decimal point are branch number digits displayed according to the branch number of the patch.

そこで、パッチがなされたステートメントについて
は、その行番号の次にパッチ番号順に従った順位で各行
が採られてその内容が表示される。また、カーソルライ
ン76がある行番号において、例えば、行挿入キーが入力
されてパッチ枝番号が小数点以下の数値として入力され
たときには、その枝番号の行がその行以降に確保され、
その行についてステートメントの挿入が可能になる。こ
のような挿入が行われたときには、パッチされたその行
のステートメントは、前記の修正の場合と同様にリスト
ファイル4の後ろに空き行が採られ、行属性情報10のパ
ッチ枝番号情報15の欄にそれが採られた順序に従って枝
番号が更新された行属性情報10とその行とが確保され、
そこに修正されたステートメントが記憶され、画面上に
もそれが対応表示される。
Thus, for a statement that has been patched, each line is taken in order according to the order of the patch number after the line number, and the contents are displayed. Also, at the line number where the cursor line 76 is located, for example, when the line insertion key is input and the patch branch number is input as a value after the decimal point, the line with that branch number is secured after that line,
The statement can be inserted for that line. When such an insertion is performed, an empty line is taken after the list file 4 in the same manner as in the case of the above-mentioned modification, and the statement of the patched line in the patch branch number information 15 of the line attribute information 10 is obtained. In the column, row attribute information 10 whose branch number is updated according to the order in which it was taken and the row are secured,
The corrected statement is stored therein, and the corresponding statement is displayed on the screen.

次に、パルカル準拠のプログラムという高級言語に記
述されたソースプログラムについて第3図に従ってステ
ートメントのパッチについて説明する。なお、カーソル
7bが第3図に示すステートメント6の位置にあるとす
る。そして、このステートメント6に対してパッチが行
われるとする。
Next, statement patching of a source program described in a high-level language called a program conforming to Palkar will be described with reference to FIG. Note that the cursor
Assume that 7b is at the position of statement 6 shown in FIG. Then, it is assumed that the statement 6 is patched.

スクリーンエディタ部8は、このときカーソル7bの位
置からリストファイル4の各行の行属性情報10を参照す
る。これにより、このときの命令文全体の実行の先頭位
置は、1つ手前の行の先頭位置Aにあることが行識別子
11をデコードすることで分かるので、Aの位置から実行
文の終わりを示す「;」をリストファイル4上で探す。
これにより複数の行に亙るステートメントの終わりのD
の位置が分かる。Dの位置と現在カーソル7bがある位置
とを比較すると、Dまでのステートメントには含まれて
いないことが分かる。その次のBの位置からステートメ
ントの終了位置を「;」により検索する。ここで、Cの
位置が分かる。このCの位置と現在カーソル7bがある位
置とを比較するとこのステートメント6の中にカーソル
7bがあることが分かる。したがって、BからCまでの間
にあるステートメントが修正されることになる。
At this time, the screen editor unit 8 refers to the line attribute information 10 of each line of the list file 4 from the position of the cursor 7b. As a result, the start position of the execution of the entire statement at this time is located at the start position A of the line immediately before the line identifier.
Since "11" can be found by decoding "11", ";" indicating the end of the executable sentence is searched on the list file 4 from the position of "A".
This results in D at the end of a multi-line statement.
The position of is known. Comparing the position of D with the position where the current cursor 7b is located, it can be seen that the statements up to D are not included. From the next position B, the end position of the statement is searched by ";". Here, the position of C is known. Comparing the position of C with the position of the current cursor 7b, the cursor in this statement 6
It turns out that there is 7b. Therefore, the statements between B and C will be modified.

そこで、スクリーンエディタ部8は、このBからCま
でのステートメント6について抽出して、これに対して
入力された修正文を置き換えていく。こうして修正され
たステートメントが出来上がると、次に、パッチ修正部
9により、抽出されたステートメントの位置にジャンプ
情報が書込まれる。そのジャンプ先に修正したステート
メントが書込まれ、その行属性情報10のパッチ番号情報
15の欄に枝番1が採られ、リターン情報が加えられる。
このときの修正ステートメントがリストファイル4の1
行ではなく、次の行にまたがるときには、この行属性情
報10と次の行属性情報10の行識別子が、例えば、実行文
の続きの識別情報とされて後はパッチ枝番も同じで同じ
内容の行属性情報10となる。
Therefore, the screen editor unit 8 extracts the statements 6 from B to C and replaces the correction sentence inputted thereto. When the corrected statement is completed in this way, next, jump information is written by the patch correction unit 9 at the position of the extracted statement. The corrected statement is written to the jump destination, and the patch number information of the line attribute information 10 is written.
Branch number 1 is taken in the 15 column, and return information is added.
The correction statement at this time is 1 in list file 4.
If the next line is not a line but the next line, this line attribute information 10 and the line identifier of the next line attribute information 10 are, for example, the identification information of the continuation of the executable statement. Becomes the row attribute information 10.

以上説明してきたが、この例では、パスカル準拠のプ
ログラムの場合を説明しているが、他の高級言語につい
ても同様であることはもちろんである。
As described above, in this example, the case of a program conforming to Pascal is described, but it goes without saying that the same applies to other high-level languages.

[発明の効果] 以上の説明から理解できるように、この発明にあって
は、ソースプログラムから生成したスクリーンエディト
対象となるリストファイルのプログラムの各行に対応し
てリスト先頭部に行属性情報を配置したリストを生成
し、各行属性情報にパッチ枝番号情報を記憶できるよう
にすることで、言語翻訳の際に同じ行番号についてはパ
ッチ枝番順にコンパイルすることができるので、ステー
トメント対応に修正分をパッチ枝番号を採ってリストフ
ァイルに記憶することによりソースプログラムにおける
パッチをステートメント対応にすることができる。
[Effects of the Invention] As can be understood from the above description, according to the present invention, line attribute information is arranged at the head of the list corresponding to each line of the program of the list file to be screen-edited generated from the source program. Generated lists and store the patch branch number information in each line attribute information allows the same line numbers to be compiled in the order of patch branch numbers during language translation. By taking the patch branch numbers and storing them in the list file, the patches in the source program can be made to correspond to the statements.

さらに、表示画面上において通常の行番号のほか、行
番号に加えてパッチ枝番号を識別表示するように、その
パッチ枝番号が行番号に対応して入力されたときに、そ
のパッチ枝番号に対応するステートメントの行をパッチ
枝番号情報欄の情報を利用して画面上及びリストファイ
ル上に確保することができる。
Furthermore, when the patch branch number is input in correspondence with the line number, the patch branch number is displayed so that the patch branch number is displayed in addition to the normal line number on the display screen in addition to the line number. The line of the corresponding statement can be secured on the screen and in the list file using the information in the patch branch number information column.

その結果、複数行に亙るステートメントについては、
ソースプログラムの実行番地の先頭からステートメント
を修正することをしなくても済み、また、1行に複数の
ステートメントがある場合にもステートメント対応で修
正処理ができる。行と行との間のステートメントの挿入
もパッチ枝番号を採ることにより容易である。したがっ
て、修正の内部処理が速くなり、プログラム作成者への
応答が早くできる。
As a result, for a multi-line statement,
It is not necessary to modify the statement from the beginning of the execution address of the source program, and even when there are a plurality of statements in one line, the modification processing can be performed corresponding to the statement. Inserting statements between lines is also easy by taking patch branch numbers. Therefore, the internal processing of the correction becomes faster, and the response to the program creator can be made faster.

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

第1図(a)は、この発明のデバック方式を適用したデ
バックシステムのリストファイルの情報形態の説明図、
第1図(b)は、その各行の先頭に配置される行属性情
報フォーマットの説明図、第1図(c)は、そのソース
プログラムのディスプレイ表示状態の説明図、第2図
は、そのデバックシステムの全体的な説明図、第3図
は、そのディスプレイのステートメントの表示状態とリ
ストファイルの行属性情報との関係の説明図である。 1……ソースファイル、2……コンピュータ、3……言
語翻訳処理部、4……リストファイル、6……ステート
メント、7……ディスプレイ、7a……画面、7b……カー
ソル、8……スクリーンエディタ部、9……パッチ修正
部、10……行属性情報、11……行識別子、12……オンサ
ートファイル番号情報、13……行番号、14……マクロ展
開情報、15……パッチ枝番情報。
FIG. 1A is an explanatory diagram of the information format of a list file of a debugging system to which the debugging method of the present invention is applied.
FIG. 1 (b) is an explanatory diagram of a line attribute information format arranged at the head of each line, FIG. 1 (c) is an explanatory diagram of a display display state of the source program, and FIG. FIG. 3 is an overall explanatory diagram of the system, and FIG. 3 is an explanatory diagram of the relationship between the display state of the statement on the display and the line attribute information of the list file. 1 ... source file, 2 ... computer, 3 ... language translation processing unit, 4 ... list file, 6 ... statement, 7 ... display, 7a ... screen, 7b ... cursor, 8 ... screen editor , 9: Patch correction unit, 10: Line attribute information, 11: Line identifier, 12: On-sert file number information, 13: Line number, 14: Macro expansion information, 15: Patch branch number information.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】スクリーンエディタ部と、パッチ修正部
と、ソースプログラムからオブジェクトプログラムを生
成する言語翻訳処理部とを備え、前記スクリーンエディ
タ部又は前記言語翻訳処理部は前記ソースプログラムの
各行に対応して行属性情報を付加したスクリーンエディ
ト対象となるステートメントのリストファイルをソース
プログラムから生成し、前記言語翻訳処理部はこのリス
トファイルからオブジェクトプログラムのファイルを生
成するものであり、前記行属性情報には実行文の先頭
か、継続文か等のその行の先頭ステートメントについて
の行属性を識別する識別情報と前記ソースプログラムの
行番号情報とその行のステートメントの修正を管理する
ためのパッチ枝番号情報とが設けられ、前記スクリーン
エディタ部が前記行番号情報の番号を上位とし前記パッ
チ番号情報を下位とした行番号表示部と前記リストファ
イルのステートメントを表示するステートメント表示部
とをディスプレイの画面を分割して前記行番号情報とそ
れに対応するステートメントとを対応させて表示し、前
記行属性情報に従って表示画面上で指定された修正対象
のステートメントを検索し、この修正対象のステートメ
ントについて前記表示画面の入力に応じた修正を行い、
パッチ修正部は前記スクリーンエディタ部により修正さ
れたステートメントを前記リストファイルの後ろの空き
の行に追加してその行の前記行属性情報を修正前の前記
行属性情報に対応させてかつその枝番を前記パッチ枝番
号情報に加えた行属性情報を発生させて記憶し、前記修
正されたステートメントとそのパッチ枝番号とを前記行
番号表示部と前記ステートメント表示部のその番号の順
位の位置に表示させかつ前記行番号表示部に表示された
行番号に対応してその行番号にさらにパッチ枝番号情報
が入力されたときにはその枝番号の行番号をその順位に
応じた位置に挿入させて画面上に表示し、それに対応す
る前記行属性情報と前記パッチ枝番号とを持つ行を前記
リストファイル上に確保して前記挿入された行に修正ス
テートメントを挿入できるようにし、前記言語翻訳処理
部は、前記行属性情報と前記パッチ枝番号情報とに応じ
て同じ行番号の前記行属性情報についてはパッチ枝番号
順に順次言語翻訳して前記修正されたステートメントに
応じて修正された前記オブジェクトプログラムのファイ
ルを生成することを特徴とするデバック方式。
A screen editor section, a patch correction section, and a language translation processing section for generating an object program from a source program, wherein the screen editor section or the language translation processing section corresponds to each line of the source program. The language translation processing unit generates a file of an object program from the list file by generating a list file of statements to be screen edited with line attribute information added thereto. Identification information for identifying a line attribute of a head statement of the line such as a head of an executable statement or a continuation statement, line number information of the source program, and patch branch number information for managing correction of the statement of the line; Is provided, and the screen editor section has the line number A line number display unit with the information number as the upper and the patch number information as the lower, and a statement display unit for displaying the statement of the list file are divided into screens of a display, and the line number information and the corresponding statement are divided. Correspondingly displayed, search for the statement to be modified specified on the display screen according to the line attribute information, perform the modification according to the input of the display screen for the statement to be modified,
The patch correction unit adds the statement corrected by the screen editor unit to an empty line after the list file so that the line attribute information of the line corresponds to the line attribute information before correction and a branch number thereof. Generates and stores line attribute information in addition to the patch branch number information, and displays the corrected statement and its patch branch number in the line number display section and the statement display section at the position of the order of the number. And when the patch branch number information is further input to the line number corresponding to the line number displayed in the line number display section, the line number of the branch number is inserted at a position corresponding to the order, and displayed on the screen. And a line having the line attribute information and the patch branch number corresponding to the line is secured on the list file, and a correction statement is inserted into the inserted line. The language translation processing unit may translate the line attribute information of the same line number sequentially in the order of the patch branch number in accordance with the line attribute information and the patch branch number information to obtain the corrected statement. A debugging method characterized by generating a file of the object program modified accordingly.
JP2300301A 1990-11-06 1990-11-06 Debug method Expired - Lifetime JP2607976B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2300301A JP2607976B2 (en) 1990-11-06 1990-11-06 Debug method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2300301A JP2607976B2 (en) 1990-11-06 1990-11-06 Debug method

Publications (2)

Publication Number Publication Date
JPH04171544A JPH04171544A (en) 1992-06-18
JP2607976B2 true JP2607976B2 (en) 1997-05-07

Family

ID=17883137

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2300301A Expired - Lifetime JP2607976B2 (en) 1990-11-06 1990-11-06 Debug method

Country Status (1)

Country Link
JP (1) JP2607976B2 (en)

Also Published As

Publication number Publication date
JPH04171544A (en) 1992-06-18

Similar Documents

Publication Publication Date Title
JP4448881B2 (en) Method and system for generating a computer program
JP5147240B2 (en) Method and system for reversible design tree transformation
US5805893A (en) Assembly language program converter
EP1085411B1 (en) A relocation format for linking
Rosen A compiler-building system developed by Brooker and Morris: including a comprehensive discussion of the major features of the system
US5261103A (en) Method of and system for compiling source program
JP2607976B2 (en) Debug method
JP2607975B2 (en) Debug method
JPH08221417A (en) New/old comparing editing device for structured document
JPH05173844A (en) Coding error correcting system
JP2000207246A (en) Debugging support device, method therefor and recording medium recorded with softwater for supporting debugging
JP2701781B2 (en) Document editing device
JPH0128974B2 (en)
JP2763289B2 (en) Detailed description positioning method in logic diagram creation processing device
JP2864955B2 (en) Patch processing method for compiled code objects
JPH0358225A (en) File editing system
JPH03292532A (en) Back-up device for development of program
JP2000132405A (en) In-line expansion processing device and method
JPH04101229A (en) Compile error display controlling system
Finlayson A Syntax-Based Program Editor Reference Manual
JP2003050706A (en) Method and device for supporting program development
JPH11296406A (en) Program correction supporting system
JPH038070A (en) Keyword extracting system
JPH03186933A (en) Symbol processing system for language processing system
JPH01118925A (en) Program input guiding method