JP2820937B2 - Error occurrence line number search device in high-level languages - Google Patents

Error occurrence line number search device in high-level languages

Info

Publication number
JP2820937B2
JP2820937B2 JP62318994A JP31899487A JP2820937B2 JP 2820937 B2 JP2820937 B2 JP 2820937B2 JP 62318994 A JP62318994 A JP 62318994A JP 31899487 A JP31899487 A JP 31899487A JP 2820937 B2 JP2820937 B2 JP 2820937B2
Authority
JP
Japan
Prior art keywords
program
address
error
line number
control table
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 - Fee Related
Application number
JP62318994A
Other languages
Japanese (ja)
Other versions
JPH01161543A (en
Inventor
勇二郎 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP62318994A priority Critical patent/JP2820937B2/en
Publication of JPH01161543A publication Critical patent/JPH01161543A/en
Application granted granted Critical
Publication of JP2820937B2 publication Critical patent/JP2820937B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 〔概 要〕 目的プログラム実行過程でエラーが発生したとき対応
する原始プログラム上のエラー発生行番号を求めるエラ
ー発生行番号探索方式に関し、 エラーの発生した目的プログラムのアドレスが通知さ
れない場合に対応する原始プログラム上のエラー発生行
番号を求めることを目的とし、 目的プログラム実行過程でエラー発生時に原始プログ
ラム上のエラー発生番号を求める高級言語におけるエラ
ー発生行番号探索方式であって、目的プログラムを実行
する各プログラムをリンケージ規約に従ってリンケージ
し、原始プログラムの各行番号の目的プログラムのアド
レスの対応を示すエラー制御テーブルを生成してそのア
ドレスを別のテーブルに設定し、エラー処理を行うプロ
グラムの復帰アドレスに基づいてエラーの発生した目的
プログラムアドレスを求め、エラー制御テーブルより原
始プログラム上のエラー発生番号を求めるように構成す
る。 〔産業上の利用分野〕 本発明は、高級言語で記述された原始プログラムを翻
訳して生成された目的プログラムの実行過程でエラーが
発生した場合に、対応する原始プログラム上のエラー発
生行番号を求める高級言語におけるエラー発生行番号探
索方式に関する。 〔従来の技術〕 COBOL等の高級言語で記述された原始プログラムは、
目的プログラムに翻訳されて実行される。この原始プロ
グラムを翻訳して生成された目的プログラムの実行過程
でエラーが発生した場合は、その原始プログラム上のエ
ラーの発生行番号を求めることがデバック等を行うため
に必要である。 エラーによるプログラム割込み発生時のプログラムカ
ウンタの値すなわち目的プログラムを実行しているプロ
グラムのアドレスがオペレーティング・システム(OS)
より通知された場合は、そのプログラムのアドレスに基
づいて目的プログラム上のエラーの発生したプログラム
アドレスを求め、更にその原始プログラム上に対応する
エラー発生行番号を求めることができる。 しかしながら、高級語の論理エラー等はOSにとっての
エラーではない。したがってOSは正常動作であり、エラ
ー通知は行わない。この場合は、他にエラーの発生した
目的プログラム上の位置を知る手段がないため、それに
対応する原始プログラム上のエラー発生行番号を求め有
効な方法がなかった。 〔発明が解決しようとする問題点〕 高級言語で記述された原始プログラムを翻訳して生成
された目的プログラムを実行するシステムにおいて、そ
の目的プログラムの実行過程でエラーが発生したとき、
システムのOSよりエラーによるプログラム割込み発生時
のプログラムのアドレスが通知されない場合、従来は対
応する原始プログラム上の行番号を求めることができな
いという問題があった。 本発明は、目的プログラムの実行過程でエラーを発生
したプログラムのアドレスがOSより通知されない場合
に、エラーの発生した目的プログラム上のアドレスに対
応する原始プログラム上のエラー発生行番号を容易かつ
確実に求めることのできる高級言語におけるエラー発生
行番号探索方式を提供することを目的とする。 〔問題点を解決するための手段〕 高級言語で記述された原始プログラムを翻訳して生成
された目的プログラムの実行過程でエラーが発生した場
合に、対応する原始プログラム上のエラー発生行番号を
求める高級言語におけるエラー発生行番号探索装置にお
いて、 原始プログラムの翻訳時、子プログラムから親プログ
ラムへの復帰アドレスを設定すると共に、親プログラム
の原始プログラム上の各行番号と、目的プログラム上の
プログラムアドレスとの対応を示すエラー制御テーブル
を備える目的プログラムを生成する手段と、 実行中の目的プログラムの先頭アドレス、最終アドレ
ス、及びエラー制御テーブルのアドレスを管理する実行
単位制御テーブルを生成する手段と、 子プログラムの命令を実行中にエラーが発生したと
き、前記子プログラムから親プログラムへの復帰アドレ
スが前記実行単位制御テーブルの先頭アドレスと最終ア
ドレスとの範囲に含まれるか否かの判定を、親プログラ
ムが目的プログラムとなるまで順次上位のプログラムに
対して繰返し、判定がYESとなったとき復帰アドレスに
対応する原始プログラム上のエラー発生行番号を前記エ
ラー制御テーブルから検索する手段と、 を有することを特徴とする。 〔作用〕 本発明の作用を第1図を参照して説明する。第1図は
本発明を処理フローチャートで示したものである。 処理S1では、目的プログラムを実行する各プログラム
を、子プログラムを呼び出した親プログラムの作業域ア
ドレスが子プログラム側から分るようにリンクし、親プ
ログラムはその子プログラムの作業域内に子からの復帰
アドレスを設定するリンケージ規約に従ってリンケージ
処理が行われる。 処理S2では、原始プログラムの翻訳単位毎に、原始プ
ログラム上の各行番号とその目的プログラム上の各プロ
グラムアドレスとの対応を示すエラー制御テーブルを目
的プログラム内に生成する処理が行われる。 処理S3では、実行のために呼び出された目的プログラ
ムが、自身の初期処理によりそのエラー制御テーブルの
アドレスを実行単位制御テーブルに設定する処理が行わ
れる。 処理S4では、目的プログラムの命令を実行中にプログ
ラムにエラーが発生したとき、そのエラー処理を行う子
プログラムの作業域にある復帰アドレスに基づいて目的
プログラムのエラーの発生したプログラムアドレスを求
める処理が行われる。 処理S5では、実行単位作業域にあるエラー制御テーブ
ルアドレスより実行中の目的プログラムのエラー制御テ
ーブルを求め、該エラー制御テーブルと前記プログラム
アドレスより、目的プログラム上のエラーを発生したプ
ログラムアドレスに対応する原始プログラムのエラー発
生行番号を求める処理が行われる。 更に本発明の作用を、第2図に示す処理の流れを参照
して説明する。 第2図において、SPGは原始プログラムで、行番号1,2
等にMOVE,ADD等の命令が記述されている。 10はシステムメモリで、目的プログラムや各種サブル
ーチン等が格納され、それらの作業域及び各種の制御テ
ーブルが設けられる。 システムメモリ10において、11は目的プログラム域
で、原始プログラムSPGを各翻訳単位毎に翻訳して生成
された各目的プログラムが格納される。111はこの目的
プログラムOBPGのエラー制御テーブルで、行番号欄には
原始プログラムSPGの行番号が格納され、プログラムア
ドレス欄には各行番号の命令に対応する目的プログラム
のプログラムアドレス(すなわち、次に説明する復帰ア
ドレス)がテキスト相対アドレス又は絶対アドレスで設
定される。 なお、目的プログラム域11及びそのエラー制御テーブ
ル111は、各翻訳単位毎に生成された各目的プログラム
毎に設けられるが、図にはその1つの目的プログラムOB
PGのものが示されている。 12は目的プログラムOBPGの1つの命令を実行するサブ
ルーチンPSBRを格納するサブルーチン域で、サブルーチ
ンPSBRは、目的プログラムOBPGを親プログラムとすると
その子プログラムの関係にある。121はその作業域で、
リンクアドレス域121L及び復帰アドレス域121Rが設けら
れている。 13はエラー出力サブルーチンESBRを格納するエラー出
力サブルーチン域で、エラー出力サブルーチンESBRは、
サブルーチンPSBRを親とすると子プログラムの関係にあ
り、エラーの発生した目的プログラムOBPG上のアドレス
に対応する原始プログラムSPG上のエラー発生行番号を
探索し、エラーメッセージとして出力する処理を行う。
131はその作業域で、リンクアドレス域131及び復帰アド
レス域131Rが設けられている。 なお、サブルーチンPSBRとエラー出力サブルーチンES
BRの間には更にサブルーチンが入り得るが、エラー発生
行番号探索動作は各サブルーチンに共通であるので、1
個のサブルーチンの場合が示されている。 14は実行単位制御サブルーチン域で、実行単位制御サ
ブルーチンECSBRが格納される。実行単位制御サブルー
チンECSBRは、目的プログラムの1つの実行単位を実行
する互いに親子の関係にある一連のサブルーチンプログ
ラム系を管理、制御するプログラムである。141は、実
行単位制御サブルーチンECSBRの作業域で、現在実行中
であるすなわち有効な目的プログラムのエラー制御テー
ブルのアドレスが設定される。 15は実行単位制御テーブルで、実行単位制御サブルー
チンECSBRにより獲得、管理され、現在実行中の有効な
目的プログラムOBPGの先頭ADPs、最終アドレスADPf及び
そのエラー制御テーブルアドレスが格納される。 以上の構成において、実行単位制御サブルーチンECSB
Rが起動すると、実行単位制御サブルーチンECSBRは、原
始プログラムSPGを翻訳して生成された各目的プログラ
ム中の1つ(目的プログラムOBPGとする)を、メモリシ
ステムの目的プログラム域11に読み込み、それを実行さ
せる。 以下の各処理も実行単位制御サブルーチンECSBRによ
って制御されて実行されるが、必要のない限り特に言及
しない。 次いで、リンケージ規約に従って、目的プログラムOB
PGが使用する各プログラムをリンクし、子プログラムを
呼び出した親プログラムが使用している作業域のアドレ
スが子プログラム側から分るようにされる(処理S1)。 この処理は、親子の関係にあるプログラムの子プログ
ラムのリンクアドレス域に親プログラムの作業域のアド
レスを格納することにより行われる。すなわち、エラー
出力サブルーチンESBRのリンクアドレス域131Lに、その
親プログラムであるサブルーチンPSBRの作業域121のア
ドレスが格納される。 同じくリンケージ規約に従って、親プログラムの作業
域内の固定的な位置(すなわち復帰アドレス域)に子プ
ログラムからの復帰アドレスが設定される(処理S1)。 この処理は、親プログラム内で子プログラムに制御を
移した命令の次の命令のアドレス(すなわち復帰アドレ
ス)を子プログラムの復帰アドレス域に設定することに
より行われる。 いま、目的プログラムOBPGがアドレスADPi(復帰アド
レスはADPi+1)でその子プログラムであるサブルーチン
PSBRに制御を移したとすると、その復帰アドレスADPi+1
が、サブルーチンPSBRの復帰アドレス域121Lに設定され
る。また、サブルーチンPSBRに実行途中でエラーを発生
し、アドレスADSjでその子プログラムであるエラー出力
サブルーチンESBRに制御を移したとすると、その復帰ア
ドレスADSj+1がエラー出力サブルーチンESBRの復帰アド
レス域131Rに設定される。 一方、原始プログラムSPGの翻訳単位毎に、原始プロ
グラムの各桁番号とその目的プログラムの各アドレスと
の対応を示すエラー制御テーブルが、目的プログラム内
に生成される(処理S2)。第2図において、111は目的
プログラムOBPGのエラー制御テーブルである。 目的プログラムOBPGが実行のために呼び出されると、
目的プログラムOBPG自身の初期処理により、そのエラー
制御テーブル111のアドレスを実行単位制御テーブル15
に設定する(処理S3)。これにより、複数の目的プログ
ラムが交互に実行される実行単位中で、現在有効なエラ
ー制御テーブルのアドレスが分かる。 目的プログラムOBPGの実行途中のアドレスADPiにおい
てサブルーチンPSBRに制御が移り、サブルーチンPSBRの
実行途中でエラーが発生し、アドレスADSj(復帰アドレ
スADSj+1)においてエラー出力サブルーチンESBRに制御
が移ったとする。 エラー出力サブルーチンESBRは、その復帰アドレス域
131Rにある復帰アドレスADSj+1に基づいて、目的プログ
ラムOBPGのエラー発生時のプログラムアドレス(すなわ
ち復帰ADPi+1)を求める(処理S4、なお、この処理S4
具体的な内容は〔実施例〕の項で説明する)。 目的プログラムOBPGのエラー発生時のプログラムアド
レスが求まると、実行単位制御テーブル15に設定されて
ある目的プログラムアドレスより目的プログラムOBPGの
エラー制御テーブル111を求める。このエラー制御テー
ブル111にある各プログラムアドレスをサーチし、前述
の処理S4で求められた復帰アドレスADPi+1に合致するプ
ログラムアドレスを求めると、対応する行番号よりエラ
ーの発生した目的プログラム上のアドレスに対応する原
始プログラムSPG上のエラー発生行番号を求めることが
できる(処理S5)。 以上のようにして、目的プログラムの実行過程でエラ
ーを発生したプログラムのアドレスがOSより通知されな
い場合でも、目的プログラム上のエラーを発生したプロ
グラムアドレスに対応する原始プログラム上の行番号を
容易かつ確実に求めることができる。 〔実施例〕 本発明の実施例を、第2図及び第3図を参照して説明
する。第3図は、同実施例のエラー発生行番号探索処理
フローチャートである。 第2図で行われる実施例の各処理中、リンケージ処理
(処理S1)、エラー制御テーブルを目的プログラム内に
生成する処理(処理S2)、実行のために呼び出された目
的プログラムOBPGが自身の初期処理によりそのエラー制
御テーブル111のアドレスを実行単位制御テーブル14に
設定する処理(処理S3)までの各処理は、前述の〔作
用〕の項すなわち第2図で説明した処理S1〜処理S3と同
じである。なお、目的プログラムOBPGの先頭アドレスAD
Ps及び最終アドレスADPfは、目的プログラムOBPGのロー
ディング時にOSにより実行単位制御テーブル15に設定さ
れる。また、各リングアドレスは、呼ぶプログラムが呼
ばれるプログラムを呼ぶ直前と呼ばれるプログラムに制
御が渡った直後にそれぞれのプログラムが設定する。 以下、サブルーチンPSBRが実行途中でエラーを発生
し、アドレスADSj(復帰アドレスADSj+1)においてエラ
ー出力サブルーチンESBRに制御が移り、そこで行われる
処理S4及びS5の処理、すなわちエラー発生行番号探索処
理を、第3図を参照し、その処理ステップに従って説明
する。なお、第3図において、処理S41〜S44は処理S4
内部処理であり、処理S51及びS52は処理S5の内部処理で
ある。 処理S41 エラー出力サブルーチンESBRは、実行単位制御サブル
ーチンECSBRに実行単位制御テーブルアドレスの通知を
依頼する。実行単位制御サブルーチンECSBRは、その作
業域141にある実行単位制御テーブル15のアドレスを通
知する。 エラー出力サブルーチンESBRは、実行単位制御テーブ
ル15をサーチして、現在実行中で有効な目的プログラム
OBPGの先頭アドレスADPsと最終アドレスADPfを求める。 処理S42,S43,S44 エラー出力サブルーチンESBRは、その作業域131の復
帰アドレス域131Rより復帰アドレスADSj+1を取り出し
(処理S42)、このADSj+1が処理S41で求めた目的プログ
ラムOBPGの先頭アドレスADPsの最終アドレスADPfの範囲
内にあるか、すなわちADPs≦ADSj+1≦ADPfの条件を満足
するか判別する(処理S43)。満足した場合は、その復
帰アドレスがエラーの発生した目的プログラムOBPGのプ
ログラムアドレスとして求められる。 復帰アドレスADSj+1については、前記条件は満足され
ない。この場合は、エラー出力サブルーチンESBRのリン
クアドレス域131Lにあるリンクアドレスより、エラー出
力サブルーチンESBRの親プログラムであるサブルーチン
PSBRの作業域121を求める(処理S44)。 次に、サブルーチンPSBRの作業域121を現作業域とし
て、前述の処理S42及びS43の処理を行う。すなわち、そ
の復帰アドレス域121Rより復帰アドレスADPi+1を取り出
し(処理S42)、ADSs≦ADPi+1≦ADPfの条件を満足する
かを判別する(処理S43)。 ADPi+1の場合は、当然前記条件は満足するので、この
ADPi+1がエラーの発生した目的プログラムOBPGのプログ
ラムアドレスとして求められる。 なお、サブルーチンが複数個存在し、それらが親と子
プログラムの関係で順番にリンクされているときは、エ
ラー出力サブルーチンESBRを出発点として親となるサブ
ルーチンの作業域を順番にたどって行き、前述の条件が
満足される復帰アドレスが得られるまで、前述の処理S
42〜S44が繰り返される。 処理S51,S52 エラー出力サブルーチンESBRは、実行単位制御テーブ
ル15にあるエラー制御テーブルアドレスより、目的プロ
グラムOBPGのエラー制御テーブル111を求め、処理S43
求めた復帰アドレスADPi+1に合致するプログラムアドレ
スを求める(処理S51)。 復帰アドレスADPi+1に合致するプログラムアドレスが
求まると、それに対応する行番号より、エラーの発生し
た目的プログラム上のアドレスに対応する原始プログラ
ムSPG上のエラー発生行番号が求められる(処理S52)。 エラー出力サブルーチンESBRは、求められた原始プロ
グラムSPGのエラー発生行番号を画面に表示又はプリン
トアウトする。 以上1つの目的プログラムOBPGの実行過程でエラーが
発生した場合の対応する原始プログラムのエラー発生行
番号探索処理について説明したが、この目的プログラム
OBPGと並行して交互に実行されている他の目的プログラ
ムの実行過程にエラーが発生した場合も、同様にして対
応する原始プログラムのエラー発生行番号を探索するこ
とができる。 〔発明の効果〕 以上説明したように、本発明によれば、目的プログラ
ムの実行過程でエラーを発生したプログラムアドレスが
OSより通知されない場合でも、目的プログラム上のエラ
ーを発生したプログラムアドレスに対応する原始プログ
ラム上の行番号を容易かつ確実に求めることができる。
DETAILED DESCRIPTION OF THE INVENTION [Summary] The present invention relates to an error occurrence line number search method for finding an error occurrence line number in a source program when an error occurs in a target program execution process. An error occurrence line number search method in a high-level language that seeks an error occurrence line number in a source program when an error occurs in a target program execution process. Link each program that executes the target program according to the linkage rules, generate an error control table indicating the correspondence between the target program address of each line number of the source program, set the address in another table, and perform error processing. Error based on program return address Obtains the desired program address generation of, configured to determine the error number on the source program from the error control table. [Industrial Application Field] The present invention relates to a method for translating a source program described in a high-level language and, when an error occurs in the course of execution of a target program generated, converting an error occurrence line number in the corresponding source program. The present invention relates to an error occurrence line number search method in a desired high-level language. [Prior art] A source program written in a high-level language such as COBOL is
Translated into the target program and executed. If an error occurs during the execution of the target program generated by translating the source program, it is necessary to obtain the line number where the error occurred in the source program in order to perform debugging or the like. The value of the program counter when a program interrupt occurs due to an error, that is, the address of the program that is executing the target program is the operating system (OS)
If notified, the program address where the error occurred in the target program is obtained based on the address of the program, and the corresponding error occurrence line number can be obtained in the source program. However, high-level logic errors are not errors for the OS. Therefore, the OS is operating normally and no error notification is made. In this case, there is no other means for knowing the position on the target program where the error has occurred, and there has been no effective method for obtaining the error line number in the source program corresponding to the error. [Problems to be Solved by the Invention] In a system for executing a target program generated by translating a source program written in a high-level language, when an error occurs during the execution of the target program,
Conventionally, when the address of a program at the time of occurrence of a program interrupt due to an error is not reported from the OS of the system, the line number in the corresponding source program cannot be obtained. According to the present invention, when an address of a program in which an error has occurred in the course of execution of a target program is not notified from the OS, the error occurrence line number in the source program corresponding to the address in the target program in which the error has occurred can be easily and reliably determined. An object of the present invention is to provide an error occurrence line number search method in a high-level language that can be obtained. [Means for Solving the Problems] When an error occurs during the execution of a target program generated by translating a source program described in a high-level language, an error occurrence line number in the corresponding source program is obtained. An error occurrence line number search device in a high-level language sets a return address from a child program to a parent program when translating a source program, and sets a line address of each line of the parent program in the source program and a program address in the target program. Means for generating a target program having an error control table indicating the correspondence; means for generating an execution unit control table for managing a start address, an end address of the target program being executed, and an address of the error control table; When an error occurs during execution of an instruction, The determination whether or not the return address from the program to the parent program is included in the range between the start address and the end address of the execution unit control table is repeated for the higher-order program sequentially until the parent program becomes the target program, Means for searching the error control table for an error occurrence line number in the source program corresponding to the return address when the determination is YES. [Operation] The operation of the present invention will be described with reference to FIG. FIG. 1 shows the present invention in a processing flowchart. In process S 1, the return of each program for executing the object program, work area address of the parent program that called the child program is linked as seen from the child program side, from the parent program child work area of the child program Linkage processing is performed according to a linkage rule for setting an address. In process S 2, each translation unit of the source program, the process of generating in the object program error control table indicating the correspondence between each row number and the program address on that object program on the source program is executed. In process S 3, object program called for execution, processing for setting the address of the error control table to execution unit control table by the initial treatment of itself is performed. In process S 4, when an error occurs in the program during execution of the instructions of the target program, it obtains a program address in which the error occurred in the object program on the basis of the error processing in the return address in the work area 4 child program processing Is performed. In process S 5, determine the error control table object running programs from error control table address in the execution unit work area, than the program address and the error control table corresponding to the program address generating errors on the object program A process for obtaining an error occurrence line number of the source program to be executed is performed. Further, the operation of the present invention will be described with reference to the processing flow shown in FIG. In FIG. 2, SPG is a source program, line numbers 1, 2
And the like, instructions such as MOVE and ADD are described. Reference numeral 10 denotes a system memory in which a target program, various subroutines, and the like are stored, and a work area thereof and various control tables are provided. In the system memory 10, a target program area 11 stores target programs generated by translating the source program SPG for each translation unit. Reference numeral 111 denotes an error control table of the target program OBPG. The line number column stores the line number of the source program SPG, and the program address column stores the program address of the target program corresponding to the instruction of each line number (that is, Return address) is set as a text relative address or an absolute address. Note that the target program area 11 and its error control table 111 are provided for each target program generated for each translation unit.
PG's are shown. Reference numeral 12 denotes a subroutine area for storing a subroutine PSBR for executing one instruction of the target program OBPG. The subroutine PSBR has a relation of a child program when the target program OBPG is a parent program. 121 is the work area,
A link address area 121L and a return address area 121R are provided. 13 is an error output subroutine area for storing the error output subroutine ESBR.
When the subroutine PSBR is set as a parent, the subprogram PSBR is in a relation of a child program, and a process of searching for an error occurrence line number in the source program SPG corresponding to an address in the target program OBPG in which an error has occurred, and outputting it as an error message is performed.
A work area 131 is provided with a link address area 131 and a return address area 131R. The subroutine PSBR and the error output subroutine ES
Although a subroutine can be further inserted between BRs, the error occurrence line number search operation is common to each subroutine.
The number of subroutines is shown. An execution unit control subroutine area 14 stores an execution unit control subroutine ECSBR. The execution unit control subroutine ECSBR is a program that manages and controls a series of subroutine program systems which execute one execution unit of the target program and have a parent-child relationship. Reference numeral 141 denotes a work area of the execution unit control subroutine ECSBR, in which an address of an error control table of a currently executed, that is, a valid target program is set. Reference numeral 15 denotes an execution unit control table, which is acquired and managed by the execution unit control subroutine ECSBR, and stores the first ADP s , last address ADP f, and its error control table address of the currently executed effective target program OBPG. In the above configuration, the execution unit control subroutine ECSB
When R starts, the execution unit control subroutine ECSBR reads one of the target programs (target program OBPG) generated by translating the source program SPG into the target program area 11 of the memory system, and reads it. Let it run. The following processes are also controlled and executed by the execution unit control subroutine ECSBR, but will not be described unless necessary. Then, according to the linkage rules, the target program OB
Each program used by the PG is linked, and the address of the work area used by the parent program that called the child program is known from the child program side (process S 1 ). This processing is performed by storing the address of the work area of the parent program in the link address area of the child program of the program having the parent-child relationship. That is, the address of the work area 121 of the subroutine PSBR that is the parent program is stored in the link address area 131L of the error output subroutine ESBR. Similarly, the return address from the child program is set in a fixed position (that is, the return address area) in the work area of the parent program according to the linkage rules (process S 1 ). This process is performed by setting the address (that is, the return address) of the instruction following the instruction whose control has been transferred to the child program in the parent program in the return address area of the child program. Now, the subroutine whose target program OBPG is the child program with the address ADP i (return address is ADP i + 1 )
If control is transferred to PSBR, the return address ADP i + 1
Is set in the return address area 121L of the subroutine PSBR. Further, subroutine error occurs during execution pSBR, assuming that transfers control to error output subroutine ESBR its child program address ADS j, return address area 131R of the return address ADS j + 1 is error output subroutine ESBR Is set to On the other hand, each translation unit of source program SPG, error control table indicating the correspondence between the addresses of each column number and an object program source program is generated in the object program (process S 2). In FIG. 2, reference numeral 111 denotes an error control table of the target program OBPG. When the target program OBPG is called for execution,
By the initial processing of the target program OBPG itself, the address of the error control table 111 is stored in the execution unit control table 15.
(Processing S 3 ). As a result, the address of the currently valid error control table can be found in the execution unit in which a plurality of target programs are alternately executed. When control is transferred to the subroutine PSBR at the address ADP i during the execution of the target program OBPG, an error occurs during the execution of the subroutine PSBR, and control is transferred to the error output subroutine ESBR at the address ADS j (return address ADS j + 1 ). I do. The error output subroutine ESBR has its return address area
Based on the return address ADS j + 1 in 131R, a program address at the time of occurrence of an error in the target program OBPG (that is, a return ADP i + 1 ) is obtained (Process S 4 , the specific contents of this process S 4 [Examples] will be described later). When the program address of the target program OBPG at the time of occurrence of the error is obtained, the error control table 111 of the target program OBPG is obtained from the target program address set in the execution unit control table 15. Searches each program address in the error control table 111, when obtaining the program address that matches the return address ADP i + 1 obtained by the process S 4 described above, the corresponding line number from the errored purposes program error line number on the source program SPG corresponding to the address can be obtained (process S 5). As described above, even if the address of the program in which the error occurred during the execution of the target program is not notified from the OS, the line number in the source program corresponding to the program address in which the error occurred in the target program can be easily and reliably determined. Can be sought. Embodiment An embodiment of the present invention will be described with reference to FIGS. 2 and 3. FIG. FIG. 3 is a flowchart of an error occurrence line number search process according to the embodiment. During each processing of the embodiment shown in FIG. 2, the linkage processing (processing S 1 ), the processing of generating an error control table in the target program (processing S 2 ), and the target program OBPG called for execution is executed by itself. each processing until the processing by the initialization process to set the address of the error control table 111 to the execution unit control table 14 (processing S 3), the term ie processing S 1 ~ described in Figure 2 of the aforementioned [Function] it is the same as the process S 3. Note that the start address AD of the target program OBPG
P s and the end address ADP f is set in the execution unit control table 15 by the OS when loading the object program OBPG. Further, each ring address is set by each program immediately after control is transferred to a program called immediately before a program called by a program to be called. Hereinafter, an error subroutine PSBR is in the middle of execution, address ADS j (return address ADS j + 1) and the control is passed to the error output subroutine ESBR in the process of processing S 4 and S 5 to be done there, i.e. the error occurrence line The number search process will be described according to the processing steps with reference to FIG. In the third diagram, the process S 41 to S 44 is the internal processing of the processing S 4, the process S 51 and S 52 is the internal processing of the processing S 5. Processing S 41 error output subroutine ESBR requests the notification of the execution unit control table address to the execution unit control subroutine ECSBR. The execution unit control subroutine ECSBR notifies the address of the execution unit control table 15 in the work area 141. The error output subroutine ESBR searches the execution unit control table 15 and executes the currently executed effective target program.
Obtain the start address ADP s and the end address ADP f of the OBPG. Processing S 42, S 43, S 44 error output subroutine ESBR is the return address ADS j + 1 from the return address area 131R of the work area 131 is taken out (step S 42), the ADS j + 1 is determined by the processing S 41 object program OBPG head address ADP s last address ADP it is within the range of f, that determines whether to satisfy the conditions of ADP s ≦ ADS j + 1 ≦ ADP f ( process S 43). If satisfied, the return address is obtained as the program address of the target program OBPG in which the error has occurred. For the return address ADS j + 1 , the above condition is not satisfied. In this case, the subroutine that is the parent program of the error output subroutine ESBR is obtained from the link address in the link address area 131L of the error output subroutine ESBR.
Obtaining the work area 121 of pSBR (processing S 44). Then, the work area 121 of the subroutine PSBR as the current work area, the process of processing S 42 and S 43 described above. That is, the return address area 121R than removed return address ADP i + 1 (process S 42), and determines whether to satisfy the condition of ADS s ≦ ADP i + 1 ≦ ADP f ( process S 43). In the case of ADP i + 1 , the above condition is naturally satisfied.
ADP i + 1 is obtained as the program address of the target program OBPG in which the error has occurred. When there are a plurality of subroutines, which are linked sequentially in the relationship between the parent and the child program, the error output subroutine ESBR is used as a starting point, and the work area of the parent subroutine is sequentially followed. Until a return address that satisfies the condition is obtained,
42 to S 44 are repeated. Processing S 51, S 52 error output subroutine ESBR is from error control table address in the execution unit control table 15, obtains the error control table 111 of the object program OBPG, matches the return address ADP i + 1 obtained in the process S 43 The program address to be executed is obtained (process S51 ). When a program address matching the return address ADP i + 1 is obtained, an error line number in the source program SPG corresponding to the address in the target program where the error has occurred is obtained from the line number corresponding to the program address (processing S52). ). The error output subroutine ESBR displays or prints out the obtained error occurrence line number of the source program SPG on the screen. The error source line number search processing of the corresponding source program when an error occurs during the execution of one target program OBPG has been described above.
When an error occurs in the execution process of another target program that is being executed alternately in parallel with the OBPG, the error source line number of the corresponding source program can be searched for in the same manner. [Effects of the Invention] As described above, according to the present invention, the program address at which an error occurred during the execution of
Even if not notified from the OS, the line number in the source program corresponding to the program address where the error in the target program has occurred can be easily and reliably obtained.

【図面の簡単な説明】 第1図は本発明の基本構成の説明図、 第2図は本発明及び実施例における処理の流れ説明図、 第3図は同実施例のエラー発生行番号探索処理フローチ
ャートである。 第2図において、 10……システムメモリ、11……目的プログラム(OBPG)
域、111……エラー制御テーブル、12……サブルーチン
(PSBR)域、121……作業域、121L……リンクアドレス
域、121R……復帰アドレス域、13……エラー出力サブル
ーチン(ESBR)域、131……作業域、131L……リンクア
ドレス域、131R……復帰アドレス域、14……実行単位制
御サブルーチン(ECSBR)域、141……作業域、15……実
行単位制御テーブル。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is an explanatory diagram of a basic configuration of the present invention, FIG. 2 is an explanatory diagram of a processing flow in the present invention and an embodiment, and FIG. 3 is an error occurrence line number searching process of the embodiment. It is a flowchart. In FIG. 2, 10: System memory, 11: Object program (OBPG)
Area, 111 error control table, 12 subroutine (PSBR) area, 121 work area, 121L link address area, 121R return address area, 13 error output subroutine (ESBR) area, 131 ... work area, 131L ... link address area, 131R ... return address area, 14 ... execution unit control subroutine (ECSBR) area, 141 ... work area, 15 ... execution unit control table.

Claims (1)

(57)【特許請求の範囲】 1.高級言語で記述された原始プログラムを翻訳して生
成された目的プログラムの実行過程でエラーが発生した
場合に、対応する原始プログラム上のエラー発生行番号
を求める高級言語におけるエラー発生行番号探索装置に
おいて、 原始プログラムの翻訳時、子プログラムから親プログラ
ムへの復帰アドレスを設定すると共に、親プログラムの
原始プログラム上の各行番号と、目的プログラム上のプ
ログラムアドレスとの対応を示すエラー制御テーブルを
備える目的プログラムを生成する手段と、 実行中の目的プログラムの先頭アドレス、最終アドレ
ス、及びエラー制御テーブルのアドレスを管理する実行
単位制御テーブルを生成する手段と、 子プログラムの命令を実行中にエラーが発生したとき、
前記子プログラムから親プログラムへの復帰アドレスが
前記実行単位制御テーブルの先頭アドレスと最終アドレ
スとの範囲に含まれるか否かの判定を、親プログラムが
目的プログラムとなるまで順次上位のプログラムに対し
て繰返し、判定がYESとなったとき復帰アドレスに対応
する原始プログラム上のエラー発生行番号を前記エラー
制御テーブルから検索する手段と、 を有することを特徴とする高級言語におけるエラー発生
行番号探索装置。
(57) [Claims] When an error occurs during the execution of a target program generated by translating a source program written in a high-level language, an error-occurring line number search device in a high-level language that obtains an error-occurring line number in the corresponding source program A target program having a return address from a child program to a parent program at the time of translation of the source program, and an error control table indicating correspondence between each line number in the source program of the parent program and a program address in the target program. Means for generating an execution unit control table for managing the start address, the end address of the target program being executed, and the address of the error control table; and when an error occurs during execution of the instruction of the child program. ,
The determination as to whether or not the return address from the child program to the parent program is included in the range between the start address and the end address of the execution unit control table is sequentially performed on higher-order programs until the parent program becomes the target program. Means for repeatedly searching the error control table for an error occurrence line number in the source program corresponding to the return address when the determination is YES, and an error occurrence line number search device in a high-level language.
JP62318994A 1987-12-18 1987-12-18 Error occurrence line number search device in high-level languages Expired - Fee Related JP2820937B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62318994A JP2820937B2 (en) 1987-12-18 1987-12-18 Error occurrence line number search device in high-level languages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62318994A JP2820937B2 (en) 1987-12-18 1987-12-18 Error occurrence line number search device in high-level languages

Publications (2)

Publication Number Publication Date
JPH01161543A JPH01161543A (en) 1989-06-26
JP2820937B2 true JP2820937B2 (en) 1998-11-05

Family

ID=18105310

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62318994A Expired - Fee Related JP2820937B2 (en) 1987-12-18 1987-12-18 Error occurrence line number search device in high-level languages

Country Status (1)

Country Link
JP (1) JP2820937B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58129557A (en) * 1982-01-27 1983-08-02 Hitachi Ltd Debugging data collecting and processing method of program in data processing system
JPS58191047A (en) * 1982-04-30 1983-11-08 Fujitsu Ltd Detecting method of breakdown area of program

Also Published As

Publication number Publication date
JPH01161543A (en) 1989-06-26

Similar Documents

Publication Publication Date Title
EP0406602B1 (en) Method and apparatus for debugging parallel programs by serialization
US5182806A (en) Incremental compiler for source-code development system
JPH04247536A (en) Computer software compile system assisting discrimination of data type at time of execution of object
JPH0630066B2 (en) Table type language translation method
Teitelman Automated programmering: the programmer's assistant
JP2820937B2 (en) Error occurrence line number search device in high-level languages
EP0406028A2 (en) Incremental compiler for source code development system
JPH08194611A (en) Device for analyzing rang of influence caused by program correction
JPS6022373B2 (en) Program conversion mechanism for programmable control equipment
JPS5922140A (en) Interactive compiling system
JPH07311679A (en) Program generation system
EP0252229B1 (en) Apl-to-fortran translator
JPH10207738A (en) Language processing system
JPS61213935A (en) Step execution system for high-level language program
JPS58109947A (en) Simulator
JP3082767B2 (en) Translation list output control device
JPH11184680A (en) File editing method, method and device for developing program using the same, and storage medium
JP2751423B2 (en) Program debug processing method
JPH03179529A (en) Language translation system
JPH06314193A (en) Compilation method for structure drawing symbol notation list
JPH03271939A (en) Message transmission and translation processing system
JPH05143356A (en) Compiler device
JPH04270422A (en) Precompile processing system
JPH05216684A (en) Program execution device and execution method
JPH0240720A (en) Object program output instruction system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees