JPH02191046A - Tracing system for program - Google Patents

Tracing system for program

Info

Publication number
JPH02191046A
JPH02191046A JP1012465A JP1246589A JPH02191046A JP H02191046 A JPH02191046 A JP H02191046A JP 1012465 A JP1012465 A JP 1012465A JP 1246589 A JP1246589 A JP 1246589A JP H02191046 A JPH02191046 A JP H02191046A
Authority
JP
Japan
Prior art keywords
program
instruction
machine language
address
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
JP1012465A
Other languages
Japanese (ja)
Inventor
Hidemasa Saito
齋藤 英雅
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 JP1012465A priority Critical patent/JPH02191046A/en
Publication of JPH02191046A publication Critical patent/JPH02191046A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To generate interruption only when a branch instruction does not exist and to improve processing speed by providing a means to know which row on a source program is presently executed from an address and row information. CONSTITUTION:A debugger 9 decodes the instruction of a machine language program (MP) 8 by a means 10 to decode the MP and it is decided by a deciding means 11 whether the decoded MP is the branch instruction or not. As the result of the decision, when the MP is the branch instruction, the instruction is reloaded to an interruption instruction to the debugger 9 by changing the MP in a memory. After that, the MP 8 is executed. On the other hand, when the MP is not the branch instruction, a value obtained by a means 12, which knows the instruction word length of the decoded MP, is added to an instruction storage address and according to an added result, it is known by a means 15 from the address and row information which row on the source program can be presently executed.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、利用者プログラムのデバッグを支援するプロ
グラムの追跡方式に関し、特に高速処理可能なプログラ
ムの追跡方式に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a program tracing method that supports debugging of a user program, and particularly to a program tracing method that can be processed at high speed.

(従来の技術) 従来、この種のプログラムの追跡方式は、メモリに記憶
されている機械語プログラムを1命令実行毎に、ソフト
ウェアあるいはハードウェア手段によってデバッガに割
り込みをかけることによってプログラム追跡を行うとい
った方式が採用されている。
(Prior Art) Conventionally, this type of program tracing method traces a machine language program stored in a memory by interrupting a debugger by software or hardware means every time an instruction is executed. method is adopted.

(発明が解決しようとする課題) 上述した従来のプログラムの追跡方式は、メモリに記憶
されている機械語1命令実行毎に、ソフトウェアあるい
はハードウェア手段によってデバッガに割り込み、プロ
グラムの追跡を行う方式であるため、1命令実行毎に分
岐したか否かを判別する必要があり、割り込みが1命令
実行毎に発生するため処理速度が遅いといった欠点があ
る。
(Problem to be Solved by the Invention) The conventional program tracing method described above is a method in which a debugger is interrupted by software or hardware means and the program is traced every time one instruction of machine language stored in memory is executed. Therefore, it is necessary to determine whether or not a branch has occurred every time one instruction is executed, and an interrupt occurs every time one instruction is executed, resulting in a slow processing speed.

(課題を解決するための手段) 本発明によるプログラム追跡方式は、翻訳プログラムに
は、利用者の記述したソースプログラムの各行が、生成
された機械語プログラムでは、どのアドレスに対応する
かといった行情報を出力する手段を備え、デバッガには
、メモリに記憶されている機械語プログラムをデコード
する手段と、デコードした機械語プログラムが分岐命令
であるか否かを判別する手段と、デコードした機械語プ
ログラムの命令語長を知る手段と、プログラムか停止し
た時点で、次に実行されるべきアドレスを知る手段と、
アドレスと、行情報から現在、ソースプログラム上、何
行目を実行しているかを知る手段とを備えて成る。
(Means for Solving the Problems) The program tracking method according to the present invention includes line information in the translation program, such as which address each line of the source program written by the user corresponds to in the generated machine language program. The debugger includes a means for decoding the machine language program stored in the memory, a means for determining whether the decoded machine language program is a branch instruction, and a means for outputting the decoded machine language program. a means of knowing the instruction word length of the program, a means of knowing the address to be executed next when the program stops,
It comprises a means for knowing which line in the source program is currently being executed from the address and line information.

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

第1図は本発明によるプログラム追跡方式の一実施例を
示す構成、機能ブロック図である。
FIG. 1 is a configuration and functional block diagram showing an embodiment of a program tracking system according to the present invention.

翻訳プログラム2は、ソースプログラム1を入力とし、
ソースプログラム1の翻訳を行い、目的プログラムを生
成すると同時に、行情報出力手段3によって、行情報4
が生成される。行情報4には、翻訳プログラム2が生成
したオブジェクトと、ソースプログラム1の各行との対
応づけを行う情報が格納される。行情報4は、さらに結
合編集プログラム5によって行情報群6となる。
Translation program 2 takes source program 1 as input,
At the same time as the source program 1 is translated and the target program is generated, the line information output means 3 outputs the line information 4.
is generated. The line information 4 stores information that associates objects generated by the translation program 2 with each line of the source program 1. The line information 4 is further processed into a line information group 6 by the combination editing program 5.

行情報群6は、行情報4を、結合編集プログラム5が生
成するロードモジュールに対応するようアドレスを変更
し、生成されるものである。
The line information group 6 is generated by changing the address of the line information 4 to correspond to the load module generated by the combined editing program 5.

デバッガ9か、会話型のデバッグを支援する場合には、
自らが情報処理装置7にロードされ、続いて、機械語プ
ログラム8、すなわちロードモジュールを情報処理装置
7にロードする。そこで、デバッガ9は、機械語プログ
ラム8の実行を監視し、デバッグ作業を支援する。
Debugger 9 or if you want to support interactive debugging,
The program itself is loaded into the information processing device 7 , and then the machine language program 8 , that is, the load module is loaded into the information processing device 7 . Therefore, the debugger 9 monitors the execution of the machine language program 8 and supports debugging work.

さて、デバッガ9は、機械語プログラムをデコードする
手段10によって、機械語プログラム8の命令レジスタ
の示す命令をデコードし、さらに、デコードした機械語
プログラムが分岐命令であるか否かを判別手段11によ
って判別する。判別の結果分岐命令の場合、メモリに記
憶されている機械語プログラムを変更する手段によって
、当該命令をデバッガ9への割り込み命令に書き換えた
後、機械語プログラム8を実行させる。その割り込み命
令まで実行すると、機械語プログラム8は停止し、デバ
ッガ9に対し割り込みを発生させるにこで、デバッガ9
は、次に実行される。べきアドレスを手段14によって
知る。続いて、このアドレスから、アドレスと行情報か
ら現在ソースプログラム上何行目を実行している1かを
知る手段15によって、ソースプログラム上の実行中性
を知る。
Now, the debugger 9 uses the machine language program decoding means 10 to decode the instruction indicated by the instruction register of the machine language program 8, and further uses the discriminating means 11 to determine whether or not the decoded machine language program is a branch instruction. Discern. If the result of the determination is a branch instruction, the instruction is rewritten into an interrupt instruction to the debugger 9 by a means for changing the machine language program stored in the memory, and then the machine language program 8 is executed. When the machine language program 8 is executed up to that interrupt instruction, the machine language program 8 stops and generates an interrupt to the debugger 9.
is executed next. The correct address is known by means 14. Subsequently, from this address, the execution neutrality of the source program is determined by the means 15 which determines which line of the source program is currently being executed from the address and line information.

一方、分岐命令でない場合には、デコードした機械語プ
ログラムの命令語長を知る手段12によって、デコード
した命令の命令語長を求め、その値を、デコードした命
令の格納されるアドレスに加算し、その結果から、アド
レスと行情報から現在ソースプログラム上何行目を実行
しているかを知る手段15によって、実行中性を知る。
On the other hand, if it is not a branch instruction, the means 12 for determining the instruction word length of the decoded machine language program calculates the instruction word length of the decoded instruction, adds that value to the address where the decoded instruction is stored, From the result, the neutrality of execution is determined by the means 15 which determines which line in the source program is currently being executed from the address and line information.

その後、続けてデコードを行う。この場合、実際のプロ
グラムの実行は行わず、分岐命令が発見されてから、続
けて、この部分のプログラムの実行を行う。
After that, decoding continues. In this case, the actual program is not executed, but after the branch instruction is discovered, this part of the program is executed.

(発明の効果) 以上説明したように本発明は、翻訳プログラム中には行
情報出力手段を設け、デバッガには、機械語プログラム
をデコードする手段と、デコードした機械語プログラム
が分岐命令であるか否かを判別する手段と、デコードし
た機械語プログラムの命令語長を知る手段と、メモリに
記憶されている機械語プログラムを変更する手段と、次
に実行されるべきアドレスを知る手段と、アドレスと行
情報から現在ソースプログラム上何行目を実行している
かを知る手段とを設けることにより、1命令実行毎では
なく、−分岐命令毎に分岐を判別すればよく、また分岐
命令が存在した時だけ割り込みが発生するため、処理速
度が早いといった効果がある。
(Effects of the Invention) As explained above, the present invention includes a means for outputting line information in a translated program, and a means for decoding a machine language program in a debugger, and means for determining whether the decoded machine language program is a branch instruction. means for determining the instruction word length of the decoded machine language program; means for changing the machine language program stored in memory; means for determining the address to be executed next; By providing a means for knowing which line in the source program is currently being executed from the line information, it is only necessary to determine the branch for each -branch instruction instead of for each execution of one instruction. Since an interrupt is generated only when the program is running, it has the effect of increasing processing speed.

【図面の簡単な説明】 第1図は本発明によるプログラム追跡方式の一実施例の
機能ブロック図である。 1・・・ソースプログラム、2・・・翻訳プログラム、
3・・・行情報出力手段、4・・・行情報、5・・・結
合編集プログラム、6・・・行情報群、7・・・情報処
理装置、8・・・機械語プログラム、9・・・デバッガ
、10・・・機械語プログラムをデコードする手段、1
1・・・デコードした機械語プログラムか分岐命令であ
るか否かを判別する手段、12・・・デコードした機械
語プログラムの命令語長を知る手段、13・・・メモリ
に記憶されている機械語プログラムを変更する手段、1
4・・・次に実行されるべきアドレスを知る手段、15
・・・アドレスと行情報から現在ソースグロダラム上何
行目を実行しているかを知る手段。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a functional block diagram of an embodiment of a program tracking method according to the present invention. 1... Source program, 2... Translation program,
3... Line information output means, 4... Line information, 5... Combined editing program, 6... Line information group, 7... Information processing device, 8... Machine language program, 9. ...Debugger, 10...Means for decoding machine language programs, 1
1... Means for determining whether the decoded machine language program is a branch instruction, 12... Means for knowing the instruction word length of the decoded machine language program, 13... Machine stored in memory Means for changing the language program, 1
4...Means for knowing the address to be executed next, 15
...Means to know which line is currently being executed on the source Grodarum from the address and line information.

Claims (1)

【特許請求の範囲】[Claims] 翻訳プログラムには、利用者の記述したソースプログラ
ムの各行が、生成された機械語プログラムでは、どのア
ドレスに対応するかといった行情報を出力する手段を備
え、デバッガには、メモリに記憶されている機械語プロ
グラムをデコードする手段と、デコードした機械語プロ
グラムが分岐命令であるか否かを判別する手段と、デコ
ードした機械語プログラムの命令語長を知る手段と、プ
ログラムが停止した時点で、次に実行されるべきアドレ
スを知る手段と、アドレスと、行情報から現在、ソース
プログラム上、何行目を実行しているかを知る手段とを
備えて成ることを特徴とするプログラムの追跡方式。
The translation program is equipped with a means for outputting line information such as which address each line of the source program written by the user corresponds to in the generated machine language program, and the debugger is equipped with a means for outputting line information stored in memory. A means for decoding a machine language program, a means for determining whether the decoded machine language program is a branch instruction, a means for knowing the instruction word length of the decoded machine language program, and a means for determining the length of the instruction word of the decoded machine language program. A program tracking method comprising means for knowing an address to be executed at the current time, and means for knowing which line in a source program is currently being executed based on the address and line information.
JP1012465A 1989-01-20 1989-01-20 Tracing system for program Pending JPH02191046A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1012465A JPH02191046A (en) 1989-01-20 1989-01-20 Tracing system for program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1012465A JPH02191046A (en) 1989-01-20 1989-01-20 Tracing system for program

Publications (1)

Publication Number Publication Date
JPH02191046A true JPH02191046A (en) 1990-07-26

Family

ID=11806113

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1012465A Pending JPH02191046A (en) 1989-01-20 1989-01-20 Tracing system for program

Country Status (1)

Country Link
JP (1) JPH02191046A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04289923A (en) * 1991-03-19 1992-10-14 Nec Corp Program converter

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63205740A (en) * 1987-02-20 1988-08-25 Fujitsu Ltd Program executing trace processing system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63205740A (en) * 1987-02-20 1988-08-25 Fujitsu Ltd Program executing trace processing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04289923A (en) * 1991-03-19 1992-10-14 Nec Corp Program converter

Similar Documents

Publication Publication Date Title
US6681280B1 (en) Interrupt control apparatus and method separately holding respective operation information of a processor preceding a normal or a break interrupt
KR970005021A (en) A data processor capable of executing two instructions simultaneously
JPH02191046A (en) Tracing system for program
JP3892873B2 (en) Programmable controller
JPH0581070A (en) Programmable controller and user program execution method in programmable controller
JP2653412B2 (en) How to set breakpoints
JP2653411B2 (en) How to set breakpoints
JP3105546B2 (en) Assembler symbol debug information processing method
JP2000250779A (en) Programmable controller
JPS63205740A (en) Program executing trace processing system
JPH04287231A (en) Microprocessor
JPH05108404A (en) Debugger system
KR0175469B1 (en) How to control the visibility of fill program variables
JPH0353322A (en) Information processor
JPH0259829A (en) Microcomputer
JPS63101966A (en) Vector processor
JPS6282439A (en) False trouble generating system
JPS6270947A (en) Control system for debug interruption
JPH0573356A (en) Debug back-up method
JPS63163543A (en) Information processor
JPH06250878A (en) Single step execution system for instruction
JPH06242942A (en) Source code level debugging device
JPH02161538A (en) Debugging mechanisms for information processor
JPH04264624A (en) Processor
JPH02234227A (en) Misalignment processing system