JPS61246845A - Program debugging method - Google Patents

Program debugging method

Info

Publication number
JPS61246845A
JPS61246845A JP60088120A JP8812085A JPS61246845A JP S61246845 A JPS61246845 A JP S61246845A JP 60088120 A JP60088120 A JP 60088120A JP 8812085 A JP8812085 A JP 8812085A JP S61246845 A JPS61246845 A JP S61246845A
Authority
JP
Japan
Prior art keywords
program
source code
test data
execution
flag 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.)
Pending
Application number
JP60088120A
Other languages
Japanese (ja)
Inventor
Uichiro Goto
後藤 卯一郎
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP60088120A priority Critical patent/JPS61246845A/en
Publication of JPS61246845A publication Critical patent/JPS61246845A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To apply debugging at the source program level by executing simulatingly a program at the source code level and outputting the number of times of execution of the line number of the executed source code to a counter of a flag table. CONSTITUTION:A data flow analysis program 6 sets a flag table 3 to the initial state and reads test data 4. The content of the read test data 4 is used and the program is executed simulatingly at the source code level according to the analysis result film 2, and after the simulating execution is conducted up to the end position of the program, the counter of the flag table 3 corresponding to the executed source line number is counted up. Whether or not the simulating execution is performed is checked on all test data 4 and when the execution is finished, the flag table is outputted.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、コンピュータプログラムのデバッグ方法に
係り、特にソースコードをオブジェクトにコンパイルす
ることなくテストデータの適正を判定することのできる
プログラムデバッグ方法に関するものである。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a method for debugging a computer program, and particularly to a method for debugging a program that can determine the suitability of test data without compiling source code into an object. It is something.

〔従来の技術〕[Conventional technology]

第4図a、bは例えば特開昭58−56049に示され
た従来のプログラムデバッグ方法を示し、第4図aは図
示しないホストマシン(仮想計算機)、又はターゲット
マシン(実計算機)上のプログラム処理内容を説明する
ための概念図、第4図すはターゲットマシン(図示せず
)上のプログラム実行内容を説明するための概念図であ
る。第4図aにおいて、1はソースコードファイル、7
はこの:/ −ス:7− トファイル1のソースコート
ヲコンパイルするコンパイラであり、ソースコードファ
イル1で書かれているソースコードによる計算機命令を
マシンコード(機械符号)に変換する機能を果たす。8
はコンパイラ7により翻訳され、出力されたオブジェク
トプログラム(目的プログラム)9はコンパイラ7によ
り作られたオブジェクトプログラム8の行番号に対応付
けられたフラグテーブルである。また、第4図すにおい
て、8,9は第4図aの同一符号のものと同一のもので
ある。
4a and 4b show a conventional program debugging method disclosed in, for example, Japanese Patent Laid-Open No. 58-56049, and FIG. 4a shows a program on a host machine (virtual computer) or target machine (actual computer), not shown. FIG. 4 is a conceptual diagram for explaining the contents of processing. FIG. 4 is a conceptual diagram for explaining the contents of program execution on a target machine (not shown). In Figure 4a, 1 is a source code file, 7
is a compiler that compiles the source code of source code file 1, and has the function of converting computer instructions based on the source code written in source code file 1 into machine code. 8
is translated by the compiler 7, and the output object program (object program) 9 is a flag table that is associated with the line numbers of the object program 8 created by the compiler 7. Further, in FIG. 4, numerals 8 and 9 are the same as those with the same reference numerals in FIG. 4a.

図中、4はプログラムの試験を行うためのテストデータ
、8aはオブジェクトプログラム8が実行状態になった
実行プログラムを示している。
In the figure, reference numeral 4 indicates test data for testing the program, and reference numeral 8a indicates an execution program in which the object program 8 is in an execution state.

次に、動作について説明する。コンパイラ7はソースコ
ードファイル1のソースコードをオブジェクトプログラ
ム8にコンパイルする際に、該オブジェクトプログラム
8の各シーケンス番号に対応したフラグテーブル9を作
成する。以上の処理は、オブジェクトプログラム8が実
際に動作するターゲットマシン上か、あるいはクロスコ
ンパイルシステムをもったホストマシン上で行われる。
Next, the operation will be explained. When the compiler 7 compiles the source code of the source code file 1 into the object program 8, it creates a flag table 9 corresponding to each sequence number of the object program 8. The above processing is performed on the target machine on which the object program 8 actually operates, or on a host machine equipped with a cross-compilation system.

次に、ターゲットマシン上で、テストデータ4を用い、
オブジェクトプログラム8を実行プログラム8aとして
テストランする際に、前記テストデータ4に従って、走
行したプログラムのシーケンス番号と対応するフラグテ
ーブル9にフラグを立て、前記フラグテーブル9の内容
に応じて前記テストデータ4の適正度を判別するように
している。
Next, on the target machine, using test data 4,
When performing a test run of the object program 8 as the execution program 8a, a flag is set in the flag table 9 corresponding to the sequence number of the run program according to the test data 4, and the test data 4 is set according to the contents of the flag table 9. We are trying to determine the suitability of

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来のプログラムデバッグ方法は、以上のようにソース
プログラムをコンパイルしてオブジェクトプログラムに
変換し、オブジェクトプログラムレベルで、デバッグを
行っているので、高級言語で書かれたプログラムの場合
に、オブジェクトプログラムレベルで実行したシーケン
ス番号が示されても、ソースプログラムとの対応付け、
及びテストデータの適正度を判定するのが困難であり、
又オブジェクトプログラムを実際に実行するため、実計
算機がないとデバッグできないという問題点があった。
In the conventional program debugging method, the source program is compiled and converted into an object program as described above, and debugging is performed at the object program level. Even if the executed sequence number is shown, the correspondence with the source program,
and it is difficult to judge the appropriateness of the test data,
Another problem is that since the object program is actually executed, debugging is not possible without a real computer.

この発明は上記のような問題点を解消するためになされ
たもので、ソースプログラムをオブジェクトプログラム
に変換することなく、ソースプログラムレベルでデバッ
グすることの可能なプログラムデバッグ方法を得ること
を目的とする。
This invention was made to solve the above-mentioned problems, and an object of the present invention is to obtain a program debugging method that allows debugging at the source program level without converting the source program into an object program. .

〔問題点を解決するための手段〕[Means for solving problems]

この発明に係るプログラムデバッグ方法は、ソースコー
ドをコンパイルしてオブジェクトコードを作成する代り
に、ソースコードの意味を解析し、その解析結果をファ
イルに蓄え、テストデータが与えられた時に前記解析結
果に従って、ソースプログラムの実行制御がどうなるか
を模擬的に実行し、実行したソースコードに対応するソ
ースコード行番号の実行回数カウンタを、カウントアツ
プするようにしたものである。
The program debugging method according to the present invention analyzes the meaning of the source code, stores the analysis result in a file, and uses the analysis result when test data is given, instead of compiling the source code to create an object code. , the execution control of the source program is executed in a simulated manner, and the execution count counter of the source code line number corresponding to the executed source code is counted up.

〔作用〕[Effect]

この発明におけるプログラムデバッグ方法は、ソースコ
ードレベルでプログラムを模擬実行し、この実行された
ソースコードの行番号の実行回数をフラグテーブルのカ
ウンタに出力するようにしたことにより、ソースコード
でテストデータの適正度が判定でき、判定が容易となる
The program debugging method according to the present invention simulates execution of the program at the source code level and outputs the number of executions of the executed source code line number to the counter of the flag table. Appropriateness can be determined and the determination becomes easy.

〔発去考実施例〕[Examination example]

以下、この発明の一実施例を図に基づいて説明する。第
1図は本発明におけるプログラム処理内容を説明するた
めの概念図である。図において、1はデバッグ対象とな
るソースプログラムを有するソースコードファイル、5
はこのソースコードファイル1のソースコードを解析す
るソースコード解析プログラム、2はこのソースコード
解析プログラム5により解析された結果を蓄える解析結
果ファイル、4はデバッグ対象プログラムを試験するだ
めのテストデータ、6は解析結果2からプログラムを模
擬的゛に実行するデータフロー解析プログラム、3はソ
ースコード解析プログラム5によってソースコード行番
号と対応付けられたフラグテーブル3であり、データフ
ロー解析プログラム6Kj りソースコードファイル1
のソースコードを実行する度毎に対応するフラグテーブ
ル3のカウンタ(図示せず)がカウントアツプされる。
Hereinafter, one embodiment of the present invention will be described based on the drawings. FIG. 1 is a conceptual diagram for explaining the contents of program processing in the present invention. In the figure, 1 is a source code file containing a source program to be debugged; 5 is a source code file containing a source program to be debugged;
is a source code analysis program that analyzes the source code of this source code file 1, 2 is an analysis result file that stores the results analyzed by this source code analysis program 5, 4 is test data for testing the program to be debugged, and 6 is a data flow analysis program that simulates the program from the analysis result 2, 3 is a flag table 3 associated with source code line numbers by the source code analysis program 5, and the data flow analysis program 6Kj is a source code file. 1
Each time the source code is executed, a corresponding counter (not shown) in the flag table 3 is counted up.

以下、ソースコード解析プログラム5と、データフロー
解析プログラム6の動作を第2図と第3図のフローチャ
ートで説明する。
The operations of the source code analysis program 5 and the data flow analysis program 6 will be explained below with reference to the flowcharts of FIGS. 2 and 3.

ソースコード解析プログラム5はソースコードファイル
1からソースコードを読み込み(処理11)、ソースコ
ードの字句を解析しく処理12)、解析した結果を解析
結果ファイル2に省き込む。(処理13)、また同時に
、ソースコードの行番号に対応したフラグテーブル3を
作成する。
The source code analysis program 5 reads the source code from the source code file 1 (processing 11), analyzes the source code lexically (processing 12), and writes the analyzed results into the analysis result file 2. (Process 13) At the same time, a flag table 3 corresponding to the line number of the source code is created.

次に、データフロー解析プログラム6はフラグテーブル
3t−初期状態(零クリア)にセットI、(処理21)
、テストデータ4を読み込む(処理22)。
Next, the data flow analysis program 6 sets the flag table 3t to the initial state (cleared to zero) (processing 21).
, the test data 4 is read (processing 22).

読み込んだテストデータ4内容を使って解析結果ファイ
ル2に従ってノースコードレベルで、プログラムを模擬
実行(処理23)し、プログラムの終了位置まで模擬実
行を行ったのち、実行したソース行番号に対応したフラ
グテーブル3のカウンタをカウントアツプしていく(処
理24)。そして、テストデータ4全てについて模擬実
行したがどうかを見て、まだ終了していなければ、上述
の処理22〜24をくり返し、ここで全てのテストデー
タ4について終了していれば(判定処理25)、フラグ
テーブル3を出力する(処理26)。
Using the read test data 4 contents, simulate execute the program at the north code level according to the analysis result file 2 (process 23), perform the simulated execution to the end position of the program, and then set the flag corresponding to the executed source line number. The counter of table 3 is counted up (processing 24). Then, it is checked whether the simulation execution has been performed for all test data 4, and if it has not been completed yet, the above-mentioned processes 22 to 24 are repeated, and if it has been completed for all test data 4 (judgment process 25) , outputs flag table 3 (process 26).

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

以上のように、この発明によれば、ソースコードレベル
でプログラムを模擬実行し、実行したソースコードの行
番号の実行回数を出力するようにしたので、ソースコー
ドをコンパイルしてオブジェクトに変換する必要がなく
なり、ソースコードレベルで、テストデータの適正度が
判定でき、判定が容易に行えるという効果があり、さら
にホスト計算機だけを使用して、プログラムの試験がで
きるので、ターゲット計算機で実行する前に十分試験を
行うことが可能であり、プログラムの信頼性を向上する
ことができるという効果がある。
As described above, according to the present invention, a program is simulated executed at the source code level, and the number of executions of the executed source code line number is output, so there is no need to compile the source code and convert it into an object. This has the effect that the appropriateness of the test data can be judged at the source code level, and the judgment can be easily made.Furthermore, since the program can be tested using only the host computer, it is possible to test the program before executing it on the target computer. It is possible to conduct sufficient tests, and the reliability of the program can be improved.

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

第1図はこの発明の一実施例によるプログラムデバッグ
方式のプログラム処理を示す概念図、第2図は第1図の
ソースコード解析プログラム5の処理手順を示すフロー
図、第3図は第1図のデータフロー解析プログラム6の
処理手順を示すフロー図、第4図は従来のプログラムデ
バッグ方法のプログラム処理を示す概念図である。 図において、1はソースコードファイル、4はテストデ
ータ、12はソースコード解析である。 なお、図中、同一符号は同一、または相当部分を示す。 第3i
FIG. 1 is a conceptual diagram showing the program processing of the program debugging method according to an embodiment of the present invention, FIG. 2 is a flow diagram showing the processing procedure of the source code analysis program 5 shown in FIG. 1, and FIG. FIG. 4 is a flowchart showing the processing procedure of the data flow analysis program 6, and FIG. 4 is a conceptual diagram showing the program processing of the conventional program debugging method. In the figure, 1 is a source code file, 4 is test data, and 12 is source code analysis. In addition, in the figures, the same reference numerals indicate the same or equivalent parts. 3rd i

Claims (1)

【特許請求の範囲】[Claims] ソースプログラムのソースコードを解析し、この解析結
果に従い、テストデータを用いてデータフローを解析し
、この解析による結果に従つて模擬的に前記ソースプロ
グラムを実行し、この実行毎に前記ソースコードに対応
するソースコード行番号のフラグテーブル上のカウンタ
をカウントアップし、このカウントアップされた前記カ
ウンタの内容に応じて前記テストデータの適正度を判別
するようにしたプログラムデバッグ方法。
Analyze the source code of the source program, analyze the data flow using test data according to the analysis results, execute the source program in a simulated manner according to the results of this analysis, and update the source code with each execution. A program debugging method that counts up a counter on a flag table of a corresponding source code line number, and determines the suitability of the test data according to the counted up contents of the counter.
JP60088120A 1985-04-24 1985-04-24 Program debugging method Pending JPS61246845A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60088120A JPS61246845A (en) 1985-04-24 1985-04-24 Program debugging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60088120A JPS61246845A (en) 1985-04-24 1985-04-24 Program debugging method

Publications (1)

Publication Number Publication Date
JPS61246845A true JPS61246845A (en) 1986-11-04

Family

ID=13934039

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60088120A Pending JPS61246845A (en) 1985-04-24 1985-04-24 Program debugging method

Country Status (1)

Country Link
JP (1) JPS61246845A (en)

Similar Documents

Publication Publication Date Title
US5132972A (en) Assembly language programming potential error detection scheme sensing apparent inconsistency with a previous operation
JPS6116100B2 (en)
US5857093A (en) Cross-compiled simulation timing backannotation
JP2017162130A (en) Hardware/software cooperative verification device and hardware/software cooperative verification method
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test
Zielasko et al. 3D Visualization of Symbolic Execution Traces
CN107145381A (en) The MIPS cpu test instruments of face the practice teaching
JPH08511370A (en) Software execution system
JPS61246845A (en) Program debugging method
JP4149047B2 (en) Simulator
JPH08263130A (en) Simulation system
JPH0258136A (en) Software test coverage measuring device
Berg Correctness of firmware-An overview
Cunha et al. A distributed debugging tool for a parallel software engineering environment
JPS6365542A (en) Debugging system
Almeida et al. Sound Test Case Generation for Concurrent Mobile Features
JPH01154256A (en) Detecting method for program error position
JPH06242943A (en) Source code level debugging device
JPS62235652A (en) Debugging method for program
JPH01307837A (en) Mpu simulation method and mpu simulator
CN114676064A (en) General test system and method for hardware language code
Lourenço et al. A Distributed Debugging Tool for a Parallel Software Engineering Environment
JPH02171938A (en) Device for supporting program development
JPH08314817A (en) Error analysis system
JPH02266440A (en) Dynamic debugging expert system