JP2013206266A - Information processor, information processing method, and program - Google Patents

Information processor, information processing method, and program Download PDF

Info

Publication number
JP2013206266A
JP2013206266A JP2012076165A JP2012076165A JP2013206266A JP 2013206266 A JP2013206266 A JP 2013206266A JP 2012076165 A JP2012076165 A JP 2012076165A JP 2012076165 A JP2012076165 A JP 2012076165A JP 2013206266 A JP2013206266 A JP 2013206266A
Authority
JP
Japan
Prior art keywords
dynamic analysis
unit
program
instruction
information processing
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
JP2012076165A
Other languages
Japanese (ja)
Inventor
Yasuhiro Matsuzaki
泰裕 松崎
Hiroki Kaminaga
浩気 神長
Hiroki Nagahama
弘樹 長濱
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2012076165A priority Critical patent/JP2013206266A/en
Publication of JP2013206266A publication Critical patent/JP2013206266A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To accelerate dynamic analysis of a program.SOLUTION: The information processor comprises: a specification part which specifies, from among monitor targets of dynamic analysis, which is analysis by executing a program, those related to changed parts of a source code of the program; and a dynamic analysis part which performs dynamic analysis to monitor the monitor targets specified by the specification part. This disclosure is applicable, e.g., to an analyzer for debugging a program.

Description

本技術は、情報処理装置および方法、並びにプログラムに関し、特に、プログラムの動的解析をより高速に行うことができるようにした情報処理装置および方法、並びにプログラムに関する。   The present technology relates to an information processing apparatus and method, and a program, and more particularly, to an information processing apparatus and method, and a program that can perform dynamic analysis of the program at higher speed.

従来、ソフトウエアプログラムのデバッグ手法として、動的解析がしばしば行われる。動的解析とは、プログラムを実行し、その実行状況が正常であるかを判断する手法である。例えば、不正なメモリ領域へアクセスしていないか、メモリ上の値が不正でないか、不正な命令が実行されていないかといった判断が行われる。また、プログラム中にデバッグのためのログやメッセージ出力を挿入し、実行状況やメモリの値の確認等も行われる。   Conventionally, dynamic analysis is often performed as a software program debugging technique. Dynamic analysis is a technique for executing a program and determining whether the execution status is normal. For example, a determination is made as to whether an illegal memory area has been accessed, a value on the memory is not illegal, or an illegal instruction has not been executed. In addition, debugging logs and message outputs are inserted into the program, and execution status and memory values are checked.

一般的に、動的解析は、ソースコードだけを解析する静的解析に比べて、その判断の正確性が優れるものの、正常の処理に加えて動作を監視する処理を行うために、処理量が多く、処理時間が増大する恐れがあった。   In general, although dynamic analysis is more accurate than the static analysis that analyzes only the source code, the amount of processing is increased because it performs processing to monitor operations in addition to normal processing. In many cases, the processing time may increase.

静的解析の場合、処理時間を短縮する方法として、ソースコードの変更部分のみを対象とする方法があった(例えば、特許文献1参照)。しかしながら、動的解析では、実行状況を監視するため、ソースコードの変更情報をそのまま利用することはできない。   In the case of static analysis, as a method for shortening the processing time, there is a method that targets only a changed portion of the source code (for example, see Patent Document 1). However, in the dynamic analysis, since the execution status is monitored, the change information of the source code cannot be used as it is.

そこで、動的解析の処理時間を低減させる方法として、プログラム全体を監視するのではなく、プログラムの一部だけを監視する方法が考えられた。監視する範囲を限定する方法として、例えば、プログラム開発者がその範囲を指定する方法や、静的解析でバグの可能性があると判断された部分のみを動的解析の対象とする方法が考えられた(例えば、特許文献2参照)。   Therefore, as a method of reducing the processing time of dynamic analysis, a method of monitoring only a part of the program instead of monitoring the entire program has been considered. As a method for limiting the range to be monitored, for example, a method in which a program developer specifies the range, or a method in which only a portion that is determined to have a bug in static analysis is subjected to dynamic analysis is considered. (See, for example, Patent Document 2).

特開2011−113298号公報JP 2011-113298 A 特開2011−133966号公報JP 2011-133966 A

しかしながら、動的解析は、ただ行えばよいというものでは無く、当然、正確かつ有意な解析結果が得られることが求められる。   However, the dynamic analysis is not just performed, and naturally, it is required to obtain an accurate and significant analysis result.

プログラム開発者が手動で動的解析対象を指定する方法の場合、正確かつ有意な解析結果を得るためには、どこを解析すべきかというプログラム開発者の正しい知識と、正確な作業が必要になる恐れがあった。つまり、その作業時間も含めて考えると、動的解析の処理時間が増大する恐れがあった。換言するに、プログラム開発者に必要な知識と手間が増大するため、処理時間を短縮させるためには、その解析精度が許容できないほど低減してしまう恐れがあった。   In the case of a method in which the program developer manually specifies the dynamic analysis target, in order to obtain an accurate and significant analysis result, it is necessary for the program developer to have a correct knowledge of where to analyze and an accurate operation. There was a fear. In other words, considering the work time, there is a risk that the processing time of the dynamic analysis will increase. In other words, since the knowledge and effort required for the program developer increases, there is a risk that the analysis accuracy may be unacceptably reduced in order to shorten the processing time.

また、特許文献2に記載の方法の場合、動的解析に比べてバグ発見の正確性が低い静的解析結果を動的解析に利用するため、動的解析によるバグ発見の正確性を低減させてしまう恐れがあった。   In addition, in the case of the method described in Patent Document 2, since the static analysis result, which is less accurate in finding bugs than in dynamic analysis, is used for dynamic analysis, the accuracy of finding bugs by dynamic analysis is reduced. There was a fear.

このように従来の方法においては、動的解析を現実的な精度で行うことが困難であり、正確かつ有意な解析結果を得ることができない恐れがあった。すなわち、実質的に処理時間を短縮させることは困難であった。   As described above, in the conventional method, it is difficult to perform dynamic analysis with realistic accuracy, and there is a possibility that accurate and significant analysis results cannot be obtained. That is, it has been difficult to substantially reduce the processing time.

本技術は、このような状況に鑑みて提案されたものであり、プログラムの動的解析の処理時間を低減させることを目的とする。   The present technology has been proposed in view of such a situation, and an object thereof is to reduce the processing time of dynamic analysis of a program.

本技術の一側面は、プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定する特定部と、前記特定部により特定された監視対象を監視するように動的解析を行う動的解析部とを備える情報処理装置である。   One aspect of the present technology is specified by a specifying unit that specifies a part related to a changed part of the source code of the program from among monitoring targets of a dynamic analysis in which the program is executed and analyzed. An information processing apparatus includes a dynamic analysis unit that performs dynamic analysis so as to monitor a monitoring target.

前記特定部は、前記変更部分が使用するメモリ領域を特定し、前記動的解析部は、前記特定部により特定された前記メモリ領域に対するアクセス、および、前記メモリ領域に格納される値の内、少なくともいずれか一方を監視することができる。   The specifying unit specifies a memory area used by the change part, and the dynamic analysis unit accesses the memory area specified by the specifying unit, and among values stored in the memory area, At least one of them can be monitored.

前記特定部は、前記ソースコードの各部分とメモリアドレスを関連付ける情報をコンパイラから取得し、取得した前記情報に基づいて、前記変更部分が使用するメモリ領域を特定することができる。   The specifying unit can acquire information associating each part of the source code with a memory address from a compiler, and can specify a memory area used by the change part based on the acquired information.

ウォッチポイントを監視し、前記ウォッチポイントの値が変化する場合、前記プログラムの実行を停止するブレークポイント処理を実行するブレークポイント処理部をさらに備え、前記動的解析部は、前記特定部により特定された前記メモリ領域に前記ウォッチポイントを設定し、前記ブレークポイント処理部に対して、前記ウォッチポイントに対する前記ブレークポイント処理を実行させることができる。   A watchpoint is monitored, and when the value of the watchpoint changes, it further includes a breakpoint processing section that executes a breakpoint process for stopping execution of the program, and the dynamic analysis section is specified by the specifying section. In addition, the watchpoint can be set in the memory area, and the breakpoint processing unit can be caused to execute the breakpoint processing for the watchpoint.

前記動的解析部は、前記特定部により特定されたメモリ領域の近傍に、デバッグ用の領域を確保することができる。   The dynamic analysis unit can secure a debugging area in the vicinity of the memory area specified by the specifying unit.

前記特定部は、前記変更部分から生成される命令を特定し、前記動的解析部は、前記特定部により特定された前記命令の実行を監視することができる。   The specifying unit may specify an instruction generated from the change part, and the dynamic analysis unit may monitor execution of the instruction specified by the specifying unit.

前記特定部は、前記ソースコードの各部分と命令アドレスを関連付ける情報をコンパイラから取得し、取得した前記情報に基づいて、前記変更部分から生成される命令を特定することができる。   The specifying unit can acquire information associating each part of the source code with an instruction address from a compiler, and can specify an instruction generated from the changed part based on the acquired information.

ブレークポイントを監視し、前記ブレークポイントの命令が実行される場合、前記プログラムの実行を停止するブレークポイント処理を実行するブレークポイント処理部をさらに備え、前記動的解析部は、前記特定部により特定された前記命令の命令アドレスに前記ブレークポイントを設定し、前記ブレークポイント処理部に対して、前記ブレークポイントに対する前記ブレークポイント処理を実行させることができる。   A breakpoint processing unit that monitors a breakpoint and executes a breakpoint process that stops execution of the program when the instruction of the breakpoint is executed is further provided, and the dynamic analysis unit is specified by the specifying unit The breakpoint is set at the instruction address of the executed instruction, and the breakpoint processing unit can be caused to execute the breakpoint processing for the breakpoint.

他の環境を模倣する模倣処理部をさらに備え、前記動的解析部は、前記模倣処理部に対して、他の環境を模倣させ、前記環境において前記プログラムを実行させることができる。   An imitation processing unit that imitates another environment is further provided, and the dynamic analysis unit can cause the imitation processing unit to imitate another environment and execute the program in the environment.

前記特定部は、前記変更部分に関連するデバッグ出力命令を特定し、特定した前記デバッグ出力命令以外のデバッグ出力命令の実行を削除または抑制し、前記動的解析部は、前記特定部により特定された前記デバッグ出力命令が実行されて出力されるデバッグ出力を監視することができる。   The specifying unit specifies a debug output instruction related to the changed part, deletes or suppresses execution of a debug output instruction other than the specified debug output instruction, and the dynamic analysis unit is specified by the specifying unit. It is also possible to monitor the debug output that is output when the debug output instruction is executed.

前記特定部は、プログラム中のデバッグ出力命令の一覧を取得し、取得した前記デバッグ出力命令の一覧に基づいて、前記変更部分に関連するデバッグ出力命令を特定することができる。   The specifying unit can acquire a list of debug output instructions in the program, and specify a debug output instruction related to the changed portion based on the acquired list of debug output instructions.

前記特定部は、ユーザによりデバッグ出力命令として指定される出力命令の一覧を、前記デバッグ出力命令の一覧として取得することができる。   The specifying unit can acquire a list of output instructions designated as debug output instructions by the user as a list of debug output instructions.

前記特定部は、ソースコードに含まれる出力命令の特徴、若しくは、コンパイルされた命令列に含まれる出力命令の特徴に基づいてデバッグ出力命令として選択される出力命令の一覧を、前記デバッグ出力命令の一覧として取得することができる。   The specifying unit displays a list of output instructions selected as a debug output instruction based on the characteristics of the output instruction included in the source code or the characteristics of the output instruction included in the compiled instruction sequence. It can be acquired as a list.

前記特定部は、所定の文字列の出力を行う出力命令の一覧を、前記デバッグ出力命令の一覧として取得することができる。   The specifying unit can obtain a list of output instructions for outputting a predetermined character string as a list of debug output instructions.

前記特定部は、所定の関数を呼び出す出力命令の一覧を、前記デバッグ出力命令の一覧として取得することができる。   The specifying unit can acquire a list of output instructions for calling a predetermined function as a list of debug output instructions.

前記特定部は、特定した前記デバッグ出力命令以外のデバッグ出力命令をNOPに書き換えることができる。   The specifying unit can rewrite a debug output instruction other than the specified debug output instruction to NOP.

本技術の一側面は、また、情報処理装置の情報処理方法であって、情報処理装置の情報処理方法であって、前記情報処理装置が、プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定し、特定された監視対象を監視するように動的解析を行う情報処理方法である。   One aspect of the present technology is also an information processing method for an information processing device, the information processing method for the information processing device, wherein the information processing device executes a program and performs analysis to be monitored Is an information processing method for identifying a portion related to a changed portion of the source code of the program and performing dynamic analysis so as to monitor the identified monitoring target.

本技術の一側面は、さらに、コンピュータを、プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定する特定部と、前記特定部により特定された監視対象を監視するように動的解析を行う動的解析部として機能させるためのプログラムである。   One aspect of the present technology further includes: a specifying unit that specifies a computer related to a changed part of a source code of the program from among monitoring targets of dynamic analysis in which the program is executed and analyzed; This is a program for functioning as a dynamic analysis unit that performs dynamic analysis so as to monitor the monitoring target specified by the unit.

本技術の一側面においては、プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものが特定され、その特定された監視対象のみを監視するように動的解析が行なわれる。   In one aspect of the present technology, among the monitoring targets of the dynamic analysis in which the program is executed and analyzed, those related to the changed part of the source code of the program are specified, and only the specified monitoring target is monitored. Dynamic analysis is performed as follows.

本技術によれば、情報を処理することが出来る。特に、プログラムの動的解析の処理時間を低減させることができる。   According to the present technology, information can be processed. In particular, the processing time for dynamic analysis of the program can be reduced.

解析装置の主な構成例を示すブロック図である。It is a block diagram which shows the main structural examples of an analyzer. ソースコードの変更履歴の例を示す図である。It is a figure which shows the example of the change log | history of a source code. 動的解析されるメモリアドレスと命令アドレスの例を示す図である。It is a figure which shows the example of the memory address and instruction address which are dynamically analyzed. 解析処理の流れの例を説明するフローチャートである。It is a flowchart explaining the example of the flow of an analysis process. コンピュータの主な構成例を示すブロック図である。And FIG. 20 is a block diagram illustrating a main configuration example of a computer.

以下、本開示を実施するための形態(以下実施の形態とする)について説明する。なお、説明は以下の順序で行う。
1.第1の実施の形態(解析装置)
2.第2の実施の形態(コンピュータ)
Hereinafter, modes for carrying out the present disclosure (hereinafter referred to as embodiments) will be described. The description will be given in the following order.
1. 1st Embodiment (analysis apparatus)
2. Second embodiment (computer)

<1.第1の実施の形態>
[1−1動的解析]
ソフトウエアプログラムのデバッグ手法として、動的解析がしばしば行われている。動的解析とは、プログラムを実行し、その実行状況が正常であるかを判断する手法である。
<1. First Embodiment>
[1-1 Dynamic analysis]
Dynamic analysis is often performed as a software program debugging technique. Dynamic analysis is a technique for executing a program and determining whether the execution status is normal.

動的解析では、例えば、不正なメモリ領域へアクセスしていないか、メモリ上の値が不正でないか、不正な命令が実行されていないかといった判断が行われる。また、動的解析では、プログラム中にデバッグのためのログやメッセージ出力を挿入し、実行状況やメモリの値を把握することも行われる。   In the dynamic analysis, for example, a determination is made as to whether an illegal memory area is not accessed, a value on the memory is not illegal, or an illegal instruction is not executed. In dynamic analysis, a log or message output for debugging is inserted into a program, and an execution status and a memory value are grasped.

動的解析は、ソースコードだけを解析する静的解析に比べて、その判断の正確性に優れる半面、正常の処理に加えて動作を監視する処理を行うために、動作のオーバーヘッドが問題となる場合があった。すなわち、一般的に、動的解析は、静的解析よりも処理量が多く、処理時間が許容できないほど増大する恐れがあった。   Dynamic analysis is superior to static analysis in which only source code is analyzed. On the other hand, in addition to normal processing, the operation overhead is a problem because it performs processing to monitor the operation. There was a case. That is, in general, the dynamic analysis has a larger processing amount than the static analysis, and the processing time may increase to an unacceptable level.

プログラムのデバッグは、プログラムを開発していく上で何度か行われるが、バグが発見されるところは、前回のデバッグ時から変更した部分である可能性が高い。そこで、動的解析のオーバーヘッドを抑制するために、プログラム全体を監視するのではなく、プログラムの一部だけを監視することにより処理量を低減させる方法が考えられた。つまり、動的解析する範囲をプログラム更新部分に限定することにより、処理量を低減させて処理時間を短くし、オーバーヘッドの抑制を図る方法が考えられた。   The debugging of the program is performed several times in developing the program, but the place where the bug is found is likely to have been changed from the previous debugging. Therefore, in order to suppress the overhead of dynamic analysis, a method of reducing the processing amount by monitoring only a part of the program instead of monitoring the entire program has been considered. In other words, a method has been considered in which the amount of processing is reduced, the processing time is shortened, and the overhead is suppressed by limiting the dynamic analysis range to the program update portion.

ところで、静的解析の場合、例えば、特許文献1に記載のように、ソースコードの変更部分のみを対象とする方法があるが、動的解析では、実行状況を監視するため、ソースコードの変更情報をそのまま利用することはできない。つまり、特許文献1に記載の方法をそのまま動的解析に利用することはできない。   By the way, in the case of static analysis, for example, as described in Patent Document 1, there is a method that targets only the changed part of the source code. However, in dynamic analysis, the source code is changed to monitor the execution status. Information cannot be used as it is. That is, the method described in Patent Document 1 cannot be used for dynamic analysis as it is.

そこで、特許文献2においては、プログラムに対して静的解析を行い、その静的解析でバグの可能性があると判断された部分のみを動的解析する方法が提案された。   Therefore, Patent Document 2 proposes a method of performing static analysis on a program and dynamically analyzing only a part that is determined to have a bug in the static analysis.

しかしながら、動的解析は、ただ行えばよいというものでは無く、当然、正確かつ有意な解析結果が得られることが求められる。   However, the dynamic analysis is not just performed, and naturally, it is required to obtain an accurate and significant analysis result.

一般的に、静的解析は、動的解析よりもバグ発見の精度が低い。そのため、静的解析結果を動的解析に利用すると、処理量を十分に低減できなかったり、バグ発見の精度が低減したりする恐れがあった。   Generally, static analysis is less accurate in finding bugs than dynamic analysis. For this reason, if the static analysis result is used for dynamic analysis, the processing amount may not be reduced sufficiently, and the accuracy of bug detection may be reduced.

例えば、静的解析において、バグではない部分に対してバグの可能性があると判断された場合、不要な動的解析が行われることになる。つまり、この場合、処理量を十分に低減することができない恐れがあった。   For example, in static analysis, if it is determined that there is a possibility of a bug in a portion that is not a bug, unnecessary dynamic analysis is performed. That is, in this case, there is a possibility that the processing amount cannot be reduced sufficiently.

また、例えば、静的解析において、バグがある部分に対してバグがあると判断されない場合、動的解析でもそのバグを検出することができない。つまり、この場合、動的解析のバグ発見精度が低減する恐れがあった。   Also, for example, in static analysis, when it is not determined that there is a bug in a portion where there is a bug, the bug cannot be detected even in dynamic analysis. That is, in this case, there is a possibility that the bug detection accuracy of the dynamic analysis is reduced.

以上のように、特許文献2に記載の方法では、当然、正確かつ有意な動的解析結果を得ることが困難であった。   As described above, with the method described in Patent Document 2, it is naturally difficult to obtain an accurate and significant dynamic analysis result.

さらに他の手法として、プログラム開発者が動的解析をする部分を指定することも考えられた。しかしながら、その場合、正確かつ有意な解析結果を得るためには、プログラム開発者のプログラムに対する正しく詳細な知識が必要であった。そのため、動的解析を行う範囲を正確に限定し、処理量を十分に低減させることは困難であった。   As another method, it was considered that the program developer specified the part to be analyzed dynamically. However, in this case, in order to obtain an accurate and significant analysis result, correct and detailed knowledge of the program developer is necessary. Therefore, it is difficult to accurately limit the range in which dynamic analysis is performed and to sufficiently reduce the processing amount.

また、正確かつ有意な解析結果を得るためには、プログラム開発者が、動的解析をする部分を指定するための煩雑な作業を正確に行う必要もあった。この指定作業の時間も動的処理の処理時間として考慮すると、処理時間を短縮させることができる程高速にこの指定作業を行うことは困難であった。   In addition, in order to obtain an accurate and significant analysis result, it is necessary for the program developer to accurately perform a complicated work for designating a portion to be dynamically analyzed. Considering the designated work time as the processing time of the dynamic processing, it is difficult to perform the designated work at such a high speed that the processing time can be shortened.

このように従来の方法においては、動的解析を現実的な精度で行うことが困難であり、正確かつ有意な解析結果を得ることができない恐れがあった。すなわち、実質的に処理時間を短縮させることは困難であった。   As described above, in the conventional method, it is difficult to perform dynamic analysis with realistic accuracy, and there is a possibility that accurate and significant analysis results cannot be obtained. That is, it has been difficult to substantially reduce the processing time.

そこで、ソースコードの変更情報だけでなく、ソースコードからプログラムを生成する際の付加情報を取得し、それらの情報に基づいてソースコードの変更部分に関連する監視対象を特定し、その特定された監視対象のみを動的解析するようにする。   Therefore, not only the change information of the source code, but also additional information when generating the program from the source code is obtained, and the monitoring target related to the changed portion of the source code is identified based on the information, and the identified information Only the monitoring target is dynamically analyzed.

このようにすることにより、動的解析の監視対象をより正確に制限することができ、適切に処理量を低減させ、プログラムの動的解析の処理時間を十分に低減させることができる。   By doing so, the monitoring target of the dynamic analysis can be more accurately limited, the processing amount can be appropriately reduced, and the processing time of the dynamic analysis of the program can be sufficiently reduced.

[1−2解析装置]
図1は、解析装置の主な構成例を示すブロック図である。
[1-2 analyzer]
FIG. 1 is a block diagram illustrating a main configuration example of the analysis apparatus.

図1に示される解析装置100は、所定の情報を処理する情報処理装置であり、例えば、ソースコードをコンパイルして得られるプログラムを動的解析する。   An analysis apparatus 100 shown in FIG. 1 is an information processing apparatus that processes predetermined information. For example, the analysis apparatus 100 dynamically analyzes a program obtained by compiling a source code.

図1に示されるように、解析装置100は、例えば、ソースコード管理部101、コンパイラ102、記憶部103、動的解析部104、ブレークポイント処理部105、およびエミュレーション処理部106を有する。   As illustrated in FIG. 1, the analysis apparatus 100 includes, for example, a source code management unit 101, a compiler 102, a storage unit 103, a dynamic analysis unit 104, a breakpoint processing unit 105, and an emulation processing unit 106.

ソースコード管理部101は、ソースコードおよびその変更履歴を管理する。ソースコード管理部101が管理するソースコードおよびその変更履歴は、何処に存在していても良い。例えば、ソースコード管理部101がソースコードや変更履歴を記憶し、それを管理するようにしてもよい。また、ソースコード管理部101が、解析装置100の外部の記憶部(記憶装置)に記憶されるソースコードやその変更履歴を管理するようにしてもよい。さらに、ソースコード管理部101が、複数箇所に記憶されるソースコードやその変更履歴を管理するようにしてもよい。   The source code management unit 101 manages the source code and its change history. The source code managed by the source code management unit 101 and its change history may exist anywhere. For example, the source code management unit 101 may store the source code and the change history and manage them. Further, the source code management unit 101 may manage the source code stored in the storage unit (storage device) outside the analysis device 100 and its change history. Furthermore, the source code management unit 101 may manage source codes stored in a plurality of locations and their change history.

例えば、ソースコード管理部101は、ユーザ操作等によって新たなソースコードの保存が指示されると、そのソースコードを管理対象として登録する。また、例えば、ユーザ操作等によって、管理対象のソースコードが更新されると、ソースコード管理部101は、更新後のソースコードを新たな版として登録する。また、ソースコード管理部101は、その更新前後のソースコードの差分を変更履歴として管理する。   For example, when an instruction to save a new source code is given by a user operation or the like, the source code management unit 101 registers the source code as a management target. Further, for example, when the source code to be managed is updated by a user operation or the like, the source code management unit 101 registers the updated source code as a new version. Further, the source code management unit 101 manages the difference between the source codes before and after the update as a change history.

ソースコード管理部101は、例えば解析装置100のユーザの指示などに基づいて、ソースコード管理部101が管理するソースコードの内、選択されたものをコンパイラ102に供給する。また、ソースコード管理部101は、例えば解析装置100のユーザの指示などに基づいて、ソースコード管理部101が管理するソースコードの変更情報の内、選択されたものを動的解析部104に供給する。   The source code management unit 101 supplies the selected one of the source codes managed by the source code management unit 101 to the compiler 102 based on, for example, a user instruction of the analysis apparatus 100. Also, the source code management unit 101 supplies the selected one of the source code change information managed by the source code management unit 101 to the dynamic analysis unit 104 based on, for example, an instruction from the user of the analysis apparatus 100. To do.

変更情報とは、例えば、ソースコード管理部101が管理しているソースコードの各版(バージョン)間で、どの行または部分文字列が変更されたかを示す情報を含む。   The change information includes, for example, information indicating which lines or partial character strings have been changed between the versions (versions) of the source code managed by the source code management unit 101.

コンパイラ102は、ソースコード管理部101から供給されるソースコードをコンパイルしてプログラム111を生成する。コンパイラ102は、生成したプログラム111を記憶部103に供給し、記憶させる。また、コンパイラ102は、そのプログラム111の生成に関する付加情報を動的解析部104に供給する。   The compiler 102 compiles the source code supplied from the source code management unit 101 and generates a program 111. The compiler 102 supplies the generated program 111 to the storage unit 103 and stores it. Further, the compiler 102 supplies additional information related to the generation of the program 111 to the dynamic analysis unit 104.

付加情報は、例えば、コンパイラ102がソースコードから命令コードを生成する際に、ソースコード中のどの部分からどの命令を生成したかを関連付ける情報を含む。また、付加情報は、コンパイラ102がソースコード中の変数をメモリ上に配置する際に、ソースコード中のどの部分からどのメモリアドレスに配置したかを関連付ける情報を含む。   The additional information includes, for example, information relating which instruction is generated from which part in the source code when the compiler 102 generates the instruction code from the source code. Further, the additional information includes information that associates from which part in the source code to which memory address when the compiler 102 arranges the variable in the source code on the memory.

記憶部103は、コンパイラ102が生成したプログラム111を取得し、記憶する。   The storage unit 103 acquires and stores the program 111 generated by the compiler 102.

動的解析部104は、この記憶部103に記憶されるプログラム111を動的解析する。例えば、動的解析部104は、後述する制御部151の制御に基づいて、制御部151に動的解析対象として指定されたプログラム111の動的解析を行う。   The dynamic analysis unit 104 dynamically analyzes the program 111 stored in the storage unit 103. For example, the dynamic analysis unit 104 performs dynamic analysis of the program 111 specified as a dynamic analysis target by the control unit 151 based on control of the control unit 151 described later.

動的解析部104は、このような動的解析を、プログラム111の全体に対してではなく、一部に対してのみ行うことができる。例えば、動的解析部104は、動的解析の監視対象であるプログラム111の、ソースコードの変更部分に関連するものを特定し、その特定された監視対象のみを監視する。このようにすることにより、動的解析部104は、動的解析の処理量を低減させることができる。   The dynamic analysis unit 104 can perform such dynamic analysis only on a part of the program 111, not on the whole. For example, the dynamic analysis unit 104 identifies a program 111 that is a monitoring target of dynamic analysis, that is related to a changed part of the source code, and monitors only the specified monitoring target. By doing in this way, the dynamic analysis part 104 can reduce the processing amount of a dynamic analysis.

動的解析部104は、例えば、動的解析対象のプログラム111について、そのソースコードの、上述した変更情報をソースコード管理部101から取得する。また、動的解析部104は、動的解析対象のプログラム111について、上述した付加情報を、コンパイラ102から取得する。動的解析部104は、これらの情報を用いて、ソースコードの変更部分に関連するものを特定する。   For example, the dynamic analysis unit 104 acquires the above-described change information of the source code of the program 111 to be analyzed from the source code management unit 101. Further, the dynamic analysis unit 104 acquires the above-described additional information from the compiler 102 for the dynamic analysis target program 111. The dynamic analysis unit 104 identifies information related to the changed portion of the source code using these pieces of information.

プログラムのデバッグは、プログラムを開発していく上で何度か行われるが、バグが発見されるところは、前回のデバッグ時から変更した部分である可能性が高い。しかしながら、動的解析は、ソースコードそのものに対しては行わないので、ソースコードの変更履歴だけでは、動的解析の監視対象全体の中から、ソースコード変更部分に対応する部分を特定することは困難である。動的解析部104は、コンパイラ102から付加情報を取得し、それを参照して動的解析を行う部分を特定するので、ソースコード変更部分に対応する部分を、より正確に特定することができる。   The debugging of the program is performed several times in developing the program, but the place where the bug is found is likely to have been changed from the previous debugging. However, since dynamic analysis is not performed on the source code itself, it is not possible to specify the part corresponding to the source code change part from the entire monitoring target of dynamic analysis only by the change history of the source code. Have difficulty. Since the dynamic analysis unit 104 acquires additional information from the compiler 102 and refers to it to identify a portion for dynamic analysis, the portion corresponding to the source code change portion can be more accurately identified. .

しかも、動的解析部104は、これらの情報を参照することにより、ユーザによる動的解析を行う部分の指定無しに、ソースコード変更部分に対応する部分を、容易に特定することができる。   In addition, the dynamic analysis unit 104 can easily specify the part corresponding to the source code change part without referring to the part for performing the dynamic analysis by referring to these pieces of information.

つまり、動的解析部104は、動的解析において監視すべき部分を、より容易かつ正確に特定することができ、適切に処理量を低減させ、プログラムの動的解析の処理時間を十分に低減させることができる。   In other words, the dynamic analysis unit 104 can more easily and accurately specify a portion to be monitored in the dynamic analysis, appropriately reduce the processing amount, and sufficiently reduce the processing time of the dynamic analysis of the program. Can be made.

動的解析として、動的解析部104は、プログラム111を実行し、例えば、使用されるメモリ領域を監視したり、プログラム111に含まれる命令の実行状況を監視したり、デバッグログやメッセージ出力を監視したりする。   As the dynamic analysis, the dynamic analysis unit 104 executes the program 111, for example, monitors the memory area used, monitors the execution status of instructions included in the program 111, and outputs a debug log and message output. Or monitor.

例えば、動的解析部104は、付加情報として、ソースコードの各部分とメモリアドレスを関連付ける情報をコンパイラ102から取得し、その情報に基づいて、ソースコード変更部分が使用するメモリ領域(メモリアドレス)を特定することができる。このようにすることにより、動的解析部104は、メモリ領域の監視について、ソースコード変更部分が使用するメモリ領域(メモリアドレス)のみを監視する(それ以外のメモリ領域の監視を省略する)ことができる。つまり、動的解析部104は、動的解析の処理量を低減させることができる。   For example, the dynamic analysis unit 104 acquires information associating each part of the source code with a memory address as additional information from the compiler 102, and based on this information, a memory area (memory address) used by the source code change part Can be specified. By doing so, the dynamic analysis unit 104 monitors only the memory area (memory address) used by the source code change part for monitoring the memory area (the monitoring of other memory areas is omitted). Can do. That is, the dynamic analysis unit 104 can reduce the processing amount of the dynamic analysis.

メモリ領域を監視する動的解析において、動的解析部104は、例えば、ソースコード変更部分が使用するメモリ領域(メモリアドレス)に対してウォッチポイントを設定し、ブレークポイント処理部105に、そのウォッチポイントを監視させることができる。   In the dynamic analysis for monitoring the memory area, the dynamic analysis unit 104 sets a watchpoint for the memory area (memory address) used by the source code change part, for example, and sets the watchpoint in the breakpoint processing unit 105. The point can be monitored.

この場合、ブレークポイント処理部105は、動的解析におけるプログラム111の実行中、設定されたウォッチポイントを監視し、アクセスがあった場合や、その値が変化したりする場合、プログラム111の実行を停止するブレークポイント処理を実行する。   In this case, the breakpoint processing unit 105 monitors the set watchpoint during execution of the program 111 in the dynamic analysis, and executes the program 111 when there is an access or when the value changes. Execute breakpoint processing to stop.

このようにすることにより、動的解析部104は、ソースコード変更部分が使用するメモリ領域(メモリアドレス)にアクセスがあった時点や、その値が変化した時点の、プログラム111の実行情況を容易に解析することができる。これにより、動的解析部104は、動的解析におけるバグ発見の精度を向上させることができる。   By doing so, the dynamic analysis unit 104 can easily execute the execution state of the program 111 when the memory area (memory address) used by the source code change part is accessed or when the value changes. Can be analyzed. As a result, the dynamic analysis unit 104 can improve the accuracy of bug discovery in the dynamic analysis.

なお、動的解析部104は、例えば、その特定したメモリ領域(メモリアドレス)の近傍に、デバッグ用の領域を確保し、アクセスしたモジュール名などデバッグに有用な情報を記録したり、またはアクセス保護を設定したりすることもできる。   The dynamic analysis unit 104, for example, secures an area for debugging in the vicinity of the specified memory area (memory address) and records information useful for debugging such as the name of the accessed module or access protection. Can also be set.

また、例えば、動的解析部104は、付加情報として、ソースコードの各部分と命令アドレスを関連付ける情報をコンパイラ102から取得し、その情報に基づいて、ソースコード変更部分から生成される命令を特定することができる。このようにすることにより、動的解析部104は、命令の実行状況の監視について、ソースコード変更部分から生成される命令の実行状況のみを監視する(それ以外の命令の実行状況の監視を省略する)ことができる。つまり、動的解析部104は、動的解析の処理量を低減させることができる。   Further, for example, the dynamic analysis unit 104 obtains information associating each part of the source code with the instruction address as additional information from the compiler 102, and specifies an instruction generated from the source code change part based on the information. can do. By doing so, the dynamic analysis unit 104 monitors only the execution status of the instruction generated from the source code change part for monitoring the execution status of the instruction (the monitoring of the execution status of other instructions is omitted). can do. That is, the dynamic analysis unit 104 can reduce the processing amount of the dynamic analysis.

命令の実行状況を監視する動的解析において、動的解析部104は、例えば、ソースコード変更部分から生成される命令の命令アドレスにブレークポイントを設定し、ブレークポイント処理部105に、そのブレークポイントを監視させることができる。   In dynamic analysis for monitoring the execution status of an instruction, the dynamic analysis unit 104 sets a breakpoint at an instruction address of an instruction generated from a source code change portion, for example, and the breakpoint processing unit 105 receives the breakpoint. Can be monitored.

この場合、ブレークポイント処理部105は、動的解析におけるプログラム111の実行中、設定されたブレークポイントを監視し、その命令が実行される場合、プログラム111の実行を停止するブレークポイント処理を実行する。   In this case, the breakpoint processing unit 105 monitors the set breakpoint during execution of the program 111 in the dynamic analysis, and executes breakpoint processing for stopping execution of the program 111 when the instruction is executed. .

このようにすることにより、動的解析部104は、ソースコード変更部分から生成される命令が実行された時点の、プログラム111の実行情況を容易に解析することができる。これにより、動的解析部104は、動的解析におけるバグ発見の精度を向上させることができる。   In this way, the dynamic analysis unit 104 can easily analyze the execution status of the program 111 when the instruction generated from the source code change portion is executed. As a result, the dynamic analysis unit 104 can improve the accuracy of bug discovery in the dynamic analysis.

さらに、動的解析部104は、例えば、エミュレーション(模倣)対象とする他の環境を設定し、エミュレーション処理部106に、その環境をエミュレーション(模倣)させることができる。   Furthermore, the dynamic analysis unit 104 can set, for example, another environment to be emulated (imitation), and can cause the emulation processing unit 106 to emulate (imitate) the environment.

この場合、エミュレーション処理部106は、指定された環境をエミュレーションし、そのエミュレーションした環境において、プログラム111の実行を行う。つまり、エミュレーションされた環境下での動的解析が行われる。このようにすることにより、動的解析部104は、例えば、運用時の環境下での動的解析を行うことができる。つまり、動的解析装置100は、より多様な環境下での動的解析を実現することができる。   In this case, the emulation processing unit 106 emulates the specified environment, and executes the program 111 in the emulated environment. That is, dynamic analysis is performed in an emulated environment. By doing in this way, the dynamic analysis part 104 can perform the dynamic analysis in the environment at the time of operation, for example. That is, the dynamic analysis apparatus 100 can realize dynamic analysis under more various environments.

さらに、例えば、動的解析部104は、付加情報として、プログラム中のデバッグ出力命令の一覧を取得し、その情報に基づいて、ソースコード変更部分に関連するデバッグ出力命令を特定することができる。   Further, for example, the dynamic analysis unit 104 can acquire a list of debug output instructions in the program as additional information, and can specify a debug output instruction related to the source code change part based on the information.

デバッグ出力命令の一覧の入手元は任意であるが、例えば、動的解析部104は、デバッグ出力命令の一覧を、ソースコード管理部101若しくはコンパイラ102から取得する。   For example, the dynamic analysis unit 104 obtains a list of debug output instructions from the source code management unit 101 or the compiler 102.

このデバッグ出力命令の一覧は、どのように生成されてもよい。例えば、ユーザによりデバッグ出力命令として指定される出力命令の一覧を、このデバッグ出力命令の一覧としてもよい。また、例えば、ソースコードに含まれる出力命令の特徴、若しくは、コンパイルされた命令列に含まれる出力命令の特徴に基づいてデバッグ出力命令として選択される出力命令の一覧を、このデバッグ出力命令の一覧としてもよい。   This list of debug output instructions may be generated in any manner. For example, a list of output instructions designated as debug output instructions by the user may be used as the list of debug output instructions. Further, for example, a list of output instructions selected as debug output instructions based on the characteristics of the output instructions included in the source code or the characteristics of the output instructions included in the compiled instruction sequence is displayed as a list of the debug output instructions. It is good.

さらに、この出力命令の特徴は、任意である。例えば、所定の文字列の出力を行うこと(例えばdebugという文字列の出力から始まること)を出力命令の特徴とするようにしてもよいし、所定の関数を呼び出すことを出力命令の特徴とするようにしてもよい。   Furthermore, the feature of this output command is arbitrary. For example, output of a predetermined character string (for example, starting from output of a character string “debug”) may be a feature of the output command, or calling a predetermined function may be a feature of the output command. You may do it.

そして、動的解析部104は、付加情報として、ソースコードの各部分とメモリアドレスを関連付ける情報をコンパイラ102から取得する。動的解析部104は、その情報に基づいて、ソースコード変更部分に関連するデバッグ出力命令により出力されるデバッグ出力が使用するメモリ領域(メモリアドレス)を特定することができる。このようにすることにより、動的解析部104は、デバッグ出力の監視について、ソースコード変更部分に関連するデバッグ出力命令により出力されるデバッグ出力(デバッグログやメッセージ出力)のみを監視する(それ以外のデバッグ出力の監視を省略する)ことができる。つまり、動的解析部104は、動的解析の処理量を低減させることができる。   Then, the dynamic analysis unit 104 acquires information associating each part of the source code with the memory address as additional information from the compiler 102. Based on the information, the dynamic analysis unit 104 can specify the memory area (memory address) used by the debug output output by the debug output instruction related to the source code change portion. By doing so, the dynamic analysis unit 104 monitors only the debug output (debug log and message output) output by the debug output instruction related to the source code change part (other than that). Can be omitted). That is, the dynamic analysis unit 104 can reduce the processing amount of the dynamic analysis.

なお、動的解析部104は、デバッグ用にプログラム111を改変することができる。例えば、動的解析部104は、特定したデバッグ出力命令以外のデバッグ命令の実行を削除または抑制することができる。その場合、動的解析部104は、例えば、付加情報として、ソースコードの各部分と命令アドレスを関連付ける情報をコンパイラ102から取得し、その情報に基づいて、各デバッグ出力命令の命令アドレスを特定する。そして、動的解析部104は、特定したデバッグ出力命令以外のデバッグ出力命令をNOPに書き換える。このようにすることにより、不要なデバッグ出力を削除または抑制することができるので、動的解析部104は、動的解析の処理量を低減させることができる。   The dynamic analysis unit 104 can modify the program 111 for debugging. For example, the dynamic analysis unit 104 can delete or suppress execution of debug instructions other than the specified debug output instruction. In that case, for example, the dynamic analysis unit 104 acquires information associating each part of the source code with the instruction address from the compiler 102 as additional information, and specifies the instruction address of each debug output instruction based on the information. . Then, the dynamic analysis unit 104 rewrites the debug output instruction other than the specified debug output instruction to NOP. In this way, unnecessary debug output can be deleted or suppressed, so that the dynamic analysis unit 104 can reduce the amount of dynamic analysis processing.

また、解析装置100は、制御部151、入力部161、出力部162、記憶部163、通信部164、およびドライブ165を有する。   The analysis apparatus 100 includes a control unit 151, an input unit 161, an output unit 162, a storage unit 163, a communication unit 164, and a drive 165.

制御部151は、例えば、CPU(Central Processing Unit)、ROM(Read Only Memory)、およびRAM(Random Access Memory)等を有し、解析装置100の各部(例えば、ソースコード管理部101乃至エミュレーション処理部106)を制御する。例えば、制御部151のCPUは、ROMに記憶されているプログラムに従って各種の処理を実行する。また、そのCPUは、記憶部163からRAMにロードされたプログラムに従って各種の処理を実行する。RAMにはまた、CPUが各種の処理を実行するにあたって必要なデータなども適宜記憶される。   The control unit 151 includes, for example, a CPU (Central Processing Unit), a ROM (Read Only Memory), a RAM (Random Access Memory), and the like, and each unit (for example, the source code management unit 101 to the emulation processing unit) of the analysis apparatus 100. 106) is controlled. For example, the CPU of the control unit 151 executes various processes according to programs stored in the ROM. In addition, the CPU executes various processes in accordance with programs loaded from the storage unit 163 into the RAM. The RAM also appropriately stores data necessary for the CPU to execute various processes.

入力部161は、例えば、キーボード、マウス、タッチパネル、および外部入力端子などよりなり、ユーザ指示や外部からの情報の入力を受け付け、制御部151に供給する。出力部162は、例えば、CRT(Cathode Ray Tube)ディスプレイやLCD(Liquid Crystal Display)等のディスプレイ、スピーカ、並びに外部出力端子などよりなり、制御部151から供給される各種情報を画像、音声、若しくは、アナログ信号やデジタルデータとして出力する。   The input unit 161 includes, for example, a keyboard, a mouse, a touch panel, an external input terminal, and the like. The input unit 161 accepts user instructions and external information input, and supplies the information to the control unit 151. The output unit 162 includes, for example, a display such as a CRT (Cathode Ray Tube) display or an LCD (Liquid Crystal Display), a speaker, and an external output terminal. The output unit 162 can display various information supplied from the control unit 151 as images, sounds, or Output as analog signal or digital data.

記憶部163は、例えばフラッシュメモリ等SSD(Solid State Drive)やハードディスクなどよりなり、制御部151から供給される情報を記憶したり、制御部151からの要求に従って、記憶している情報を読み出して供給したりする。   The storage unit 163 includes, for example, an SSD (Solid State Drive) such as a flash memory, a hard disk, etc., stores information supplied from the control unit 151, or reads out stored information in accordance with a request from the control unit 151. Or supply.

通信部164は、例えば、有線LAN(Local Area Network)や無線LANのインタフェースやモデムなどよりなり、インターネットを含むネットワークを介して、外部の装置との通信処理を行う。例えば、通信部164は、制御部151から供給される情報を通信相手に送信したり、通信相手から受信した情報を制御部151に供給したりする。   The communication unit 164 includes, for example, a wired LAN (Local Area Network), a wireless LAN interface, a modem, and the like, and performs communication processing with an external device via a network including the Internet. For example, the communication unit 164 transmits information supplied from the control unit 151 to the communication partner or supplies information received from the communication partner to the control unit 151.

ドライブ165は、必要に応じて制御部151に接続される。そして、磁気ディスク、光ディスク、光磁気ディスク、或いは半導体メモリなどのリムーバブルメディア171がそのドライブ165に適宜装着される。そして、そのドライブ165を介してリムーバブルメディア171から読み出されたコンピュータプログラムが、必要に応じて記憶部163にインストールされる。   The drive 165 is connected to the control unit 151 as necessary. Then, a removable medium 171 such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory is appropriately attached to the drive 165. Then, the computer program read from the removable medium 171 via the drive 165 is installed in the storage unit 163 as necessary.

以上のように、解析装置100は、プログラムの動的解析の処理量を低減させることができる。したがって、解析装置100は、プログラムの動的解析をより高速に行い、その処理時間を低減させることができる。   As described above, the analysis apparatus 100 can reduce the processing amount of the dynamic analysis of the program. Therefore, the analysis apparatus 100 can perform dynamic analysis of the program at higher speed and reduce the processing time.

なお、例えば、動作クロックの高速化や、コア数やメモリ容量の増大といった、ハードウエア性能の向上を行えば、当然、動的解析の高速化は、実現可能である。しかしながら、その場合、製造コストや消費電力の増大を伴う恐れがある。また、ハードウエア性能の向上には、技術上の限界がある。このようなデメリットが存在するため、このような高速化が適切であるか否かは、場合によって異なる。したがって、ここでは、解析装置100のハードウエア性能の向上による高速化は考慮しないこととする。   For example, if the hardware performance is improved by increasing the operating clock speed or increasing the number of cores or memory capacity, it is naturally possible to increase the speed of dynamic analysis. However, in that case, there is a risk that the manufacturing cost and power consumption increase. In addition, there are technical limitations in improving hardware performance. Since such disadvantages exist, whether or not such speeding up is appropriate depends on the case. Therefore, here, speeding up due to improvement in hardware performance of the analysis apparatus 100 is not considered.

換言するに、解析装置100は、上述したように動的解析処理を行うことにより、ハードウエア性能の向上を必要とせずに、プログラムの動的解析をより高速に行い、その処理時間を低減させることができる。   In other words, the analysis apparatus 100 performs the dynamic analysis processing as described above, thereby performing the dynamic analysis of the program at a higher speed without reducing the hardware performance and reducing the processing time. be able to.

[1−3具体的動作例]
次に、解析装置100による動的解析の具体的な例について説明する。図2は、動的解析されるプログラム111の、ソースコードの変更履歴の例を示す図である。また、図3は、そのプログラム111の、動的解析されるメモリアドレスと命令アドレスの例を示す図である。
[1-3 Specific operation example]
Next, a specific example of dynamic analysis by the analysis apparatus 100 will be described. FIG. 2 is a diagram showing an example of a source code change history of the program 111 to be dynamically analyzed. FIG. 3 is a diagram showing an example of memory addresses and instruction addresses of the program 111 that are dynamically analyzed.

図2に示されるソースコード201は、ソースコード管理システムによって管理されている、デバッグ対象プログラムの変更前のソースコード(version=1)である。また、図2に示されるソースコード202は、ソースコード管理システムによって管理されている、変更後のソースコード(version=2)である。さらに、図2に示される変更差分情報203は、ソースコード管理システムによって管理されている、ソースコード201とソースコード202との変更差分情報(differences)である。   The source code 201 shown in FIG. 2 is the source code (version = 1) before the change of the debug target program managed by the source code management system. Also, the source code 202 shown in FIG. 2 is the changed source code (version = 2) managed by the source code management system. Furthermore, the change difference information 203 shown in FIG. 2 is change difference information (differences) between the source code 201 and the source code 202 managed by the source code management system.

また、図3に示される付加情報301は、コンパイラ102によって生成された、ソースコードの各部分とメモリアドレスを関連付ける情報である。また、図3に示される付加情報302は、コンパイラ102によって生成された、ソースコードの各部分と命令アドレスを関連付ける情報である。   Further, the additional information 301 shown in FIG. 3 is information that associates each part of the source code and the memory address generated by the compiler 102. Further, the additional information 302 shown in FIG. 3 is information that associates each part of the source code and the instruction address generated by the compiler 102.

動的解析部104は、変更差分情報203に基づいて、4行目が変更されていることを特定する。   The dynamic analysis unit 104 identifies that the fourth line has been changed based on the change difference information 203.

動的解析部104は、メモリ領域を監視する場合、変更部分で使用しているメモリ領域を付加情報301から特定する。例えば、変更差分情報203によると、変更された4行目において「bonus」という変数が使用されている。したがって、動的解析部104は、付加情報301から、この変数「bonus」が格納されるメモリアドレス0xC00Cを特定し、このメモリアドレスを動的解析の監視対象とする。動的解析部104は、例えば、このメモリアドレス0xC00Cに対してウォッチポイントを設定する。   When monitoring the memory area, the dynamic analysis unit 104 identifies the memory area used in the changed part from the additional information 301. For example, according to the change difference information 203, a variable “bonus” is used in the changed fourth line. Therefore, the dynamic analysis unit 104 specifies the memory address 0xC00C in which the variable “bonus” is stored from the additional information 301, and sets this memory address as a monitoring target of the dynamic analysis. For example, the dynamic analysis unit 104 sets a watchpoint for the memory address 0xC00C.

また、命令の実行状況を監視する場合、動的解析部104は、変更部分から生成される命令アドレスを付加情報302から特定する。例えば、変更差分情報203によると、ソースコードの4行目が変更されている。そこで、動的解析部104は、付加情報302を用いて、この4行目から命令がアドレス0x8000および0x8004に生成されていることを特定し、この命令アドレスを動的解析の監視対象とする(4バイト命令が2つ(0x8000-0x8007))。動的解析部104は、例えば、このアドレス0x8000または0x8004に対して、ブレークポイントを設定する。   When monitoring the execution status of an instruction, the dynamic analysis unit 104 identifies an instruction address generated from the changed part from the additional information 302. For example, according to the change difference information 203, the fourth line of the source code is changed. Therefore, the dynamic analysis unit 104 uses the additional information 302 to specify that an instruction is generated at addresses 0x8000 and 0x8004 from the fourth line, and uses the instruction address as a monitoring target for dynamic analysis ( Two 4-byte instructions (0x8000-0x8007)). For example, the dynamic analysis unit 104 sets a breakpoint at the address 0x8000 or 0x8004.

さらに、デバッグログやメッセージを出力する解析を行う場合、動的解析部104は、変更部分に関連するデバッグ出力命令が出力するデバッグ出力を付加情報301から特定する。   Furthermore, when performing analysis for outputting a debug log or a message, the dynamic analysis unit 104 specifies the debug output output by the debug output instruction related to the changed part from the additional information 301.

例えば、ソースコード201(ソースコード202)において、7行目および8行目がデバッグ出力であるとする。動的解析部104は、付加情報301に基づいて、ソースコード変更部分である4行目と関連するデバッグ出力が8行目のデバッグ出力であること(4行目で操作されている変数「bonus」を出力していること)を特定する。   For example, in the source code 201 (source code 202), the 7th and 8th lines are assumed to be debug outputs. Based on the additional information 301, the dynamic analysis unit 104 determines that the debug output associated with the fourth line that is the source code change part is the debug output on the eighth line (the variable “bonus” operated on the fourth line). ”Is specified).

動的解析部104は、付加情報302に基づいて、特定されたデバッグ出力以外のデバッグ出力命令、つまり7行目のデバッグ出力命令の命令アドレス(0x8024および0x8028(0x8024-0x802F))を特定する。そして、動的解析部104は、それらの命令が実行されないように、命令アドレス0x8024および0x8028の命令をNOP(何もしない命令)に書き換える。   Based on the additional information 302, the dynamic analysis unit 104 specifies a debug output instruction other than the specified debug output, that is, the instruction address (0x8024 and 0x8028 (0x8024-0x802F)) of the debug output instruction on the seventh line. Then, the dynamic analysis unit 104 rewrites the instructions at the instruction addresses 0x8024 and 0x8028 to NOP (an instruction that does nothing) so that those instructions are not executed.

なお、以上に説明した例では、直近した2つのバージョン間の変更差分情報を用いたが、解析装置100は、動的解析を行う部分を特定するのに、離れた2つのバージョン間の変更差分情報を用いるようにしても良いし、多くのバージョン間の変更統計を変更情報として用い、変更回数や変更頻度がある閾値以上の部分を監視対象とするようにしても良い。   In the example described above, the change difference information between the two most recent versions is used. However, the analysis apparatus 100 specifies the change difference between the two separated versions in order to specify the portion for performing the dynamic analysis. Information may be used, or change statistics between many versions may be used as change information, and a portion of the number of changes or change frequency equal to or greater than a threshold value may be monitored.

[1−4処理の流れ]
次に、解析装置100により実行される各処理について説明する。
[1-4 Process Flow]
Next, each process executed by the analysis apparatus 100 will be described.

(1)解析処理
図4のフローチャートを参照して、解析装置100により実行される解析処理の流れの例を説明する。解析装置100は、動的解析を行う場合、この解析処理を実行する。
(1) Analysis Processing An example of the flow of analysis processing executed by the analysis device 100 will be described with reference to the flowchart of FIG. The analysis apparatus 100 executes this analysis process when performing dynamic analysis.

例えば、ユーザや他の装置等に、動的解析処理の実行が指示されると、制御部151は、解析処理を開始し、その指示において指定されたソースコードをコンパイラ102に通知する。コンパイラ102は、ステップS101において、ソースコード管理部101から、制御部151に指定されたプログラム111のソースコードを取得する。   For example, when execution of dynamic analysis processing is instructed to a user or another device, the control unit 151 starts analysis processing and notifies the compiler 102 of the source code specified in the instruction. In step S 101, the compiler 102 acquires the source code of the program 111 specified by the control unit 151 from the source code management unit 101.

コンパイラ102は、ステップS102において、ステップS101において取得したソースコードをコンパイルしてプログラム111を生成する。コンパイラ102は、生成したプログラム111を記憶部103に供給し、記憶させる。   In step S102, the compiler 102 compiles the source code acquired in step S101 to generate a program 111. The compiler 102 supplies the generated program 111 to the storage unit 103 and stores it.

なお、動的解析処理の実行が指示された時点で、プログラム111が記憶部103に格納されているようにしてもよい。その場合、ステップS101およびステップS102の処理は省略することができる。また、その場合、ユーザや他の装置等は、動的解析処理の実行指示において、ソースコードではなくプログラム111を指定することもできる。   Note that the program 111 may be stored in the storage unit 103 when the execution of the dynamic analysis process is instructed. In that case, the processing of step S101 and step S102 can be omitted. In this case, the user or another device can also specify the program 111 instead of the source code in the execution instruction of the dynamic analysis process.

制御部151は、動的解析開始の指示において指定されたソースコード(若しくはプログラム111)を動的解析部104に通知する。ステップS103において、動的解析部104は、制御部151から指定されたソースコード(若しくはプログラム111)に対応する付加情報をコンパイラ102から取得する。   The control unit 151 notifies the dynamic analysis unit 104 of the source code (or program 111) designated in the dynamic analysis start instruction. In step S <b> 103, the dynamic analysis unit 104 acquires additional information corresponding to the source code (or program 111) designated from the control unit 151 from the compiler 102.

これらの処理と並列して、または前後して、ステップS104において、動的解析部104は、制御部151から指定されたソースコード(若しくは、制御部151から指定されたプログラム111に対応するソースコード)の変更情報をソースコード管理部101から取得する。   In parallel with or before or after these processes, in step S104, the dynamic analysis unit 104 selects the source code specified by the control unit 151 (or the source code corresponding to the program 111 specified by the control unit 151). ) Change information is acquired from the source code management unit 101.

動的解析部104は、コンパイラ102から得た付加情報とソースコード管理部101から得た変更情報を組み合わせて、解析対象部分を限定して動的解析を行う。動的解析処理の例として、メモリ領域を監視する解析、命令の実行状況を監視する解析、デバッグログやメッセージ出力を用いた解析を挙げる。   The dynamic analysis unit 104 combines the additional information obtained from the compiler 102 and the change information obtained from the source code management unit 101, and performs dynamic analysis by limiting the analysis target portion. Examples of dynamic analysis processing include analysis for monitoring a memory area, analysis for monitoring the execution status of an instruction, and analysis using a debug log or message output.

メモリ領域を監視する場合、動的解析部104は、ステップS105において、変更情報に加えて、コンパイラ102から取得した付加情報のうち、ソースコード中の各部分とメモリアドレス(メモリ領域)を関連付けた情報を用い、ソースコード中で変更のあった部分と関連付けられているメモリアドレス(メモリ領域)を特定する。   When monitoring the memory area, in step S105, the dynamic analysis unit 104 associates each part in the source code with the memory address (memory area) in the additional information acquired from the compiler 102 in addition to the change information. Using the information, the memory address (memory area) associated with the changed part in the source code is specified.

ステップS106において、動的解析部104は、ステップS105において特定されたメモリアドレスへのアクセス、または、そのメモリアドレスに格納されている値を監視する。監視方法としては、例えばウォッチポイントを設定する方法や、メモリ配置を改変して特定アドレスの前後等にデバッグ用の領域を確保し、アクセスしたモジュール名などデバッグに有用な情報を記録したり、またはアクセス保護を設定したりする方法が挙げられる。   In step S106, the dynamic analysis unit 104 monitors access to the memory address specified in step S105 or a value stored in the memory address. As a monitoring method, for example, a method for setting a watchpoint, a memory area is modified to secure a debugging area before and after a specific address, and information useful for debugging such as an accessed module name is recorded, or And how to set access protection.

命令の実行状況を監視する場合、動的解析部104は、ステップS107において、変更情報に加えて、コンパイラ102から取得した付加情報のうち、ソースコード中の各部分と命令アドレスを関連付けた情報を用い、ソースコード中で変更のあった部分と関連付けられている命令アドレスを特定する。   When monitoring the execution status of an instruction, the dynamic analysis unit 104, in step S107, adds information associated with each part in the source code and the instruction address in the additional information acquired from the compiler 102 in addition to the change information. Used to specify the instruction address associated with the changed part in the source code.

ステップS108において、動的解析部104は、ステップS107において特定された命令の実行を監視する。監視方法としては、例えばブレークポイントを設定する方法や、命令をそのまま実行せず、エミュレーション機構を通して実行する方法が挙げられる。   In step S108, the dynamic analysis unit 104 monitors the execution of the instruction specified in step S107. Examples of the monitoring method include a method of setting a breakpoint and a method of executing through an emulation mechanism without executing an instruction as it is.

デバッグログやメッセージ出力を用いた解析を行う場合、動的解析部104は、ステップS109において、プログラム中のデバッグ出力命令の中から、変更情報を用いて変更部分と関連するデバッグ出力命令を特定する。ここでいう関連とは、例えば変更部分から実行されているか、または変更部分で使用されている変数の内容を出力する等である。   When performing analysis using a debug log or message output, in step S109, the dynamic analysis unit 104 specifies a debug output instruction associated with the changed portion using the change information from among the debug output instructions in the program. . The relation here is, for example, that the contents of a variable that is executed from the changed part or used in the changed part is output.

ステップS110において、動的解析部104は、ステップS109において特定されたデバッグ出力以外のデバッグ出力を選択する。   In step S110, the dynamic analysis unit 104 selects a debug output other than the debug output specified in step S109.

ステップS111において、動的解析部104は、付加情報のうち、ソースコード中の各部分と命令アドレスを関連付けた情報を元に、ステップS110において選択されたデバッグ出力命令のアドレスを求め、それらの命令が実行されないようにする。例えば、動的解析部104は、その命令をプログラムから削除または置換しても良いし、分岐命令などで実行されないようにしても良い。   In step S111, the dynamic analysis unit 104 obtains the address of the debug output instruction selected in step S110 based on the information that associates each part in the source code with the instruction address in the additional information, and outputs these instructions. Is not executed. For example, the dynamic analysis unit 104 may delete or replace the instruction from the program, or may not be executed by a branch instruction or the like.

以上の処理が終了すると、解析処理が終了する。   When the above process ends, the analysis process ends.

なお、解析処理を終了する際、動的解析部104は、例えば、動的解析結果を制御部151に供給し、出力部162のディスプレイに表示させたり、スピーカから音声出力させたり、外部出力端子から出力させたりするようにしてもよい。また、この動的解析結果は、記憶部163や記憶部103に記憶させるようにしてもよいし、通信部164を介して他の装置に伝送されるようにしてもよいし、ドライブ165を介してリムーバブルメディア171に記録されるようにしてもよい。   When ending the analysis process, the dynamic analysis unit 104 supplies, for example, the dynamic analysis result to the control unit 151 and displays the result on the display of the output unit 162, outputs the sound from the speaker, or the external output terminal. Or may be output from. The dynamic analysis result may be stored in the storage unit 163 or the storage unit 103, may be transmitted to another device via the communication unit 164, or may be transmitted via the drive 165. May be recorded on the removable medium 171.

以上のように各処理を実行することにより、解析装置100は、プログラムの動的解析の処理量を低減させ、処理時間を低減させることができる。   By executing each process as described above, the analysis apparatus 100 can reduce the processing amount of the dynamic analysis of the program and reduce the processing time.

解析装置100は、例えば、プログラムを動的解析する際に、プログラム全体を監視するのではなく、前回のデバッグ時から変更した部分に限って監視し、他の部分に対する処理を省略することで、動的解析のオーバーヘッドを削減することができる。また、このようにすることにより、バグが起きやすい部分を対象にすることができ、解析装置100は、より効率的に動的解析を行うことができる。   For example, when analyzing the program dynamically, the analysis apparatus 100 does not monitor the entire program, but monitors only the part changed from the previous debugging, and omits processing for other parts. The overhead of dynamic analysis can be reduced. In addition, by doing in this way, it is possible to target a portion where a bug is likely to occur, and the analysis apparatus 100 can perform dynamic analysis more efficiently.

また、解析装置100は、デバッグ出力を行う解析をする際、変更した部分以外に関するデバッグ出力を抑制させることで、デバッグ出力結果の量を低減させることができ、プログラム開発者がデバッグ出力結果を確認する手間を低減させることができる。   In addition, the analysis apparatus 100 can reduce the amount of the debug output result by suppressing the debug output related to other than the changed part when performing the debug output analysis, and the program developer confirms the debug output result. The trouble of performing can be reduced.

また、解析装置100がこのように動的解析を行うことにより、プログラム開発者による動的解析をするべき部分の指定が不要になる。したがって、プログラム開発者は、より容易に動的解析を行うことができ、どこを解析すべきかの正確かつ詳細な知識(ノウハウ)が不要になる。また、プログラム開発者は、動的解析をするべき部分を指定する手間を省略することができる。したがって、解析装置100は、動的解析の処理時間をより低減させることができる。   Further, the analysis apparatus 100 performs dynamic analysis in this manner, so that it is not necessary to specify a part to be dynamically analyzed by the program developer. Therefore, the program developer can perform the dynamic analysis more easily, and accurate and detailed knowledge (know-how) of where to analyze is unnecessary. In addition, the program developer can omit the trouble of specifying the part to be dynamically analyzed. Therefore, the analysis apparatus 100 can further reduce the processing time for dynamic analysis.

<2.第2の実施の形態>
[コンピュータ]
上述した一連の処理は、ハードウエアにより実行させることもできるし、ソフトウエアにより実行させることもできる。一連の処理をソフトウエアにより実行する場合には、そのソフトウエアを構成するプログラムが、コンピュータにインストールされる。ここでコンピュータには、専用のハードウエアに組み込まれているコンピュータや、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のパーソナルコンピュータ等が含まれる。
<2. Second Embodiment>
[Computer]
The series of processes described above can be executed by hardware or can be executed by software. When a series of processing is executed by software, a program constituting the software is installed in the computer. Here, the computer includes, for example, a general-purpose personal computer that can execute various functions by installing a computer incorporated in dedicated hardware and various programs.

図5は、上述した一連の処理をプログラムにより実行するコンピュータのハードウエアの構成例を示すブロック図である。   FIG. 5 is a block diagram showing an example of the hardware configuration of a computer that executes the above-described series of processing by a program.

図5に示されるコンピュータ500において、CPU(Central Processing Unit)501、ROM(Read Only Memory)502、RAM(Random Access Memory)503は、バス504を介して相互に接続されている。   In a computer 500 shown in FIG. 5, a CPU (Central Processing Unit) 501, a ROM (Read Only Memory) 502, and a RAM (Random Access Memory) 503 are connected to each other via a bus 504.

バス504にはまた、入出力インタフェース510も接続されている。入出力インタフェース510には、入力部511、出力部512、記憶部513、通信部514、およびドライブ515が接続されている。   An input / output interface 510 is also connected to the bus 504. An input unit 511, an output unit 512, a storage unit 513, a communication unit 514, and a drive 515 are connected to the input / output interface 510.

入力部511は、例えば、キーボード、マウス、マイクロホン、タッチパネル、入力端子などよりなる。出力部512は、例えば、ディスプレイ、スピーカ、出力端子などよりなる。記憶部513は、例えば、ハードディスク、RAMディスク、不揮発性のメモリなどよりなる。通信部514は、例えば、ネットワークインタフェースよりなる。ドライブ515は、磁気ディスク、光ディスク、光磁気ディスク、または半導体メモリなどのリムーバブルメディア521を駆動する。   The input unit 511 includes, for example, a keyboard, a mouse, a microphone, a touch panel, an input terminal, and the like. The output unit 512 includes, for example, a display, a speaker, an output terminal, and the like. The storage unit 513 includes, for example, a hard disk, a RAM disk, a nonvolatile memory, and the like. The communication unit 514 includes a network interface, for example. The drive 515 drives a removable medium 521 such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory.

以上のように構成されるコンピュータでは、CPU501が、例えば、記憶部513に記憶されているプログラムを、入出力インタフェース510およびバス504を解して、RAM503にロードして実行することにより、上述した一連の処理が行われる。RAM503にはまた、CPU501が各種の処理を実行する上において必要なデータなども適宜記憶される。   In the computer configured as described above, for example, the CPU 501 loads the program stored in the storage unit 513 via the input / output interface 510 and the bus 504, loads the program into the RAM 503, and executes the program. A series of processing is performed. The RAM 503 also appropriately stores data necessary for the CPU 501 to execute various processes.

コンピュータ(CPU501)が実行するプログラムは、例えば、パッケージメディア等としてのリムーバブルメディア521に記録して適用することができる。また、プログラムは、ローカルエリアネットワーク、インターネット、デジタル衛星放送といった、有線または無線の伝送媒体を介して提供することができる。   The program executed by the computer (CPU 501) can be recorded and applied to a removable medium 521 as a package medium or the like, for example. The program can be provided via a wired or wireless transmission medium such as a local area network, the Internet, or digital satellite broadcasting.

コンピュータでは、プログラムは、リムーバブルメディア521をドライブ515に装着することにより、入出力インタフェース510を介して、記憶部513にインストールすることができる。また、プログラムは、有線または無線の伝送媒体を介して、通信部514で受信し、記憶部513にインストールすることができる。その他、プログラムは、ROM502や記憶部513に、あらかじめインストールしておくことができる。   In the computer, the program can be installed in the storage unit 513 via the input / output interface 510 by attaching the removable medium 521 to the drive 515. The program can be received by the communication unit 514 via a wired or wireless transmission medium and installed in the storage unit 513. In addition, the program can be installed in the ROM 502 or the storage unit 513 in advance.

なお、コンピュータが実行するプログラムは、本明細書で説明する順序に沿って時系列に処理が行われるプログラムであっても良いし、並列に、あるいは呼び出しが行われたとき等の必要なタイミングで処理が行われるプログラムであっても良い。   The program executed by the computer may be a program that is processed in time series in the order described in this specification, or in parallel or at a necessary timing such as when a call is made. It may be a program for processing.

また、本明細書において、記録媒体に記録されるプログラムを記述するステップは、記載された順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。   Further, in the present specification, the step of describing the program recorded on the recording medium is not limited to the processing performed in chronological order according to the described order, but may be performed in parallel or It also includes processes that are executed individually.

また、本明細書において、システムとは、複数の構成要素(装置、モジュール(部品)等)の集合を意味し、全ての構成要素が同一筐体中にあるか否かは問わない。したがって、別個の筐体に収納され、ネットワークを介して接続されている複数の装置、及び、1つの筐体の中に複数のモジュールが収納されている1つの装置は、いずれも、システムである。   In this specification, the system means a set of a plurality of components (devices, modules (parts), etc.), and it does not matter whether all the components are in the same housing. Accordingly, a plurality of devices housed in separate housings and connected via a network and a single device housing a plurality of modules in one housing are all systems. .

また、以上において、1つの装置(または処理部)として説明した構成を分割し、複数の装置(または処理部)として構成するようにしてもよい。逆に、以上において複数の装置(または処理部)として説明した構成をまとめて1つの装置(または処理部)として構成されるようにしてもよい。また、各装置(または各処理部)の構成に上述した以外の構成を付加するようにしてももちろんよい。さらに、システム全体としての構成や動作が実質的に同じであれば、ある装置(または処理部)の構成の一部を他の装置(または他の処理部)の構成に含めるようにしてもよい。   In addition, in the above description, the configuration described as one device (or processing unit) may be divided and configured as a plurality of devices (or processing units). Conversely, the configurations described above as a plurality of devices (or processing units) may be combined into a single device (or processing unit). Of course, a configuration other than that described above may be added to the configuration of each device (or each processing unit). Furthermore, if the configuration and operation of the entire system are substantially the same, a part of the configuration of a certain device (or processing unit) may be included in the configuration of another device (or other processing unit). .

以上、添付図面を参照しながら本開示の好適な実施形態について詳細に説明したが、本開示の技術的範囲はかかる例に限定されない。本開示の技術分野における通常の知識を有する者であれば、特許請求の範囲に記載された技術的思想の範疇内において、各種の変更例または修正例に想到し得ることは明らかであり、これらについても、当然に本開示の技術的範囲に属するものと了解される。   The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings, but the technical scope of the present disclosure is not limited to such examples. It is obvious that a person having ordinary knowledge in the technical field of the present disclosure can come up with various changes or modifications within the scope of the technical idea described in the claims. Of course, it is understood that it belongs to the technical scope of the present disclosure.

例えば、本技術は、1つの機能を、ネットワークを介して複数の装置で分担、共同して処理するクラウドコンピューティングの構成をとることができる。   For example, the present technology can take a configuration of cloud computing in which one function is shared by a plurality of devices via a network and jointly processed.

また、上述のフローチャートで説明した各ステップは、1つの装置で実行する他、複数の装置で分担して実行することができる。   In addition, each step described in the above flowchart can be executed by being shared by a plurality of apparatuses in addition to being executed by one apparatus.

さらに、1つのステップに複数の処理が含まれる場合には、その1つのステップに含まれる複数の処理は、1つの装置で実行する他、複数の装置で分担して実行することができる。   Further, when a plurality of processes are included in one step, the plurality of processes included in the one step can be executed by being shared by a plurality of apparatuses in addition to being executed by one apparatus.

なお、本技術は以下のような構成も取ることができる。
(1) プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定する特定部と、
前記特定部により特定された監視対象を監視するように動的解析を行う動的解析部と
を備える情報処理装置。
(2) 前記特定部は、前記変更部分が使用するメモリ領域を特定し、
前記動的解析部は、前記特定部により特定された前記メモリ領域に対するアクセス、および、前記メモリ領域に格納される値の内、少なくともいずれか一方を監視する
前記(1)に記載の情報処理装置。
(3) 前記特定部は、前記ソースコードの各部分とメモリアドレスを関連付ける情報をコンパイラから取得し、取得した前記情報に基づいて、前記変更部分が使用するメモリ領域を特定する
前記(2)に記載の情報処理装置。
(4) ウォッチポイントを監視し、前記ウォッチポイントの値が変化する場合、前記プログラムの実行を停止するブレークポイント処理を実行するブレークポイント処理部をさらに備え、
前記動的解析部は、前記特定部により特定された前記メモリ領域に前記ウォッチポイントを設定し、前記ブレークポイント処理部に対して、前記ウォッチポイントに対する前記ブレークポイント処理を実行させる
前記(2)または(3)に記載の情報処理装置。
(5) 前記動的解析部は、前記特定部により特定されたメモリ領域の近傍に、デバッグ用の領域を確保する
前記(2)乃至(4)のいずれかに記載の情報処理装置。
(6) 前記特定部は、前記変更部分から生成される命令を特定し、
前記動的解析部は、前記特定部により特定された前記命令の実行を監視する
前記(1)乃至(5)のいずれかに記載の情報処理装置。
(7) 前記特定部は、前記ソースコードの各部分と命令アドレスを関連付ける情報をコンパイラから取得し、取得した前記情報に基づいて、前記変更部分から生成される命令を特定する
前記(6)に記載の情報処理装置。
(8) ブレークポイントを監視し、前記ブレークポイントの命令が実行される場合、前記プログラムの実行を停止するブレークポイント処理を実行するブレークポイント処理部をさらに備え、
前記動的解析部は、前記特定部により特定された前記命令の命令アドレスに前記ブレークポイントを設定し、前記ブレークポイント処理部に対して、前記ブレークポイントに対する前記ブレークポイント処理を実行させる
前記(6)または(7)に記載の情報処理装置。
(9) 他の環境を模倣する模倣処理部をさらに備え、
前記動的解析部は、前記模倣処理部に対して、他の環境を模倣させ、前記環境において前記プログラムを実行させる
前記(1)乃至(8)のいずれかに記載の情報処理装置。
(10) 前記特定部は、前記変更部分に関連するデバッグ出力命令を特定し、特定した前記デバッグ出力命令以外のデバッグ出力命令の実行を削除または抑制し、
前記動的解析部は、前記特定部により特定された前記デバッグ出力命令が実行されて出力されるデバッグ出力を監視する
前記(1)乃至(9)のいずれかに記載の情報処理装置。
(11) 前記特定部は、プログラム中のデバッグ出力命令の一覧を取得し、取得した前記デバッグ出力命令の一覧に基づいて、前記変更部分に関連するデバッグ出力命令を特定する
前記(10)に記載の情報処理装置。
(12) 前記特定部は、ユーザによりデバッグ出力命令として指定される出力命令の一覧を、前記デバッグ出力命令の一覧として取得する
前記(11)に記載の情報処理装置。
(13) 前記特定部は、ソースコードに含まれる出力命令の特徴、若しくは、コンパイルされた命令列に含まれる出力命令の特徴に基づいてデバッグ出力命令として選択される出力命令の一覧を、前記デバッグ出力命令の一覧として取得する
前記(11)または(12)に記載の情報処理装置。
(14) 前記特定部は、所定の文字列の出力を行う出力命令の一覧を、前記デバッグ出力命令の一覧として取得する
前記(13)に記載の情報処理装置。
(15) 前記特定部は、所定の関数を呼び出す出力命令の一覧を、前記デバッグ出力命令の一覧として取得する
前記(13)または(14)に記載の情報処理装置。
(16) 前記特定部は、特定した前記デバッグ出力命令以外のデバッグ出力命令をNOPに書き換える
前記(10)乃至(15)のいずれかに記載の情報処理装置。
(17) 情報処理装置の情報処理方法であって、
前記情報処理装置が、
プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定し、
特定された監視対象を監視するように動的解析を行う
情報処理方法。
(18) コンピュータを、
プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定する特定部と、
前記特定部により特定された監視対象を監視するように動的解析を行う動的解析部と
して機能させるためのプログラム。
In addition, this technique can also take the following structures.
(1) a specifying unit for specifying a part related to a changed part of the source code of the program from among the monitoring targets of the dynamic analysis to be executed and analyzed;
An information processing apparatus comprising: a dynamic analysis unit that performs dynamic analysis so as to monitor the monitoring target specified by the specifying unit.
(2) The specifying unit specifies a memory area used by the change part,
The information processing apparatus according to (1), wherein the dynamic analysis unit monitors at least one of access to the memory area specified by the specifying unit and a value stored in the memory area. .
(3) The specifying unit acquires information associating each part of the source code with a memory address from a compiler, and specifies a memory area used by the changed part based on the acquired information. The information processing apparatus described.
(4) A watchpoint is monitored, and when the value of the watchpoint changes, a breakpoint processing unit that executes a breakpoint process that stops execution of the program is further provided.
The dynamic analysis unit sets the watchpoint in the memory area specified by the specifying unit, and causes the breakpoint processing unit to execute the breakpoint processing for the watchpoint. The information processing apparatus according to (3).
(5) The information processing apparatus according to any one of (2) to (4), wherein the dynamic analysis unit secures an area for debugging in the vicinity of the memory area specified by the specifying unit.
(6) The specifying unit specifies an instruction generated from the change part,
The information processing apparatus according to any one of (1) to (5), wherein the dynamic analysis unit monitors execution of the instruction specified by the specifying unit.
(7) The specifying unit acquires information associating each part of the source code with an instruction address from a compiler, and specifies an instruction generated from the changed part based on the acquired information. The information processing apparatus described.
(8) further comprising a breakpoint processing unit that monitors a breakpoint and executes a breakpoint process for stopping execution of the program when the instruction of the breakpoint is executed;
The dynamic analysis unit sets the breakpoint at the instruction address of the instruction specified by the specifying unit, and causes the breakpoint processing unit to execute the breakpoint processing for the breakpoint. ) Or the information processing apparatus according to (7).
(9) It further includes an imitation processing unit that imitates other environments,
The information processing apparatus according to any one of (1) to (8), wherein the dynamic analysis unit causes the imitation processing unit to imitate another environment and execute the program in the environment.
(10) The specifying unit specifies a debug output instruction related to the changed part, and deletes or suppresses execution of a debug output instruction other than the specified debug output instruction,
The information processing apparatus according to any one of (1) to (9), wherein the dynamic analysis unit monitors a debug output output by executing the debug output instruction specified by the specifying unit.
(11) The specification unit acquires a list of debug output instructions in a program, and specifies a debug output instruction related to the changed portion based on the acquired list of debug output instructions. Information processing device.
(12) The information processing apparatus according to (11), wherein the specifying unit acquires a list of output instructions specified as a debug output instruction by a user as the list of debug output instructions.
(13) The specifying unit displays a list of output instructions selected as a debug output instruction based on the characteristics of the output instructions included in the source code or the characteristics of the output instructions included in the compiled instruction sequence. The information processing apparatus according to (11) or (12), which is acquired as a list of output commands.
(14) The information processing apparatus according to (13), wherein the specifying unit acquires a list of output instructions for outputting a predetermined character string as the list of debug output instructions.
(15) The information processing apparatus according to (13) or (14), wherein the specifying unit acquires a list of output instructions for calling a predetermined function as the list of debug output instructions.
(16) The information processing apparatus according to any one of (10) to (15), wherein the specifying unit rewrites a debug output instruction other than the specified debug output instruction into a NOP.
(17) An information processing method for an information processing apparatus,
The information processing apparatus is
From the monitoring targets of the dynamic analysis to be executed and analyzed, specify those related to the modified part of the source code of the program,
An information processing method that performs dynamic analysis to monitor the specified monitoring target.
(18) Connect the computer
A specific unit for identifying a target related to a changed part of the source code of the program from among the monitoring targets of the dynamic analysis to be executed and analyzed;
A program for causing a dynamic analysis unit to perform dynamic analysis so as to monitor a monitoring target specified by the specifying unit.

100 解析装置, 101 ソースコード管理部, 102 コンパイラ, 103 記憶部, 104 動的解析部, 105 ブレークポイント処理部, 106 エミュレーション処理部, 151 制御部, 161 入力部, 162 出力部, 163 記憶部, 164 通信部, 165 ドライブ, 171 リムーバブルメディア   DESCRIPTION OF SYMBOLS 100 Analysis apparatus, 101 Source code management part, 102 Compiler, 103 Storage part, 104 Dynamic analysis part, 105 Breakpoint processing part, 106 Emulation processing part, 151 Control part, 161 Input part, 162 Output part, 163 Storage part, 164 communication unit, 165 drive, 171 removable media

Claims (18)

プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定する特定部と、
前記特定部により特定された監視対象を監視するように動的解析を行う動的解析部と
を備える情報処理装置。
A specific unit for identifying a target related to a changed part of the source code of the program from among the monitoring targets of the dynamic analysis to be executed and analyzed;
An information processing apparatus comprising: a dynamic analysis unit that performs dynamic analysis so as to monitor the monitoring target specified by the specifying unit.
前記特定部は、前記変更部分が使用するメモリ領域を特定し、
前記動的解析部は、前記特定部により特定された前記メモリ領域に対するアクセス、および、前記メモリ領域に格納される値の内、少なくともいずれか一方を監視する
請求項1に記載の情報処理装置。
The specifying unit specifies a memory area used by the change part,
The information processing apparatus according to claim 1, wherein the dynamic analysis unit monitors at least one of access to the memory area specified by the specifying unit and a value stored in the memory area.
前記特定部は、前記ソースコードの各部分とメモリアドレスを関連付ける情報をコンパイラから取得し、取得した前記情報に基づいて、前記変更部分が使用するメモリ領域を特定する
請求項2に記載の情報処理装置。
The information processing unit according to claim 2, wherein the specifying unit acquires information associating each part of the source code with a memory address from a compiler, and specifies a memory area used by the change part based on the acquired information. apparatus.
ウォッチポイントを監視し、前記ウォッチポイントの値が変化する場合、前記プログラムの実行を停止するブレークポイント処理を実行するブレークポイント処理部をさらに備え、
前記動的解析部は、前記特定部により特定された前記メモリ領域に前記ウォッチポイントを設定し、前記ブレークポイント処理部に対して、前記ウォッチポイントに対する前記ブレークポイント処理を実行させる
請求項2に記載の情報処理装置。
A breakpoint processing unit for monitoring a watchpoint and executing a breakpoint process for stopping execution of the program when the value of the watchpoint changes;
The dynamic analysis unit sets the watchpoint in the memory area specified by the specifying unit, and causes the breakpoint processing unit to execute the breakpoint processing for the watchpoint. Information processing device.
前記動的解析部は、前記特定部により特定されたメモリ領域の近傍に、デバッグ用の領域を確保する
請求項2に記載の情報処理装置。
The information processing apparatus according to claim 2, wherein the dynamic analysis unit secures an area for debugging in the vicinity of the memory area specified by the specifying unit.
前記特定部は、前記変更部分から生成される命令を特定し、
前記動的解析部は、前記特定部により特定された前記命令の実行を監視する
請求項1に記載の情報処理装置。
The specifying unit specifies an instruction generated from the change part,
The information processing apparatus according to claim 1, wherein the dynamic analysis unit monitors execution of the instruction specified by the specifying unit.
前記特定部は、前記ソースコードの各部分と命令アドレスを関連付ける情報をコンパイラから取得し、取得した前記情報に基づいて、前記変更部分から生成される命令を特定する
請求項6に記載の情報処理装置。
The information processing unit according to claim 6, wherein the specifying unit acquires information associating each part of the source code with an instruction address from a compiler, and specifies an instruction generated from the changed part based on the acquired information. apparatus.
ブレークポイントを監視し、前記ブレークポイントの命令が実行される場合、前記プログラムの実行を停止するブレークポイント処理を実行するブレークポイント処理部をさらに備え、
前記動的解析部は、前記特定部により特定された前記命令の命令アドレスに前記ブレークポイントを設定し、前記ブレークポイント処理部に対して、前記ブレークポイントに対する前記ブレークポイント処理を実行させる
請求項6に記載の情報処理装置。
A breakpoint processing unit for monitoring a breakpoint and executing a breakpoint process for stopping execution of the program when an instruction of the breakpoint is executed;
The dynamic analysis unit sets the breakpoint at the instruction address of the instruction specified by the specifying unit, and causes the breakpoint processing unit to execute the breakpoint processing for the breakpoint. The information processing apparatus described in 1.
他の環境を模倣する模倣処理部をさらに備え、
前記動的解析部は、前記模倣処理部に対して、他の環境を模倣させ、前記環境において前記プログラムを実行させる
請求項1に記載の情報処理装置。
It further includes an imitation processing unit that imitates other environments,
The information processing apparatus according to claim 1, wherein the dynamic analysis unit causes the imitation processing unit to imitate another environment and execute the program in the environment.
前記特定部は、前記変更部分に関連するデバッグ出力命令を特定し、特定した前記デバッグ出力命令以外のデバッグ出力命令の実行を削除または抑制し、
前記動的解析部は、前記特定部により特定された前記デバッグ出力命令が実行されて出力されるデバッグ出力を監視する
請求項1に記載の情報処理装置。
The specifying unit specifies a debug output instruction related to the changed part, and deletes or suppresses execution of a debug output instruction other than the specified debug output instruction;
The information processing apparatus according to claim 1, wherein the dynamic analysis unit monitors a debug output output by executing the debug output instruction specified by the specifying unit.
前記特定部は、プログラム中のデバッグ出力命令の一覧を取得し、取得した前記デバッグ出力命令の一覧に基づいて、前記変更部分に関連するデバッグ出力命令を特定する
請求項10に記載の情報処理装置。
The information processing apparatus according to claim 10, wherein the specifying unit acquires a list of debug output instructions in a program, and specifies a debug output instruction related to the changed portion based on the acquired list of debug output instructions. .
前記特定部は、ユーザによりデバッグ出力命令として指定される出力命令の一覧を、前記デバッグ出力命令の一覧として取得する
請求項11に記載の情報処理装置。
The information processing apparatus according to claim 11, wherein the specifying unit acquires a list of output instructions designated as a debug output instruction by a user as the list of debug output instructions.
前記特定部は、ソースコードに含まれる出力命令の特徴、若しくは、コンパイルされた命令列に含まれる出力命令の特徴に基づいてデバッグ出力命令として選択される出力命令の一覧を、前記デバッグ出力命令の一覧として取得する
請求項11に記載の情報処理装置。
The specifying unit displays a list of output instructions selected as a debug output instruction based on the characteristics of the output instruction included in the source code or the characteristics of the output instruction included in the compiled instruction sequence. The information processing apparatus according to claim 11, acquired as a list.
前記特定部は、所定の文字列の出力を行う出力命令の一覧を、前記デバッグ出力命令の一覧として取得する
請求項13に記載の情報処理装置。
The information processing apparatus according to claim 13, wherein the specifying unit acquires a list of output instructions for outputting a predetermined character string as a list of the debug output instructions.
前記特定部は、所定の関数を呼び出す出力命令の一覧を、前記デバッグ出力命令の一覧として取得する
請求項13に記載の情報処理装置。
The information processing apparatus according to claim 13, wherein the specifying unit acquires a list of output instructions that call a predetermined function as the list of debug output instructions.
前記特定部は、特定した前記デバッグ出力命令以外のデバッグ出力命令をNOPに書き換える
請求項10に記載の情報処理装置。
The information processing apparatus according to claim 10, wherein the specifying unit rewrites a debug output instruction other than the specified debug output instruction to NOP.
情報処理装置の情報処理方法であって、
前記情報処理装置が、
プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定し、
特定された監視対象を監視するように動的解析を行う
情報処理方法。
An information processing method for an information processing apparatus,
The information processing apparatus is
From the monitoring targets of the dynamic analysis to be executed and analyzed, specify those related to the modified part of the source code of the program,
An information processing method that performs dynamic analysis to monitor the specified monitoring target.
コンピュータを、
プログラムを実行させて解析する動的解析の監視対象の中から、前記プログラムのソースコードの変更部分に関連するものを特定する特定部と、
前記特定部により特定された監視対象を監視するように動的解析を行う動的解析部と
して機能させるためのプログラム。
Computer
A specific unit for identifying a target related to a changed part of the source code of the program from among the monitoring targets of the dynamic analysis to be executed and analyzed;
A program for causing a dynamic analysis unit to perform dynamic analysis so as to monitor a monitoring target specified by the specifying unit.
JP2012076165A 2012-03-29 2012-03-29 Information processor, information processing method, and program Pending JP2013206266A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012076165A JP2013206266A (en) 2012-03-29 2012-03-29 Information processor, information processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012076165A JP2013206266A (en) 2012-03-29 2012-03-29 Information processor, information processing method, and program

Publications (1)

Publication Number Publication Date
JP2013206266A true JP2013206266A (en) 2013-10-07

Family

ID=49525249

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012076165A Pending JP2013206266A (en) 2012-03-29 2012-03-29 Information processor, information processing method, and program

Country Status (1)

Country Link
JP (1) JP2013206266A (en)

Similar Documents

Publication Publication Date Title
US11694299B2 (en) Methods and apparatus to emulate graphics processing unit instructions
JP4901075B2 (en) Computer-readable medium, method and computing device
US7900198B2 (en) Method and system for parameter profile compiling
US8910126B2 (en) Compiling source code for debugging with variable value restoration based on debugging user activity
US20110191752A1 (en) Method and System for Debugging of Software on Target Devices
US9372770B2 (en) Hardware platform validation
US8347278B2 (en) Instrumenting a compiled software routine for augmentation
US20220100512A1 (en) Deterministic replay of a multi-threaded trace on a multi-threaded processor
US9117020B2 (en) Determining control flow divergence due to variable value difference
US20080127119A1 (en) Method and system for dynamic debugging of software
US8904346B1 (en) Method and system for automated load testing of web applications
CN106293687B (en) A kind of control method and device being packaged process
US9195562B2 (en) Recording external processes
US20080127118A1 (en) Method and system for dynamic patching of software
GB2594269A (en) Emulation software and a method of emulating behaviour of a device containing one or more DSP cores
US9075921B2 (en) Error simulation
US9710360B2 (en) Optimizing error parsing in an integrated development environment
JP2012123726A (en) Simulation device and simulation program
US20170286275A1 (en) System for monitoring and reporting performance and correctness issues across design, compile and runtime
JP2013206266A (en) Information processor, information processing method, and program
US20090271770A1 (en) Method, system, and computer program product for generating unit testing scripts
CN109753308B (en) Instruction path verification system and instruction path monitoring method
US10061604B2 (en) Program execution recording and playback
JP2013206061A (en) Information processing device and method, and program
WO2024086965A1 (en) Testing device driver by combining the device driver, firmware emulation layer, embedded simulator, and model of hardware subsystem within single native host application