JP6471556B2 - DEBUG SUPPORT DEVICE AND DEBUG SUPPORT METHOD - Google Patents

DEBUG SUPPORT DEVICE AND DEBUG SUPPORT METHOD Download PDF

Info

Publication number
JP6471556B2
JP6471556B2 JP2015054535A JP2015054535A JP6471556B2 JP 6471556 B2 JP6471556 B2 JP 6471556B2 JP 2015054535 A JP2015054535 A JP 2015054535A JP 2015054535 A JP2015054535 A JP 2015054535A JP 6471556 B2 JP6471556 B2 JP 6471556B2
Authority
JP
Japan
Prior art keywords
variable
value
unit
node
program
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.)
Active
Application number
JP2015054535A
Other languages
Japanese (ja)
Other versions
JP2016173799A (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.)
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 JP2015054535A priority Critical patent/JP6471556B2/en
Publication of JP2016173799A publication Critical patent/JP2016173799A/en
Application granted granted Critical
Publication of JP6471556B2 publication Critical patent/JP6471556B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は、デバッグ支援装置及びデバッグ支援方法に関する。   The present invention relates to a debugging support apparatus and a debugging support method.

特許文献1及び2は、プログラムが異常終了した際の走行経路を推定するデバッグ支援装置を開示している。   Patent Documents 1 and 2 disclose a debugging support device that estimates a travel route when a program ends abnormally.

特許第3062266号明細書Japanese Patent No. 3062266 特許第4107470号明細書Patent No. 4107470

ところで、プログラムが異常終了した場合、その原因を推定する方法として、例えば、以下のような方法が知られている。即ち、第1に、異常終了した時点でのメモリの記憶内容を詳しく調べる。第2に、異常終了した時点で自動的に生成されたメモリダンプを取得し、そのメモリダンプの内容を調べる。   By the way, as a method for estimating the cause of the abnormal termination of the program, for example, the following methods are known. That is, first, the contents stored in the memory at the time of abnormal termination are examined in detail. Secondly, a memory dump automatically generated at the time of abnormal termination is acquired, and the contents of the memory dump are examined.

また、プログラム内で異常終了が発生しそうな箇所にトレースを埋込み、このトレースによって生成されたトレース情報に基いて、異常終了の原因を推定することも考えられる。しかし、プログラム内にトレースを埋め込むことによって異常終了の原因を推定するようにすると、第1に、そもそもトレースを埋め込んでいない箇所で異常終了が発生した場合はトレース情報を何ら取得することができず、第2に、トレースを埋め込むとシステムの性能低下を招くという問題がある。   It is also conceivable to embed a trace at a place where an abnormal end is likely to occur in the program and to estimate the cause of the abnormal end based on the trace information generated by this trace. However, if the cause of the abnormal termination is estimated by embedding the trace in the program, first, if an abnormal termination occurs at a place where the trace is not embedded, no trace information can be acquired. Second, there is a problem that embedding a trace causes a decrease in system performance.

一方で、前述のメモリダンプを取得し、そのメモリダンプの内容を調べる方法は、システムの性能低下を招かないので、異常終了の原因を推定するのに広く活用されている。メモリダンプの内容を参照すれば、複数の変数間の関係(ある変数を演算する際に、どの変数が参照されたか、といった関係)を調べながら、複数の変数の値の妥当性を確認したり、プログラムの走行経路を推定することで、どの部分で異常終了が発生したかを推定することができる。   On the other hand, the above-described method for obtaining a memory dump and examining the contents of the memory dump does not cause a decrease in system performance, and is widely used to estimate the cause of abnormal termination. By referring to the contents of the memory dump, you can check the validity of the values of multiple variables while checking the relationship between multiple variables (such as which variable was referenced when computing a variable) By estimating the travel route of the program, it is possible to estimate at which part the abnormal termination has occurred.

しかしながら、メモリダンプを利用して異常終了の原因を調べる方法は、あくまで手作業によるものであるから、異常終了の原因を特定するのに多大なる時間と労力を要する。   However, since the method of investigating the cause of abnormal termination using a memory dump is by hand only, it takes much time and effort to identify the cause of abnormal termination.

ここで、図21を参照し、上記特許文献1について詳しく説明する。上記特許文献1では、異常終了時の変数の値に基いて、プログラム中の式(分岐命令における条件式や代入)のうち成立している部分にアンダーラインを付すことで、トレース情報がなくとも利用者がプログラムの走行経路を推定できるようになっている。しかし、この方法では、異常終了時の変数の値に基づいているため、それよりも前に実行された式では、変数の値が異なっている場合もあることから、アンダーラインを付した式が実際には走行経路ではない場合もあり、利用者が誤解する場合がある。   Here, with reference to FIG. 21, the Patent Document 1 will be described in detail. In the above-mentioned Patent Document 1, even if there is no trace information, an underline is added to an established portion of an expression (conditional expression or assignment in a branch instruction) based on the value of a variable at the time of abnormal termination. The user can estimate the travel route of the program. However, since this method is based on the value of the variable at the time of abnormal termination, the value of the variable may be different in the expression executed before that. In fact, it may not be a travel route, and the user may misunderstand.

即ち、上記特許文献1では、例えば、図21のソースプログラムの29行目で異常終了した場合の変数bの値が1であった場合、bを使用している15行目の条件式が成立している(真である)とみなし、そこにアンダーラインを付している。しかし、異常終了時の変数bの値は、19行目のb=b+1を実行した結果の値に他ならず、19行目を実行した後の変数bの値は確かに1であるが、15行目の時点では変数bの値は0である。従って、15行目の条件式は実際には成立していない(真ではない)にもかかわらず、アンダーラインが付されることとなる。   That is, in Patent Document 1, for example, when the value of the variable b is 1 when the source program shown in FIG. 21 ends abnormally on line 29, the conditional expression on line 15 using b is established. Is underlined (underlined). However, the value of the variable b at the time of abnormal termination is nothing but the result of executing b = b + 1 on the 19th line, and the value of the variable b after executing the 19th line is certainly 1. At the time of the 15th line, the value of the variable b is 0. Therefore, although the conditional expression on the 15th line is not actually satisfied (not true), it is underlined.

また、特許文献2は、通常のプログラムのコンパイルに加え、逆方向プログラムを生成し、異常終了した時点でのメモリダンプを用いて逆方向プログラムを実行している。しかしながら、上記特許文献2の方法では、通常のプログラム実行中は常に、逆方向プログラムを実行するのに必要となるメモリの内容をログとして採取する必要がある。このことは、システムの性能低下を招き、現実的ではない。   Further, in Patent Document 2, in addition to normal program compilation, a backward program is generated, and the backward program is executed using a memory dump at the time of abnormal termination. However, in the method of Patent Document 2, it is necessary to always collect as a log the contents of the memory necessary for executing the backward program during normal program execution. This leads to system performance degradation and is not realistic.

本発明の目的は、システムの性能低下を招くことなく、プログラムの異常終了の原因を利用者が判断し易くするための技術を提供することにある。   An object of the present invention is to provide a technique for making it easier for a user to determine the cause of abnormal termination of a program without causing a decrease in system performance.

本願発明の第1の観点によれば、異常終了時のメモリダンプに基いて異常終了箇所から処理を逆方向に遡って変数の値を復元する復元命令を、ソースプログラムに基いて生成する、復元命令生成部と、異常終了時に前記復元命令を実行することで前記変数の値を復元する、変数値算出部と、を備えた、デバッグ支援装置が提供される。
本願発明の第2の観点によれば、異常終了時のメモリダンプに基いて異常終了箇所から処理を逆方向に遡って変数の値を復元する復元命令を、ソースプログラムに基いて生成するステップと、異常終了時に前記復元命令を実行することで前記変数の値を復元するステップと、を含む、デバッグ支援方法が提供される。
According to the first aspect of the present invention, based on a memory dump at the time of abnormal termination, a restoration instruction that restores the value of a variable by retroactively processing from the abnormal termination point is generated based on the source program. A debugging support device is provided, comprising: an instruction generation unit; and a variable value calculation unit that restores the value of the variable by executing the restoration instruction upon abnormal termination.
According to a second aspect of the present invention, a step of generating a restore instruction based on a source program for restoring a variable value by going back to the process from the abnormal end location based on a memory dump at the time of abnormal end; And a step of restoring the value of the variable by executing the restoration instruction at the time of abnormal termination.

本発明によれば、システムの性能低下を招くことなく、プログラムの異常終了の原因を利用者が判断し易くすることができる。   According to the present invention, it is possible for a user to easily determine the cause of abnormal termination of a program without degrading system performance.

デバッグ支援装置の機能ブロック図である。(第1実施形態)It is a functional block diagram of a debugging assistance apparatus. (First embodiment) デバッグ支援装置の機能ブロック図である。(第2実施形態)It is a functional block diagram of a debugging assistance apparatus. (Second Embodiment) トークン列の構造を示す図である。(第2実施形態)It is a figure which shows the structure of a token sequence. (Second Embodiment) 解析木の構造を示す図である。(第2実施形態)It is a figure which shows the structure of an analysis tree. (Second Embodiment) 解析木・プログラム位置対応表情報の構造を示す図である。(第2実施形態)It is a figure which shows the structure of parse tree / program position correspondence table information. (Second Embodiment) 変数アドレス対応表の構造を示す図である。(第2実施形態)It is a figure which shows the structure of a variable address corresponding table. (Second Embodiment) 参照関係の構造を示す図である。(第2実施形態)It is a figure which shows the structure of a reference relationship. (Second Embodiment) 再生命令の構造を示す図である。(第2実施形態)It is a figure which shows the structure of a reproduction | regeneration command. (Second Embodiment) 再生命令に使用する関数の一覧を示す図である。(第2実施形態)It is a figure which shows the list of the functions used for a reproduction | regeneration command. (Second Embodiment) 逆方向命令の構造を示す図である。(第2実施形態)It is a figure which shows the structure of a reverse direction command. (Second Embodiment) 逆方向命令生成の動作を示すフローチャートである。(第2実施形態)It is a flowchart which shows the operation | movement of a reverse direction command generation. (Second Embodiment) 異常終了箇所特定部の動作を示すフローチャートである。(第2実施形態)It is a flowchart which shows operation | movement of the abnormal termination location specific part. (Second Embodiment) 変数アドレス対応表の構造を示す図である。(第2実施形態)It is a figure which shows the structure of a variable address corresponding table. (Second Embodiment) 再生確認リストを示す図である。(第2実施形態)It is a figure which shows a reproduction | regeneration confirmation list. (Second Embodiment) 変数値算出部の動作を示すフローチャートである。(第2実施形態)It is a flowchart which shows operation | movement of a variable value calculation part. (Second Embodiment) 逆方向処理部の動作を示すフローチャートである。(第2実施形態)It is a flowchart which shows operation | movement of a reverse direction process part. (Second Embodiment) 再生処理部の動作を示すフローチャートである。(第2実施形態)It is a flowchart which shows operation | movement of a reproduction | regeneration processing part. (Second Embodiment) 条件式判定部の動作を示すフローチャートである。(第2実施形態)It is a flowchart which shows operation | movement of a conditional expression determination part. (Second Embodiment) 参照変数特定部の動作を示すフローチャートである。(第2実施形態)It is a flowchart which shows operation | movement of a reference variable specific | specification part. (Second Embodiment) 変数値取得部の動作の説明図である。(第2実施形態)It is explanatory drawing of operation | movement of a variable value acquisition part. (Second Embodiment) 特許文献1の説明図である。It is explanatory drawing of patent document 1. FIG. デバッガの画面表示の一例を示す図である。(第2実施形態)It is a figure which shows an example of the screen display of a debugger. (Second Embodiment) デバッガの画面表示の一例を示す図である。(第2実施形態)It is a figure which shows an example of the screen display of a debugger. (Second Embodiment) 画面表示部の動作を示すフローチャートである。(第2実施形態)It is a flowchart which shows operation | movement of a screen display part. (Second Embodiment)

(第1実施形態)
図1を参照して、第1実施形態を説明する。
(First embodiment)
The first embodiment will be described with reference to FIG.

デバッグ支援装置1は、異常終了時のメモリダンプに基いて異常終了箇所から処理を逆方向に遡って変数の値を復元する復元命令をソースプログラムに基いて生成する復元命令生成部2と、異常終了時に復元命令を実行することで変数の値を復元する変数値算出部3と、を備える。以上の構成によれば、異常終了時に、異常終了箇所から処理を逆方向に遡って変数の値を復元できるので、システムの性能低下を招くことなく、プログラムの異常終了の原因を利用者が判断し易くすることができる。   The debugging support device 1 includes a restoration instruction generation unit 2 that generates a restoration instruction based on a source program based on a memory dump at the time of abnormal termination, and restores the value of a variable by tracing back the process from the abnormal termination point. And a variable value calculation unit 3 that restores the value of the variable by executing a restoration command at the end. According to the above configuration, at the time of abnormal termination, the value of the variable can be restored by going back from the abnormal termination location, so that the user can determine the cause of abnormal termination of the program without degrading system performance. Can be made easier.

(第2実施形態)
以下、図面を参照して、第2実施形態を説明する。
(Second Embodiment)
The second embodiment will be described below with reference to the drawings.

先ず、第2実施形態の概要を説明する。第2実施形態の目的は、プログラムの処理から可能な限り変数の値を、処理の逆方向に逆方向命令または再生命令を実行することにより復元し、条件分岐を正しく判断し、プログラムの走行経路の推定の確実性を向上させること、及び、プログラムが異常終了する原因となった変数が、どの変数により設定及び導出されているかの情報を画面に表示されるソースプログラム上に利用者が識別できるように表示することで、異常終了の原因調査を効率化する技術を提供することにある。   First, the outline of the second embodiment will be described. The purpose of the second embodiment is to restore the value of the variable as much as possible from the processing of the program by executing a backward command or a playback command in the reverse direction of the processing, correctly determine the conditional branch, and run the program The user can identify on the source program displayed on the screen the information on which variable that caused the abnormal termination of the program is set and derived. By displaying in this way, it is intended to provide a technique for improving the cause investigation of abnormal termination.

そこで、第2実施形態では、異常終了時のメモリダンプのみから、異常終了した場所から処理を逆方向に遡り、復元可能な場合にその時点での変数の値を算出及び表示し、また、プログラムの走行経路を表示する。さらには、異常終了の直接の原因となった変数に関係する変数(導出や演算のもとにした変数など)をソース中に識別表示することで、異常終了の原因究明の作業に貢献する。   Therefore, in the second embodiment, from only the memory dump at the time of abnormal termination, the process is traced backward from the location where the abnormal termination was completed, and when the restoration is possible, the value of the variable at that time is calculated and displayed, and the program The travel route of is displayed. Furthermore, by identifying and displaying in the source the variables related to the variable that directly caused the abnormal termination (such as variables derived or derived), it contributes to the work of investigating the cause of the abnormal termination.

図22には、第2実施形態のデバッガの画面表示の一例を示している。異常終了した場所を二重の矢印(⇒)で表示し(この例では29行目)、その関数を呼び出している場場所を矢印(→)で表示し(この例では20行目)、走行した経路の行を下線で表示する。また、異常終了の直接の原因となった変数に関係する変数(導出や演算のもとにした変数や参照している変数)には、ハッチングをつけて表示する。図22に示すように、デバッガは、変数の値を表示することができる。即ち、デバッガは、19行目で左辺の変数bの値(“1”)や、右辺の変数bの値(“0”)を表示することができる。   FIG. 22 shows an example of the screen display of the debugger of the second embodiment. The location of the abnormal end is displayed with a double arrow (⇒) (in this example, line 29), and the location where the function is called is displayed with an arrow (→) (in this example, line 20). The line of the selected route is underlined. In addition, variables related to variables that directly cause abnormal termination (variables derived or calculated and variables that are referenced) are displayed with hatching. As shown in FIG. 22, the debugger can display the value of the variable. That is, the debugger can display the value of the variable b on the left side (“1”) and the value of the variable b on the right side (“0”) on the 19th line.

第2実施形態は、変数の値を復元することができない場合があるため、そのことを利用者に示すこともできる。図23のプログラムソースは、19行目の処理が図22のプログラムソースと異なる。この場合、15行目での変数bの値は復元できないため、bの値を表示すると不確定と表示される。また、変数bの値が不確定であるため、15行目のif文の条件式の真偽がわからず、真の処理を通過したかどうかを判断できないため、真であった場合に通過する走行経路には点線下線が付されている。このように、変数bの値が不確定の場合は、利用者にそのことがわかるようにしている。   In the second embodiment, the value of the variable may not be restored, and this can be shown to the user. The program source in FIG. 23 is different from the program source in FIG. In this case, since the value of the variable b on the 15th line cannot be restored, the value b is displayed as indeterminate. In addition, since the value of the variable b is indeterminate, the true / false of the conditional expression of the if statement on the 15th line is not known, and it cannot be determined whether or not the true processing has been passed. The travel route is underlined with a dotted line. As described above, when the value of the variable b is indeterminate, the user knows this.

メモリダンプのみから、処理を逆方向に遡り変数の値を復元できるのは、(1)未初期化変数を初期設定する場合、(2)初期化済み変数の内容を上書きする場合、(3)初期化済みメモリを解放する場合、のうちの(1)及び(2)である。   The value of the variable can be restored from the memory dump only in the reverse direction. (1) When initializing an uninitialized variable, (2) When overwriting the contents of an initialized variable, (3) When releasing the initialized memory, (1) and (2).

(1)
この場合、未初期化の値に戻すのではなく、未初期化状態に戻ったことをデバッガに通知すればよい。
(1)
In this case, instead of returning to the uninitialized value, it is only necessary to notify the debugger that the state has returned to the uninitialized state.

(2)
(2)のうち、処理を逆方向に遡り変数の値を復元できるのは、(2−1)可逆性演算である場合、及び、(2−2)上書きにより失われるデータを再度計算して再生できる場合、である。
(2)
Among (2), it is possible to go back in the reverse direction and restore the value of the variable. (2-1) Reversible calculation and (2-2) Recalculate data lost by overwriting If it can be played.

(2−1)
例えば、変数の値を1だけ増やす演算は、可逆性演算である。なぜなら、その演算後の変数の値から1減らす演算を行うことにより、変数の値を演算前の状態に復元することができるからである。
(2-1)
For example, an operation that increases the value of a variable by 1 is a reversible operation. This is because the value of the variable can be restored to the state before the operation by performing an operation of subtracting 1 from the value of the variable after the operation.

(2−2)
上書きにより失われたデータを計算する時に使用したデータがまだ変更されずに残っている場合、上書きにより失われたデータを再度計算して再生することができる。例えば、A = B + C(変数Aに変数Bと変数Cの和を代入する)という演算に関して言えば、変数Aの値が失われても、変数Bと変数Cの値がまだ残っているならば、変数Bと変数Cの和を再度計算することにより失われたデータを復元することができる。
(2-2)
If the data used when calculating the data lost due to overwriting still remains unchanged, the data lost due to the overwriting can be calculated again and reproduced. For example, regarding the operation A = B + C (assigning the sum of variable B and variable C to variable A), even if the value of variable A is lost, the value of variable B and variable C still remains Then, the lost data can be restored by recalculating the sum of variable B and variable C.

上記(2−1)に従って、コンパイラは、可逆性演算の場合はデバッガで逆の演算を実行できるように逆方向命令を生成する。   In accordance with the above (2-1), in the case of a reversible operation, the compiler generates a backward instruction so that the reverse operation can be executed by the debugger.

また、上記(2−2)に従って、コンパイラは、可逆性の有無にかかわらず、デバッガで同一命令を再度実行できるように再生命令を生成し、この再生命令を解析木のノードに登録する。   Further, according to the above (2-2), the compiler generates a reproduction instruction so that the debugger can execute the same instruction again regardless of the presence or absence of reversibility, and registers this reproduction instruction in the node of the analysis tree.

デバッガは、異常終了した処理の場所(アドレス)から、利用者が指定したソースの行まで、通常プログラムが処理される順とは逆に遡り、コンパイラが出力した解析木をたどり、変数値算出部により変数の値を復元する。変数を復元できた場合は、解析木のノードの評価結果に“確定”(復元済み)と復元した変数の値を格納し、復元できない場合は、“不確定”(復元不可)であることを格納する。   The debugger traces the analysis tree output by the compiler from the location (address) of the abnormally terminated processing to the source line specified by the user in the reverse order of processing, and the variable value calculation unit To restore the value of the variable. If the variable can be restored, “determined” (restored) and the value of the restored variable are stored in the evaluation result of the node of the analysis tree. If the variable cannot be restored, it is “indeterminate” (unrecoverable). Store.

処理を逆に遡る際の条件式の判定は、条件式判定部が行う。まず、変数の値を復元し、再生命令に必要な変数が全て復元できている場合は、再生命令を実行する。再生命令の結果により真偽が明らかになると、if文の真偽のどちらの処理を通過したかも判明する。再生命令に必要な変数のうち、1個でも不確定の変数が存在する場合は、条件式の判定結果も不確定となる。   The conditional expression determination unit performs the determination of the conditional expression when going back to the process. First, the value of the variable is restored, and when all the variables necessary for the reproduction command have been restored, the reproduction command is executed. When the authenticity is revealed by the result of the reproduction command, it is also determined which of the processes of the if statement passed. If at least one of the variables required for the playback command is indeterminate, the result of the conditional expression is also indeterminate.

異常終了した箇所を行単位ではなく、その行に書かれている変数、式のレベルで特定するために、コード生成部は、解析木をもとにマシン命令を生成するとともに、ソース行−解析木のアドレス−プログラム位置(該当するソース行をマシン命令にした場合の先頭位置)の対応表(解析木・プログラム位置対応表)を出力する。さらに、解析木のノードに、1行又は複数行のマシン命令から構成される場合があるため、各ノードに対応するプログラム位置を解析木のノードに格納する。   The code generator generates machine instructions based on the parse tree and the source line-analysis in order to identify the abnormal end not at the line level but at the level of the variable or expression written on that line. A correspondence table (analysis tree / program position correspondence table) of the address of the tree and the program position (the top position when the corresponding source line is a machine instruction) is output. Furthermore, since the analysis tree node may be composed of one or more lines of machine instructions, the program position corresponding to each node is stored in the analysis tree node.

デバッガは、異常終了したアドレス(プログラム位置)から、まずは、解析木・プログラム位置対応表を参照して、ソース行の位置、および、解析木のノードのアドレスを求める。デバッガは、その解析木のノードを基点に配下のノードのアドレスを参照し、異常終了したアドレスと一致するノードを探し、変数、式のレベルで異常終了した場所を特定する。   The debugger first obtains the position of the source line and the address of the node of the analysis tree by referring to the analysis tree / program position correspondence table from the abnormally terminated address (program position). The debugger refers to the address of the subordinate node based on the node of the analysis tree, searches for a node that matches the abnormally terminated address, and identifies the location where the abnormal termination has occurred at the variable or expression level.

変数の導出や演算のもとにした変数の参照関係を示すために、コンパイラの参照関係生成部は、解析木を参照し、左辺の変数(被参照変数)と右辺の変数(参照変数)を関連付けて参照関係として出力する。デバッガの参照変数特定部は、ある変数が、どの変数から導出されているかを調べるために、この参照関係から被参照変数を検索し、被参照変数に関連付けられている参照変数を求める。求めた参照変数を今度は被参照変数から検索し、この被参照変数に関連付けられている参照変数を求める。デバッガは、これを繰り返すことにより順次、参照変数を得ていく。   In order to show the variable reference relationship based on the derivation or operation of the variable, the compiler's reference relationship generation unit refers to the parse tree and determines the variable on the left side (referenced variable) and the variable on the right side (reference variable). Correlate and output as a reference relationship. The reference variable specifying unit of the debugger searches a referenced variable from this reference relationship to find a reference variable associated with the referenced variable in order to examine which variable a certain variable is derived from. This time, the obtained reference variable is searched from the referenced variable, and the reference variable associated with the referenced variable is obtained. The debugger obtains reference variables sequentially by repeating this.

図2に示すように、デバッグ支援装置200は、ソースプログラム120を翻訳しオブジェクトコードであるプログラム131を生成するコンパイラ100と、生成したプログラム131による処理の流れやプログラム131で使用している変数の値を確認するデバッガ150と、を備える。   As shown in FIG. 2, the debugging support apparatus 200 translates the source program 120 and generates a program 131 that is an object code, the processing flow by the generated program 131, and the variables used in the program 131. And a debugger 150 for checking the value.

コンパイラ100は、ソース読み込み部102と、字句解析部103と、構文解析部104と、意味解析部105と、参照関係生成部106と、コード生成部107と、コード出力部108と、制御部101と、を有する。   The compiler 100 includes a source reading unit 102, a lexical analysis unit 103, a syntax analysis unit 104, a semantic analysis unit 105, a reference relationship generation unit 106, a code generation unit 107, a code output unit 108, and a control unit 101. And having.

ソース読み込み部102は、ソースプログラム120を読み込む。   The source reading unit 102 reads the source program 120.

字句解析部103は、ソース読み込み部102が読み込んだソースプログラム120を、プログラミング言語の構成単位である字句に分解し、その字句をリスト化したトークン列情報121を生成する。   The lexical analysis unit 103 decomposes the source program 120 read by the source reading unit 102 into lexical phrases that are constituent units of a programming language, and generates token string information 121 that lists the lexical phrases.

構文解析部104は、トークン列情報121をもとに文法の解析を行い、木構造のデータ構造として解析木情報122(解析木)を作成する。   The syntax analysis unit 104 analyzes the grammar based on the token string information 121 and creates parse tree information 122 (parse tree) as a data structure of a tree structure.

意味解析部105は、解析木情報122をもとに、ソースプログラム120に記述されている文や変数の型がプログラミング言語の文法に合致しているかどうかをチェックする。   The semantic analysis unit 105 checks whether the sentence and variable types described in the source program 120 match the grammar of the programming language based on the parse tree information 122.

参照関係生成部106は、変数の代入の際に参照している変数は何か、関数呼び出しの際に呼び出された関数へ引数として渡される変数は何か、の関係を示す参照関係情報128を生成する。   The reference relationship generation unit 106 stores reference relationship information 128 indicating the relationship between what variable is referred to when assigning a variable and what variable is passed as an argument to the function called when the function is called. Generate.

コード生成部107は、解析木情報122をもとにオブジェクトコードを生成する。コード生成部107は、復元命令生成部109と、解析木・プログラム位置対応表生成部113と、変数アドレス対応関係生成部114と、を有する。   The code generation unit 107 generates an object code based on the analysis tree information 122. The code generation unit 107 includes a restoration instruction generation unit 109, an analysis tree / program position correspondence table generation unit 113, and a variable address correspondence generation unit 114.

復元命令生成部109は、異常終了時のメモリダンプ170から処理を遡り、変数の値を復元するための命令(復元命令)及び情報を出力する。   The restoration command generation unit 109 traces the processing from the memory dump 170 at the time of abnormal termination, and outputs a command (restoration command) and information for restoring the value of the variable.

解析木・プログラム位置対応表生成部113は、ソースプログラムの行がプログラムのどの位置に配置されたのか、さらに解析木のどのノードに該当するのかの対応関係を示す解析木・プログラム位置対応表情報129を出力し、解析木のノードに該当する部分がプログラムのどの位置に配置されたのかを解析木のノードのプログラム位置情報126に出力する。   The analysis tree / program position correspondence table generation unit 113 is an analysis tree / program position correspondence table information indicating a correspondence relationship between which position of the source program row is arranged in the program and which node of the analysis tree corresponds. 129 is output, and the position of the program corresponding to the node of the analysis tree is output to the program position information 126 of the node of the analysis tree.

変数アドレス対応関係生成部114は、プログラムで使用される変数の型とサイズとアドレスとをもつ変数アドレス対応表情報130を出力し、解析木の変数のノードに変数アドレス対応表の該当する番号を変数アドレス対応表番号情報127に出力する。   The variable address correspondence generation unit 114 outputs variable address correspondence table information 130 having the type, size, and address of the variables used in the program, and assigns the corresponding number in the variable address correspondence table to the variable node of the parse tree. Output to the variable address correspondence table number information 127.

コード出力部108は、コード生成部107が生成したオブジェクトコードをプログラム131として出力する。   The code output unit 108 outputs the object code generated by the code generation unit 107 as a program 131.

制御部101は、ソース読み込み部102と字句解析部103と構文解析部104と意味解析部105と参照関係生成部106とコード生成部107とコード出力部108を制御する。   The control unit 101 controls the source reading unit 102, the lexical analysis unit 103, the syntax analysis unit 104, the semantic analysis unit 105, the reference relationship generation unit 106, the code generation unit 107, and the code output unit 108.

復元命令生成部109は、逆方向命令生成110(逆方向命令生成部)と、再生命令生成111(逆方向命令生成部)と、を有する。復元命令は、逆方向命令と再生命令を含む。   The restoration command generation unit 109 includes a reverse command generation 110 (reverse command generation unit) and a reproduction command generation 111 (reverse command generation unit). The restoration command includes a backward command and a playback command.

逆方向命令生成110は、解析木のノードの処理が可逆の場合に、その処理とは逆の処理をそのノードの逆方向命令情報123に格納する。   When the processing of the node of the parse tree is reversible, the reverse direction instruction generation 110 stores a process opposite to the process in the reverse direction instruction information 123 of the node.

再生命令生成111は、解析木のノードと同じ処理をそのノードの再生命令情報124に格納する。   The reproduction command generation 111 stores the same processing as the node of the analysis tree in the reproduction command information 124 of the node.

復元命令生成部109が第2実施形態の特徴的な一つの部分である。通常のコンパイラでは、順方向の命令のみを生成し、プログラムに出力するだけであるのに対し、本第2実施形態のコンパイラでは、順方向の命令をプログラムに出力することに加えて、順方向の命令、逆方向の命令を解析木のノードに出力する。これらの出力情報は、本第2実施形態のデバッガを使用して、異常終了時のメモリダンプから処理を遡り変数の値を復元するために使用される。詳細については後述する。   The restoration command generation unit 109 is one characteristic part of the second embodiment. In a normal compiler, only a forward instruction is generated and output to a program. In the compiler according to the second embodiment, in addition to outputting a forward instruction to a program, a forward direction is generated. And reverse instructions are output to the node of the analysis tree. These pieces of output information are used to recover the value of the variable by tracing the process from the memory dump at the time of abnormal termination using the debugger of the second embodiment. Details will be described later.

また、参照関係生成部106も本第2実施形態の特徴的な一つの部分である。通常のコンパイラでは参照関係は出力しない。出力した参照関係は、本第2実施形態のデバッガで、直接の原因となった処理が参照している変数をデバッガで表示しているソースプログラム上で利用者が識別できるような印をつけて表示するために使用される。   The reference relationship generation unit 106 is also a characteristic part of the second embodiment. The normal compiler does not output the reference relationship. The output reference relation is marked so that the user can identify the variable referenced by the process that caused the direct cause in the debugger in the second embodiment on the source program displayed in the debugger. Used to display.

さらには、解析木・プログラム位置対応表生成部113や変数アドレス対応関係生成部114も本第2実施形態の特徴的な部分であり、それらが出力する解析木・プログラム位置対応表情報129、プログラム位置情報126、変数アドレス対応表番号情報127は、本第2実施形態のデバッガで、異常終了箇所の処理を特定し、処理を遡るために使用される。   Furthermore, the analysis tree / program position correspondence table generation unit 113 and the variable address correspondence generation unit 114 are also characteristic parts of the second embodiment. The position information 126 and the variable address correspondence table number information 127 are used by the debugger of the second embodiment to identify the abnormal end processing and trace the processing.

デバッガ150は、ソース読み込み部152と、コンパイラ出力情報読み込み部153と、データアクセス部154と、異常終了箇所特定部163と、条件式判定部155と、変数値算出部156と、変数値取得部164と、参照変数特定部159と、ソースプログラム編集部160と、画面表示部161と、利用者コマンド入力・解析部162と、制御部151と、を有する。   The debugger 150 includes a source reading unit 152, a compiler output information reading unit 153, a data access unit 154, an abnormal end location specifying unit 163, a conditional expression determining unit 155, a variable value calculating unit 156, and a variable value acquiring unit. 164, a reference variable specifying unit 159, a source program editing unit 160, a screen display unit 161, a user command input / analysis unit 162, and a control unit 151.

ソース読み込み部152は、デバッグの対象とするソースプログラム120を読み込む。   The source reading unit 152 reads the source program 120 to be debugged.

コンパイラ出力情報読み込み部153は、コンパイラ100が出力したトークン列情報121と解析木情報122と参照関係情報128と解析木・プログラム位置対応表情報129と変数アドレス対応表情報130とプログラム131を読み込む。   The compiler output information reading unit 153 reads the token string information 121, the parse tree information 122, the reference relation information 128, the parse tree / program position correspondence table information 129, the variable address correspondence table information 130, and the program 131 output by the compiler 100.

データアクセス部154は、異常終了時に生成されたメモリダンプ170を読み込む。   The data access unit 154 reads the memory dump 170 generated at the abnormal end.

異常終了箇所特定部163は、異常終了した場所を特定する。   The abnormal end location specifying unit 163 specifies a location where the abnormal end has occurred.

条件式判定部155は、異常が発生した場所から処理を遡り、条件分岐する処理で、条件式に使用されている変数の値を復元し、条件式の真偽の判定を行う。   The conditional expression determination unit 155 restores the value of the variable used in the conditional expression by performing a conditional branching process after tracing the process from the place where the abnormality occurred, and determines whether the conditional expression is true or false.

変数値算出部156は、逆方向処理部157と、再生処理部158と、を有する。変数値算出部156は、復元命令を実行することで、変数の値を復元する。復元命令は、逆方向命令と再生命令を含む。   The variable value calculation unit 156 includes a backward processing unit 157 and a reproduction processing unit 158. The variable value calculation unit 156 restores the value of the variable by executing a restoration instruction. The restoration command includes a backward command and a playback command.

逆方向処理部157は、参照したい変数がある処理の場所で、その変数の値が逆方向命令で復元できるかどうかを判断し、復元できる場合は逆方向命令を実行する。   The backward processing unit 157 determines whether the value of the variable can be restored by the backward instruction at the processing location where there is a variable to be referred to. If the variable can be restored, the backward processing unit 157 executes the backward instruction.

再生処理部158は、逆方向処理部157で変数の値を復元できない場合に、その変数の値が再生命令で復元できるかどうかを判断し、復元できる場合は再生命令を実行する。   When the backward processing unit 157 cannot restore the value of the variable, the playback processing unit 158 determines whether the value of the variable can be restored by the playback command, and executes the playback command if it can be restored.

変数値算出部156は、復元した変数の値を解析木に格納する。   The variable value calculation unit 156 stores the restored variable value in the analysis tree.

データ領域情報172は、メモリダンプ170からデータ領域部分だけを複写したデータ領域の情報であり、変数値算出部156と条件式判定部155により、処理を遡りながら変数の値を参照または変更される。   The data area information 172 is data area information obtained by copying only the data area portion from the memory dump 170, and the variable value calculation unit 156 and the conditional expression determination unit 155 refer to or change the value of the variable while tracing back the processing. .

変数値取得部164は、変数値算出部156により復元された変数の値を解析木から取得する。   The variable value acquisition unit 164 acquires the value of the variable restored by the variable value calculation unit 156 from the analysis tree.

参照変数特定部159は、参照関係情報128をもとに、異常終了の直接の原因となった処理が参照している変数を特定する。   Based on the reference relationship information 128, the reference variable specifying unit 159 specifies a variable that is referenced by the process that directly caused the abnormal termination.

ソースプログラム編集部160は、条件式判定部155の真偽の判定結果によりどの処理を通過したのか、および、参照変数特定部159により特定された変数を、画面に表示されるソースプログラム上に利用者が識別できる方法でソースプログラムの文字の表示属性を編集する。   The source program editing unit 160 uses which processing has passed according to the true / false determination result of the conditional expression determination unit 155 and the variable specified by the reference variable specifying unit 159 on the source program displayed on the screen. Edit the display attributes of the characters in the source program in a way that the user can identify.

画面表示部161は、ソースプログラム120をソースプログラム編集部160により指定された表示属性に基いて表示する。画面表示部161は、復元された変数の値をソースプログラム120と共に表示する。   The screen display unit 161 displays the source program 120 based on the display attribute specified by the source program editing unit 160. The screen display unit 161 displays the restored variable values together with the source program 120.

利用者コマンド入力・解析部162は、キーボードやマウス等の入力装置からデバッガ150への指示を解析する。   The user command input / analysis unit 162 analyzes instructions from the input device such as a keyboard and a mouse to the debugger 150.

制御部151は、ソース読み込み部152とコンパイラ出力情報読み込み部153とデータアクセス部154と異常終了箇所特定部163と条件式判定部155と変数値算出部156と変数値取得部164と参照変数特定部159とソースプログラム編集部160と画面表示部161と利用者コマンド入力・解析部162とを制御する。   The control unit 151 includes a source reading unit 152, a compiler output information reading unit 153, a data access unit 154, an abnormal end location specifying unit 163, a conditional expression determining unit 155, a variable value calculating unit 156, a variable value acquiring unit 164, and a reference variable specifying. Control unit 159, source program editing unit 160, screen display unit 161, and user command input / analysis unit 162.

参照関係生成部106と復元命令生成部109と解析木・プログラム位置対応表生成部113は、通常のコンパイラにはない。   The reference relation generation unit 106, the restoration instruction generation unit 109, and the parse tree / program position correspondence table generation unit 113 are not included in a normal compiler.

また、異常終了箇所特定部163と条件式判定部155と変数値算出部156と逆方向処理部157と再生処理部158と参照変数特定部159は、通常のデバッガにはない。   Further, the abnormal end location specifying unit 163, the conditional expression determining unit 155, the variable value calculating unit 156, the backward processing unit 157, the reproduction processing unit 158, and the reference variable specifying unit 159 are not included in a normal debugger.

以下、参照関係生成部106、復元命令生成部109、解析木・プログラム位置対応表生成部113、トークン列情報121、解析木情報122を詳細に説明する。   Hereinafter, the reference relationship generation unit 106, the restoration command generation unit 109, the parse tree / program position correspondence table generation unit 113, the token string information 121, and the parse tree information 122 will be described in detail.

図3を参照するとトークン列の構造を示している。字句解析部103が出力するトークン列の中には、
(a)予約語、数値、識別子等の文法規則を番号としてあらわしたトークンid
(b)ソースプログラム中の行位置
(c)行中の文字位置
(d)トークンの長さ
(e)トークン
を格納する。このひとかたまりが、リスト化されて連なっている。
FIG. 3 shows the structure of the token string. Among the token strings output by the lexical analyzer 103,
(A) Token id representing grammar rules such as reserved words, numerical values, and identifiers as numbers
(B) Line position in source program (c) Character position in line (d) Token length (e) Token is stored. This group is linked in a list.

図4を参照すると解析木の構造を示している。まず、図4の左上の図を参照すると、例として、“b > 0”の比較式の解析木を示している。構文を表している解析木に、プログラムの生成、さらには本実施形態の特徴である異常終了時のメモリダンプから、停止した処理から逆に遡って条件の判定や変数の値を復元するための情報を加え持つ解析木のノードは、図4の左下の図に示す構造を持つ。解析木のノードは、
(a)構文(構文の種類をあらわす)
(b)トークン列アドレス(このノードに該当するトークン列の部分の先頭のアドレス)
(c)トークン列数
(d)逆方向命令
(e)再生命令
(f)評価結果格納アドレス
(g)プログラムの位置
(h)子ノードの個数
(i)子ノードのアドレス
を格納し、末端が定数や変数の場合には、
(j)型
(k)変数アドレス対応表のNo.
(l)定数の値
を格納する。
FIG. 4 shows the structure of an analysis tree. First, referring to the upper left diagram of FIG. 4, as an example, an analysis tree of a comparison expression of “b> 0” is shown. In order to restore condition values and variable values back to the stopped processing from program generation and memory dump at abnormal termination, which is a feature of this embodiment, to the parse tree representing the syntax The node of the analysis tree having information added has the structure shown in the lower left diagram of FIG. The node of the parse tree is
(A) Syntax (represents the type of syntax)
(B) Token string address (the first address of the token string corresponding to this node)
(C) Number of token strings (d) Reverse instruction (e) Replay instruction (f) Evaluation result storage address (g) Program position (h) Number of child nodes (i) Address of child nodes For constants and variables,
(J) Type (k) No. of variable address correspondence table
(L) Store the constant value.

図4の右下の図は、“b > 0”の比較式の解析木の構造を示している。   The lower right diagram in FIG. 4 shows the structure of the analysis tree of the comparison expression “b> 0”.

構文解析部104は(a)(b)(c)(h)(i)(l)を設定し、復元命令生成部109は(d)(e)を設定し、解析木・プログラム位置対応表生成部113が(g)を設定し、条件式判定部155と変数値算出部156とが(f)を設定する。意味解析105が(j)を設定し、変数アドレス対応関係生成部114が(k)を設定する。   The parsing unit 104 sets (a), (b), (c), (h), (i), and (l), the restoration instruction generation unit 109 sets (d) and (e), and the analysis tree / program position correspondence table The generation unit 113 sets (g), and the conditional expression determination unit 155 and the variable value calculation unit 156 set (f). The semantic analysis 105 sets (j), and the variable address correspondence generation unit 114 sets (k).

図5を参照すると、解析木・プログラム位置対応表生成部113が出力する解析木・プログラム位置対応表情報129の構造を示している。解析木・プログラム位置対応表情報129には、ソースプログラムの行に対応する解析木のノードのアドレスとプログラムの位置を相対アドレスで示したものの対応を格納する。コード生成部107は、解析木を参照し、コードを生成しながら、ソースプログラムの1行毎にその行の最初の解析木のノードのアドレスとプログラム位置を解析木・プログラム位置対応表生成部113に渡し、解析木・プログラム位置対応表生成部113は、解析木のノードのアドレスとプログラム位置をソースプログラムの行位置とともに、解析木・プログラム位置対応表に出力する。また、コード生成部107は、解析木のノード毎に生成したプログラムの位置と解析木のノードのアドレスを解析木・プログラム位置対応表生成部113に渡し、解析木・プログラム位置対応表生成部113は、その解析木のノードのプログラム位置126にプログラム位置を出力する。   Referring to FIG. 5, the structure of the analysis tree / program position correspondence table information 129 output from the analysis tree / program position correspondence table generation unit 113 is shown. The analysis tree / program position correspondence table information 129 stores a correspondence between the address of the node of the analysis tree corresponding to the line of the source program and the position of the program indicated by a relative address. The code generation unit 107 refers to the analysis tree and generates the code, and for each line of the source program, the address and program position of the node of the first analysis tree in that line and the program position are analyzed. The analysis tree / program position correspondence table generation unit 113 outputs the address of the analysis tree and the program position to the analysis tree / program position correspondence table together with the line position of the source program. Also, the code generation unit 107 passes the position of the program generated for each node of the analysis tree and the address of the node of the analysis tree to the analysis tree / program position correspondence table generation unit 113, and the analysis tree / program position correspondence table generation unit 113. Outputs the program position to the program position 126 of the node of the analysis tree.

これにより、異常終了したプログラムのアドレスから、1行中のどの処理、あるいはどの変数参照で異常が発生したかを詳細に特定することができる。   Thereby, it is possible to specify in detail which process in one line or which variable reference caused the abnormality from the address of the abnormally terminated program.

図6を参照すると、変数アドレス対応関係生成部114が出力する変数アドレス対応表130の構造を示している。変数アドレス対応表130には、変数名、変数の型、変数のサイズ、データ領域内で変数が割り付けられる相対アドレスを格納する。コード生成部107は、解析木を参照し、コードを生成しながら、変数のある解析木のノードのアドレスを変数アドレス対応関係生成部114に渡し、変数アドレス対応関係生成部114は、当該変数のデータ領域内に割り付けるための相対アドレスを算出し、変数名と型とサイズとともに、変数アドレス対応表に出力する。また、変数アドレス対応関係生成部114は、受け取った解析木のノードの変数アドレス対応表No.127に、変数アドレス対応表のNo.を出力する。   Referring to FIG. 6, the structure of the variable address correspondence table 130 output from the variable address correspondence generation unit 114 is shown. The variable address correspondence table 130 stores variable names, variable types, variable sizes, and relative addresses to which variables are allocated in the data area. The code generation unit 107 refers to the parse tree and generates the code while passing the address of the node of the parse tree with the variable to the variable address correspondence generation unit 114. The variable address correspondence generation unit 114 The relative address to be allocated in the data area is calculated and output to the variable address correspondence table together with the variable name, type and size. In addition, the variable address correspondence generation unit 114 receives the variable address correspondence table No. No. 127 of the variable address correspondence table. Is output.

これにより、変数値算出部156は、解析木のノードからデータ領域172の変数の値を参照することができる。   Thereby, the variable value calculation unit 156 can refer to the value of the variable in the data area 172 from the node of the analysis tree.

図7を参照すると、参照関係生成部106が出力する参照関係128の構造を示している。参照関係128には、主に代入式の左辺の変数である被参照変数の情報と主に代入式の右辺の変数である参照変数の情報が格納される。関数の引数として、呼び出された関数に渡される場合は、仮引数が被参照変数、実引数が参照変数である。被参照変数と参照変数の情報はともにソースファイル名、関数名、変数名、ソースプログラム内の行番号、トークン列の該当するトークン列のアドレス、変数名をあらわしているトークン列の数から構成される。図7内のトークン列アドレスは、実際には当該変数のトークン列のアドレスであるが、便宜上、該当するトークンの文字列で示す。参照関係生成部106は、解析木を参照し、左辺の変数を被参照変数の情報として出力する。その後、解析木を探索し、右辺の情報を参照変数として出力する。参照変数が複数ある場合、変数名を格納する場所に、複数の変数名を格納する。関数の引数の場合も同様である。   FIG. 7 shows the structure of the reference relationship 128 output from the reference relationship generation unit 106. In the reference relationship 128, information on a referenced variable that is mainly a variable on the left side of the assignment expression and information on a reference variable that is a variable on the right side of the assignment expression are mainly stored. When passed as a function argument to a called function, the dummy argument is a referenced variable and the actual argument is a reference variable. Both the referenced variable and the reference variable information are composed of the source file name, function name, variable name, line number in the source program, the address of the corresponding token string of the token string, and the number of token strings that represent the variable name. The Although the token string address in FIG. 7 is actually the address of the token string of the variable, it is indicated by the character string of the corresponding token for convenience. The reference relationship generation unit 106 refers to the parse tree and outputs the variable on the left side as information on the referenced variable. Thereafter, the parse tree is searched, and information on the right side is output as a reference variable. When there are a plurality of reference variables, a plurality of variable names are stored in a location where the variable names are stored. The same applies to function arguments.

図8を参照すると、再生命令生成111で作成される再生命令124の構造を示している。再生命令124は、解析木のノード内の再生命令へのポインタから指し示す。再生命令は関数(x,y)で表し、関数の種類を表す関数No.とxパラメータを表す解析木中のxのノードアドレスとyパラメータを表す解析木中のyのノードアドレスから構成される。図9に再生命令に使用する関数の一覧を示す。それぞれの関数のNo.が割り付けられている。例えば、x+yのような加算の場合は、add(x,y)関数で同等な加算を実現する。また、図8を参照すると、例えば、b=b+1の再生命令の例を示している。b+1は加算であるため、図9の関数一覧のadd(x,y)が同等な関数であり、add(b,1)と表すことができる。再生命令の関数No.には、該当するadd関数のNo.1を格納する。xのノードアドレスには、b+1のbのノードアドレスを格納する。yのノードアドレスには、b+1の1のノードアドレスを格納する。   Referring to FIG. 8, the structure of the reproduction command 124 created by the reproduction command generation 111 is shown. The reproduction command 124 points from a pointer to the reproduction command in the analysis tree node. The reproduction command is represented by a function (x, y), and a function number indicating the type of the function. And the node address of x in the parse tree representing the x parameter and the node address of y in the parse tree representing the y parameter. FIG. 9 shows a list of functions used for the reproduction command. No. of each function Is assigned. For example, in the case of addition such as x + y, equivalent addition is realized by an add (x, y) function. Further, referring to FIG. 8, for example, an example of a reproduction command of b = b + 1 is shown. Since b + 1 is addition, add (x, y) in the function list of FIG. 9 is an equivalent function and can be expressed as add (b, 1). Replay command function No. Includes the No. of the corresponding add function. 1 is stored. The node address of x stores the node address of b of b + 1. The node address of y stores the node address of 1 of b + 1.

図10を参照すると、逆方向命令生成110で作成される逆方向命令123の構造を示している。逆方向命令123は、解析木のノード内の逆方向命令へのポインタから指し示す。逆方向命令は関数(x,y)で表し、関数の種類を表す関数No.とxパラメータを表す解析木中のxのノードアドレスとyパラメータを表す解析木中のyのノードアドレスから構成される。逆方向命令に使用する関数の一覧は、再生命令の時と同じであり、図9に示す。例えば、b=b+1における逆方向命令は、b=b−1である。ここで、b−1のbは、ソースプログラムのb=b+1の左辺のbである。b−1は減算であるため、図9の関数一覧のsub(x,y)が同等な関数であり、sub(b,1)と表すことができる。逆方向命令の関数No.には、該当するsub関数のNo.2を格納する。xのノードアドレスには、b=b+1の左辺のbのノードアドレスを格納する。yのノードアドレスには、b+1の1のノードアドレスを格納する。   Referring to FIG. 10, the structure of the backward instruction 123 created by the backward instruction generation 110 is shown. The backward instruction 123 points from a pointer to the backward instruction in the analysis tree node. The backward direction instruction is represented by a function (x, y), and a function number indicating the type of the function. And the node address of x in the parse tree representing the x parameter and the node address of y in the parse tree representing the y parameter. The list of functions used for the backward command is the same as that for the playback command, and is shown in FIG. For example, the backward instruction at b = b + 1 is b = b−1. Here, b of b-1 is b on the left side of b = b + 1 of the source program. Since b-1 is subtraction, sub (x, y) in the function list of FIG. 9 is an equivalent function and can be expressed as sub (b, 1). Reverse direction function No. No. of the corresponding sub function. 2 is stored. The node address of b stores the node address of b on the left side of b = b + 1. The node address of y stores the node address of 1 of b + 1.

図11は、逆方向命令生成110の動作を示すフローチャートである。   FIG. 11 is a flowchart showing the operation of the backward direction instruction generation 110.

逆方向命令生成110は、当該処理が可逆かどうかを判定する(S1301)。代入式の左辺の変数が右辺にもある場合可逆であると判定する。当該処理の逆の処理に該当する関数を求め、解析木のノード内の逆方向命令の関数No.と関数のパラメータを示す解析木中のノードアドレスを設定し(S1302)、逆方向命令のノードにその関数が使用する変数を設定する(S1303)。可逆でない場合は、逆方向命令にNULL、すなわち、逆方向命令なしを設定する(S1304)   The backward instruction generation 110 determines whether the process is reversible (S1301). If the variable on the left side of the assignment expression is also on the right side, it is determined to be reversible. A function corresponding to the reverse process is obtained, a function number of the backward instruction in the node of the parse tree and a node address in the parse tree indicating the parameter of the function are set (S1302), and the backward instruction node A variable used by the function is set in (S1303). If it is not reversible, NULL is set in the backward instruction, that is, no backward instruction is set (S1304).

次に、一般的なデバッガに条件式判定部155と変数値算出部156と逆方向処理部157、再生処理部158と参照変数特定部159とを新たに追加し、異常終了箇所特定部163を改良した点が本実施形態の特徴である。これらの処理の流れの実施例について説明する。   Next, a conditional expression determination unit 155, a variable value calculation unit 156, a backward processing unit 157, a reproduction processing unit 158, and a reference variable specifying unit 159 are newly added to a general debugger, and an abnormal end location specifying unit 163 is set. The improved point is a feature of this embodiment. An example of the flow of these processes will be described.

図12は、異常終了箇所特定部163の動作を示すフローチャートである。   FIG. 12 is a flowchart showing the operation of the abnormal end location specifying unit 163.

解析木・プログラム位置対応表を参照し、異常終了したアドレスから、ソースプログラムの行と対応する解析木のノードのアドレスを取得する(S2001)。   With reference to the analysis tree / program position correspondence table, the address of the node of the analysis tree corresponding to the line of the source program is acquired from the abnormally terminated address (S2001).

取得した解析木のノードアドレスが示すノードを基点とし配下にあるノードから、ノード内のプログラムの位置を参照し、異常終了したアドレスと一致するノードを探す(S2002)。   With reference to the position of the program in the node from the subordinate nodes with the node indicated by the node address of the acquired parse tree as the base point, the node that matches the abnormally terminated address is searched (S2002).

見つけた解析木のノードのトークンをたどり、ソースプログラム上の該当する変数名のソースプログラム上の行中の文字位置、長さを求め、ソースプログラム上の行番号とともにソースプログラム編集部160に通知する(S2003)。   The token of the node of the found parse tree is traced, the character position and length in the line on the source program of the corresponding variable name on the source program are obtained, and notified to the source program editing unit 160 together with the line number on the source program. (S2003).

図13は、条件式判定部155と変数値算出部156と逆方向処理部157、再生処理部158で使用する変数アドレス対応表の構造をあらわしている。図13の変数アドレス対応表は、図6の変数アドレス対応表に変数算出可能性、左辺変更場所、保留発生場所を追加している。変数算出可能性は、処理を逆方向に実行していく際に、データ領域172の変数の値をそのまま使えるかどうかを示すものであり、使える場合は“可能”、使えない場合は“保留”が設定される。“保留”は、代入式の左辺の変数が上書きされる場合、上書きされる前の値を再生処理により直ちに求めることができない時に設定される。左辺変更場所は、算出可能性が“保留”の場合に、処理を逆方向にたどり、左辺と同一変数を変更している処理がある場合、その解析木のノードのアドレスが格納される。保留発生場所は、“保留”となった処理の解析木のノードのアドレスが格納される。   FIG. 13 shows the structure of a variable address correspondence table used in the conditional expression determination unit 155, the variable value calculation unit 156, the backward processing unit 157, and the reproduction processing unit 158. The variable address correspondence table in FIG. 13 adds the variable calculation possibility, the left side change place, and the hold occurrence place to the variable address correspondence table in FIG. The variable calculation possibility indicates whether or not the value of the variable in the data area 172 can be used as it is when the process is executed in the reverse direction. If it can be used, it is “possible”; Is set. “Pending” is set when the variable on the left side of the assignment expression is overwritten and the value before overwriting cannot be immediately obtained by the reproduction process. When the calculation possibility is “pending”, the left side change place stores the address of the node of the analysis tree when the process is followed in the reverse direction and there is a process in which the same variable as the left side is changed. In the place where the hold is generated, the address of the node of the analysis tree of the process that becomes “hold” is stored.

図14は、図13の変数アドレス対応表の算出可能性が“保留”となった時に、その変数の変数アドレス対応表でのNo.を登録するための再生確認リストである。変数のNo.を覚えておき、処理を逆方向に処理していく時に、再生確認リストにある変数のNo.に対して、再生処理により、変数の値を復元する際に使用される。   FIG. 14 is a reproduction confirmation list for registering No. in the variable address correspondence table of the variable when the calculation possibility of the variable address correspondence table of FIG. 13 becomes “pending”. When the variable number is remembered and the process is performed in the reverse direction, the variable number in the reproduction confirmation list is used to restore the variable value by the reproduction process.

図15は、変数値算出部156の動作を示すフローチャートである。   FIG. 15 is a flowchart showing the operation of the variable value calculation unit 156.

変数値算出部156は、制御部151から、処理を逆方向に遡っていく際、ソースの1行毎にソースの行、すなわち、該当する解析木のノードを指定して、呼び出される。   The variable value calculation unit 156 is called from the control unit 151 by designating the source line, that is, the node of the corresponding analysis tree for each source line when tracing the processing backward.

変数値算出部156は、まず、再生確認リストに登録されている変数すべてについて、再生処理を実行し(S1601)、算出可能性が“保留”となっている変数を再生処理により復元することが可能な場合、復元する。再生処理の動作については、後述する。   First, the variable value calculation unit 156 executes the reproduction process for all the variables registered in the reproduction confirmation list (S1601), and the variable whose calculation possibility is “pending” can be restored by the reproduction process. Restore if possible. The operation of the reproduction process will be described later.

次に、変数アドレス対応表で、指定された処理の左辺の変数の算出可能性が“可能”であるかどうか確認する(S1602)。“可能”である場合、データ領域172の当該変数の値がそのまま利用できる状態であるため、左辺の変数の解析木のノードの評価結果の状態に“確定”を設定し、評価結果の値にデータ領域172の当該変数の値を設定する(S1603)。“可能”でない場合、左辺の変数の解析木のノードの評価結果の状態に“不確定” を設定する(S1604)。   Next, in the variable address correspondence table, it is confirmed whether or not the calculation possibility of the variable on the left side of the designated process is “possible” (S1602). If it is “possible”, the value of the variable in the data area 172 can be used as it is. Therefore, “confirm” is set in the evaluation result state of the analysis tree node of the variable on the left side, and the value of the evaluation result is set. The value of the variable in the data area 172 is set (S1603). If it is not “possible”, “indeterminate” is set as the evaluation result state of the node of the analysis tree of the variable on the left side (S1604).

次に、指定された処理の右辺の変数のうち左辺と同じ変数を除く全ての変数について、S1606〜S1608のステップを実行する(S1605、S1609)。変数アドレス対応表で、当該変数の算出可能性が“可能”であるか確認する(S1606)。“可能”である場合、データ領域172の当該変数の値がそのまま利用できる状態であるため、当該変数の解析木のノードの評価結果の状態に“確定”を設定し、評価結果の値にデータ領域172の当該変数の値を設定する(S1607)。“可能”でない場合、当該変数の解析木のノードの評価結果の状態に“不確定” を設定する(S1608)。   Next, steps S1606 to S1608 are executed for all variables except the same variable as the left side among the variables on the right side of the designated process (S1605, S1609). In the variable address correspondence table, it is confirmed whether the calculation possibility of the variable is “possible” (S1606). If it is “possible”, the value of the variable in the data area 172 is in a state that can be used as it is, and therefore, “determined” is set in the evaluation result state of the analysis tree node of the variable, and the value of the evaluation result is data The value of the variable in the area 172 is set (S1607). If it is not “possible”, “indeterminate” is set as the evaluation result state of the analysis tree node of the variable (S1608).

続けて、逆方向処理を実行し(S1610)、可逆性のある演算の場合に、逆方向処理により変数を復元する。逆方向処理の動作については、後述する。逆方向処理で左辺の変数の算出可能性が“保留”になったかを確認する(S1611)。“保留”になった場合は、左辺の変数について、再び、再生処理を実行し(S1612)、左辺の変数の算出可能性が“保留”にならなかった場合は、終了する。この再生処理で、左辺の変数の算出可能性が“可能”になったかを確認する(SS1613)。“可能“になった場合は、再び、逆方向処理を実行し(S1614)、”可能”にならなかった場合は、終了する。   Subsequently, the backward process is executed (S1610), and in the case of a reversible operation, the variable is restored by the backward process. The reverse processing operation will be described later. It is confirmed whether the calculation possibility of the variable on the left side is “pending” in the reverse processing (S1611). When “hold” is set, the reproduction process is executed again for the variable on the left side (S1612). When the possibility of calculating the variable on the left side does not become “hold”, the process ends. In this reproduction process, it is confirmed whether the calculation possibility of the variable on the left side has become “possible” (SS1613). If it becomes “possible”, the backward processing is executed again (S1614), and if it is not “possible”, the process ends.

図16は、逆方向処理部157の動作を示すフローチャートである。   FIG. 16 is a flowchart showing the operation of the backward processing unit 157.

まず、解析木のノードに逆方向命令があるかどうかを確認する(S1701)。逆方向命令がある場合は、その逆方向命令で入力となる全ての変数について、変数アドレス対応表の算出可能性が“可能”であるかを確認する(S1702)。全てが“可能”である場合は、逆方向命令を実行し(S1703)、その結果をデータ領域172内の左辺と同じ右辺の変数の場所に設定する(S1704)。続けて、左辺と同じ右辺の変数の解析木のノードの評価結果の状態に“確定”を設定し、評価結果の値にデータ領域172の当該変数の値を設定し、終了する(S1705)。   First, it is confirmed whether or not there is a backward direction instruction in the node of the analysis tree (S1701). If there is a reverse direction instruction, it is checked whether or not the variable address correspondence table can be calculated for all variables input by the reverse direction instruction (S1702). If all are “possible”, a backward instruction is executed (S1703), and the result is set in the location of the variable on the right side of the data area 172 (S1704). Subsequently, “determined” is set as the evaluation result state of the analysis tree node of the variable on the right side that is the same as the left side, the value of the variable in the data area 172 is set as the value of the evaluation result, and the process ends (S1705).

S1701で、逆方向命令がない場合、または、S1702で少なくとも何れかが“可能”でなかった場合は、左辺と同じ右辺の変数の解析木のノードの評価結果の状態に“不確定”を設定する(S1706)。続けて、処理を逆方向に解析木をたどり、左辺と同一変数を変更している解析木のノードを探す(S1707)。これは、左辺と同一変数を変更している解析木のノードの情報から、再生処理により、変数の値を復元するためである。   If there is no backward instruction in S1701, or if at least one of them is not "possible" in S1702, "indeterminate" is set in the evaluation result state of the analysis tree node of the variable on the right side that is the same as the left side. (S1706). Subsequently, the analysis tree is traced in the reverse direction, and a node of the analysis tree in which the same variable as the left side is changed is searched (S1707). This is because the value of the variable is restored by the reproduction process from the information of the node of the analysis tree in which the same variable as the left side is changed.

同一変数を変更している解析木のノードが見つかった場合、変数アドレス対応表の左辺の変数の算出可能性に“保留”を設定し、左辺変更場所に見つけた解析木のノードのアドレスを設定する(S1709)。変数アドレス対応表の左辺の変数の保留発生場所に、現在のソースの行、すなわち逆方向命令を実行しようとした解析木のノードのアドレスを登録する(S1710)。保留発生場所を登録しておくことで、あとで、再生処理が成功した際に、保留発生場所が示す解析木のノードの評価結果に、復元した変数の値を設定することができる。次に、再生確認リストに、変数アドレス対応表の当該変数のNo.を登録する(S1711)。再生確認リストに登録することにより、変数値算出部156の最初の処理再生処理を実行するが、この時の対象の変数を容易に把握できるようにする。   If an analysis tree node that has changed the same variable is found, set "pending" to the variable calculation possibility on the left side of the variable address correspondence table, and set the address of the analysis tree node found at the left side change location. (S1709). The current source line, that is, the address of the node of the parse tree that attempted to execute the backward instruction is registered in the variable hold place on the left side of the variable address correspondence table (S1710). By registering the hold occurrence location, the value of the restored variable can be set in the evaluation result of the analysis tree node indicated by the hold occurrence location when the reproduction process is succeeded later. Next, the variable number in the variable address correspondence table is registered in the reproduction confirmation list (S1711). By registering in the reproduction confirmation list, the first process reproduction process of the variable value calculation unit 156 is executed, but the target variable at this time can be easily grasped.

S1707で解析木のノードが見つからなかった場合、変更している場所がないため、これより前の変数の状態は未初期化状態であるため、変数アドレス対応表の左辺の変数の算出可能性に“未初期化”を設定する(S1712)。   If no node of the parse tree is found in S1707, there is no place to change, and the state of the variable before this is an uninitialized state. Therefore, it is possible to calculate the variable on the left side of the variable address correspondence table. “Uninitialized” is set (S1712).

図17は、再生処理部158の動作を示すフローチャートである。   FIG. 17 is a flowchart showing the operation of the playback processing unit 158.

まず、再生処理部158は、再生確認リストに格納されている変数No.全てについて、または、指定された変数No.について、S1802〜S1811のステップを実行する(S1801、S1812)。   First, the reproduction processing unit 158 displays the variable No. stored in the reproduction confirmation list. All or the specified variable No. , Steps S1802 to S1811 are executed (S1801, S1812).

再生確認リストに格納されている変数No.または指定された変数No.をもとに、変数アドレス対応表を参照し(S1802)、その左辺変更格納場所が示す解析木のノードを参照する(S1803)。次に、その解析木のノードの右辺の全ての変数について、その解析木のノードから現在の行までの間に変更しているところがないかを確認する(S1804)。   Based on the variable No. stored in the reproduction confirmation list or the designated variable No., the variable address correspondence table is referred to (S1802), and the node of the analysis tree indicated by the left side change storage location is referred to (S1803). ). Next, with respect to all variables on the right side of the node of the analysis tree, it is confirmed whether there is any change between the node of the analysis tree and the current line (S1804).

変更しているところがない場合、その解析木のノードの右辺の全ての変数について、変数アドレス対応表の算出可能性は“可能”であるかを確認し(S1805)。全て可能である場合は、その解析木のノードの再生命令を実行する(S1806)。   If there is no change, it is checked whether the calculation possibility of the variable address correspondence table is “possible” for all the variables on the right side of the node of the analysis tree (S1805). If all are possible, a reproduction command for the node of the analysis tree is executed (S1806).

次に、再生命令の実行結果を、データ領域172内の左辺と同じ右辺の変数の場所に設定する(S1807)。その後、左辺と同じ右辺の変数の解析木のノードの評価結果の状態に“確定”を設定し、評価結果の値にデータ領域172の当該変数の値を設定する(S1808)。   Next, the execution result of the reproduction command is set to the variable location on the right side that is the same as the left side in the data area 172 (S1807). Thereafter, “determined” is set as the evaluation result state of the analysis tree node of the variable on the right side that is the same as the left side, and the value of the variable in the data area 172 is set as the evaluation result value (S1808).

今度は、左辺と同じ右辺の変数が復元できたので、保留発生場所の解析木のノードの評価結果の状態に“確定”、評価結果の値にデータ領域172の当該変数の値を設定する(S1809)。   This time, since the variable on the right side that is the same as the left side can be restored, “determined” is set as the evaluation result state of the analysis tree node at the place where the hold occurred, and the value of the variable in the data area 172 is set as the value of the evaluation result ( S1809).

最後に、変数アドレス対応表の算出可能性に“可能”を設定し、左辺変更場所と保留発生場所を削除して(S1810)、再生確認リストから当該変数のNo.を削除する(S1811)。   Finally, “possible” is set as the calculation possibility of the variable address correspondence table, the left side change place and the hold occurrence place are deleted (S1810), and the variable No. Is deleted (S1811).

尚、S1804で、変更しているところがあった場合(Noの場合)は、再生命令を実行できないので、終了する。また、S1805で、変数1個でも算出可能性が“可能”でない場合(Noの場合)も、再生命令が実行できないので、終了する。   If there is a change in S1804 (in the case of No), the reproduction command cannot be executed, and the process ends. Also, in S1805, if the calculation possibility is not “possible” even with one variable (in the case of No), the reproduction command cannot be executed, and the process is terminated.

図18は、条件式判定部155の動作を示すフローチャートである。   FIG. 18 is a flowchart showing the operation of the conditional expression determination unit 155.

条件式判定部155も、変数値算出部156同様に変数の値を復元する。このため、まず、再生確認リストに登録されている変数すべてについて、再生処理を実行し、(S1901)、算出可能性が“保留”となっている変数を再生処理により復元することが可能な場合、復元する。   Similarly to the variable value calculation unit 156, the conditional expression determination unit 155 also restores the value of the variable. For this reason, first, the reproduction process is executed for all variables registered in the reproduction confirmation list (S1901), and the variable whose calculation possibility is “pending” can be restored by the reproduction process. ,Restore.

次に、条件式の解析木のノードを参照し、そのノード配下にある変数全てについて、S1903〜S1905のステップを実行する(S1902、S1906)   Next, the nodes of the conditional expression analysis tree are referred to, and the steps S1903 to S1905 are executed for all the variables under the node (S1902, S1906).

変数アドレス対応表で、当該変数の算出可能性は“可能”であるか確認する(S1903)。“可能”である場合、当該変数の解析木のノードの評価結果の状態に“確定”、評価結果の値にデータ領域の当該変数の値を設定する(S1904)。算出可能性が“可能”でない場合は、当該変数の解析木のノードの評価結果の状態に“不確定”を設定する(S1905)。   In the variable address correspondence table, it is confirmed whether the calculation possibility of the variable is “possible” (S1903). When it is “possible”, “determined” is set as the evaluation result state of the analysis tree node of the variable, and the value of the variable in the data area is set as the value of the evaluation result (S1904). If the calculation possibility is not “possible”, “indeterminate” is set as the evaluation result state of the analysis tree node of the variable (S1905).

次に、求めた変数の評価結果の状態は、全て“確定”であるか確認する(S1907)。全て“確定”である場合は、解析木のノード内の再生命令を実行し、評価結果の状態に“確定”を設定し、評価結果の値に再生命令を実行した結果(真または偽)を設定する(S1908)。真または偽の結果から、通過するソースプログラムの行を、解析木のノードをたどり、さらに、解析木のノードからトークン列をたどり求める。トークン列から行位置、行中位置、長さを取得し、ソースプログラム編集部160に通知する。   Next, it is confirmed whether the statuses of the obtained evaluation results of the variables are all “confirmed” (S1907). If all are “determined”, execute the replay command in the node of the parse tree, set “determined” to the status of the evaluation result, and the result (true or false) of executing the replay command as the evaluation result value The setting is made (S1908). From the true or false result, the line of the source program to be passed is followed by a node of the parse tree, and further, a token string is obtained from the node of the parse tree. The line position, middle line position, and length are acquired from the token string and notified to the source program editing unit 160.

確定でないものがあった場合は、条件式の評価結果の状態に“不確定”を設定する(S1910)。   If there is something that is not finalized, "indeterminate" is set as the condition result of the conditional expression (S1910).

図19は、参照変数特定部159の動作を示すフローチャートである。   FIG. 19 is a flowchart showing the operation of the reference variable specifying unit 159.

異常終了箇所特定部163が特定したソース行番号と変数を、参照関係の被参照変数から探す(S2101)。   The source line number and variable specified by the abnormal end location specifying unit 163 are searched from the referenced variables in the reference relationship (S2101).

見つけた被参照変数に対応する参照変数のソースファイル名、関数名、変数名、ソース行番号、トークン列アドレス、トークン列数を取得し、ソースプログラム編集部160に通知する(S2102)。   The source file name, function name, variable name, source line number, token string address, and token string number of the reference variable corresponding to the found referenced variable are acquired and notified to the source program editing unit 160 (S2102).

取得したソースファイル名、関数名、変数名を、参照関係の被参照変数から探す(S2103)。   The acquired source file name, function name, and variable name are searched from the referenced variables in the reference relationship (S2103).

見つかった場合は、見つけた被参照変数のソースファイル名、関数名、変数名、ソース行番号、トークン列アドレス、トークン列数を取得し、トークン列アドレスが示すトークン列から行位置、行中の文字位置、トークンの長さを取得し、ソースプログラム編集部160に通知する(S2105)。S2102へ飛び処理を繰り返す。S2104で、見つからなかった場合は、終了する。   If found, get the source file name, function name, variable name, source line number, token column address, token column number of the referenced variable that was found, and from the token column indicated by the token column address, the line position, in the line The character position and token length are acquired and notified to the source program editing unit 160 (S2105). The process jumps to S2102 and is repeated. If it is not found in S2104, the process ends.

図20を参照し、変数値取得部164の動作を説明する。図20の上部は、”b = b + 1”を例にした変数の値を画面に表示しているイメージ例である。図20の下部は、”b = b + 1”を例とした解析木の構造である。   The operation of the variable value acquisition unit 164 will be described with reference to FIG. The upper part of FIG. 20 is an image example in which the value of a variable with “b = b + 1” as an example is displayed on the screen. The lower part of FIG. 20 shows the structure of an analysis tree with “b = b + 1” as an example.

解析木を参照すると、変数値算出部156により、変数の値が復元されている状態である。解析木のノード2201は、”b = b + 1”の左辺の変数bを示すノードであり、評価結果格納アドレスで示される評価結果に、状態として“確定”、値として1が設定されている。解析木のノード2202は、”b = b + 1”の右辺の変数bを示すノードであり、評価結果格納アドレスで示される評価結果に、状態として“確定”、値として0が設定されている。   Referring to the analysis tree, the variable value calculation unit 156 is in a state where the value of the variable is restored. The analysis tree node 2201 is a node indicating the variable b on the left side of “b = b + 1”, and “established” as the state and 1 as the value are set in the evaluation result indicated by the evaluation result storage address. . The analysis tree node 2202 is a node indicating the variable b on the right side of “b = b + 1”, and “established” as the state and 0 as the value are set in the evaluation result indicated by the evaluation result storage address. .

変数値取得部164は、取得を指示された変数の解析木のノードを探し、変数の状態と値を取得する。例えば、”b = b + 1”の左辺の変数bを指定された場合は、解析木のノード2201を参照する。”b = b + 1”の右辺の変数bを指定された場合は、解析木のノード2202を参照する。   The variable value acquisition unit 164 searches for the node of the analysis tree of the variable instructed to acquire, and acquires the state and value of the variable. For example, when the variable b on the left side of “b = b + 1” is designated, the node 2201 of the analysis tree is referred to. When the variable b on the right side of “b = b + 1” is designated, the node 2202 of the analysis tree is referred to.

変数値取得部164は、変数名、値、状態(確定または不確定)を、画面表示部161に渡し、画面表示部161は、図20の上部のように、ソースプログラム120と共に、変数名、値、状態を画面に表示する。即ち、画面表示部161は、図24に示すように、ソースプログラム120を、復元された変数の値と共に画面に表示するステップ(S3000)を更に含む。   The variable value acquisition unit 164 passes the variable name, value, and state (confirmed or indeterminate) to the screen display unit 161. The screen display unit 161, together with the source program 120, as shown in the upper part of FIG. Display the value and status on the screen. That is, the screen display unit 161 further includes a step (S3000) of displaying the source program 120 on the screen together with the value of the restored variable, as shown in FIG.

以上、第2実施形態を説明した。上記第2実施形態は、以下のように構成される。   The second embodiment has been described above. The second embodiment is configured as follows.

デバッグ支援装置200は、異常終了時のメモリダンプに基いて異常終了箇所から処理を逆方向に遡って変数の値を復元する復元命令を、ソースプログラムに基いて生成する、復元命令生成部109と、異常終了時に復元命令を実行することで変数の値を復元する、変数値算出部156と、を備える。以上の構成によれば、システムの性能低下を招くことなく、プログラムの異常終了の原因を利用者が判断し易くすることができる。   The debugging support device 200 generates a restoration instruction for restoring a variable value based on a memory dump at the time of abnormal termination by going back to the process from the abnormal termination part in the reverse direction, and a restoration instruction generation unit 109 And a variable value calculation unit 156 that restores the value of the variable by executing a restoration command upon abnormal termination. According to the above configuration, the user can easily determine the cause of the abnormal termination of the program without degrading the performance of the system.

復元命令は、遡る処理が可逆の場合にその処理とは逆の処理を実行することで変数の値を復元する逆方向命令を含む。   The restoration instruction includes a backward instruction for restoring the value of the variable by executing a process reverse to the process when the retroactive process is reversible.

復元命令は、復元対象である変数の値を演算した際に用いた演算を再度実行することで変数の値を復元する再生命令を含む。   The restoration instruction includes a reproduction instruction for restoring the value of the variable by executing again the operation used when the value of the variable to be restored is calculated.

デバッグ支援装置200は、ソースプログラムを、復元された変数の値と共に表示する画面表示部161を更に備える。   The debugging support apparatus 200 further includes a screen display unit 161 that displays the source program together with the restored variable values.

デバッグ支援方法は、異常終了時のメモリダンプに基いて異常終了箇所から処理を逆方向に遡って変数の値を復元する復元命令を、ソースプログラムに基いて生成するステップ(S1302)と、異常終了時に復元命令を実行することで変数の値を復元するステップ(S1601、S1610)と、を含む。   The debugging support method includes a step (S1302) of generating a restoration instruction based on the source program to restore a variable value by going back to the process from the abnormal termination point based on the memory dump at the abnormal termination, and abnormal termination. Sometimes restoring the value of the variable by executing a restore instruction (S1601, S1610).

デバッグ支援方法は、ソースプログラム120を、復元された変数の値と共に表示するステップ(S3000)を更に含む。   The debugging support method further includes a step (S3000) of displaying the source program 120 together with the value of the restored variable.

上記実施形態によれば、以下の(1)〜(3)の効果が発揮される。   According to the said embodiment, the following effects (1)-(3) are exhibited.

(1)プログラムが異常終了した際に、メモリダンブ情報から、直接の原因となった変数が即座に特定でき、また、処理を逆方向に遡り、その時点での変数の値を復元し表示し、通過経路も表示できるため、原因究明にかかる時間を短縮することができる。
(2)原因となった変数がどこの処理のどの変数を参照して導出されたものなのかを表示できるため、原因究明の手助けとなる。
(3)トレースやデバッグ用の情報を埋め込んだプログラムは本番運用しているシステムに適用することは難しいが、本発明は、それらがなくとも、異常終了した時のメモリダンプ情報のみからデバッグを実施できる。
(1) When the program terminates abnormally, the variable that caused the direct cause can be immediately identified from the memory dump information, and the process is traced backwards, and the variable value at that time is restored and displayed. Since the passage route can also be displayed, the time required to investigate the cause can be shortened.
(2) Since it is possible to display which variable of the cause is derived by referring to which variable of which process, it helps the cause investigation.
(3) Although it is difficult to apply a program in which trace or debug information is embedded to a production system, the present invention performs debugging only from memory dump information at the time of abnormal termination even without them. it can.

上述の例において、プログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えばフレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば光磁気ディスク)、CD−ROM(Read Only Memory)、CD−R、CD−R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM(random access memory))を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は無線通信路を介して、プログラムをコンピュータに供給できる。   In the above example, the program can be stored and supplied to a computer using various types of non-transitory computer readable media. Non-transitory computer readable media include various types of tangible storage media. Examples of non-transitory computer-readable media include magnetic recording media (for example, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (for example, magneto-optical disks), CD-ROMs (Read Only Memory), CD-Rs, CD-R / W and semiconductor memory (for example, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM (random access memory)) are included. The program may also be supplied to the computer by various types of transitory computer readable media. Examples of transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. The temporary computer-readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.

1 デバッグ支援装置
2 復元命令生成部
3 変数値算出部
DESCRIPTION OF SYMBOLS 1 Debugging support apparatus 2 Restoration instruction generation part 3 Variable value calculation part

Claims (6)

異常終了時のメモリダンプに基いて異常終了箇所から処理を逆方向に遡って変数の値を復元する復元命令を、ソースプログラムに基いて生成する、復元命令生成部と、
異常終了時に前記復元命令を実行することで前記変数の値を復元する、変数値算出部と、
前記ソースプログラムを、復元された前記変数の値と共に表示する画面表示部と、
を備え、
前記画面表示部は、更に、前記ソースプログラムを、前記変数の復元の可否と共に表示する、
デバッグ支援装置。
A restoration instruction generation unit that generates a restoration instruction that restores the value of a variable by tracing back the process from the abnormal termination point based on a memory dump at the time of abnormal termination based on a source program;
A variable value calculation unit that restores the value of the variable by executing the restoration instruction at the time of abnormal termination;
A screen display unit for displaying the source program together with the value of the restored variable;
With
The screen display unit further displays the source program together with whether or not the variable can be restored.
Debugging support device.
請求項1に記載のデバッグ支援装置であって、
前記復元命令は、遡る処理が可逆の場合にその処理とは逆の処理を実行することで前記変数の値を復元する逆方向命令を含む、
デバッグ支援装置。
The debugging support device according to claim 1,
The restoration instruction includes a backward instruction that restores the value of the variable by executing a process reverse to the process when the retroactive process is reversible,
Debugging support device.
請求項1又は2に記載のデバッグ支援装置であって、
前記復元命令は、復元対象である前記変数の値を演算した際に用いた演算を再度実行することで前記変数の値を復元する再生命令を含む、
デバッグ支援装置。
The debugging support device according to claim 1 or 2,
The restoration instruction includes a reproduction instruction for restoring the value of the variable by performing again the operation used when the value of the variable to be restored is calculated.
Debugging support device.
異常終了時のメモリダンプに基いて異常終了箇所から処理を逆方向に遡って変数の値を復元する復元命令を、ソースプログラムに基いて生成するステップと、
異常終了時に前記復元命令を実行することで前記変数の値を復元するステップと、
前記ソースプログラムを、復元された前記変数の値と共に表示するステップと、
を含み、
前記ソースプログラムを、復元された前記変数の値と共に表示するステップでは、更に、前記ソースプログラムを、前記変数の復元の可否と共に表示する、
デバッグ支援方法。
A step of generating, based on the source program, a restoration instruction that restores the value of the variable by tracing the process backward from the abnormal end point based on the memory dump at the time of abnormal end,
Restoring the value of the variable by executing the restoration instruction upon abnormal termination;
Displaying the source program together with the restored value of the variable;
Including
In the step of displaying the source program together with the value of the restored variable, the source program is further displayed together with whether or not the variable can be restored.
Debugging support method.
請求項4に記載のデバッグ支援方法であって、
前記復元命令は、遡る処理が可逆の場合にその処理とは逆の処理を実行することで前記変数の値を復元する逆方向命令を含む、
デバッグ支援方法。
The debugging support method according to claim 4 ,
The restoration instruction includes a backward instruction that restores the value of the variable by executing a process reverse to the process when the retroactive process is reversible,
Debugging support method.
請求項4又は5に記載のデバッグ支援方法であって、
前記復元命令は、復元対象である前記変数の値を演算した際に用いた演算を再度実行することで前記変数の値を復元する再生命令を含む、
デバッグ支援方法。
The debugging support method according to claim 4 or 5 ,
The restoration instruction includes a reproduction instruction for restoring the value of the variable by performing again the operation used when the value of the variable to be restored is calculated.
Debugging support method.
JP2015054535A 2015-03-18 2015-03-18 DEBUG SUPPORT DEVICE AND DEBUG SUPPORT METHOD Active JP6471556B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015054535A JP6471556B2 (en) 2015-03-18 2015-03-18 DEBUG SUPPORT DEVICE AND DEBUG SUPPORT METHOD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015054535A JP6471556B2 (en) 2015-03-18 2015-03-18 DEBUG SUPPORT DEVICE AND DEBUG SUPPORT METHOD

Publications (2)

Publication Number Publication Date
JP2016173799A JP2016173799A (en) 2016-09-29
JP6471556B2 true JP6471556B2 (en) 2019-02-20

Family

ID=57008236

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015054535A Active JP6471556B2 (en) 2015-03-18 2015-03-18 DEBUG SUPPORT DEVICE AND DEBUG SUPPORT METHOD

Country Status (1)

Country Link
JP (1) JP6471556B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0250228A (en) * 1988-08-11 1990-02-20 Fujitsu Ltd Debug processor
JP3062266B2 (en) * 1991-03-20 2000-07-10 富士通株式会社 Support device
JPH06250876A (en) * 1993-02-26 1994-09-09 Nec Software Ltd Interactive debugging supporting system
JPH09160806A (en) * 1995-12-14 1997-06-20 Hitachi Ltd Method for supporting debugging and its device
JP4107470B2 (en) * 2001-10-11 2008-06-25 三菱電機株式会社 Software failure analysis method and apparatus
JP2004133827A (en) * 2002-10-15 2004-04-30 Hitachi Ltd Core analysis system

Also Published As

Publication number Publication date
JP2016173799A (en) 2016-09-29

Similar Documents

Publication Publication Date Title
US8819642B2 (en) Method and system for generating and processing black box test cases
US10783056B2 (en) Time travel source code debugger incorporating point in time links
US9916230B1 (en) White box testing
US10761964B2 (en) Object monitoring in code debugging
US9898387B2 (en) Development tools for logging and analyzing software bugs
US9229738B2 (en) Software development tool for providing user context information to improve message quality at development time
US20140089895A1 (en) Test case pattern matching
CN107111545B (en) Method and system for generating computer executable graph
JP2005302028A (en) Method and system for probe optimization for instrumenting program
CN110196801B (en) Code coverage rate based test method and device
Petrillo et al. Towards understanding interactive debugging
US9189372B2 (en) Trace coverage analysis
JP6471556B2 (en) DEBUG SUPPORT DEVICE AND DEBUG SUPPORT METHOD
CN110399284A (en) A kind of test case writes and executes method and device
CN114020648B (en) Application control testing method and device, electronic equipment and storage medium
CN107688534A (en) Zonal testing method, apparatus, computer equipment and storage medium
Li et al. Medic: metaprogramming and trace-oriented debugging
CN115454702A (en) Log fault analysis method and device, storage medium and electronic equipment
Chitil Source-based trace exploration
CN113282495A (en) Java software fault positioning method based on track monitoring
CN113342657A (en) Method and device for detecting code exception
Hamid et al. Detecting Refactorable Clones by Slicing Program Dependence Graphs.
CN105512035B (en) Debugging method and system of mobile APP
Mirghasemi et al. Debugging by lastChange
Duarte et al. Extraction of probabilistic behaviour models based on contexts

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180208

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20181019

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20181030

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181207

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20181225

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190107

R150 Certificate of patent or registration of utility model

Ref document number: 6471556

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150