JPH05265742A - Program patch system - Google Patents

Program patch system

Info

Publication number
JPH05265742A
JPH05265742A JP4062637A JP6263792A JPH05265742A JP H05265742 A JPH05265742 A JP H05265742A JP 4062637 A JP4062637 A JP 4062637A JP 6263792 A JP6263792 A JP 6263792A JP H05265742 A JPH05265742 A JP H05265742A
Authority
JP
Japan
Prior art keywords
program
patch
correction
modification
object program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP4062637A
Other languages
Japanese (ja)
Inventor
Tetsuhiko Kitamura
哲彦 北村
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 JP4062637A priority Critical patent/JPH05265742A/en
Publication of JPH05265742A publication Critical patent/JPH05265742A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To provide a program patch system which can be easily corrected and in which an original program and the correction history can be grasped. CONSTITUTION:In a patch system where a 1st object program 31 compiled from a source program 1 is emergently corrected, the correction information including the correction data on the program 1 and the information designating a patch area where the correction result is stored are described into the program 1. Then, the correction result is stored in a corrected area of the program 31 and also a designated patch area as necessary based on the correction information so that the corrected area of the program 1 has the same size as the program 31. A compiler 2 is provided with a correction means 5 which produces a 2nd object program 32. Then, both programs 31 and 32 are compared with each other and a discordant part is applied to the program 31 as the patch data.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は,プログラムパッチ(応
急修正)方式,特に,目的プログラム(オブジェクトプ
ログラム)に対する原始プログラム(ソースコード)レ
ベルでのパッチに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program patch (emergency correction) system, and more particularly to a patch at a source program (source code) level for a target program (object program).

【0002】コンピュータシステムを動作させるための
プログラムには,バグがつきものであり,近年,プログ
ラム規模の増大に伴って,そのバグも増大している。こ
のため,プログラムを応急的に修正するための手段であ
るパッチは,必要不可欠なものとなっている。従って,
修正が容易であると共に,元のプログラム及び適用され
た修正が把握できるプログラムパッチ方式が望まれてい
る。
A program for operating a computer system is accompanied by a bug, and in recent years, the bug has also increased with the increase in the program scale. For this reason, patches, which are means for urgently modifying programs, are indispensable. Therefore,
There is a demand for a program patch method that is easy to modify and that can grasp the original program and the applied modifications.

【0003】[0003]

【従来の技術】従来のパッチデータ作成は,次のような
方法で行っていた。 (1) ソースプログラムリスト上で修正箇所をソースコー
ドで記述する。 (2) 機械語コードが記述されたアセンブルリストと,
(1) で記述した修正ソースコードから修正箇所を探し出
し,修正するプログラムの論理を機械語コードに置き換
えてパッチデータを作成する。
2. Description of the Related Art Conventional patch data is created by the following method. (1) Describe the modification points in the source code on the source program list. (2) Assemble list in which the machine language code is described,
Find the modified part from the modified source code described in (1) and replace the logic of the program to be modified with the machine language code to create patch data.

【0004】[0004]

【発明が解決しようとする課題】上記のパッチ実施方法
では,次のような問題点がある。 (1) 近年のソフトウェアは,その殆どが高級言語で記述
・作成したものであり,プログラム作成者は機械語を理
解していない者が多く機械語コードでのパッチデータ作
成は,非常に難しい。 (2) 機械語を理解したとしても,アドレスの計算が多
く,かつ複雑であるため,計算ミスを起こし易い。
The above-described patch execution method has the following problems. (1) Most of recent software is written and created in a high-level language, and many program creators do not understand the machine language, and it is very difficult to create the patch data in the machine language code. (2) Even if the machine language is understood, calculation of addresses is complicated and complicated, and calculation errors are likely to occur.

【0005】従って,本発明は,修正が容易であると共
に,元のプログラム及び適用された修正が把握できるプ
ログラムパッチ方式を提供することを目的とする。
Therefore, it is an object of the present invention to provide a program patch system which is easy to modify and which can grasp the original program and the applied modification.

【0006】[0006]

【課題を解決するための手段】図1は,本発明の原理ブ
ロック図である。図中,1は,原始プログラム,2は,
コンパイラ,31は,原始プログラム1をコンパイラ2に
よってコンパイルして得られた第1の目的プログラム,
4は,原始プログラム1に記述され,その修正箇所及び
修正内容を示す修正データと,修正した結果を格納する
パッチ領域を指定する情報とを含む原始プログラム1レ
ベルで書かれた修正情報,5は,修正情報に基づいて原
始プログラム1の修正箇所を第1の目的プログラム31の
ロードモジュールとサイズが同じとなるよう,修正結果
を第1の目的プログラム31の被修正箇所に対応して新た
な修正データに置き換え,また,必要に応じて,指定さ
れたパッチ領域へ格納して第2の目的プログラム32を作
成する,コンパイラに備えられた修正手段,6は,〔特
開平 01-201727号(平成1年8月14日)『ソフトウェア
パッチ方式』として出願済〕の機能を有し,第1の目的
プログラム31と第2の目的プログラム32とを比較し,不
一致部分をパッチデータとして第1の目的プログラム31
に適用するパッチデータを作成するパッチ作成手段であ
る。
FIG. 1 is a block diagram showing the principle of the present invention. In the figure, 1 is the source program, 2 is the
The compiler, 31 is a first target program obtained by compiling the source program 1 by the compiler 2,
4 is modification information written in the source program 1 and including modification data indicating the modification location and modification content and information designating a patch area for storing the modification result, and 5 is , Based on the modification information, the modification result of the source program 1 is newly modified corresponding to the modified part of the first target program 31 so that the size is the same as the load module of the first target program 31. The modifying means 6 provided in the compiler, which replaces the data and, if necessary, stores it in a designated patch area to create the second object program 32, is disclosed in [JP-A-01-201727 (August 14, 1st year) "Applied as a software patch method"], the first object program 31 and the second object program 32 are compared, and the inconsistent portion is regarded as patch data. And then the first objective program 31
Is a patch creating means for creating patch data to be applied to.

【0007】[0007]

【作用】原始プログラム1をコンパイラ2によってコン
パイルして得られた第1の目的プログラム31を応急修正
するプログラムパッチ方式において,修正情報4は原始
プログラム1に記述され,その修正箇所及び修正内容を
示す修正データと,修正した結果を格納するパッチ領域
を指定する情報とを含む修正情報が原始プログラム1レ
ベルで書かれ,修正手段5は修正情報に基づいて原始プ
ログラム1の修正箇所を第1の目的プログラム31のロー
ドモジュールと同じサイズとなるよう,修正結果を第1
の目的プログラム31の被修正箇所に対応して新たな修正
データに置き換え,また,必要に応じて,指定されたパ
ッチ領域へ格納して第2の目的プログラム32を作成し,
パッチ手段6は第1の目的プログラム31と第2の目的プ
ログラム32とを比較し,不一致部分をパッチデータとし
て第1の目的プログラム31に適用するので,目的プログ
ラムに対する原始プログラムレベルでのパッチが可能と
なる。
In the program patch method for urgently correcting the first object program 31 obtained by compiling the source program 1 by the compiler 2, the correction information 4 is described in the source program 1 and indicates the correction location and the content of the correction. The correction information including the correction data and the information designating the patch area for storing the correction result is written at the source program 1 level, and the correction means 5 sets the correction location of the source program 1 based on the correction information as the first purpose. Make the first correction result so that it has the same size as the load module of program 31.
The target program 31 is replaced with new correction data corresponding to the part to be corrected, and if necessary, stored in a designated patch area to create a second target program 32,
Since the patch means 6 compares the first object program 31 and the second object program 32 and applies the unmatched portion to the first object program 31 as patch data, it is possible to patch the object program at the source program level. Becomes

【0008】[0008]

【実施例】図2は,本発明の実施例を示すブロック図で
ある。ソースプログラム1aは,高級言語(例えば,C言
語)で書かれたオリジナルの原始プログラム(以下,ソ
ースプログラムという)であり,ソースプログラム1b
は,ソースプログラム1aに後述する修正情報4aを付加し
てコーディングされたプログラムである。コンパイラ25
は,ソースプログラムを機械語の目的プログラム(以
下,オブジェクトプログラムという)に翻訳するコンパ
イル部2aと,本発明の一構成要素であって,修正情報4a
に基づいて修正した結果に対して後述する手順の第(3)
項で説明する処理を行う修正部5aとから構成される。コ
ンパイラ25はソースプログラム1a及び1bを,それぞれ,
オブジェクトプログラム31a 及び32aに翻訳する。
FIG. 2 is a block diagram showing an embodiment of the present invention. The source program 1a is an original source program (hereinafter referred to as source program) written in a high-level language (for example, C language), and the source program 1b
Is a program coded by adding modification information 4a described later to the source program 1a. Compiler 25
Is a compiling unit 2a for translating a source program into a machine language target program (hereinafter referred to as an object program), and one component of the present invention, the modification information 4a.
(3) of the procedure described later for the result corrected based on
The correction unit 5a performs the processing described in the section. The compiler 25 executes the source programs 1a and 1b,
Translate into object programs 31a and 32a.

【0009】パッチ部6aは,本出願人が〔特開平 01-20
1727号(平成1年8月14日)『ソフトウェアパッチ方
式』として出願済〕の機能を有し,オブジェクトプログ
ラム31a 及び32a とを比較し,不一致部分をパッチデー
タとして作成し,これをオブジェクトプログラム31a に
適用することによって,計算機で実行可能な形式に編集
してロードモジュールとして出力する。
The patch section 6a is described in Japanese Patent Application Laid-Open No. 01-20
No. 1727 (August 14, 1991) "Applied as a software patch method"], it compares the object programs 31a and 32a, creates inconsistencies as patch data, and creates this as the object program 31a. By applying to, it is edited into a format that can be executed by a computer and output as a load module.

【0010】上記の手順を以下に詳細に説明すると, (1) ソースプログラム1aをコンパイラ25によって翻訳し
た結果のオブジェクトプログラム31a に対するパッチを
ソースレベルで修正するために,図3─9に示すよう
に,ソースプログラム1a上に修正情報4a(即ち,パッチ
修正対象箇所マーク“¥”,削除対象箇所マーク“D
¥”,変更ソースデータマーク“n¥”及びパッチ領域
定義マーク“P¥”)を付加してコーディングする。 (2) 上記(1) において,同一プログラムの変更を複数回
行った場合に,以前の修正を踏まえて最新のソースコー
ドが識別できるようにするため,プログラム変更時の変
更版数“n¥”を付加する (nはパッチ変更版数を示す
数字) 。 (3) コンパイラ25は,入力されたソースコードから,未
変更状態(ソースレベルパッチで変更する前のオリジナ
ルソースプログラム1aの状態)で作成されるオブジェク
トプログラム31a のサイズを変えることなく,以下の方
法でソースコードによるパッチを反映したオブジェクト
プログラム32a を作成する。
The above procedure will be described in detail below. (1) As shown in FIGS. 3-9, in order to correct the patch for the object program 31a resulting from the translation of the source program 1a by the compiler 25 at the source level, , The modification information 4a on the source program 1a (that is, patch modification target mark "\", deletion target position mark "D"
\ ", Change source data mark" n \ ", and patch area definition mark" P \ ") are added and coded. (2) In the above (1), when the same program was changed multiple times, In order to be able to identify the latest source code based on the correction of the above, add the modified version number "n \" at the time of program modification (n is a number indicating the patch modified version.) (3) Compiler 25 Reflect the source code patch by the following method without changing the size of the object program 31a created from the input source code in the unmodified state (the state of the original source program 1a before the source level patch was changed). Create the created object program 32a.

【0011】(a) 変更箇所について,変更前のオブジェ
クトプログラム31a (マシンコードレベル)と変更後の
オブジェクトプログラム32a (マシンコードレベル)で
使用バイト数に差が無い場合,変更後のソースコードを
使用してオブジェクトプログラム32a を作成する (図4
参照) 。
(A) If there is no difference in the number of bytes used between the object program 31a (machine code level) before the change and the object program 32a (machine code level) after the change, use the changed source code To create the object program 32a (Fig. 4
See).

【0012】(b) 変更箇所について,変更前のオブジェ
クトプログラム31a の方が変更後のオブジェクトプログ
ラム32a の使用バイト数より大きい場合,変更前の使用
バイト数の領域を変更せずに,変更後のオブジェクトプ
ログラム32a を埋め込む。変更後のオブジェクトプログ
ラム32a の最後が,変更前のオブジェクトプログラム31
a の次ステップとリンクしなければならないときは,変
更後のオブジェクトプログラム32a の最後に,変更前の
オブジェクトプログラム31a の次ステップへのジャンプ
命令を付加する (図6参照) 。
(B) Regarding the changed part, if the object program 31a before the change is larger than the used byte number of the object program 32a after the changed, the area of the used byte number before the change is not changed and Embed the object program 32a. The end of the changed object program 32a is the object program 31 before the change
When it is necessary to link with the next step of a, a jump instruction to the next step of the object program 31a before change is added to the end of the object program 32a after change (see FIG. 6).

【0013】(c) 変更箇所について,変更前のオブジェ
クトプログラム31a の方が変更後のオブジェクトプログ
ラム32a の使用バイト数より小さい場合,変更前のオブ
ジェクトプログラム31a の使用バイト数を越えるデータ
は,パッチ領域の空き領域に展開して,ジャンプ命令で
結合する (図8参照) 。
(C) Regarding the changed part, if the object program 31a before the change is smaller than the used byte number of the object program 32a after the changed, the data exceeding the used byte number of the object program 31a before the change is stored in the patch area. Expand it to the empty area of and combine with a jump instruction (see Figure 8).

【0014】以下,図3〜図9を参照して上記の作用に
ついて具体的に説明する。図3は,オリジナルのソース
プログラムの状態を示す図である。パッチ領域を確保す
るために,static char patch [1000]なるステートメ
ントを予めソースプログラム1aに記述すると共に,ステ
ートメントにパッチ領域定義マーク“P¥”(参照)
を付加しておく。
The above operation will be described in detail below with reference to FIGS. FIG. 3 is a diagram showing the state of the original source program. In order to secure the patch area, the statement static char patch [1000] is described in the source program 1a in advance, and the patch area definition mark "P \" (see) is added to the statement.
Is added.

【0015】図4は,ソースプログラムと変更前及び変
更後のオブジェクトプログラムとの関係図(その1)で
あって,変更箇所について,変更前のオブジェクトプロ
グラム31a のサイズと変更後のオブジェクトプログラム
32a のサイズが等しいケースを示す。
FIG. 4 is a relational diagram (1) between the source program and the object programs before and after the change, in which the size of the object program 31a before the change and the object program after the change are changed.
The case where the sizes of 32a are equal is shown.

【0016】変更前の命令(c=a+b)のバイト数
と変更後の命令(c=a−b)のバイト数が等しい場
合は,コンパイラ25が命令コードの置換のみを行う( A
DD→SUBTRACT)。
When the number of bytes of the instruction before change (c = a + b) and the number of bytes of the instruction after change (c = a-b) are equal, the compiler 25 only replaces the instruction code (A
DD → SUBTRACT).

【0017】図5は,ソースプログラムと変更前及び変
更後のオブジェクトプログラムとの関係図(その2)で
あって,変更後のオブジェクトプログラム32a のサイズ
が変更前のオブジェクトプログラム31a のサイズより小
さいケースを示す。
FIG. 5 is a relational diagram (2) between the source program and the object programs before and after the change, in which the size of the object program 32a after the change is smaller than the size of the object program 31a before the change. Indicates.

【0018】変更前の命令()のバイト数より変更後
の命令()のバイト数が小さい場合は,バイト数が少
なくなった分(即ち,+b分), 無演算命令(NOP) 命令
を詰めるか,次の有効ステップaへジャンプ(JUMP)命令
で分岐する方法で, コンパイラ25がオブジェクトプログ
ラム32a を作成する。
When the number of bytes of the instruction () after the change is smaller than the number of bytes of the instruction () before the change, the non-operation instruction (NOP) instruction is packed by the reduced number of bytes (that is, + b). Alternatively, the compiler 25 creates the object program 32a by a method of branching to the next valid step a with a jump (JUMP) instruction.

【0019】図6は,ソースプログラムと変更前及び変
更後のオブジェクトプログラムとの関係図(その3)で
あって,変更後のオブジェクトプログラム32a のサイズ
が変更前のオブジェクトプログラム31a のサイズよりよ
り大きいケースを示す。
FIG. 6 is a relationship diagram (3) between the source program and the object programs before and after the change, in which the size of the object program 32a after the change is larger than the size of the object program 31a before the change. Show the case.

【0020】変更前の命令()のバイト数より変更後
の命令()のバイト数が大きい場合は,その超過分か
らJUMP p命令〔(JUMP p)命令を変更箇所の領域の最後
に挿入する〕分を減算した分を, で定義したパッチ領
域の未使用領域pへ(JUMP p)命令で展開し,その後に
(JUMP a)命令で, 変更箇所の次のステップaへ分岐す
る方法で, コンパイラ25がオブジェクトプログラム32a
を作成する。
If the number of bytes of the instruction () after the change is larger than the number of bytes of the instruction () before the change, the JUMP p instruction [insert the (JUMP p) instruction at the end of the changed area] By subtracting the minutes, expand the minutes to the unused area p of the patch area defined by using the (JUMP p) instruction, and then use the (JUMP a) instruction to branch to the next step a after the change. 25 is an object program 32a
To create.

【0021】図7は,ソースプログラムと変更前及び変
更後のオブジェクトプログラムとの関係図(その4)で
あって,一つのステイトメントを複数回修正するケース
を示す。
FIG. 7 is a relational diagram (part 4) between the source program and the object programs before and after the change, showing a case where one statement is corrected a plurality of times.

【0022】図6のケースの変更()から更に同一行
の変更()を行う場合,パッチ領域pにある以前のパ
ッチデータは,そのまま残し, 未使用領域qヘ(JUMP
q)命令で, 新たな変更データを展開する方法で, コン
パイラ25がオブジェクトプログラム32a を作成する。
When the same line is further changed () from the case change () shown in FIG. 6, the previous patch data in the patch area p is left as it is and the unused area q (JUMP
q) The compiler 25 creates the object program 32a by the method of expanding the new change data with an instruction.

【0023】図8は,ソースプログラムと変更前及び変
更後のオブジェクトプログラムとの関係図(その5)で
あって,一つのステイトメント()にステイトメント
(2つの)を追加を行うケースを示す。
FIG. 8 is a relationship diagram (No. 5) between the source program and the object programs before and after the change, and shows a case in which the statement (two) is added to one statement (). ..

【0024】図6と同様に,変更前の命令()のバイ
ト数より変更後の命令(及び2つの)のバイト数が
大きい場合は,その超過分から(JUMP p)命令を変更箇
所の領域の最後に挿入する分を減算した分を, で定義
したパッチ領域の未使用領域pへ(JUMP p)命令を使用
して展開し,その後に(JUMP a)命令で, 変更箇所の次
のステップaへ分岐する方法で, コンパイラ25がオブジ
ェクトプログラム32aを作成する。
As in the case of FIG. 6, when the number of bytes of the instruction (and two) after the change is larger than the number of bytes of the instruction () before the change, the (JUMP p) instruction is changed from the excess to the area of the changed portion. The amount obtained by subtracting the amount to be inserted at the end is expanded to the unused area p of the patch area defined in by using the (JUMP p) instruction, and then by the (JUMP a) instruction, the next step a The compiler 25 creates the object program 32a by branching to.

【0025】図9は,ソースプログラムと変更前及び変
更後のオブジェクトプログラムとの関係図(その6)で
あって,一つのステイトメントを削除するケースを示
す。図4と同様,命令()を削除することにより,変
更前の命令バイト数より変更後の命令バイト数が小さく
なるので,バイト数が少なくなった分, NOP 命令を詰め
るか,次の有効ステップaへ( JUMP a )命令で分岐す
る方法で, コンパイラ25がオブジェクトプログラム32a
を作成する。
FIG. 9 is a diagram of the relationship between the source program and the object programs before and after the change (No. 6), showing a case where one statement is deleted. As in Fig. 4, by deleting the instruction (), the number of instruction bytes after the change becomes smaller than the number of instruction bytes before the change. Therefore, the NOP instruction is packed or the next valid step The compiler 25 branches to the object program 32a with the (JUMP a) instruction.
To create.

【0026】図10は,本発明の実施例を示すフローチャ
ートであって,パッチデータ作成及び実施方法を示す。
以上のようにして作成されたオブジェクトプログラム32
a に基づいて, 下記に示すようにパッチ修正後のロード
モジュールは作成され,実行される。
FIG. 10 is a flow chart showing an embodiment of the present invention, showing a patch data creation and implementation method.
Object program 32 created as above
Based on a, the load module after patch modification is created and executed as shown below.

【0027】(イ) 未変更(ソースレベルパッチで変更
する前のオリジナルソースの状態)のソースプログラム
1aに基づいて翻訳されたオリジナルのオブジェクトプロ
グラム31a()は,実マシン上で実行すべく実行環境
ファイル8a()に組み込まれてロードモジュールとし
て実行される。
(B) Unchanged (original source state before changing with source level patch) source program
The original object program 31a () translated based on 1a is incorporated into the execution environment file 8a () to be executed on a real machine and is executed as a load module.

【0028】(ロ) その後にプログラム修正の必要が発
生すると,ソースプログラム1aに修正情報4aを付加して
コーディングしたソースプログラム1bを基に,前記手順
(3) の(a)-(c) に従って作成された変更1後のオブジェ
クトプログラム 32a()が作成される。オリジナルの
オブジェクトプログラム 31a()と変更1後のオブジ
ェクトプログラム 32a()との間で,パッチ部6aによ
ってファイル比較によるパッチデータの自動生成〔特開
平 01-201727号(平成1年8月14日)『ソフトウェアパ
ッチ方式』〕を行い,作成されたパッチデータはパッチ
データファイル9a()に格納される。
(B) If it is necessary to modify the program thereafter, the above procedure is performed based on the source program 1b which is coded by adding the modification information 4a to the source program 1a.
The modified object program 32a () created according to (a)-(c) of (3) is created. Automatic generation of patch data by file comparison between the original object program 31a () and the changed object program 32a () by the patch section 6a [JP-A-01-201727 (August 14, 2001)] "Software patch method"] is performed, and the created patch data is stored in the patch data file 9a ().

【0029】(ハ) 前記 (ロ) で作成したパッチデータ
を実行環境ファイル8a()に適用することにより,変
更1後のオブジェクトプログラム 32a()と同じ論理
で,ロードモジュールとして実行される。
(C) By applying the patch data created in (b) to the execution environment file 8a (), it is executed as a load module with the same logic as the object program 32a () after the change 1.

【0030】(ニ) 更にその後, プログラム修正の要求
が発生すると,図7に示すケースを踏まえて変更2後の
オブジェクトプログラム 32a()が作成され,以下前
記 (ロ) 及び (ハ) と同様の処理 (ニ) 及び (ホ) を行
う。
(D) After that, when a request for program modification is made, the object program 32a () after modification 2 is created based on the case shown in FIG. 7, and the same as the above (b) and (c). Process (d) and (e).

【0031】[0031]

【発明の効果】以上説明したように本発明によれば,ソ
ースプログラムレベルでパッチの修正データが作成でき
るため,機械語理解の必要がなく,また,機械語レベル
のように複雑なアドレス計算が不要となってアドレス計
算の誤りを防ぐことができ,プログラム修正が容易で,
かつ,元のプログラム及び修正履歴が容易に把握できる
という効果がある。
As described above, according to the present invention, since the patch correction data can be created at the source program level, it is not necessary to understand the machine language, and the complicated address calculation as at the machine language level can be performed. It becomes unnecessary and can prevent the error of address calculation, and the program modification is easy,
Moreover, there is an effect that the original program and the correction history can be easily grasped.

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

【図1】 本発明の原理ブロック図FIG. 1 is a block diagram of the principle of the present invention.

【図2】 本発明の実施例を示すブロック図FIG. 2 is a block diagram showing an embodiment of the present invention.

【図3】 オリジナルのソースプログラムの状態を示す
FIG. 3 shows the state of the original source program

【図4】 ソースプログラムと変更前及び変更後のオブ
ジェクトプログラムとの関係図(その1)
FIG. 4 is a relationship diagram (1) between the source program and the object program before and after the change.

【図5】 ソースプログラムと変更前及び変更後のオブ
ジェクトプログラムとの関係図(その2)
FIG. 5 is a relationship diagram between the source program and the object program before and after the change (Part 2)

【図6】 ソースプログラムと変更前及び変更後のオブ
ジェクトプログラムとの関係図(その3)
FIG. 6 is a relational diagram (3) between the source program and the object program before and after the change.

【図7】 ソースプログラムと変更前及び変更後のオブ
ジェクトプログラムとの関係図(その4)
FIG. 7 is a relational diagram (4) between the source program and the object programs before and after the change.

【図8】 ソースプログラムと変更前及び変更後のオブ
ジェクトプログラムとの関係図(その5)
FIG. 8 is a relational diagram (5) between the source program and the object programs before and after the change.

【図9】 ソースプログラムと変更前及び変更後のオブ
ジェクトプログラムとの関係図(その6)
FIG. 9 is a relational diagram (6) between the source program and the object programs before and after the change.

【図10】 本発明の実施例を示すフローチャートFIG. 10 is a flowchart showing an embodiment of the present invention.

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

1 原始プログラム 1a,1b ソースプログラム 2,25 コンパイラ 2a コンパイル部 4,4a 修正情報 5 修正手段 5a 修正部 6 パッチ手段 6a パッチ部 8a 実行環境ファイル 9a,パッチデータファイル 31 第1の目的プログラム 32 第2の目的プログラム 31a,32a オブジェクトプログラム 1 source program 1a, 1b source program 2,25 compiler 2a compilation part 4,4a modification information 5 modification means 5a modification part 6 patch means 6a patch part 8a execution environment file 9a, patch data file 31 first object program 32 second Object programs for 31a, 32a Object programs

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 原始プログラム(1) をコンパイラ(2) に
よってコンパイルして得られた第1の目的プログラム(3
1)を応急修正するプログラムパッチ方式において,前記
原始プログラム(1) に記述され,その修正箇所及び修正
内容を示す修正データと,修正した結果を格納するパッ
チ領域を指定する情報とを含む前記原始プログラム(1)
レベルで書かれた修正情報(4) と,修正情報(4) に基づ
いて前記原始プログラム(1) の修正箇所を前記第1の目
的プログラム(31)のロードモジュールと同じサイズとな
るよう,修正結果を対応する前記第1の目的プログラム
(31)の被修正箇所に対応して新たな修正データに置き換
え,また,必要に応じて,前記指定されたパッチ領域へ
格納して第2の目的プログラム(32)を作成する,前記コ
ンパイラ(2) に備えられた修正手段(5) と,前記第1の
目的プログラム(31)と該第2の目的プログラム(32)とを
比較し,不一致部分をパッチデータとして第1の目的プ
ログラム(31)に適用するパッチデータを作成するパッチ
作成手段(6) とを設けることを特徴とするプログラムパ
ッチ方式。
1. A first object program (3) obtained by compiling a source program (1) by a compiler (2).
In the program patch method for emergency correction of 1), the source program described in the source program (1), including the correction data indicating the correction point and the correction content, and the information designating the patch area for storing the correction result. Program (1)
Modify the modification information (4) written in the level and the modification location of the source program (1) based on the modification information (4) so that it has the same size as the load module of the first object program (31). The first object program corresponding to the result
The compiler (31) is replaced with new correction data corresponding to the portion to be corrected, and if necessary, stored in the specified patch area to create the second object program (32). The correction means (5) provided in (2) is compared with the first object program (31) and the second object program (32), and the inconsistent portion is used as patch data for the first object program (31). And a patch creating means (6) for creating patch data to be applied to the program patch method.
【請求項2】 前記修正情報(4) は,前記原始プログラ
ム(1) 上にパッチ修正箇所を示すマーク,削除箇所を示
すマーク,変更・修正データを示すマーク及び修正した
結果を格納する領域を指定する情報を示すマークを付加
してコーディングすることを特徴とする請求項1のプロ
グラムパッチ方式。
2. The correction information (4) includes a patch on the source program (1), a mark indicating a patch correction point, a mark indicating a deletion point, a mark indicating change / correction data, and an area for storing the correction result. 2. The program patch system according to claim 1, wherein the program patch system is coded by adding a mark indicating information to be designated.
【請求項3】 前記修正情報(4) の変更・修正データ
は,同一プログラムが複数回,修正される場合に修正の
都度,更新された修正版数を含んでコーディングされる
ことを特徴とする請求項2のプログラムパッチ方式。
3. The modification / modification data of the modification information (4) is coded so as to include an updated modification version each time the modification is made when the same program is modified multiple times. The program patch method according to claim 2.
【請求項4】 前記修正手段(5) は,前記第2の目的プ
ログラム(32)の記憶容量が前記第1の目的プログラム(3
1)の記憶容量と等しくなるように,修正結果が要する記
憶領域の大きさが前記第1の目的プログラム(31)の被修
正箇所が占める領域の大きさと等しい,より大,又は小
に従って,(a) 等しいとき,修正結果を前記第1の目的
プログラム(31)の被修正箇所へ格納し,(b) 小のとき,
修正結果を前記第1の目的プログラム(31)の被修正箇所
へ格納すると共に,被修正箇所の残りの部分へ無演算命
令を充当する,もしくは格納された修正結果の後に,被
修正箇所に続く命令へ分岐する分岐命令を追加し,(c)
大のとき,修正結果の一部に加えてパッチ領域へ分岐す
る分岐命令を被修正箇所へ格納し,修正結果の残りの部
分をパッチ領域ヘ格納することによって前記第2の目的
プログラム(32)を作成することを特徴とする請求項1の
プログラムパッチ方式。
4. The correction means (5) is configured so that the storage capacity of the second object program (32) is the first object program (3).
The size of the storage area required by the correction result is equal to the size of the area occupied by the portion to be modified of the first object program (31), which is equal to or larger than the storage capacity of 1). a) When they are equal, the modification result is stored in the modified part of the first object program (31), and (b) when small,
The modification result is stored in the modified part of the first object program (31), and a no-operation instruction is applied to the rest of the modified part, or the stored modified result is followed by the modified part. Add a branch instruction to branch to the instruction, (c)
When the value is large, a branch instruction for branching to the patch area is stored in the patched area in addition to a part of the modification result, and the remaining part of the modification result is stored in the patch area, whereby the second object program (32) The program patch method according to claim 1, wherein
JP4062637A 1992-03-18 1992-03-18 Program patch system Withdrawn JPH05265742A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4062637A JPH05265742A (en) 1992-03-18 1992-03-18 Program patch system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4062637A JPH05265742A (en) 1992-03-18 1992-03-18 Program patch system

Publications (1)

Publication Number Publication Date
JPH05265742A true JPH05265742A (en) 1993-10-15

Family

ID=13206046

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4062637A Withdrawn JPH05265742A (en) 1992-03-18 1992-03-18 Program patch system

Country Status (1)

Country Link
JP (1) JPH05265742A (en)

Similar Documents

Publication Publication Date Title
US5313387A (en) Re-execution of edit-compile-run cycles for changed lines of source code, with storage of associated data in buffers
US6954747B1 (en) Methods for comparing versions of a program
US5170465A (en) Incremental-scanning compiler for source-code development system
US5325531A (en) Compiler using clean lines table with entries indicating unchanged text lines for incrementally compiling only changed source text lines
US5182806A (en) Incremental compiler for source-code development system
US5339430A (en) System for dynamic run-time binding of software modules in a computer system
US5201050A (en) Line-skip compiler for source-code development system
JPH09152961A (en) Method and apparatus for attachment of version setting information to software program
JP4181326B2 (en) Method, apparatus and program for code optimization
JP4638484B2 (en) Data integrity in data processing equipment
US6684394B1 (en) Relocation format for linking with relocation instructions containing operations for combining section data
US5301327A (en) Virtual memory management for source-code development system
US6519768B1 (en) Instruction translation method
AU638999B2 (en) Incremental compiler for source-code development system
CN111400256B (en) Method and device for calling resource file by application program
US6314564B1 (en) Method for resolving arbitrarily complex expressions at link-time
WO2022194173A1 (en) Patching method and relevant device
JP2009048259A (en) Program conversion method and program for conversion
JPH05265742A (en) Program patch system
JP3266097B2 (en) Automatic reentrant method and system for non-reentrant program
JP2609820B2 (en) Program management method
CN116243971B (en) Static dependency bootstrapping-based kernel-independent module construction method
JPS61147336A (en) Generation management system of load module
JP2607975B2 (en) Debug method
JPH0695868A (en) Software management system

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990518