Patch creation / operation method at high-level language level
JPH09114655A
Japan
- Other languages
English - Inventor
Koichi Kiyono Masami Momoumi Shinichi Yamauchi 伸一 山内 浩一 清野 正実 百海
Description
translated from
【0001】[0001]
【発明の属する技術分野】本発明は高水準言語を適用したソフトウェア制御の交換システムにおいて、高水準言語レベルでのパッチ作成・運用方式に関する。交換用ソフトウェアは、一般的にアセンブラ言語より記述が容易で作業効率のよいCHILL言語やC言語などの高水準言語が使用されている。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a patch creation / operation system at a high level language level in a software controlled exchange system to which a high level language is applied. The exchange software generally uses a high-level language such as CHILL language or C language which is easier to write than assembler language and is more work efficient.
【0002】NTTのディジタル交換機ではCHILL言語を採用しているが、特に処理を早くする必要のあるプログラムや、ハードウェアを直接制御するプログラムはアセンブラ言語で直接記述する場合もある。アセンブラ言語は“0”と“1”との組合せよりなる機械語と1対1に対応しているが、高水準言語または高級言語は機械語と1対nで対応しており、高水準言語の1ワードで機械語の複数の命令を表現することが可能である。In a digital exchange of NTT, CHILL is used.
Although the language is adopted, there are cases where a program that needs to speed up processing or a program that directly controls hardware is written directly in the assembler language. The assembler language is a machine language consisting of a combination of "0" and "1" and 1
Corresponding to one-to-one, a high-level language or a high-level language has a one-to-n correspondence with a machine language, and one word of the high-level language can express a plurality of machine language instructions.
【0003】[0003]
【従来の技術】交換局プログラム(ファイル)作成手順の概略を図5に示す。システム部は .交換機の動作を規定するプログラムは、CHILLなどの交換機用高水準言語を用いて作成する。作成したプログラムをパソコン端末から電子計算機に投入して、ソースモジュール(SM)として取り出す。この時のプログラムの状態はCHILL言語で書かれたイメージがそのままソースコードファイルに格納される。 .交換機はCHILL言語のソースモジュールをそのまま実行することはできないので、実行可能な機械語に変換する必要がある。CHILL言語を機械語に変換するプログラムはCHILLコンパイラと呼ばれる。CHILLコンパイラ等のプログラムは総称してオペレーティングシステム(OS)と呼ばれる。 .ソースモジュール(SM)はCHILLコンパイラによりアセンブラコードに翻訳され機械語に変換され、オブジェクトモジュール(OM)と呼ばれてオブジェクトコードファイルに格納される。 .しかしオブジェクトモジュール(OM)は機械語に変換されているが、メモリ上の配置は決まってないので、さらにリンケージエディタによりプログラムのメモリ上の配置を決める必要があり、こうしてできた実行可能なプログラムはロードモジュール(LM)と呼ばれて、ロードモジュールファイルに格納される。 .ロードモジュール(LM)はメモリ上に展開されて運用システムとして使用される。メモリの番地が割り付けられたロードモジュール(LM)形式の局データはすべて機械語により構成され、運用システムのプログラムにより必要な局データの読み出し書き込みが行われる。2. Description of the Related Art An outline of a procedure for creating a switching center program (file) is shown in FIG. The system department is. The program that defines the operation of the exchange is CHILL
Created using a high-level language for exchanges such as. Input the created program from the personal computer terminal to the computer,
It is taken out as a source module (SM). As for the state of the program at this time, the image written in the CHILL language is stored as it is in the source code file. . Since the exchange cannot directly execute the CHILL language source module, it has to convert it into an executable machine language. A program for converting the CHILL language into a machine language is called a CHILL compiler. CH
Programs such as the ILL compiler are collectively called an operating system (OS). . The source module (SM) is translated into assembler code by CHILL compiler and converted into machine language,
It is called an object module (OM) and is stored in an object code file. . However, although the object module (OM) has been converted into machine language, its placement in memory is not fixed, so it is necessary to determine the placement of the program in memory by the linkage editor. It is called a load module (LM) and is stored in a load module file. . The load module (LM) is expanded on the memory and used as an operation system. All load module (LM) format station data to which memory addresses are assigned is configured in machine language, and necessary station data is read and written by a program of the operating system.
【0004】かかる運用プログラムに問題箇所(バグ)が判明した場合、機械語で問題箇所を修正するパッチ(修正命令)を作成し、運用局に送付し機械語で投入していたので、命令コードを直接書き換えるアドレスに置き換える必要があった。Problems (bugs) in the operation program
If it was found, a patch (correction instruction) was created to correct the problem in the machine language, and it was sent to the operation station and submitted in the machine language, so it was necessary to replace the instruction code with the directly rewritten address.
【0005】[0005]
【発明が解決しようとする課題】高水準言語レベルでソフトウェア制御を行う交換システムにおいて、従来は運用プログラムに問題箇所(バグ)が発生した場合、いちいち機械語で問題箇所を修正するパッチ(修正命令)を作成していたため、修正作業が複雑になり、機械語に熟知した技術者でないとバッチ作成が困難であった。In a switching system that controls software at a high level language level, when a problem point (bug) occurs in an operation program, a patch (correction instruction) is used to correct the problem point in machine language. ) Was made, the correction work became complicated, and it was difficult to make a batch unless the engineer was familiar with machine language.
【0006】本発明はソースコードレベルで修正を行うことにより、機械語による修正を必要としないで、作業者がパソコン端末等から容易に問題箇所を修正できるようにすることを目的とする。An object of the present invention is to make corrections at the source code level so that a worker can easily correct a problem part from a personal computer terminal or the like without the need for correction by machine language.
【0007】[0007]
【課題を解決するための手段】本発明の原理構成図を図1に示す。図において、1は現用ソースコードファイル、2は修正ソースコードファイル、3はパッチ用アセンブラコードファイル、4は修正アセンブラコードファイル、5はパッチ用アセンブラコードファイルの関数構成、6は修正アセンブラコードファイルの関数構成、7は修正関数、8はパッチ用オブジェクトコードファイル、9はバッチ用ロードモジュールファイル、10はメモリを示す。FIG. 1 is a block diagram showing the principle of the present invention. In the figure, 1 is a current source code file, 2 is a modified source code file, 3 is a patch assembler code file, 4 is a modified assembler code file, 5 is a function configuration of the patch assembler code file, and 6 is a modified assembler code file. Function configuration, 7
Is a correction function, 8 is an object code file for patch, 9 is a load module file for batch, and 10 is a memory.
【0008】修正コードファイル2は現用ソースコードファイル1を修正し、パッチ用アセンブラコードファイル3は現用ソースコードファイル1をアセンブラコードに変換し、修正アセンブラコードファイル4は修正ソースコードファイル2をアセンブラコードに変換したものである。The modified code file 2 modifies the current source code file 1, the patch assembler code file 3 converts the current source code file 1 into assembler code, and the modified assembler code file 4 converts the modified source code file 2 into assembler code. Is converted to.
【0009】パッチ用アセンブラコードファイルの関数構成5は関数Aと関数Bと関数Cに修正関数7を付加したものであり、修正アセンブラコードファイルの関数構成6は関数Aを修正したものと関数Bと関数Cよりなり、修正された関数Aは修正関数7として抽出される。The function structure 5 of the patch assembler code file is the function A, the function B, and the function C with the modification function 7 added, and the function structure 6 of the modified assembler code file is the function A with the function A modified and the function B. The modified function A is extracted as the modified function 7.
【0010】パッチ用オブジェクトコードファイル8はパッチ用アセンブラコードファイルの関数構成6より修正関数A’を取り出しバッチセクションに出力できるようにしたもの、パッチ用ロードモジュールファイル9は関数A’のロードモジュールをパッチ用アセンブラコードファイル8をリンケージしてメモリ10上の番地に割り付けるようにしたものである。The patch object code file 8 is a patch assembler code file having the function configuration 6 from which the modified function A'is fetched so that it can be output to the batch section. The patch load module file 9 stores the load module of the function A '. The patch assembler code file 8 is linked and assigned to an address on the memory 10.
【0011】本発明の基本の処理フローチャートを図2に示す。高水準言語レベルのパッチにより機械語レベルのパッチを作成、運用する方式において、 .現用ソースコードファイル1、修正ソースコードファイル2をアセンブラコードに変換し、パッチ用アセンブラコードファイル3、修正アセンブラコードファイル4に格納する。 .パッチ用アセンブラコードファイル3と修正アセンブラコードファイル4の差分(コンペア)をとる。 .差分があった場合、修正アセンブラコードファイルの関数構成6より修正関数7を抽出する。 .パッチ用アセンブラコードファイルの関数構成5の後ろに修正関数7を付加する。この時、シンボル名の多重定義でアセンブルエラーが発生しないように修正関数Aの関数名を変更する(関数A’とする)。 .前記で作成したファイルをアセンブルしてパッチ用オブジェクトコードファイル8を作成する。この時、関数A’はパッチセクション(通常のコンバイラが生成するセクション以外)に生成されるように指定する。 .前記で作成したパッチ用オブジェクトコードファイル8をリンケージし、パッチセクションロードモジュール部分のみ抽出する。 .パッチセクションロードモジュール部分をメモリ10の運用システムに書き込み、運用システムの関数Aの先頭番地を関数A’へのシャンプ命令に書き換え、バッチを運用状態とする。A basic processing flow chart of the present invention is shown in FIG.
Shown in In the method of creating and operating a machine language level patch from a high level language level patch, The current source code file 1 and the modified source code file 2 are converted into assembler codes and stored in the patch assembler code file 3 and the modified assembler code file 4. . The difference (compare) between the patch assembler code file 3 and the modified assembler code file 4 is calculated. . If there is a difference, the correction function 7 is extracted from the function configuration 6 of the modified assembler code file. . A correction function 7 is added after the function configuration 5 of the patch assembler code file. At this time, the function name of the correction function A is changed (referred to as function A ′) so that an assemble error does not occur in the symbol name multiple definition. . The files created above are assembled to create the patch object code file 8. At this time,
The function A ′ is specified to be generated in the patch section (other than the section generated by the normal combiner). . The patch object code file 8 created above is linked, and only the patch section load module part is extracted. . Patch section Load module part memory 10
In the operation system, the head address of the function A of the operation system is rewritten with a shamp instruction to the function A ′, and the batch is put into the operation state.
【0012】[0012]
【発明の実施の形態】前記図2の処理フローチャート方式が基本であるが、ソースコードファイルからアセンブラコードにおとすことで最適化処理の相違により運用システムの機械語と異なる場合についての接続構成図の実施例を図3に示す。図において、11はソースコードファイル、12はパッチ用オブジェクトコードファイル、13はアセンブラコードファイル、14はパッチ用オブジェクトコードファイル、15は現用ロードモジュールファイル、16はパッチ用ロードモジュールファイル、17はメモリを示す。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The processing flow chart system of FIG. 2 is basically used. However, by changing from a source code file to an assembler code, a difference in optimization processing causes a difference in machine language of an operating system from a connection configuration diagram. An example is shown in FIG. In the figure, 11 is a source code file, 12 is a patch object code file, 13 is an assembler code file, 14 is a patch object code file, 15 is a current load module file,
Reference numeral 16 indicates a patch load module file, and 17 indicates a memory.
【0013】パッチ用オブジェクトコードファイル12はソースコードファイル11をコンパイルして運用システムのオブジェクトコードを生成する方法であり、パッチ用オブジェクトコードファイル14はソースコードファイル11よりアセンブラコード生成によりアセンブラコードファイル13を生成し、アセンブラコードファイル13をアセンブルしてパッチ用オブジェクトコードを生成する方法である。The patch object code file 12 is a method of compiling the source code file 11 to generate the object code of the operation system, and the patch object code file 14 is the source code file.
In this method, the assembler code file 13 is generated from 11 and the assembler code file 13 is assembled to generate the patch object code.
【0014】本実施例はソースコードファイル11からオブジェクトコードファイルを生成する方法であって、アセンブラコードを経由する場合としない場合とで最終的に生成されるオブジェクトコードファイルが異なる場合を示す。本実施例の処理フローチャートを図4に示す。オブジェクトコードファイルの差分がない時との差分の処理フローは以下の通りである。 (1) 現用ソースコードファイル、修正ソースコードファイルをアセンブラコードに変換する。 (2) アセンブラコードファイルの差分(コンペア)をとる。 (3) 差分があった場合、修正アセンブラコードファイルより修正関数を抽出する。 (4)この修正アセンブラコード内の相対番地ジャンプ命令を絶対番地ジャンプ命令に変換する。 (5) パッチ用アセンブラコードファイルの後ろに、修正関数Aを付加する。この時、シンボル名の多重定義でアセンブルエラーが発生しないよう修正関数名を変更する。(関数A’とする) (6) 前記(5) で作成したファイルをアセンブルしパッチ用オブジェクトコードファイルを作成する。この時、関数A' はパッチセクション(通常のコンパイラが生成するセクション以外)に生成されるように指定する。 (7) 前記(6) で作成したパッチ用オブジェクトコードファイルをリンケージし、パッチセクションロードモジュール部分のみ抽出する。 (8) 修正関数から呼ばれる関数のアドレスを取得する。 (9) 取得したアドレス情報よりパッチ用ロードモジュールファイルをサーチし、シンボル情報を取得する。 (10)取得したシンボル情報より現用ロードモジュールファイルをサーチし、現用アドレス情報を取得する。 (11)取得した現用アドレス情報をパッチセクションロードモジュールの絶対番地ジャンプ命令のアドレス部に書き込みアドレス補正を行う。 (12)パッチセクションロードモジュール部分を運用システムに書き込み、運用システムの関数Aの先頭番地を関数A’へのジャンプ命令に書き換え、パッチを運用状態とする。The present embodiment is a method of generating an object code file from the source code file 11, and shows a case where the finally generated object code file differs between the case where the assembler code is used and the case where the assembler code is not used. A processing flowchart of this embodiment is shown in FIG.
The difference processing flow when there is no difference in the object code file is as follows. (1) Convert the current source code file and modified source code file into assembler code. (2) Take the difference (compare) between assembler code files. (3) If there is a difference, extract the correction function from the correction assembler code file. (4) Convert the relative address jump instruction in this modified assembler code into an absolute address jump instruction. (5) Add the correction function A after the patch assembler code file. At this time, the modified function name is changed so that an assemble error will not occur in the symbol name overload. (Function A ′) (6) Assemble the file created in (5) above to create a patch object code file. At this time, the function A ′ is specified to be generated in the patch section (other than the section generated by a normal compiler). (7) Link the object code file for patch created in (6) above and extract only the patch section load module part. (8) Get the address of the function called from the modification function. (9) Search the load module file for patch from the acquired address information and acquire the symbol information. (10) The working load module file is searched from the acquired symbol information to acquire the working address information. (11) The acquired working address information is written to the address section of the absolute address jump instruction of the patch section load module to correct the writing address. (12) Patch section The load module part is written in the operation system, the start address of the function A of the operation system is rewritten to the jump instruction to the function A ′, and the patch is put in the operation state.
【0015】本実施例で基本の処理フロー図2に追加した処理ステップは、(4) と(8) 〜(11)である。The processing steps added to the basic processing flow chart 2 in this embodiment are (4) and (8) to (11).
【0016】[0016]
【発明の効果】本発明の方式を採用することにより、ソースコードレベルでパッチをつくることが可能なため、機械語に熟知した技術者でなくともパッチ作成が可能となり、機械語とソースレベルの2種の修正確認をなくすことが可能となり、パッチ作成・運用を容易化する効果がある。By adopting the method of the present invention, it is possible to create a patch at the source code level.
Even a technician who is not familiar with machine language can create a patch, and it is possible to eliminate the two types of modification confirmations of the machine language and the source level, which has the effect of facilitating patch creation and operation.
【図1】 本発明の原理構成図FIG. 1 is a diagram showing the principle configuration of the present invention.
【図2】 本発明の基本の処理フローチャートFIG. 2 is a basic processing flowchart of the present invention.
【図3】 本発明の接続構成図の実施例FIG. 3 is an embodiment of a connection configuration diagram of the present invention.
【図4】 実施例の処理フローチャートFIG. 4 is a processing flowchart of an embodiment.
【図5】 交換局プログラム作成手順の概略[Fig. 5] Outline of exchange station program creation procedure
1 現用ソースコードファイル 2 修正ソースコードファイル 3 パッチ用アセンブラコードファイル 4 修正アセンブラコードファイル 5 パッチ用アセンブラコードファイルの関数構成 6 修正アセンブラコードファイルの関数構成 7 修正関数 8 パッチ用オブジェクトコードファイル 9, 16 バッチ用ロードモジュールファイル 10, 17 メモリ 11 ソースコードファイル 12,14 パッチ用オブジェクトコードファイル 13 アセンブラコードファイル 15 現用ロードモジュールファイル 1 active source code file 2 modified source code file 3 patch assembler code file 4 modified assembler code file 5 patch assembler code file function configuration 6 modified assembler code file function configuration 7 patch function 8 patch object code file 9, 16 Load module file for batch 10, 17 Memory 11 Source code file 12, 14 Object code file for patch 13 Assembler code file 15 Current load module file
フロントページの続き (72)発明者 百海 正実 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 清野 浩一 東京都千代田区内幸町一丁目1番6号 日 本電信電話株式会社内Front Page Continuation (72) Inventor Masami Hyakukai 1015 Kamiodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Within Fujitsu Limited (72) Inventor Koichi Seino 1-6 Uchiyuki-cho, Chiyoda-ku, Tokyo Nihon Telegraph and Telephone Corporation Within
Claims (2)
Hide Dependent
translated from
- 【請求項1】 高水準言語を適用したソフトウェア制御の交換システムにおける、高水準言語レベルでのソースコード修正により機械語パッチを生成・運用する方式において、 現用ソースコードファイルに対して問題箇所をソースコードレベルで修正し、修正したソースコードファイルよりアセンブラコードファイルを作成し、現用ソースコードファイルをアセンブラコードファイルに変換した現用アセンブラコードファイルとの差分を解析することにより修正箇所のある関数のみのアセンブラコードファイルを抽出し、 該修正関数のみのアセンブラコードファイルを現用アセンブラコードファイルに並べ変えて翻訳することにより修正関数のアセンブラコードの修正部分にオブジェクトコードを生成し、連携をとることにより修正部分に生成された修正関数のロードモジュールのみを抽出し、 該ロードモジュールを運用システムのパッチエリアに書き込み、運用システムの修正関数の先頭にパッチエリアへのジャンプ命令を書き込むことにより、投入したパッチを運用することを特徴とする高水準言語レベルでのパッチ作成・運用方式。1. A method for generating and operating a machine language patch by modifying a source code at a high level language level in a software controlled exchange system to which a high level language is applied. Modify the code level, create an assembler code file from the modified source code file, and analyze the difference between the current source code file and the current assembler code file. By extracting the code file, rearranging the assembler code file containing only the modification function into the current assembler code file and translating, an object code is generated in the modification part of the assembler code of the modification function, and by linking, the modification part is created. Living The loaded patch is operated by extracting only the load module of the modified function that has been created, writing the load module in the patch area of the operation system, and writing a jump command to the patch area at the beginning of the modification function of the operation system. A patch creation / operation method at a high level language level characterized by.
- 【請求項2】 前記請求項1の高水準言語レベルでのパッチ作成・運用方式であって、 ソースコードから機械語パッチを生成する過程で、一旦アセンブラコードに変換するが、ソースコードから直接機械語に変換する場合と比較してコード生成の最適化処理が相違することがあり、生成されるオブジェクトコードファイルのサイズがそれぞれ異なる場合、 修正関数のアセンブラコード内の相対ジャンプ命令を現行ロードモジュールのアドレス情報を基に絶対番地命令に変換することにより、運用している現行システムのパッチとして運用可能とすることを特徴とする修正関数内のジャンプアドレス補正方式。2. The patch creation / operation method at the high level language level according to claim 1, wherein in the process of generating a machine language patch from the source code, the assembler code is once converted, but the source code is directly converted into a machine. If the optimization process of code generation is different compared to the case of converting to a word, and the size of the generated object code file is different, the relative jump instruction in the assembler code of the correction function is changed to the current load module. A jump address correction method within a correction function, which is characterized by being converted into an absolute address instruction based on address information so that it can be operated as a patch of the current operating system.