JPS6292032A - Test method for program - Google Patents

Test method for program

Info

Publication number
JPS6292032A
JPS6292032A JP60232523A JP23252385A JPS6292032A JP S6292032 A JPS6292032 A JP S6292032A JP 60232523 A JP60232523 A JP 60232523A JP 23252385 A JP23252385 A JP 23252385A JP S6292032 A JPS6292032 A JP S6292032A
Authority
JP
Japan
Prior art keywords
program
address
instruction
undefined
executed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP60232523A
Other languages
Japanese (ja)
Inventor
Kiyoshi Kodama
児玉 清
Shiro Fukushima
福島 史郎
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.)
Omron Corp
Original Assignee
Omron Tateisi Electronics Co
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 Omron Tateisi Electronics Co filed Critical Omron Tateisi Electronics Co
Priority to JP60232523A priority Critical patent/JPS6292032A/en
Publication of JPS6292032A publication Critical patent/JPS6292032A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To test the execution of a single program by executing this program then an instruction including an address allocated automatically to display them, and making the instruction accessible to the corresponding program. CONSTITUTION:A debugging system comprises a work station 11, a terminal equipment 12 and a debug executing device 13. When an operation test is executed for the debug, etc. after a source program is compiled, an address set previously is automatically allocated to an instruction containing an unfixed address to be substituted even in case such instruction is included in a machine word program owing to a fact that the source program includes an undefined part. Thus the machine word program can be executed singly. If the instruction having its executed, this executed instruction is displayed on a display device 27 and a direct access is possible to the program via an emulator 29. Thus an execution test can be carried out with a single program.

Description

【発明の詳細な説明】 〈発明の技術分野〉 本発明は、プログラムのテスト方法、特に未定義部分を
含むプログラムを単体でテストする方法に関する。
DETAILED DESCRIPTION OF THE INVENTION Technical Field of the Invention The present invention relates to a method for testing a program, and particularly to a method for individually testing a program including an undefined portion.

〈発明の概要〉 ごの発明は、ソースプログラムをコンパイルしてデバッ
グ等のために動作テストを行う際、ソースプログラムに
未定義部分が存在することに起因して、代入すべきアド
レスが未定状態の命令が機械語プログラム中に含まれて
も、かかる命令に対して予め設定しておいたアドレスを
自動的に割り当ててそれ単独で実行可能な形式とする一
方、該プログラムの実行中、アドレスを自動割り当てし
た命令が実行されるとそれを表示して、該プログラムに
直接アクセス可能とすることにより、プログラムのJi
j体での実行テストを行える様にしたものである。
<Summary of the Invention> The invention provides that when a source program is compiled and an operation test is performed for debugging etc., an address to be assigned is in an undefined state due to the existence of an undefined part in the source program. Even if an instruction is included in a machine language program, a preset address is automatically assigned to the instruction so that it can be executed independently, while the address is automatically assigned during the execution of the program. By displaying the assigned instructions when they are executed and making the program directly accessible, you can improve the program's Ji
This allows execution tests to be performed on the j-body.

〈発明の背景〉 従来、高級言語で記述したプログラムを実行キストする
場合、?Wj+のファイルから成るソースプログラムを
リンケージエディツトしてロー)・°モジュールを作成
し、更にそれを被デバッグwY上にダウンロードする、
:とにより、シンポリノクデバノガの制御の基にプログ
ラムを実行しながらデバッグすることが一般的であった
<Background of the invention> Conventionally, when executing a program written in a high-level language, what happens? Linkage edit the source program consisting of Wj+ files to create a low)/°module, and download it onto the debugged wY.
Because of this, it was common to debug a program while running it under the control of a simple computer.

しかしながら上記デバッグシステムにあっては、被デバ
ツグプログラム中に未定義関数や未′さ義外部変教の様
な未定義部分が含まれていると、リンケージエディツト
時にエラーが発生したり、未定義部分に無意味な数値が
代入されたりして適正なロードモジュールが形成されな
い。
However, in the above debugging system, if the program to be debugged contains undefined parts such as undefined functions or undefined external transformations, an error may occur during linkage editing or undefined parts may occur. A meaningless value is assigned to the definition part, and a proper load module is not formed.

従ってプログラムをテストしようとすると、プYコグラ
ムが全て完成するまで待つか、あるいは未定義関数をな
くすためにスタブ関数をコーディングしたり、未定義外
部変数を別に定義する必要があった。しかしかかる未定
義部分をなくす作業は、ともすると実際のプログラム作
成よりも手間取る虞れが強く、このことが関数を東体で
デバッグする上での障害となって作業能率の低下を招東
する問題があった。
Therefore, when trying to test a program, it was necessary to wait until all the pY-cograms were completed, or to code a stub function to eliminate undefined functions, or to separately define undefined external variables. However, the task of eliminating such undefined parts is likely to take more time than actually creating the program, and this becomes an obstacle when debugging functions in the text field, leading to a decrease in work efficiency. was there.

〈発明のに1的〉 本発明は、上記問題に鑑みてなされたものであって、ソ
ースプログラムに未定部分が含まれていてもそのままコ
ンパイルするとともに、該未定部分に起因して発生する
未解決な外部ラベルに対し、所定のアドレスを自動的に
υjり当てることにより、ソースプログラムに対して前
もって特殊な処理を施すことな(、プログラムを単体で
実行テストすることを可能とする方法を提供することを
目的とする。
<First aspect of the invention> The present invention has been made in view of the above-mentioned problems, and is capable of compiling a source program as is even if it contains an undefined part, and solving unresolved issues caused by the undefined part. By automatically assigning a predetermined address υj to a given external label, we provide a method that allows you to test the execution of a single program without performing any special processing on the source program in advance. The purpose is to

〈発明の構成および効果〉 上記目的を達成するため、本発明のプログラムのテスト
方法では、ソースプログラムの未定義部分を未定義状態
のままコンパイルする工程と、ソースプログラムの未定
義部分に起因して代入すべきアドレスが未定状態の命令
に対し、予め設定しておいたアドレスを自動的に割り当
てることにより、単独で実行可能な形式とする工程と、
プログラムを実行させ、自動割り当てされたアドレスを
含む命令を実行するとそれを表示して、プログラムに対
しアクセス可能とする工程とをその構成とした。
<Configuration and Effects of the Invention> In order to achieve the above object, the program testing method of the present invention includes a step of compiling an undefined portion of a source program in an undefined state, and a step of compiling an undefined portion of a source program in an undefined state. A step of automatically assigning a preset address to an instruction for which the address to be assigned is undetermined, thereby making it independently executable;
The method consists of the steps of executing a program, executing an instruction including an automatically assigned address, and displaying it to make the program accessible.

本発明は上記構成により、スタブ関数や未定義な外部変
数を単体デバッグのためだけにコーディングする必要が
なく、プログラムの単体による実行テストが容易に行え
、プログラムの開発効率が向上する効果を有する。
With the above-described configuration, the present invention eliminates the need to code stub functions and undefined external variables only for unit debugging, facilitates execution testing of individual programs, and has the effect of improving program development efficiency.

〈実施例の説明〉 以下図面に示す実施例に基づき、本発明を具体的に説明
する。
<Description of Examples> The present invention will be specifically described below based on examples shown in the drawings.

なお実施例では、汎用コンピュータを用い、テスト目的
に応じて周辺機器およびソフトウェアを取り替えること
により適用範囲を広げたC言語用のデバッグシステムに
本発明を実施した一例を示すが、これに限らず、それ単
独で動作するプログラムテスト専用機等にも略同様に実
施でき、又、被デバツグプログラム用の言語もrCJ以
外の各種高級言語に変更して実施できることは勿論であ
る。
In the embodiment, an example will be shown in which the present invention is implemented in a C language debugging system that uses a general-purpose computer and expands the scope of application by replacing peripheral devices and software depending on the test purpose, but the present invention is not limited to this. It goes without saying that the present invention can be implemented in substantially the same manner on a dedicated program test machine that operates independently, and the language for the program to be debugged can also be changed to various high-level languages other than rCJ.

本発明を実施するデバッグシステムは、第3図に示す如
(、汎用コンピュータを使用したエンジニアリングワー
クステーション11と、該ワークステーション11に対
するオペレータの直接的なアクセスを可能とする端末装
置12と、ワークステーション11を用いて開発された
被デバツグプログラムをワークステーション11側から
の制御の下に実行し、アセンブラレヘルでのデバッグを
可能とするデパ・ノブ実行装置13とから構成される。
A debugging system embodying the present invention includes an engineering workstation 11 using a general-purpose computer, a terminal device 12 that allows an operator to directly access the workstation 11, and a workstation as shown in FIG. 11 under the control from the workstation 11 side, and a Depa-Nobu execution device 13 that enables debugging at an assembler level.

ワークステーション11は、マイクロプロセッサを使用
した演算制御装置21を中心として、RAMから成る内
部記憶装置22と、〕〕\トートィスクドライブの外部
記憶装置23と、周辺装置に対するインターフェース回
路を備えた入出力装置24とを各種バス25を介して接
続したものであって、更にワークステーション11に対
し、入出力装置24を通じてO:1;末装置12とデバ
ッグ実行装置13とが接続される。
The workstation 11 has an arithmetic control unit 21 using a microprocessor as its center, an internal storage device 22 consisting of RAM, an external storage device 23 such as a tote disk drive, and an input/output system equipped with an interface circuit for peripheral devices. A device 24 is connected to the workstation 11 via various buses 25, and an O:1 terminal device 12 and a debug execution device 13 are further connected to the workstation 11 through an input/output device 24.

端末装置12は、ワークステーション11に対する直接
的なアクセスを可能とするキーボード26と、ワークス
テーション11内でのデータ処理状況を視認しうる形で
表示するC、 RT等のディスプレイ装置27とから成
り、キーボード26からのコマンド人力により、外部記
憶装置23に予め格納しておいた第4図に示すコンパイ
ラ3トリンケージエディタ32・シンボリックデハソガ
33等の実行プログラム37、ソースプログラム34・
オブジェクトファイル35・ロードモジュール36等か
ら成るデータを内部記憶装置22に適宜ロードした後、
演算制御装置21においてプログラム31・32・33
を順次実行させて行くことにより、ワークステーション
11はデバッグ実行装置13を制御しながら全体でデバ
ッグシステムとして動作する。
The terminal device 12 consists of a keyboard 26 that allows direct access to the workstation 11, and a display device 27 such as C or RT that displays the data processing status within the workstation 11 in a visible manner. By manually inputting commands from the keyboard 26, the execution programs 37, source programs 34, etc., such as the compiler 3 linkage editor 32 and symbolic debugger 33 shown in FIG. 4, stored in the external storage device 23 in advance are executed.
After appropriately loading the data consisting of the object file 35, load module 36, etc. into the internal storage device 22,
Programs 31, 32, 33 in the arithmetic and control unit 21
By sequentially executing the steps, the workstation 11 operates as a debug system as a whole while controlling the debug execution device 13.

デバッグ実行装置13は、デバッグすべきプログラムを
走らせうるマイクロブロセ・ノサを制御部に使用した電
子式金銭登録機等の被デバツグ装置28と、該被デバツ
グ装置28とリークステーション11間にあって、被デ
バツグ装置28のCPUに代わって被デバツグ装置28
を直接制御するエミュレータ29とから成る。該エミュ
レータ29はそれ単独でもアセンブラレベルでのデバッ
グを可能とするものであるが、本実施例にあっては、入
出力装置24を通じてワークステーション11側から与
えられたコマンドに対応し、ソースプログラム34J−
の変数名を指定して被デバツグ装置28 、、lのメモ
リーの内容を表示、更新し、あるいは又、被デバツグ装
置28上のプログラムを実行、停止等の各種制御を行っ
た後、その結果をワークステーション11側に返送する
ことにより、ワークステーション11側で高級言語によ
るソースプログラム34のレベルでのデバッグ処理を可
能とする。
The debug execution device 13 is located between a device to be debugged 28 such as an electronic cash register using a microprocessor as a control unit capable of running a program to be debugged, and the device to be debugged 28 and the leak station 11. The debugged device 28 replaces the CPU of the debugging device 28.
and an emulator 29 that directly controls the. The emulator 29 can perform debugging at the assembler level by itself, but in this embodiment, it responds to commands given from the workstation 11 through the input/output device 24 and debugs the source program 34J. −
Display or update the memory contents of the debugged devices 28, . By sending the data back to the workstation 11 side, debugging processing at the level of the source program 34 in a high-level language can be performed on the workstation 11 side.

本発明は、上記デバッグシステムにおりJろプ【コグラ
ムの実行テスト方法にその特徴を有する。
The present invention is characterized by a method for testing the execution of J-loop programs in the debugging system.

第4図は、C言語で記述されたソースプログラム34が
機械語に翻訳され、史にノンポリ。
Figure 4 shows a source program 34 written in C language that has been translated into machine language and is completely non-polymorphic.

クデベソグされるまでの主としてソフトウェアによる処
理の流れを概略的に示す。
This figure schematically shows the flow of processing, mainly performed by software, up to the point where it is debugged.

まず最初に、未定義な関数の呼び出j−5や未定義な外
部変数の参qぺを含むソースプログうム34は、ワーク
ステーション11の内部でコンパイラ31によりコンパ
イルされ、リロケータ7’ルなオブジェクトファイル3
5が形成される。該オブジェクトファイル35は、ソー
スプロゲラJ、34に対応する機械語に加えて、該機械
語のアドレスとソースプログラム34の行番号の対応関
係を示す行番号情報、ソースプログロム34上で記述さ
れた変数の型、サイズ、アドレス等の情報からなるシン
ボル情報を含むものであって、そのファイル形式は、例
えばオペレーティングシステムUNIX  SYSTE
M  VのCOF F (Common 0bject
 File Format)に従って構成される。
First of all, a source program 34 containing calls to undefined functions and references to undefined external variables is compiled by the compiler 31 inside the workstation 11, and then processed by the relocator 7'. Object file 3
5 is formed. The object file 35 includes, in addition to the machine language corresponding to the source progera J, 34, line number information indicating the correspondence between the address of the machine language and the line number of the source program 34, and information written on the source program 34. It contains symbol information consisting of information such as variable types, sizes, addresses, etc., and its file format is, for example, the operating system UNIX SYSTE.
M V COF F (Common 0bject
File Format).

しかしこの段階にあっては、機械語はりロゲータブルな
形式で記述されているために絶対“?ドレスは確定でき
ず、従って行番号↑n報の機械語のアドレスに代えて、
オブジェクトファイル35中における先頭の機械語から
のオフセット値を代入するとともに、シ〉′ポル情報中
のア[〜レス値は未確定な状態としている。更にソース
プログラム34中に未定義な部分が存在するために、例
えば関数呼び出しにおけるジャンプ先のアドレスや、外
部変数のアドレスなどは、未解決な状態のままとなって
いる。
However, at this stage, since the machine language is written in a rogutable format, the absolute "?" address cannot be determined, so instead of the machine language address for line number ↑n,
The offset value from the first machine language in the object file 35 is substituted, and the address value in the file information is in an undetermined state. Furthermore, since there are undefined portions in the source program 34, for example, the jump destination address in a function call, the address of an external variable, etc. remain unresolved.

次にリンケージエディタ32は、ト記オブ7・エクトフ
ァイル35を入力データとしてロードモジュール36を
作成する。ロードモジュール36は、被デバツグ装置2
8が実行しうる絶対アドレスで記述された機械語に加え
て、シンポリ、クデバノグに利用するための行番号端(
Uやシンボル情報が含まれ、オブジェクトファイル35
と略同様のファイル形式で構成される。
Next, the linkage editor 32 creates a load module 36 using the 7-file 35 as input data. The load module 36 is a device to be debugged 2.
In addition to the machine language written using absolute addresses that can be executed by 8, line number end (
Contains U and symbol information, object file 35
It consists of almost the same file format as .

ところでロードモジュール36の作成段トじにあっては
、上記とは反対に、未解決な外部ラー、ルがそのまま残
ることはj′+されない。そごで本実施例にあっては、
第1図ζど、〒1ずlJu <、未解l↓1な外部ラヘ
ルがBSR命令42の様な関数呼び出しにかかるジャン
プ先のアドレスであれば、常にaff B S R命令
42のオペランド41に対し一定のアドレス八をセット
する。
By the way, in the process of creating the load module 36, contrary to the above, unresolved external errors are not left as they are. So, in this example,
If the external Rahel with 〒1zlJu <, unresolved l↓1 in Figure 1 is the address of the jump destination for a function call such as the BSR instruction 42, then the aff BSR instruction 42's operand 41 is always Set a constant address 8 to the address.

一方、未定義な外部ラヘルが、MOVE (メモリーか
らレジスタへのデータ転送)命令44の如く外部変数の
参照にかかるアドレスであれば、該命令44のオペラン
ド43に対し特定のアドレスエリア45のアドレスB、
B2 ・・・・を、未定義な外部ラヘルの出現順に、変
数のサイズ分づつスタートアドレスB、から順次割り当
てる。上記特定のアドレスA及びアドレスエリア、45
は、リンケージエディタ32の起動時に利用汗によって
指定され、更にアドレスAには、エミュレータ2つのハ
ードウェアブレークボイ〉′トHBPをセットすること
により、該アドレスAを実行するとプログラムがハード
ウェア的に自動的にブレークされる様に設定しておく。
On the other hand, if the undefined external Rahel is an address related to referencing an external variable such as in the MOVE (data transfer from memory to register) instruction 44, the address B of the specific address area 45 is specified for the operand 43 of the instruction 44. ,
B2... are sequentially allocated starting from the start address B by the size of the variable in the order of appearance of the undefined external Rahel. The above specific address A and address area, 45
is specified by the user when starting up the linkage editor 32, and furthermore, by setting the hardware breakpoint HBP of the two emulators at address A, when the address A is executed, the program is automatically executed by hardware. Set it so that it will break automatically.

上記の如く処理を行ったロードモジュール36を入力デ
ータとしてシンポリノクデバノガ33を作動させ、端末
装置12のキーボー1−26から所定のコマンドを入力
すると、該コマンドを処理するために必要なエミュレー
タコマンドがエミュレータ29に送られる。エミュレー
タ29は、このエミュレータコマンドを解釈、実行した
後その結果をデバッガ33に返送する。
When the load module 36 processed as described above is used as input data to operate the simple debanoga 33 and a predetermined command is input from the keyboard 1-26 of the terminal device 12, the emulator command necessary to process the command is activated. is sent to the emulator 29. The emulator 29 interprets and executes this emulator command, and then sends the result back to the debugger 33.

シンポリノクデバソガ33は、従来の高級言語用と同じ
(、ソースプログラム34上の変数名を指定してその内
容を表示・更新する機能や、被デバツグ装置28内のプ
ログラムを実行・停止させる機能を有するのに加えて、
以下で詳述する如く、■未定義な関数が呼び出されるこ
とによりアドレスAが実行された時、未定義な関数を呼
び出したプログラムの行番号を表示するとともに、被デ
バ・ング装置28のプログラムを停止させる機能、■コ
マンドによって未定義な関数の引数の型を人力すること
により、引数の内容を表示する機能、■コマンドにより
未定義な関数の戻り値を定義したうえで、被デバツグプ
ログラムを再実行する機能を有する。なおデバッガ33
はその内部のメモリー上に、ロードモジュール36の行
番号情報を基にして、機械語のアドレスとそれに対応す
るファイル名、関Sり名、行番号から成るレコード群で
構成される行一番号テーブルを予め作成してあり、デバ
ッガ3:3はエミュレータ29から返送される処理結果
を上記行番号テーブルを参照しながら編集し、端末装置
12のディスプレイ装置27においてソースプログラム
34上の情報として表示可能とする。
The simple debugger 33 has the same functions as those for conventional high-level languages (i.e., the function of specifying variable names in the source program 34 and displaying/updating their contents, and the function of executing/stopping the program in the debugged device 28). In addition to having
As detailed below, ■ When address A is executed by calling an undefined function, the line number of the program that called the undefined function is displayed, and the program of the device to be debugged 28 is displayed. ■A function that displays the contents of the arguments by manually specifying the argument type of an undefined function using a command.■A function that allows you to define the return value of an undefined function using a command and then run the debugged program. It has a re-execution function. Note that the debugger 33
On its internal memory, a row number table is created based on the row number information of the load module 36, which is a record group consisting of a machine language address, a corresponding file name, a function name, and a row number. has been created in advance, and the debugger 3:3 edits the processing results returned from the emulator 29 while referring to the line number table, so that it can be displayed as information on the source program 34 on the display device 27 of the terminal device 12. do.

次にシンポリノクデハッガ33を用いて、上記処理をし
た単体モジュール70を実行させてデバッグする手順を
説明する。
Next, a procedure for using the simple debugger 33 to execute and debug the single module 70 that has undergone the above processing will be described.

シンポリノクデハノガ33を起動し、第2図に示す如く
端末装置12からプログラムの実行コマンド51である
°″GO”を入力すると、被デバツグプログラムは実行
を開始する。ここで該プログラムの実行中に、未定義な
外部変数を引用するMOVE命令44が実行された場合
は、第1図の様に、予めオペランド43に設定したアド
レスBに対応する番地のメモリー内容46を順次取り込
みながらプログラムの実行をそのまま継続させる。
When the simple debugger 33 is activated and the program execution command 51 "GO" is input from the terminal device 12 as shown in FIG. 2, the program to be debugged starts execution. If a MOVE instruction 44 that quotes an undefined external variable is executed during the execution of the program, as shown in FIG. Continue executing the program while sequentially importing the files.

しかし未定義関数が呼び出されると、該呼び出しに対応
するBSR命令42のオペランド41には特定のアドレ
スAがセットされているため、プログラムの実行は強制
的にアドレスAに分岐され、更に8亥アドレスAには、
エミュレータ29のハードウェアブレークポイントHB
Pが予めセットされているため、このアドレスAがアク
セスされるとエミュレータ29は被デバツグプログラム
の実行を停止し、ブレークの発生をシンポリンクデバノ
ガ33に対し通知する。
However, when an undefined function is called, the operand 41 of the BSR instruction 42 corresponding to the call is set to a specific address A, so program execution is forcibly branched to address A, and the program execution is forcibly branched to address A. In A,
Emulator 29 hardware breakpoint HB
Since P is set in advance, when this address A is accessed, the emulator 29 stops execution of the program to be debugged and notifies the sympolink debugger 33 of the occurrence of a break.

第5図は、上記の如く未定義関数が呼び出されたために
、被デバツグプログラムが停止した後におけるスタック
エリア61と、関数呼び出しに関係する各種レジスタ5
0の様子を示している。すなわちスタックエリア61に
は、未定義関数の呼び出しに起因するアドレスの分岐が
起こイ〉と、呼び出し元の関数が利用する領域62の上
に、未定義関数に対し渡される引数63を順次スタック
し、更にその上に呼び出し元に対する戻りアドレス64
を格納した後、その戻りアドレス64を格納した番地を
スタックポインタ65にセットしてあり、従ってスタッ
クポインタ65の値からのオフセント値として、戻りア
ドレス64や引数63が格納されるアドレスが一義的に
求められる。
FIG. 5 shows the stack area 61 and various registers 5 related to the function call after the debugged program has stopped due to the undefined function being called as described above.
0 is shown. In other words, in the stack area 61, if an address branch occurs due to a call to an undefined function, the arguments 63 passed to the undefined function are sequentially stacked on the area 62 used by the calling function. , and furthermore a return address 64 to the caller.
After storing the return address 64, the address where the return address 64 is stored is set in the stack pointer 65. Therefore, as an offset value from the value of the stack pointer 65, the address where the return address 64 and the argument 63 are stored is uniquely set. Desired.

図示例では、未定義関数を呼び出した元の関数に戻るた
めのアドレス64は、スタックポインタ65の指すアド
レスに、引数63は更にそれから+2のアドレスから後
に格納されていることを示している。シンポリソクデバ
ソガ33はかかる戻りアドレス64をもとにして行番号
テーブルを検索し、未定義関数を呼び出したソースプロ
グラム34上の位置を、第2図の如くファイル名52、
関数名53、行番号54のフォーマットで画面55上に
表示して、利用者に未定義関数が呼び出されたことを知
らせる。
The illustrated example shows that the address 64 for returning to the original function that called the undefined function is stored at the address pointed to by the stack pointer 65, and the argument 63 is stored further after the address +2. The simple software developer 33 searches the line number table based on the return address 64, and finds the position in the source program 34 where the undefined function was called, using the file name 52, as shown in FIG.
It is displayed on the screen 55 in the format of function name 53 and line number 54 to inform the user that an undefined function has been called.

ここで、未定義関数に渡された引数63を表示させるた
めのコマンド56であるdisparg″を端末装置1
2を通じてオペレータが入力すると、該コマンド56の
オペランド57における型指定に従って、上記したスタ
ックエリア61に格納されている引数63の値が順次読
め出されて画面55に表示され、外部関数に対して正し
く引数63が引き渡されたか否かの確認が行われる。
Here, disparg'', which is the command 56 for displaying the argument 63 passed to the undefined function, is sent to the terminal device 1.
2, the values of the arguments 63 stored in the stack area 61 are sequentially read out and displayed on the screen 55 according to the type specification in the operand 57 of the command 56, and are correctly applied to the external function. A check is made to see if argument 63 has been passed.

図示例では、未定義関数はソース10グラL34のファ
イル名sample、 c 、hの関数mainの12
行目から呼び出され、更に引数63は3つあって、第1
の引数は整数型(ilでr123Jを、第2の引数は文
字型(C)でraJを、第3の引数は倍精度浮動小数点
型(dlでrl、23e12Jであることが判る。
In the illustrated example, the undefined function is 12 of the function main of source 10 file name sample, c, h of file L34.
It is called from line 63, and there are three arguments 63, the first
It can be seen that the argument is an integer type (r123J for il, the second argument is character type (C) and raJ, and the third argument is a double precision floating point type (rl for dl, 23e12J).

次に上記の如く未定義関数が呼び出されてストップした
状態において、プログラムの実行を再開するだめのコマ
ンド58である“return”をパノノすると、以下
で説明する手順により、表定義関数側から呼び出し元に
制御が戻され、次の未定義関数が呼び出されるので、被
デバツグプログラムは処理を継続する。
Next, when the undefined function is called and stopped as described above, if you execute the command 58 "return" to restart program execution, the table definition function side will call the caller using the procedure described below. Control is returned to , the next undefined function is called, and the debugged program continues processing.

すなわち、被デバツグ装置28トの7ドレス空間の一部
で、被デバツグプログラムが1(]用していないアドレ
スエリアの一部に、第6図の如くサブルーチンから戻る
ための命令であるRTS命令66を、シンポリノクデバ
ノガ33により予め格納しておく。更に、端末装置12
がら入力される“return”命令58のオペランド
に、戻り値60をオペレータが指定することにより一呼
び出し元に渡される戻り値6oがデータレジスタ67に
格納される。図示例では、整理型(1)で、「123コ
が戻り値Goとして指定されたことを示す。
That is, as shown in FIG. 6, an RTS instruction, which is an instruction for returning from a subroutine, is placed in a part of the address area of the debugged device 28 that is not used by the debugged program. 66 is stored in advance by the simple storage device 33.Furthermore, the terminal device 12
When the operator specifies a return value 60 as the operand of the "return" instruction 58 that is input during the call, the return value 6o that is passed to a caller is stored in the data register 67. In the illustrated example, the sorting type (1) indicates that "123 items have been designated as the return value Go."

上記の如く、戻り値60を指定したreturn命令5
8の入力と連繋して、シンポリソクデハッガ33は、プ
ログラムカウンタ68の値をRTS命令66を格納した
アドレスにセットした後、被デバツグプログラムをR[
JN状嘘にする。するとRTS命令66が実1テされ、
ゼータレジスタ67に格納した戻り値60を取り込んで
呼び出し元の関数に戻り、プログラムの実行テストをw
F:続するのである。
As above, return instruction 5 with return value 60 specified
In conjunction with input 8, the simple debugger 33 sets the value of the program counter 68 to the address storing the RTS instruction 66, and then moves the program to be debugged to R[
JN letter is a lie. Then, RTS instruction 66 is executed,
Take in the return value 60 stored in the zeta register 67, return to the calling function, and run the program execution test.
F: Continue.

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

第1図は本発明にかかるプログラムテスト時におけるプ
ログラムのアドレスとメモリーとの関係を示す説明図、
第2図は操作手順を説明する表示画面の正面図、第3図
は本発明を実施するだめのデハソグシステムの=−例を
示すブロック図、第4図は第3図のシステム中における
処理の流れを説明する概略図、第5図はプログラムのブ
レーク発生時におけるし、;スタとスタックエリアとの
関係を示す説明図、第6図はプログラムの実行再開手順
を示す説明図である。 11・・・・ワークステーション 12・・・・端末装置 27・・・・ディスプレイ装置 31・・・・コンパイラ 32・・・・リンケージエディタ 33・・・・シンポリノクデハノガ 34・・・・ソースプログラム 36・・・ロードモジュール 特 許 出 願 人  立石電機株式会社寸3 >3 斗Jg<a八なズ掩するr濁d゛°ノ072’システム
9−イクjをホすフ゛°0.7りLハ 寸5 >B ムシヌノ 踊本’A、i:L          /jテ)ぐアク
尖t〒145【
FIG. 1 is an explanatory diagram showing the relationship between program addresses and memory during program testing according to the present invention;
Fig. 2 is a front view of a display screen for explaining the operating procedure, Fig. 3 is a block diagram showing an example of a dehasog system for implementing the present invention, and Fig. 4 is a process in the system of Fig. 3. FIG. 5 is an explanatory diagram showing the relationship between the stack area and the stack area when a program break occurs, and FIG. 6 is an explanatory diagram showing the procedure for restarting program execution. 11...Workstation 12...Terminal device 27...Display device 31...Compiler 32...Linkage editor 33...Simporinokudehanoga 34...Source program 36...Load module patent application Person: Tateishi Electric Co., Ltd. Dimension 3 > 3 DoJg L Ha dimension 5 > B Mushinuno Odorihon'A, i: L / j Te) Guaku tip t〒145 [

Claims (2)

【特許請求の範囲】[Claims] (1)ソースプログラムの未定義部分を未定状態のまま
コンパイルする工程と、 ソースプログラムの未定義部分に起因して代入すべきア
ドレスが未定状態の命令に対し、予め設定しておいたア
ドレスを自動的に割り当てることにより、単体で実行可
能な形式とする工程と、 上記単体のプログラムを実行させ、自動割り当てされた
アドレスを含む命令を実行するとそれを表示して、該プ
ログラムに対しアクセス可能とする工程とを備えたプロ
グラムテスト方法。
(1) The process of compiling the undefined part of the source program in an undefined state, and automatically assigning a preset address to an instruction whose address to be assigned is undefined due to the undefined part of the source program. a step of making the program executable on its own by allocating automatically; and a step of executing the above single program and displaying it when an instruction including an automatically assigned address is executed, making the program accessible. A program testing method comprising a process.
(2)代入すべきアドレスが未定の命令の内、実行アド
レスを分岐する命令に対しては全て同一のアドレスを割
り当てるとともに、該アドレスにブレークポイントを設
定している特許請求の範囲第1項記載のプログラムテス
ト方法。
(2) Among the instructions for which the address to be assigned is undetermined, the same address is assigned to all instructions that branch the execution address, and a breakpoint is set at the address. program testing method.
JP60232523A 1985-10-17 1985-10-17 Test method for program Pending JPS6292032A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60232523A JPS6292032A (en) 1985-10-17 1985-10-17 Test method for program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60232523A JPS6292032A (en) 1985-10-17 1985-10-17 Test method for program

Publications (1)

Publication Number Publication Date
JPS6292032A true JPS6292032A (en) 1987-04-27

Family

ID=16940665

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60232523A Pending JPS6292032A (en) 1985-10-17 1985-10-17 Test method for program

Country Status (1)

Country Link
JP (1) JPS6292032A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0228839A (en) * 1988-07-19 1990-01-30 Nec Corp Load module generating system for routine single test processing system
JPH05204700A (en) * 1992-01-29 1993-08-13 Nec Corp Language processor

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5858648A (en) * 1981-09-30 1983-04-07 Fujitsu Ltd Pending item processing system of program
JPS58175061A (en) * 1982-04-06 1983-10-14 Toshiba Corp Test device of computer program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5858648A (en) * 1981-09-30 1983-04-07 Fujitsu Ltd Pending item processing system of program
JPS58175061A (en) * 1982-04-06 1983-10-14 Toshiba Corp Test device of computer program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0228839A (en) * 1988-07-19 1990-01-30 Nec Corp Load module generating system for routine single test processing system
JPH05204700A (en) * 1992-01-29 1993-08-13 Nec Corp Language processor

Similar Documents

Publication Publication Date Title
JP2795244B2 (en) Program debugging system
US7761855B2 (en) Computer program product and system for altering execution flow of a computer program
US5325531A (en) Compiler using clean lines table with entries indicating unchanged text lines for incrementally compiling only changed source text lines
US5313387A (en) Re-execution of edit-compile-run cycles for changed lines of source code, with storage of associated data in buffers
US5182806A (en) Incremental compiler for source-code development system
US5201050A (en) Line-skip compiler for source-code development system
US5193191A (en) Incremental linking in source-code development system
US8997049B1 (en) Method and system for debugging of compiled code using an interpreter
US20120317551A1 (en) Post-compile instrumentation of object code for generating execution trace data
CA2307349A1 (en) Ranked break points and method for debugging a computer program
US6330691B1 (en) Use of dynamic translation to provide breakpoints in non-writeable object code
EP0406028A2 (en) Incremental compiler for source code development system
JP2919302B2 (en) CPU simulation method
JPH0766342B2 (en) Program test equipment
JPS6292032A (en) Test method for program
JPS626260B2 (en)
WO2024069730A1 (en) Debugging device and debugging method
CN117234953B (en) Kernel debugging method based on shadow code cache
JP2659366B2 (en) Debugging method and device
JPS6292034A (en) Program debugging device
Ashby et al. Design of an interactive debugger for FORTRAN: MANTIS
JP3372387B2 (en) Program inspection method
JPH05250221A (en) Simulator execution system
Berthaud et al. Coupling virtual machines and system construction
Gladstone Comparing Microcomputer Development System Capabilities