JPH04169941A - Debugging information output processing system - Google Patents

Debugging information output processing system

Info

Publication number
JPH04169941A
JPH04169941A JP2297412A JP29741290A JPH04169941A JP H04169941 A JPH04169941 A JP H04169941A JP 2297412 A JP2297412 A JP 2297412A JP 29741290 A JP29741290 A JP 29741290A JP H04169941 A JPH04169941 A JP H04169941A
Authority
JP
Japan
Prior art keywords
information
processing
source program
program
debugging
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
JP2297412A
Other languages
Japanese (ja)
Inventor
Hiroyasu Saikai
西海 弘恭
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP2297412A priority Critical patent/JPH04169941A/en
Publication of JPH04169941A publication Critical patent/JPH04169941A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To execute the processing at a high speed by generating a call instruction to an interrupt function processing part for debugging in the source level before object information of each statement in a source program. CONSTITUTION:A C language processing program 202 consists of an input part 204 which inputs source program information from an input file 201, a syntax analyzing part 205 which analyzes source program information, and an object output part 206 which generates and outputs an object program of the analyzed source program. Source program information is inputted from the input file 201 and is analyzed to generate object information, and object information including debugging information is outputted to a prescribed object file, and the call instruction to a prescribed debugging processing part is added before object information to an interrupt function in the source program included in object information. Thus, the debugging operation is simplified to shorten the operation time for execution.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明のデバッグ情報出力処理方式に関し、特にソース
レベルのデバッグを行う場合の言語処理プログラムのデ
バッグ情報出力処理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a debug information output processing method, and particularly relates to a debug information output processing method for a language processing program when performing source level debugging.

〔従来の技術〕[Conventional technology]

従来の言語処理プログラムのデバッグ情報出力処理方式
には二通りの方法がある。一つは、行番号情報のように
、ソースプログラムと直接結び付いた情報を出力する方
法であり、もう一つは、例えばスタックが使用可能であ
るか否かを調べるルーチンを呼び出す呼び出し命令のよ
うに、関数の先頭で機械語命令として生成する情報を出
力する方法である。
There are two conventional debug information output processing methods for language processing programs. One is to output information that is directly associated with the source program, such as line number information, and the other is to output information that is directly associated with the source program, such as a call instruction that calls a routine that checks whether the stack is available. , is a method of outputting information generated as machine language instructions at the beginning of a function.

前者の、ソースレベルデバッグのための情報である行番
号情報のように、機械語とは異なる情報は、ソースレベ
ルデバッグを行うときにデバッガが使用するもので1行
ごとのステップ実行を行う場合などに使用される。
Information that is different from machine language, such as the former line number information that is information for source level debugging, is used by the debugger when performing source level debugging, such as when step execution is performed line by line. used for.

後者の、関数の先頭でスタックが使用可能であるかを調
べるルーチンを呼び出す呼び出し命令のように、機械語
命令として生成する情報は、実行時のエラーが発生する
可能性がある場合やエラーの発生した場合等に、特殊な
処理ルーチンを呼び出したり、メツセージの出力や、エ
ラー処理等を行う場合に使用する。
The information generated as machine language instructions, such as the latter call instruction that calls a routine that checks whether the stack is available at the beginning of a function, is useful when an error may occur at runtime or when an error occurs. It is used to call special processing routines, output messages, handle errors, etc.

以下に、従来のソースレベルのデバッグのうち、割り込
み関数に対するデバッグの方法を説明する。
Below, a method for debugging an interrupt function among conventional source-level debugging will be explained.

割り込み関数は、ソースプログラムの流れに関係なく、
ハードウェア割り込みや、ソフトウェア割り込みが発生
した場合に呼び出される関係である。このため、通常の
関数のデバッグ方法のひとつであるステップ実行では、
タイミングが異なるためデバッグすることができないの
で、以下の手順でデバッグを行う。
Interrupt functions are used regardless of the flow of the source program.
This relationship is called when a hardware interrupt or software interrupt occurs. For this reason, in step execution, which is one of the normal methods of debugging functions,
Since the timing is different, debugging is not possible, so follow the steps below to debug.

(1)すべての割り込み関数のエントリ部に、ブレーク
ポイントを設定する。
(1) Set breakpoints in the entry sections of all interrupt functions.

(2)割り込みが発生し、割り込み関数の先頭で実行が
中断する。
(2) An interrupt occurs and execution is interrupted at the beginning of the interrupt function.

(3)割り込み関数のステップ実行を行い、デバッグを
行つ。
(3) Perform step execution of the interrupt function and debug it.

現在ては、テパイスの機能強化により割り込み要因の数
が増加しているため、それにあわせて割り込み関数の数
も増加している。また、すべての割り込み関数のエント
リ部へのブレークポイント設定のためのインサーキット
エミュレータとの通信量の増加のため、テバッカ使用者
へのコマンドの応対時間か増加しており、コマンドの応
対時間の高速化の要求かある。
Currently, the number of interrupt sources has increased due to the enhancement of Tepais' functionality, so the number of interrupt functions has also increased accordingly. In addition, due to the increase in the amount of communication with the in-circuit emulator for setting breakpoints in the entry sections of all interrupt functions, the response time for commands for Tebacker users has increased, and the response time for commands has become faster. There is a demand for change.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来の言語処理プログラムのデバッグ情報出力
処理方式においては、割り込み関数のデバッグを行う場
合、すべての割り込み関数のエントリ部へのブレークポ
イント設定を行わなければならない。また、割り込み関
数はプログラムの動作の流れが連続的でないため、ソー
スプログラムからは分岐先は予想できず、プログラムの
動作の流れを追うことはできない。また分岐した先でプ
ログラムが終了してしまうことも考えられるのて、デバ
ッグを最初からやり直さなければならなくなる。
In the conventional language processing program debug information output processing method described above, when debugging an interrupt function, breakpoints must be set at the entry portions of all interrupt functions. Furthermore, since the flow of program operations in interrupt functions is not continuous, branch destinations cannot be predicted from the source program, and the flow of program operations cannot be followed. It is also possible that the program will end at the branch point, and you will have to start debugging from the beginning again.

従って、従来の言語処理プログラムのデバッグ情報出力
処理方式には、デバッグの操作上、余分の時間を要し、
実行時の応対時間が多大になるという欠点がある。
Therefore, the conventional debugging information output processing method for language processing programs requires extra time for debugging.
The drawback is that it takes a lot of time to respond during execution.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のデバッグ情報出力処理方式は、言語処理プログ
ラムのデバッグ情報出力処理方式において、所定のファ
イルよりソースプログラム情報を入力する手段と、入力
される前記ソースプログラム情報を解析してオブジェク
ト情報を生成する手段と、デバッグ情報を含んだ前記オ
ブジェクト情報を所定のオブジェクトファイルに出力す
る手段と、前記オブジェクト情報に含まれるソースプロ
グラム中の割込み関数に対するオブジェクト情報の前に
、所定のデバッグ処理部に対する呼出し命令を付加る手
段と、を備えて構成される。
A debug information output processing method of the present invention is a debug information output processing method for a language processing program, which includes means for inputting source program information from a predetermined file, and generating object information by analyzing the input source program information. means for outputting the object information including debug information to a predetermined object file; and a means for outputting the object information including debug information to a predetermined object file; and means for adding.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は、本発明の一実施例におけるC言語処理プログ
ラムのオブジェクト出力部のフローチャートであり、第
2図は本実施例のシステム構成図である。
FIG. 1 is a flowchart of an object output section of a C language processing program in an embodiment of the present invention, and FIG. 2 is a system configuration diagram of the embodiment.

第2図において、C−言語処理プログラム202は、入
力ファイル201からソースプログラム情報を入力する
入力部204、入力したソースブロクラム情報分解析す
る構文解析部205、および構文解析されたソースプロ
グラムに対しオブジェクトプログラムを生成して出力す
るオブジェクト出力部206から構成されている。
In FIG. 2, the C-language processing program 202 includes an input unit 204 that inputs source program information from an input file 201, a parsing unit 205 that parses the input source block information, and a parsed source program. It is composed of an object output unit 206 that generates and outputs an object program.

第3図は前記入力フォイル201の内容である。左側の
数字は説明のために付けたソースプログラム中の行番号
である。
FIG. 3 shows the contents of the input foil 201. The numbers on the left are line numbers in the source program for explanation purposes.

第4図は、本発明の一実施例のオブジェクトファイル2
03の内容(オブジェクトプログラム)を示す情報説明
図である。
FIG. 4 shows an object file 2 according to an embodiment of the present invention.
03 is an information explanatory diagram showing the contents (object program).

第2図により全体の処理の流れを説明する。入力部20
4が入力ファイル201からプログラム情報を入力する
。次に構文解析部205でソースプログラムを解析する
。最後に、オブジェクト出力部206でオブジェクトプ
ログラムを生成し出力ファイル203に出力する。
The overall processing flow will be explained with reference to FIG. Input section 20
4 inputs program information from the input file 201. Next, a syntax analysis unit 205 analyzes the source program. Finally, the object output unit 206 generates an object program and outputs it to the output file 203.

ここで第1図のフローチャートの説明を行う。The flowchart shown in FIG. 1 will now be explained.

ただしC言語処理プログラムのオブジェクト出力の対象
となる関数と、文に着目して説明を行う。
However, the explanation will focus on functions and statements that are objects of object output of a C language processing program.

(1)ソースプログラムの解析処理により、入力ファイ
ル201の1行を解析する(ステップ101)。
(1) One line of the input file 201 is analyzed by source program analysis processing (step 101).

(2)(1)の処理の結果、オブジェクト出力の対象で
あるか否かを判定する。ソースプログラムの1行が宣言
やブロックの開始であれば、オブジェクト出力の対象で
はないのでステップ101の処理に戻り、次の′行の解
析を行う(ステップ1゜2)。
(2) As a result of the processing in (1), it is determined whether the object is to be output. If one line of the source program is the start of a declaration or block, it is not an object to be output, so the process returns to step 101 and the next ' line is analyzed (steps 1 and 2).

(3)ステップ103においては、ソースプログラムの
終了であるが否がを判定し、ソースプログラムが終了し
ていれば、処理は終了処理(ステップ104)へ移り終
了する。ソースプログラムが終了していなければ処理は
次のステップ105の処理へ移る。
(3) In step 103, it is determined whether the source program has ended or not. If the source program has ended, the process moves to end processing (step 104) and ends. If the source program has not ended, the process moves to the next step 105.

(4)ステップ105においては、ステップ101の処
理の結果、割り込み関数の始まりであれば、処理は割り
込み開数処理部の呼み出し命令出力処理(ステップ10
6)へ移る。割り込み関数処理部の呼び出し命令出力処
理(ステップ106)では、割り込み関数処理部の呼び
出し命令を出力する。
(4) In step 105, as a result of the processing in step 101, if it is the beginning of an interrupt function, the processing starts with the call instruction output processing of the interrupt open number processing section (step 10).
Move on to 6). In the interrupt function processing section call instruction output process (step 106), a call instruction for the interrupt function processing section is output.

(5)割り込み開数処理部の呼び出し命令を出力したあ
と、処理は関数内の文に対する機械語命令出力処理(ス
テップ107)へ移る。関数内の文に対する機械語命令
出力処理(ステップ1o7)では、関数内の文に対する
機械語命令を出力する。
(5) After outputting the call instruction for the interrupt open number processing unit, the process moves to machine language instruction output processing for the statement within the function (step 107). In the machine language instruction output process for a statement within a function (step 1o7), a machine language instruction for a statement within a function is output.

次に、第1図のフローチャートに従い、第2図のC言語
処理プログラム202が第3図に示すソースプログラム
と入力し、第4図に示すオブジェクトプログラムを出力
する処理を説明する。第4図のオブジェクトプログラム
は、簡略のため全体の構成のみを記述しである。また、
ソースプログラム情報の入力からオブジェクトプログラ
ム出力の全体の処理は、前記全体を処理の流れの説明ど
うりであるので省略して説明を行う。
Next, a process in which the C language processing program 202 of FIG. 2 inputs the source program shown in FIG. 3 and outputs the object program shown in FIG. 4 will be explained according to the flowchart of FIG. 1. In the object program shown in FIG. 4, only the overall configuration is described for the sake of brevity. Also,
The entire process from the input of source program information to the output of the object program is the same as the description of the process flow above, so the explanation will be omitted.

(1)ソースプログラムの解析処理(ステップ101)
により、第3図の1行目を解析する。オブジェクト出力
判定処理(ステップ102)により、この行に対してオ
ブジェクトは生成されないので、処理はソースプログラ
ムの解析処理(ステップ101)に移り、2行目の解析
を行う。
(1) Source program analysis processing (step 101)
The first line of FIG. 3 is analyzed by: Since no object is generated for this line in the object output determination process (step 102), the process moves to the source program analysis process (step 101) and analyzes the second line.

(2)2行目はオブジェクト出力判定処理(ステップ1
02〉により、オブジェクト出力対象と判定され、さら
に終了判定処理(ステップ103)により、ソースプロ
グラムの終了でないと判定されるので、処理は割込み関
数判定処理(ステップ105)へ移る。
(2) The second line is object output determination processing (step 1
02>, it is determined that the object is to be output, and furthermore, in the end determination process (step 103), it is determined that the source program has not ended, so the process moves to the interrupt function determination process (step 105).

(3)関数判定処理(ステップ105)で、2行目は割
り込み関数ではないと判定されるため、関数内の文に対
する機械語出力処理(ステップ1゜7)に処理が移る。
(3) In the function determination process (step 105), it is determined that the second line is not an interrupt function, so the process moves to machine language output processing for the statement within the function (step 1.7).

(4)関数内の文に対する機械語出力処理(ステップ1
07)により、第3図の4〜6行目に対する機械語を出
力する。これが第4図に関数前処理部402、関数内の
文に対する機械語命令403、関数後処理部404およ
びリターン命令405である。
(4) Machine language output processing for statements in functions (step 1
07), the machine language for lines 4 to 6 in FIG. 3 is output. These are a function preprocessing section 402, a machine language instruction 403 for a statement within the function, a function postprocessing section 404, and a return instruction 405 in FIG.

(5〉処理はソースプログラムの解析処理(ステップ1
01)に戻り、第3図の7行目を解析する。オブジェク
ト出力判定処理(ステップ′1゜2)により、この行に
対してオブジェクトは生成されないので、処理はソース
プログラムの解析処理(ステップ101〉に移り8行目
の解析を行う。
(5> Processing is source program analysis processing (step 1)
01) and analyze the 7th line in FIG. Since no object is generated for this line in the object output determination process (step 102), the process moves to the source program analysis process (step 101>) and analyzes the 8th line.

(6)8行目はオブジェクト出方判定処理(ステップ1
02)によりオブジェクト出力対象と判定され、さらに
終了判定処理(ステップ103)により、ソースプログ
ラムの終了ではないと判定されるので、処理関係判定処
理(ステップ1o5)へ移る。
(6) The 8th line is the object appearance determination process (step 1
02), it is determined that the object is to be output, and furthermore, in the end determination process (step 103), it is determined that the source program has not ended, so the process moves to the processing relationship determination process (step 1o5).

(7)関数判定処理(ステップ1o5)で8行目は割り
込み関数の始まりと判定されるため、割り込み関数処理
部の呼び出し命令出力処理(ステップ106)により、
割り込み関数処理部の呼び出し命令を出力する。これが
第4図の割り込み関係処理部の呼び出し命令401であ
る。
(7) In the function determination process (step 1o5), the 8th line is determined to be the beginning of the interrupt function, so the call instruction output process (step 106) of the interrupt function processing unit
Outputs a call instruction for the interrupt function processing section. This is the call instruction 401 of the interrupt-related processing section shown in FIG.

(8)次に関数内の文に対する機械語圧力処理(ステッ
プ107)により、文に対する機械語を出力する。これ
が第4図の関数前処理部402゜関数内の文に対する機
械語命令403.関数後処理部404およびリターン命
令405である。
(8) Next, the machine language pressure processing for the sentence within the function (step 107) is performed to output the machine language for the sentence. This is the function preprocessing unit 402 in FIG. 4. Machine language instructions 403 for statements within the function. These are a function post-processing unit 404 and a return instruction 405.

このようにして、第3図のソースプログラムに対して、
第4図のオブジェクトが生成される6次に、出力された
第4図のオブジェクトプログラムによって、ソースレベ
ルの割り込み関数のデバッグ方法を説明する。
In this way, for the source program in Figure 3,
6. The object shown in FIG. 4 is generated Next, a method for debugging a source level interrupt function will be explained using the output object program shown in FIG.

ソースデバッガでは、割り込み関数処理部にブレークポ
イントを設定して、被デバツグプログラムを実行する、
ハードウェア割り込みまたはソフトウェア割り込みによ
り割り込みが発生し、割り込み関数処理部で被デバツグ
プログラムの実行が移ったとき、ソースデバッガにより
、被デバツグプロクラムの動作は停止する。これにより
被デバツグプログラムのデバッグ中に、割り込み関数が
呼び出された場合でも、呼び出された関数の先頭で被デ
バッグプログラムの実行は停止するので、被デバツグプ
ログラムの動作の流れを追えなくなってしまったり、呼
び出された関数中で、被デバツグプログラムの実行が終
了してしまい、デバッグを最初からやり直さなければな
らなくなるとういことがなくなる。
With a source debugger, you can set a breakpoint in the interrupt function processing section and run the program to be debugged.
When an interrupt occurs due to a hardware interrupt or a software interrupt and the execution of the program to be debugged is transferred to the interrupt function processing section, the operation of the program to be debugged is stopped by the source debugger. As a result, even if an interrupt function is called while the debugged program is being debugged, the execution of the debugged program will stop at the beginning of the called function, making it impossible to follow the flow of the debugged program's operations. It would be a waste if the execution of the debugged program ended in a called function and the debugging had to be restarted from the beginning.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明は、ソースプログラム中の
各文に対するオブジェクト情報の前に、ソースレベルの
デバッグのため割り込み関数処理部に対する呼び出し命
令を生成することにより、すべての割り込み関数のエン
トリ部に、ブレークポイントを設定して実行するといっ
た手間もかがらなくなるばかりでなく、すべての割り込
み関数のエントリ部に、ブレークポイントを設定して実
行した場合に比べて、高速に実行が行なうことができる
という効果がある。
As explained above, the present invention generates a call instruction for the interrupt function processing section for source-level debugging before the object information for each statement in the source program, so that the entry section of all interrupt functions is This not only eliminates the hassle of setting and executing breakpoints, but also enables faster execution compared to setting breakpoints at the entry sections of all interrupt functions. effective.

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

第1図は本発明の一実施例におけるC言語プログラムの
オブジェクト出力処理のフローチャート、第2図は前記
実行例のシステム構成図、第3図は入力ファイルの内容
を示す図、第4図は前記実施例におけるオブジェクトフ
ァイルの内容を示す情報説明図である。 図において、101・・・ソースプログラムの解析、1
02・・・オブジェクト出力判定処理、103・・・終
了判定処理、104・・・終了処理、105・・・関係
判定処理、1’06・・・割込み関数処理部の読出し命
令出力処理、107・・・文に対する機械語命令出力処
理、201・・・入力ファイル、202・・・C言語処
理、203・・・オブジェクトファイル、204・・・
入力部、205・・・構文解析部、206・・・オブジ
ェクト出力部、401山割込み関数処理部の読出し命令
、402・・・関数前処理部、403・・・関数内の文
に対する機械語命令、404・・・関数後処理部、40
5・・・リターン命令。
FIG. 1 is a flowchart of object output processing of a C language program in an embodiment of the present invention, FIG. 2 is a system configuration diagram of the execution example, FIG. 3 is a diagram showing the contents of an input file, and FIG. It is an information explanatory diagram showing the contents of an object file in an example. In the figure, 101... Source program analysis, 1
02...Object output determination processing, 103...End determination processing, 104...End processing, 105...Relationship determination processing, 1'06...Read command output processing of interrupt function processing unit, 107. ...Machine language instruction output processing for sentences, 201...Input file, 202...C language processing, 203...Object file, 204...
Input section, 205...Syntax analysis section, 206...Object output section, 401 Interruption function processing section read instruction, 402...Function preprocessing section, 403...Machine language instruction for the statement within the function , 404...Function post-processing unit, 40
5...Return command.

Claims (1)

【特許請求の範囲】[Claims] 言語処理プログラムのデバッグ情報出力処理方式におい
て、所定のファイルよりソースプログラム情報を入力す
る手段と、入力される前記ソースプログラム情報を解析
してオブジェクト情報を生成する手段と、デバッグ情報
を含んだ前記オブジェクト情報を所定のオブジェクトフ
ァイルに出力する手段と、前記オブジェクト情報に含ま
れるソースプログラム中に割込み関数に対するオブジェ
クト情報の前に、所定のデバッグ処理部に対する呼出し
命令を付加する手段と、を備えることを特徴とするデバ
ッグ情報出力処理方式。
In a debug information output processing method for a language processing program, means for inputting source program information from a predetermined file, means for analyzing the input source program information to generate object information, and the object including the debug information. The present invention is characterized by comprising means for outputting information to a predetermined object file, and means for adding a call instruction for a predetermined debug processing unit before the object information for the interrupt function in the source program included in the object information. Debug information output processing method.
JP2297412A 1990-11-02 1990-11-02 Debugging information output processing system Pending JPH04169941A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2297412A JPH04169941A (en) 1990-11-02 1990-11-02 Debugging information output processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2297412A JPH04169941A (en) 1990-11-02 1990-11-02 Debugging information output processing system

Publications (1)

Publication Number Publication Date
JPH04169941A true JPH04169941A (en) 1992-06-17

Family

ID=17846173

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2297412A Pending JPH04169941A (en) 1990-11-02 1990-11-02 Debugging information output processing system

Country Status (1)

Country Link
JP (1) JPH04169941A (en)

Similar Documents

Publication Publication Date Title
US7761855B2 (en) Computer program product and system for altering execution flow of a computer program
JP2004164554A (en) Program execution monitoring device and method
JPH0748182B2 (en) Program error detection method
KR900018809A (en) Modular compiler with class independent parser and many class dependent parsers
JPS62113244A (en) Program test device
JP3196675B2 (en) Language processing method
JPH04169941A (en) Debugging information output processing system
JP4055197B2 (en) Device for analyzing procedures included in the program
JPH0353334A (en) Output processing system for debug information on language process program
JPS626260B2 (en)
JP2659366B2 (en) Debugging method and device
JPH0695910A (en) Interactive debugging control system for abnormality processing
JPS59202548A (en) Debugging device
KR0175469B1 (en) How to control the visibility of fill program variables
JPH0353335A (en) Compiler processing system
JPS6365542A (en) Debugging system
JPH0239332A (en) Software break system
JPH0358232A (en) Preprocessor calling system
JPH01274253A (en) Software break system
JPH03290739A (en) Dynamic analysis system for program
JPH03175539A (en) Debugging microprocessor
JPH0588878A (en) Lisp instruction executing system
JP2001147832A (en) Display system corresponding to source program
Parker Annotation-based program stepping
JPH04333146A (en) Program execution control system for debugging