JP2014026347A - Monitoring device, computer program, and monitoring method - Google Patents
Monitoring device, computer program, and monitoring method Download PDFInfo
- Publication number
- JP2014026347A JP2014026347A JP2012164155A JP2012164155A JP2014026347A JP 2014026347 A JP2014026347 A JP 2014026347A JP 2012164155 A JP2012164155 A JP 2012164155A JP 2012164155 A JP2012164155 A JP 2012164155A JP 2014026347 A JP2014026347 A JP 2014026347A
- Authority
- JP
- Japan
- Prior art keywords
- monitoring
- order
- memory access
- information
- access
- 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
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 308
- 238000000034 method Methods 0.000 title claims abstract description 197
- 238000004590 computer program Methods 0.000 title claims abstract description 13
- 238000012806 monitoring device Methods 0.000 title claims description 16
- 230000015654 memory Effects 0.000 claims abstract description 316
- 230000008569 process Effects 0.000 claims abstract description 182
- 238000012545 processing Methods 0.000 claims description 113
- 230000006870 function Effects 0.000 description 92
- 238000010586 diagram Methods 0.000 description 25
- 238000001514 detection method Methods 0.000 description 11
- 238000005259 measurement Methods 0.000 description 6
- 230000008859 change Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000013500 data storage Methods 0.000 description 3
- 238000012905 input function Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000000737 periodic effect Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
【課題】プログラム内の複数の処理の実行順序を監視することができる監視装置、コンピュータプログラム及び監視方法を提供する。
【解決手段】実行部21で監視対象プログラム3内のメモリアクセス処理が実行されると、メモリアクセス処理に関する監視位置情報が監視部22へ通知される。ID特定部221は、監視テーブル4を用いて、実行部21から順位通知された監視位置情報毎に、当該監視位置情報に対応する順序情報を順次特定する。メモリアクセス順序判定部222は、ID特定部221で特定した順序情報と一致する監視テーブル4内の順序情報に応じて、実行部21で実行するメモリアクセス用I/Fの実行順序が所定の実行順序であるか否かを判定する。
【選択図】図20A monitoring apparatus, a computer program, and a monitoring method capable of monitoring the execution order of a plurality of processes in a program are provided.
When a memory access process in a monitoring target program is executed by an execution unit, monitoring position information related to the memory access process is notified to the monitoring unit. Using the monitoring table 4, the ID specifying unit 221 sequentially specifies the order information corresponding to the monitoring position information for each monitoring position information notified of the rank from the execution unit 21. The memory access order determination unit 222 executes the execution order of the memory access I / F executed by the execution unit 21 according to the order information in the monitoring table 4 that matches the order information specified by the ID specification unit 221. It is determined whether it is an order.
[Selection] Figure 20
Description
本発明は、プログラム内の複数の処理を実行する実行部が実行する処理の順序を監視する監視装置、該監視装置を実現するためのコンピュータプログラム及び監視方法に関する。 The present invention relates to a monitoring apparatus that monitors the order of processes executed by an execution unit that executes a plurality of processes in a program, a computer program for realizing the monitoring apparatus, and a monitoring method.
プログラムが組み込まれた組込機器又は組込システムにおいて、監視対象であるプログラム(モジュール)に監視コードを予め挿入しておくことにより、組込機器又は組込システム内で実行される処理の順序が正しいか否かを判定する監視機能が実現されている。 In an embedded device or an embedded system in which a program is incorporated, by inserting a monitoring code into a program (module) to be monitored in advance, the order of processing executed in the embedded device or the embedded system can be changed. A monitoring function for determining whether or not it is correct is realized.
例えば、プログラムのソースコードから監視対象となるモジュールを検出する検出部、監視対象となるモジュールを識別する識別コードを定義したシーケンス監視テーブル、監視対象となるモジュールに対して監視用コードを生成する生成部、生成した監視用コードを各モジュールのソースコードに挿入して得られたソースコードを出力する出力部などを備えたシーケンス監視自動プログラミング装置が開示されている(特許文献1参照)。 For example, a detection unit for detecting a module to be monitored from a program source code, a sequence monitoring table in which an identification code for identifying the module to be monitored is defined, and a generation for generating a monitoring code for the module to be monitored And a sequence monitoring automatic programming device including an output unit that outputs a source code obtained by inserting the generated monitoring code into the source code of each module (see Patent Document 1).
特許文献1の装置にあっては、プログラムの各モジュールの実行順序(シーケンス)を監視することができる。このようなモジュールでは、メモリ領域にアクセスして、データの読出し及びデータの書込みなどの複数のメモリアクセス処理が実行される。また、このようなメモリアクセス処理は、複数のモジュールから呼び出すことができるメモリアクセス専用の外部関数が用いられている。
In the apparatus of
一般的にプログラムがメモリ領域にアクセスして処理を行う際には、必ず初期データの書込み処理を行ってからデータの読出し処理を行うように、同じモジュール内であっても、メモリアクセス処理の順序が定められており、メモリアクセス処理の順序には制約が存在する。 In general, when a program accesses a memory area to perform processing, the order of memory access processing is performed even in the same module so that the data is read after the initial data is written. There are restrictions on the order of memory access processing.
例えば、同じモジュール内において、特定の条件が成立した場合にのみメモリアクセスを実行することがある。このため、それぞれのモジュールが正しい順序で実行されている場合であっても、各モジュール内の処理について注目すると、各モジュール内のメモリアクセス処理が誤った順序で実行されてしまう場合もある。しかし、特許文献1の装置は、各モジュールの実行順序のみを監視するので、このようなメモリアクセス処理の順序までは監視することができない。
For example, memory access may be executed only when a specific condition is satisfied in the same module. For this reason, even if the modules are executed in the correct order, if attention is paid to the processing in each module, the memory access processing in each module may be executed in the wrong order. However, since the apparatus of
また、モジュール内に割込みの発生によって実行される割込み処理が存在する場合、同じモジュール内の複数個所で割込み処理が実行される可能性があり、また実行箇所はプログラムの実行中に決定される。そして、割込み処理からのメモリアクセスには、割込み前の通常の処理がメモリ領域にデータを一旦書込んだ後、割込み処理がメモリ領域のデータを読出す等のメモリアクセス順序の制約が存在する。このような場合においても、特許文献1の装置は、各モジュールの実行順序のみを監視するので、このような割込み処理の順序までは監視することができない。
Further, when there is an interrupt process executed by the occurrence of an interrupt in the module, the interrupt process may be executed at a plurality of places in the same module, and the execution place is determined during the execution of the program. The memory access from the interrupt process has restrictions on the memory access order such that the normal process before the interrupt once writes the data in the memory area and then the interrupt process reads the data in the memory area. Even in such a case, since the apparatus of
本発明は、斯かる事情に鑑みてなされたものであり、プログラム内の複数の処理の実行順序を監視することができる監視装置、該監視装置を実現するためのコンピュータプログラム及び監視方法を提供することを目的とする。 The present invention has been made in view of such circumstances, and provides a monitoring device capable of monitoring the execution order of a plurality of processes in a program, a computer program for realizing the monitoring device, and a monitoring method. For the purpose.
第1発明に係る監視装置は、プログラム内の複数の処理を実行する実行部を備え、該実行部が実行する処理の順序を監視する監視装置において、メモリのアクセスに関する複数の監視対象のアクセス処理の実行順序を定める順序情報と該監視対象のアクセス処理によるメモリアクセスに関する固有情報とを関連付けた監視テーブルを記憶する記憶部と、前記実行部で複数のアクセス処理を順次実行した場合に、該アクセス処理によるメモリアクセスに関する固有情報を順次検出する検出手段と、前記監視テーブルを用いて、前記検出手段で検出した固有情報に対応する順序情報を順次特定する特定手段と、該特定手段で特定した順序情報に応じて前記実行部が実行する監視対象のアクセス処理の順序を監視する監視手段とを備えることを特徴とする。 A monitoring apparatus according to a first aspect of the present invention includes an execution unit that executes a plurality of processes in a program, and monitors the order of processes executed by the execution unit. In the monitoring apparatus, a plurality of monitoring target access processes related to memory access When a plurality of access processes are sequentially executed by the execution unit, the storage unit storing a monitoring table in which the order information for determining the execution order of the monitoring target and the specific information related to the memory access by the access process to be monitored is associated Detection means for sequentially detecting unique information related to memory access by processing, specification means for sequentially specifying order information corresponding to the unique information detected by the detection means using the monitoring table, and order specified by the specification means Monitoring means for monitoring the order of access processing to be monitored executed by the execution unit according to information. To.
第2発明に係る監視装置は、第1発明において、前記検出手段で検出した固有情報に対応する順序情報が前記監視テーブルに存在するか否かを判定する判定手段を備え、前記特定手段は、前記判定手段が存在すると判定した順序情報を特定するようにしてあることを特徴とする。 The monitoring device according to a second aspect of the present invention includes a determination unit that determines whether or not order information corresponding to the unique information detected by the detection unit exists in the monitoring table in the first invention, and the specifying unit includes: The order information determined to be present by the determination means is specified.
第3発明に係る監視装置は、第1発明又は第2発明において、前記監視テーブルは、前記順序情報により前記監視対象のアクセス処理の所定の実行順序を特定するようにしてあり、前記監視手段は、前記特定手段が特定した順序情報と一致する前記監視テーブル内の順序情報に応じて、前記実行部で実行する監視対象のアクセス処理の順序が前記所定の実行順序であるか否かを判定する順序判定手段を備えることを特徴とする。 In the monitoring device according to a third aspect of the present invention, in the first or second aspect, the monitoring table specifies a predetermined execution order of the access processing to be monitored based on the order information, and the monitoring means includes: In accordance with the order information in the monitoring table that matches the order information specified by the specifying means, it is determined whether or not the order of the access processing to be monitored executed by the execution unit is the predetermined execution order. An order determining means is provided.
第4発明に係る監視装置は、第3発明において、前記順序判定手段が前記実行部で実行する監視対象のアクセス処理の順序が前記所定の実行順序でないと判定した場合、所定のエラー処理を行うエラー処理手段を備えることを特徴とする。 A monitoring apparatus according to a fourth invention performs a predetermined error process in the third invention, when the order determination means determines that the order of the monitoring target access processes executed by the execution unit is not the predetermined execution order. An error processing means is provided.
第5発明に係る監視装置は、第1発明乃至第4発明のいずれか1つにおいて、前記固有情報は、前記監視対象のアクセス処理に対応する機械語のメモリアドレスを含むことを特徴とする。 According to a fifth aspect of the present invention, in the monitoring apparatus according to any one of the first to fourth aspects, the unique information includes a memory address of a machine language corresponding to the access process to be monitored.
第6発明に係る監視装置は、第1発明乃至第5発明のいずれか1つにおいて、前記固有情報は、メモリからの読み込み処理若しくはメモリへの書き込みの処理の種別、アクセスするメモリのアドレス又はメモリへの書き込み値に関する情報を含むことを特徴とする。 The monitoring device according to a sixth aspect of the present invention is the monitoring device according to any one of the first to fifth aspects, wherein the specific information includes a type of a process of reading from or writing to a memory, an address of a memory to be accessed, or a memory It contains the information regarding the write value to.
第7発明に係るコンピュータプログラムは、コンピュータに、プログラムを構成する複数の処理を実行する実行部が実行する処理の順序を監視させるためのコンピュータプログラムにおいて、コンピュータに、前記実行部で複数のアクセス処理を順次実行した場合に、該アクセス処理によるメモリアクセスに関する固有情報を順次検出するステップと、メモリのアクセスに関する複数の監視対象のアクセス処理の実行順序を定める順序情報と該監視対象のアクセス処理によるメモリアクセスに関する固有情報とを関連付けた監視テーブルを用いて、検出した固有情報に対応する順序情報を順次特定するステップと、特定した順序情報に応じて前記実行部が実行する監視対象のアクセス処理の順序を監視するステップとを実行させることを特徴とする。 A computer program according to a seventh aspect of the present invention is a computer program for causing a computer to monitor the order of processes executed by an execution unit that executes a plurality of processes constituting the program. Sequentially detecting specific information related to memory access by the access processing, order information for determining the execution order of a plurality of monitoring target access processing related to memory access, and memory by the monitoring target access processing A step of sequentially specifying order information corresponding to the detected unique information using a monitoring table that associates specific information related to access, and an order of access processing to be executed by the execution unit according to the specified order information And a step of monitoring To.
第8発明に係る監視方法は、プログラムを構成する複数の処理を実行する実行部を備え、該実行部が実行する処理の順序を監視する監視装置による監視方法において、メモリのアクセスに関する複数の監視対象のアクセス処理の実行順序を定める順序情報と該監視対象のアクセス処理によるメモリアクセスに関する固有情報とを関連付けた監視テーブルを記憶しておくステップと、前記実行部で複数のアクセス処理を順次実行した場合に、該アクセス処理によるメモリアクセスに関する固有情報を順次検出するステップと、前記監視テーブルを用いて、検出された固有情報に対応する順序情報を順次特定するステップと、特定された順序情報に応じて前記実行部が実行する監視対象のアクセス処理の順序を監視するステップとを含むことを特徴とする。 A monitoring method according to an eighth aspect of the present invention is a monitoring method by a monitoring device that includes an execution unit that executes a plurality of processes constituting a program, and that monitors the order of processes executed by the execution unit. Storing a monitoring table associating sequence information for determining the execution order of the target access processing with specific information relating to memory access by the access processing of the monitoring target, and executing the plurality of access processing in the execution unit sequentially A step of sequentially detecting unique information regarding memory access by the access processing, a step of sequentially specifying order information corresponding to the detected unique information using the monitoring table, and a step according to the specified order information Monitoring the order of monitored access processes executed by the execution unit. To.
第1発明、第7発明及び第8発明にあっては、メモリのアクセスに関する複数の監視対象のアクセス処理の実行順序を定める順序情報と監視対象のアクセス処理によるメモリアクセスに関する固有情報とを関連付けた監視テーブルを記憶部に記憶する。順序情報は、メモリアクセスの順序を特定することができる情報である。順序情報は、例えば、モジュール等の区別を示す系列、当該系列内でのアクセス処理の実行順序を示すIDなどの情報を含む。固有情報は、監視位置情報であり、例えば、メモリアクセスを実行するアクセス処理を呼び出す関数名、アクセスするメモリ領域(メモリのアドレス)、メモリアクセスの処理内容(読込み処理又は書込み処理の別)、メモリアクセスが書込み処理である場合の書込み値、同一関数において同一処理内容のアクセス処理の実行順番を識別する番号、アクセス処理に対応する命令コード(オブジェクトコード)のアドレスなどを含む。 In the first invention, the seventh invention, and the eighth invention, the order information for determining the execution order of a plurality of monitoring target access processes related to memory access is associated with the specific information related to the memory access by the monitoring target access process. The monitoring table is stored in the storage unit. The order information is information that can specify the order of memory access. The order information includes, for example, information such as a series indicating the distinction of modules and the like, and an ID indicating the execution order of access processing within the series. The unique information is monitoring position information. For example, a function name for calling an access process for executing memory access, a memory area to be accessed (memory address), a memory access process content (separate from read process or write process), memory A write value when the access is a write process, a number for identifying the execution order of the access process having the same process content in the same function, an address of an instruction code (object code) corresponding to the access process, and the like are included.
検出手段は、実行部で複数のアクセス処理を順次実行した場合に、当該アクセス処理によるメモリアクセスに関する固有情報を順次検出する。固有情報の検出は、例えば、以下の方法で行うことができる。すなわち、メモリのアクセス処理が実行されたときに、その都度固有情報を取得して通知する監視用コードを、当該アクセス処理を行う対象コードに挿入しておく。 When a plurality of access processes are sequentially executed by the execution unit, the detection unit sequentially detects specific information related to memory access by the access process. The unique information can be detected by the following method, for example. In other words, each time a memory access process is executed, a monitoring code for acquiring and notifying unique information is inserted into the target code for performing the access process.
特定手段は、監視テーブルを用いて、検出した固有情報に対応する順序情報を順次特定する。順序情報は、前述のとおり、メモリアクセスの順序を特定することができる情報であり、例えば、モジュール等の区別を示す系列、当該系列内でのアクセス処理の実行順序を示すIDなどの情報を含むので、検出した固有情報に対応する順序情報を順次特定することにより、アクセス処理の実行順序を検出することができる。 The specifying unit sequentially specifies the order information corresponding to the detected unique information using the monitoring table. As described above, the order information is information that can specify the order of memory access. For example, the order information includes information such as a series indicating the distinction of modules and the like, and an ID indicating the execution order of access processing within the series. Therefore, the execution order of the access processing can be detected by sequentially specifying the order information corresponding to the detected unique information.
監視手段は、特定した順序情報に応じて実行部が実行する監視対象のアクセス処理の順序を監視する。例えば、監視対象のアクセス処理の順序が予定順序のとおりであれば、正しい順序でアクセス処理が行われていると判定することができ、また、監視対象のアクセス処理の順序が予定順序と異なる場合には、誤った順序でアクセス処理が行われていると判定することができ、プログラム内の複数の処理の実行順序を監視することができる。 The monitoring unit monitors the order of the access processing to be monitored that is executed by the execution unit according to the specified order information. For example, if the order of access processing to be monitored is as planned, it can be determined that the access processing is being performed in the correct order, and the order of access processing to be monitored is different from the schedule order In this case, it can be determined that the access processing is performed in an incorrect order, and the execution order of a plurality of processes in the program can be monitored.
第2発明にあっては、判定手段は、検出手段で検出した固有情報に対応する順序情報が監視テーブルに存在するか否かを判定する。特定手段は、判定手段が存在すると判定した順序情報を特定する。すなわち、監視テーブルにより監視対象のアクセス処理の順序情報及び固有情報を関連付けておくことにより、仮に監視対象のプログラム内に監視対象のアクセス処理と監視対象でないアクセス処理とが混在する場合でも、監視対象外のアクセス処理を除外して、監視が必要なアクセス処理だけを抽出して監視することができる。これにより、監視対象のプログラムの仕様変更、機能変更等により監視対象のアクセス処理が異なるようになったときでも、監視が必要なアクセス処理は、監視テーブルを用いて特定することができるので、監視対象のプログラムを変更せずにそのまま使用することができる。 In the second invention, the determination means determines whether or not the order information corresponding to the unique information detected by the detection means exists in the monitoring table. The specifying means specifies the order information determined that the determining means exists. In other words, by associating the monitoring target access processing sequence information and unique information with the monitoring table, even if monitoring target access processing and non-monitoring access processing coexist in the monitoring target program, the monitoring target By excluding external access processes, only the access processes that need to be monitored can be extracted and monitored. As a result, even when the monitoring target access process changes due to the specification change or function change of the monitoring target program, the access process that needs to be monitored can be identified using the monitoring table. The target program can be used without change.
第3発明にあっては、監視テーブルは、順序情報により監視対象のアクセス処理の所定の実行順序を特定するようにしてある。例えば、順序情報は、モジュール等の区別を示す系列、当該系列内でのアクセス処理の実行順序を示すIDなどの情報を含む順序情報とすることができる。順序判定手段は、特定した順序情報と一致する監視テーブル内の順序情報に応じて、実行部で実行する監視対象のアクセス処理の順序が所定の実行順序(予定の実行順序)であるか否かを判定する。例えば、複数のアクセス処理が実行されることにより検出したIDと監視テーブル内のIDとが一致する場合、予定の順序でアクセス処理が実行されていると判定することができ、検出したIDと監視テーブル内のIDとが一致しない場合、誤った順序でアクセス処理が実行されていると判定することができる。 In the third invention, the monitoring table specifies a predetermined execution order of the access processing to be monitored based on the order information. For example, the order information may be order information including information such as a series indicating the distinction of modules and the like, and an ID indicating the execution order of access processing within the series. The order determination means determines whether or not the order of the monitored access processing executed by the execution unit is a predetermined execution order (scheduled execution order) according to the order information in the monitoring table that matches the specified order information. Determine. For example, when an ID detected by executing a plurality of access processes matches an ID in the monitoring table, it can be determined that the access process is being executed in a scheduled order. If the IDs in the table do not match, it can be determined that the access processes are being executed in the wrong order.
第4発明にあっては、エラー処理手段は、順序判定手段が実行部で実行する監視対象のアクセス処理の順序が所定の実行順序でないと判定した場合、所定のエラー処理を行う。エラー処理は、例えば、実行順序が誤っていると判定された当該アクセス処理の内容に応じて決定することができる。エラー処理は、例えば、実行順序が誤っていると判定されたアクセス処理の前段の処理であって、所定のポイントからの再度実行(リトライ)を行うとともに、実行順序に誤りが発生したことを示すエラーログを記録する。また、別のエラー処理としては、例えば、実行順序が誤っていると判定された時点でモジュールの実行を一旦停止し、実行順序に誤りが発生したことを通知することができる。 In the fourth invention, the error processing means performs predetermined error processing when the order determination means determines that the order of the monitored access processes executed by the execution unit is not the predetermined execution order. The error process can be determined, for example, according to the content of the access process that has been determined that the execution order is incorrect. The error process is, for example, a process preceding the access process in which it is determined that the execution order is incorrect, and the execution (retry) is performed again from a predetermined point, and an error has occurred in the execution order. Record an error log. As another error processing, for example, when it is determined that the execution order is incorrect, the execution of the modules is temporarily stopped, and it is possible to notify that an error has occurred in the execution order.
第5発明にあっては、固有情報は、監視対象のアクセス処理に対応する機械語のメモリアドレスを含む。機械語は、オブジェクトコード、命令コード、目的コードとも称される。機械語(命令コード)のアドレスは、メモリのアクセス処理の呼び出し元のアドレスとみなすことができる。監視用プログラム内の監視対象のアクセス処理それぞれを識別(区別)することができる固有情報として機械語のアドレスを用いるので、監視対象のアクセス処理の実行順序を正確に監視することができる。 In the fifth invention, the unique information includes a machine language memory address corresponding to the monitored access process. The machine language is also referred to as an object code, an instruction code, and a purpose code. The address of the machine language (instruction code) can be regarded as the address of the caller of the memory access process. Since the machine language address is used as unique information that can identify (distinguish) each access process to be monitored in the monitoring program, the execution order of the access processes to be monitored can be accurately monitored.
第6発明にあっては、固有情報は、メモリからの読み込み処理若しくはメモリへの書き込みの処理の種別、アクセスするメモリのアドレス又はメモリへの書き込み値に関する情報を含む。これにより、メモリからの読込みに関する固有情報又はメモリへの書込みに関する固有情報が判れば、アクセス処理の順序情報が特定され、当該アクセス処理の実行順序を監視することができる。 In the sixth invention, the unique information includes information related to the type of processing for reading from or writing to the memory, the address of the memory to be accessed, or the value written to the memory. As a result, if the specific information related to reading from the memory or the specific information related to writing to the memory is known, the order information of the access processing can be specified, and the execution order of the access processing can be monitored.
本発明によれば、メモリアクセス処理の順序を監視することができる。 According to the present invention, the order of memory access processing can be monitored.
以下、本発明をその実施の形態を示す図面に基づいて説明する。図1は本実施の形態のプログラム生成装置100の構成の一例を示すブロック図である。プログラム生成装置100は、装置全体を制御する制御部10、プログラム(ソースコード)1、関連テーブル2を取得するための入力部11、記憶部12、監視用コード挿入済プログラム3、監視テーブル4を出力する出力部13、監視対象特定部14、監視用コード生成部15などを備える。
Hereinafter, the present invention will be described with reference to the drawings illustrating embodiments thereof. FIG. 1 is a block diagram illustrating an example of the configuration of the
プログラム生成装置100は、プログラム(ソースコード)1及び関連テーブル2が入力されると、監視用コード挿入済プログラム3、及び監視テーブル4を生成して出力する。
When the program (source code) 1 and the association table 2 are input, the
プログラム(ソースコード)1は、組込機器又は組込システムなどに組み込まれるプログラムであり、監視用コードが挿入される前のものである。プログラム1は、例えば、複数のモジュール(系列とも称することができる)を含む。
The program (source code) 1 is a program incorporated in an embedded device or an embedded system, and is before the monitoring code is inserted. The
図2、図3及び図4は入力されるプログラム(ソースコード)1の一例を示す説明図である。図2は系列Xのソースコードであり、図3は系列Yのソースコードであり、図4は系列Zのソースコードである。系列X、Y、Zは、例えば、それぞれ別のモジュールで構成され、系列X、Y、Zは予め定められた順序で実行される。 2, 3, and 4 are explanatory diagrams illustrating an example of the input program (source code) 1. 2 is a sequence X source code, FIG. 3 is a sequence Y source code, and FIG. 4 is a sequence Z source code. For example, the series X, Y, and Z are composed of different modules, and the series X, Y, and Z are executed in a predetermined order.
図2に示すように、系列Xのモジュールは、moduleA_mainという関数内でmoduleA_input、moduleA_outputという関数がこの順序で実行されるようになっている。また、moduleA_input、moduleA_outputという関数は、変数などメモリ領域にアクセスする際に、Write(書込み先メモリ領域、書込み用データ)、Read(読出し元メモリ領域、読出しデータ格納先)というメモリアクセス用I/F(インタフェース)を呼び出す。メモリアクセス用I/Fは、実行順序を監視する対象コードであり、例えば、アセンブラコードとする(アセンブリ言語で記述する)ことができる。なお、図2中、対象コードは破線で囲まれたコードである。 As shown in FIG. 2, in the module of the series X, functions called moduleA_input and moduleA_output are executed in this order in a function called moduleA_main. The functions moduleA_input and moduleA_output are memory access I / Fs called Write (write destination memory area and write data) and Read (read source memory area and read data storage destination) when accessing the memory area such as variables. Call (interface). The memory access I / F is a target code for monitoring the execution order, and can be, for example, an assembler code (described in assembly language). In FIG. 2, the target code is a code surrounded by a broken line.
図5は対象コードとしてのメモリアクセス用I/Fの一例を示す説明図である。図5Aに示すように、Read(読出し元メモリ領域、読出しデータ格納先)は、読込みI/Fであり、指定された読出し元のメモリ領域mem(例えば、変数名、メモリアドレス等)から読出したデータを指定されたデータ格納先areaに格納(設定)する。例えば、Read(変数MEM_A、変数x)は、定数MEM_Aが指すメモリ領域から読出したデータを変数xに格納するという処理を行う。 FIG. 5 is an explanatory diagram showing an example of a memory access I / F as a target code. As shown in FIG. 5A, Read (read source memory area, read data storage destination) is a read I / F, and read from a specified read source memory area mem (eg, variable name, memory address, etc.). Data is stored (set) in the designated data storage destination area. For example, Read (variable MEM_A, variable x) performs a process of storing data read from the memory area indicated by the constant MEM_A in the variable x.
また、図5Bに示すように、Write(書込み先メモリ領域、書込み用データ)は、書込みI/Fであり、指定された書込み先メモリ領域mem(例えば、変数名、メモリアドレス等)に指定されたデータdataを書込む。例えば、Write(変数MEM_A、変数x)は、変数xに格納されたデータを、定数MEM_Aが指すメモリ領域に書込むという処理を行う。 Further, as shown in FIG. 5B, Write (write destination memory area, write data) is a write I / F, and is designated by a designated write destination memory area mem (for example, variable name, memory address, etc.). Write the data data. For example, Write (variable MEM_A, variable x) performs a process of writing the data stored in the variable x into the memory area pointed to by the constant MEM_A.
図2に例示した系列Xのソースコード1においては、関数moduleA_inputから呼び出されるWrite(MEM_J、0)、関数moduleA_outputから呼び出されるRead(MEM_J、a)、Read(MEM_J、a)、Write(MEM_J、b)の4つのメモリアクセス用I/Fが、この順序で実行される。
In the
また、図3に示すように、系列Yのモジュールは、moduleB_mainという関数を実行する際に、割込み処理により、例えば、1秒経過の都度、moduleC_interruptという関数が呼ばれるようになっている。図3に例示した系列Yのソースコード1においては、関数moduleB_mainから呼び出されるWrite(MEM_K、1)、関数moduleC_interruptから呼び出されるWrite(MEM_L、x)、再度、関数moduleB_mainから呼び出されるRead(MEM_L、l)の3つのメモリアクセス用I/Fが、この順序で実行される。なお、図3中、対象コードは破線で囲まれたコードである。
Also, as shown in FIG. 3, when the module of series Y executes a function called moduleB_main, for example, a function called moduleC_interrupt is called every time one second elapses due to an interrupt process. In the
また、図4に示すように、系列Zのモジュールは、moduleX_ctrl、moduleY_ctrl、又はmoduleZ_ctrlという関数のいずれかが実行されると、moduleW_sleepという関数を実行するようになっている。図4に例示した系列Zのソースコード1においては、moduleX_ctrl、moduleY_ctrl、又はmoduleZ_ctrlのいずれかの関数から呼び出されるWrite(MEM_S、1)、関数moduleW_sleepから呼び出されるWrite(MEM_P、1)の2つのメモリアクセス用I/Fが、この順序で実行される。なお、図4中、対象コードは破線で囲まれたコードである。
Further, as shown in FIG. 4, the module of the series Z is configured to execute a function called moduleW_sleep when one of the functions moduleX_ctrl, moduleY_ctrl, or moduleZ_ctrl is executed. In the
図6はメモリアクセス用I/Fの予め定義された実行順序の一例を示す説明図である。図6の例は、上述の図2乃至図4の例に対応する。図6に示すように、系列Xにおいては、関数moduleA_inputにてメモリ領域Jに0を書込む処理を行い(対象コードの順序情報ID=1)、関数moduleA_outputにてメモリ領域Jから読出したデータを変数aに格納する処理を行い(対象コードの順序情報ID=2)、関数moduleA_outputにてメモリ領域Jから読出したデータを再度変数aに格納する処理を行い(対象コードの順序情報ID=3)、関数moduleA_outputにてメモリ領域Jに変数bの値を書込む処理を行い(対象コードの順序情報ID=4、末尾ID=4)、最初の処理(先頭ID=1)に戻って同様の処理を繰り返す。 FIG. 6 is an explanatory diagram showing an example of a predefined execution order of the memory access I / F. The example of FIG. 6 corresponds to the above-described examples of FIGS. As shown in FIG. 6, in the series X, a process of writing 0 to the memory area J with the function moduleA_input (order information ID of target code = 1), and the data read from the memory area J with the function moduleA_output Processing to store in variable a (target code sequence information ID = 2), and processing to store data read from memory area J in function variable A_output again into variable a (target code sequence information ID = 3) , The function moduleA_output performs the process of writing the value of the variable b in the memory area J (target code sequence information ID = 4, end ID = 4), and returns to the first process (start ID = 1) to perform the same process. repeat.
また、系列Yにおいては、関数moduleB_mainにてメモリ領域Kに1を書込む処理を行い(対象コードの順序情報ID=1)、関数moduleC_interruptにてメモリ領域Lに変数xの値を書込む処理を行い(対象コードの順序情報ID=2)、関数moduleB_mainにてメモリ領域Lから読出したデータを変数lに格納する処理を行い(対象コードの順序情報ID=3、末尾ID=3)、最初の処理(先頭ID=1)に戻って同様の処理を繰り返す。 In series Y, the function moduleB_main performs a process of writing 1 to the memory area K (target code order information ID = 1), and the function moduleC_interrupt performs a process of writing the value of the variable x to the memory area L. (The target code sequence information ID = 2), and the function moduleB_main performs the process of storing the data read from the memory area L in the variable l (target code sequence information ID = 3, end ID = 3). Returning to the process (first ID = 1), the same process is repeated.
また、系列Zにおいては、いずれかの関数moduleX_ctrl、moduleY_ctrl、又はmoduleZ_ctrlにてメモリ領域Sに1を書込む処理を行い(対象コードの順序情報ID=1)、関数moduleW_sleepにてメモリ領域Pに1を書込む処理を行い(対象コードの順序情報ID=2、末尾ID=2)、最初の処理(先頭ID=1)に戻って同様の処理を繰り返す。 Further, in the series Z, a process of writing 1 to the memory area S with one of the functions moduleX_ctrl, moduleY_ctrl, or moduleZ_ctrl (order information ID = 1 of the target code), and 1 to the memory area P with the function moduleW_sleep. Is written (target code sequence information ID = 2, end ID = 2), and the process returns to the first process (start ID = 1) and the same process is repeated.
図6に例示した各系列の関数の実行順序、すなわち監視対象となるメモリアクセス用I/Fの実行順序は、予めユーザが、例えば、関連テーブルにより定義することができる。 The execution order of the functions of each series illustrated in FIG. 6, that is, the execution order of the memory access I / Fs to be monitored can be defined in advance by the user, for example, using a related table.
図7は関連テーブル2の一例を示す説明図である。図7に例示の関連テーブル2は、図2乃至図6の例に対応している。関連テーブル2は、図2乃至図4にて例示したプログラムの関数呼び出し順序(メモリアクセス用I/Fの実行順序)を監視するためのテーブルであり、ユーザが予め定義して作成するものである。 FIG. 7 is an explanatory diagram showing an example of the association table 2. The association table 2 illustrated in FIG. 7 corresponds to the examples of FIGS. The association table 2 is a table for monitoring the function call order (execution order of the memory access I / F) of the programs exemplified in FIGS. 2 to 4 and is created by the user in advance. .
関連テーブル2は、メモリアクセスに関する複数のメモリアクセス用I/F(対象コード)の実行順序を定めた順序情報と当該メモリアクセス用I/Fのメモリアクセスに関する固有情報とを予め関連付けたテーブルである。順序情報は、メモリアクセスの順序を特定することができる情報である。図7の例では、順序情報は、モジュール等の区別を示す系列、当該系列内でのメモリアクセス用I/F(あるいは当該メモリアクセス用I/Fを呼び出す関数)の実行順序を示すIDなどの情報を含む。 The association table 2 is a table in which order information that determines the execution order of a plurality of memory access I / Fs (target codes) related to memory access and specific information related to memory access of the memory access I / F are associated in advance. . The order information is information that can specify the order of memory access. In the example of FIG. 7, the order information includes a series indicating the distinction between modules and the like, an ID indicating the execution order of the memory access I / F (or a function that calls the memory access I / F) in the series, and the like. Contains information.
また、固有情報は、メモリアクセス用I/Fによるメモリアクセスに関する固有の情報である。図7の例では、監視位置情報が固有情報である。監視位置情報は、監視対象となるメモリアクセスが存在する位置を表し、例えば、メモリアクセスを実行するメモリアクセス用I/Fを呼び出す関数名、アクセスするメモリ領域(メモリのアドレス)、メモリアクセスの処理内容(読込み処理又は書込み処理の別)、メモリアクセスが書込み処理である場合の書込み値、同一関数において同一処理内容のメモリアクセス処理であるメモリアクセス用I/Fの実行順番を識別する番号、メモリアクセス用I/Fに対応する命令コード(オブジェクトコード)のアドレスなどを含む。 The unique information is unique information related to memory access by the memory access I / F. In the example of FIG. 7, the monitoring position information is unique information. The monitoring position information represents a position where a memory access to be monitored exists, for example, a function name for calling a memory access I / F for executing memory access, a memory area to be accessed (memory address), and a memory access process. Contents (separate from read process or write process), write value when memory access is write process, number for identifying execution order of memory access I / F which is memory access process of the same process content in the same function, memory An address of an instruction code (object code) corresponding to the access I / F is included.
監視位置情報の関数名は、メモリアクセス用I/Fを呼び出す関数の名前である。関数単位で指定する理由は、同じモジュールでも入力関数、出力関数等の複数の関数があり、例えば、入力関数を実行した後に出力関数を実行するというような処理順序が関数で定義されているからである。なお、関数名は省略することができるが、関数名を指定することにより、ユーザが認識しやすくなる。 The function name of the monitoring position information is the name of the function that calls the memory access I / F. The reason for specifying in units of functions is that there are multiple functions such as input functions and output functions even in the same module. For example, the processing order such as executing the output function after executing the input function is defined in the function. It is. Although the function name can be omitted, the user can easily recognize the function name by specifying the function name.
また、監視位置情報に書込み値を記載する理由は、同じメモリ領域でも書込むデータによって処理の内容が大きく異なる場合があるからである。例えば、ネットワークの通信状態を表すメモリ領域に正常値と異常値のいずれを書込むかによって、その後の処理内容は大きく異なる。 The reason why the write value is described in the monitoring position information is that the contents of processing may vary greatly depending on the data to be written even in the same memory area. For example, the subsequent processing contents vary greatly depending on whether a normal value or an abnormal value is written in a memory area representing the communication state of the network.
また、監視位置情報の番号は、監視位置情報の関数名、メモリ領域、処理内容及び書込み値のすべてが同じである場合、メモリアクセスが関数の先頭から何番目に実行されるかによって区別するためのものである。図7の例では、系列XのID=2、ID=3のメモリアクセスが同じであるので、関数moduleA_outputの1番目、2番目のメモリアクセスであることを指定すべく番号1、2を用いている。なお、番号は省略してもよい。
In addition, the number of the monitoring position information is distinguished depending on what number the memory access is executed from the beginning of the function when the function name, the memory area, the processing content, and the write value of the monitoring position information are all the same. belongs to. In the example of FIG. 7, since the memory access of ID = 2 and ID = 3 of the series X is the same,
上述のように、関連テーブル2の順序情報は、監視位置情報で指定されるメモリアクセスの実行順序を定義する。例えば、同じ系列にあるメモリアクセスが、指定されたIDの順序通りに実行されている場合には正常であると判定することができる。なお、IDは定数Cずつ増加する連番とすることができる。図7の例では、定数Cは1であるが、これに限定されるものではない。 As described above, the order information of the association table 2 defines the execution order of memory access specified by the monitoring position information. For example, when memory accesses in the same series are executed in the order of designated IDs, it can be determined that they are normal. The ID can be a serial number that increases by a constant C. In the example of FIG. 7, the constant C is 1, but is not limited to this.
本実施の形態のプログラム生成装置100は、関連テーブル2で定義された情報(順序情報、監視位置情報)を用いて、監視対象となるプログラム1中で使用されるメモリアクセス用I/Fの中に、プログラムがメモリアクセスする順序を監視する監視用コード(検出コード)を自動的に挿入し、監視用コードが挿入されたプログラム(ソースコード)3を生成する。また、本実施の形態のプログラム生成装置100は、関連テーブル2を用いて、監視対象となるプログラム内のメモリアアクセスが正しい順序で実行されているか否を監視する際に用いられる監視テーブル4を生成する。以下、これらの点について説明する。
The
監視対象特定部14は、ソースコード1の中からメモリアクセス用I/F(対象コード)を特定する特定手段としての機能を有する。監視対象特定部14は、関連テーブル2を用いて、ソースコード1の中から複数のメモリアクセス用I/Fを特定する。例えば、監視対象特定部14は、関連テーブル2内の監視位置情報の関数名を用いてソースコード1を検索し、関数から呼び出されているメモリアクセス用I/Fを特定する。
The monitoring
監視用コード生成部15は、監視用コード(検出コード)をメモリアクセス用I/F内に挿入する挿入手段としての機能を有する。監視用コードは、メモリアクセス用I/Fが実行するメモリアクセスに関する固有情報(監視位置情報)を検出するコードである。
The monitoring
図8は監視用コードが挿入された対象コード(メモリからの読込み)の一例を示す説明図である。監視対象特定部14が、メモリアクセス用I/F(対象コード)であるRead(mem、area)を特定した場合、監視用コード生成部15は、特定されたRead(mem、area)の中に、監視用コードCheck(r1、0、0、r3)を挿入する。
FIG. 8 is an explanatory diagram showing an example of a target code (reading from a memory) into which a monitoring code is inserted. When the monitoring
図8に示すように、メモリアクセス用I/FであるRead(mem、area)に対応する監視用コードCheck(r1、0、0、r3)は、4つの引数を固有情報として検出して監視モジュール(不図示)に通知する。 As shown in FIG. 8, the monitoring code Check (r1, 0, 0, r3) corresponding to Read (mem, area), which is a memory access I / F, detects and monitors four arguments as specific information. Notify the module (not shown).
第1引数r1は、アクセスするメモリアドレスが格納されたレジスタであり、メモリアクセス用I/Fがアクセスするメモリ領域である。第2引数は0であり、メモリアクセス用I/Fの処理内容が読出しであることを示す。第3引数は0であり、処理内容が読出しである場合には0に固定されている。第4引数r3は、Readの呼出し元のアドレスが格納されたレジスタであり、メモリアクセス用I/Fの呼出し元である命令コード(アセンブラ)のアドレスである。 The first argument r1 is a register storing a memory address to be accessed, and is a memory area accessed by the memory access I / F. The second argument is 0, indicating that the processing content of the memory access I / F is read. The third argument is 0, and is fixed to 0 when the processing content is read. The fourth argument r3 is a register in which the address of the Read call source is stored, and is the address of the instruction code (assembler) that is the call source of the memory access I / F.
命令コード(アセンブラ)のアドレスは、以下のようにして取得することができる。すなわち、制御部10は、監視用コードが挿入されたメモリアクセス用I/Fを含むソースコードをオブジェクトコードに変換し、メモリアクセス用I/Fに対応するオブジェクトコードに固有のメモリアドレスを割り当てる割当手段としての機能を有する。すなわち、制御部10は、コンパイラの機能を有し、ソースコードからオブジェクトコードへの変換は、コンパイラを用いることができる。なお、制御部10にコンパイラの機能を持たせるのではなく、制御部10とは別にコンパイラを備えるようにしてもよい。また、ソースコードの他にライブラリが存在する場合には、リンカによりライブラリをオブジェクトコードにリンクさせておくことができる。
The address of the instruction code (assembler) can be obtained as follows. That is, the
オブジェクトコードは、命令コード、目的コード、機械語とも称される。なお、コンパイラが割り当てるメモリアドレスは、命令コード(オブジェクトコード)のアドレスであるが、メモリアクセス用I/Fの呼び出し元のアドレスとみなすことができる。 The object code is also called an instruction code, a purpose code, or a machine language. The memory address assigned by the compiler is the address of the instruction code (object code), but can be regarded as the address of the caller of the memory access I / F.
図9は監視用コードが挿入された対象コード(メモリへの書込み)の一例を示す説明図である。監視対象特定部14が、メモリアクセス用I/F(対象コード)であるWrite(mem、data)を特定した場合、監視用コード生成部15は、特定されたWrite(mem、data)の中に、監視用コードCheck(r1、1、r2、r3)を挿入する。
FIG. 9 is an explanatory diagram showing an example of a target code (writing to a memory) into which a monitoring code is inserted. When the monitoring
図9に示すように、メモリアクセス用I/FであるWrite(mem、data)に対応する監視用コードCheck(r1、1、r2、r3)は、4つの引数を固有情報として検出して監視モジュール(不図示)に通知する。 As shown in FIG. 9, the monitoring code Check (r1, 1, r2, r3) corresponding to Write (mem, data), which is an I / F for memory access, detects and monitors four arguments as specific information. Notify the module (not shown).
第1引数r1は、アクセスするメモリアドレスが格納されたレジスタであり、メモリアクセス用I/Fがアクセスするメモリ領域である。第2引数は1であり、メモリアクセス用I/Fの処理内容が書込みであることを示す。第3引数r2は、処理内容が書込みである場合の書き込み値が格納されたレジスタである。第4引数r3は、Writeの呼出し元のアドレスが格納されたレジスタであり、メモリアクセス用I/Fの呼出し元である命令コード(アセンブラ)のアドレスである。 The first argument r1 is a register storing a memory address to be accessed, and is a memory area accessed by the memory access I / F. The second argument is 1, indicating that the processing content of the memory access I / F is writing. The third argument r2 is a register storing a write value when the processing content is write. The fourth argument r3 is a register that stores the address of the caller of Write, and is the address of the instruction code (assembler) that is the caller of the memory access I / F.
監視用コード生成部15が生成する監視用コード挿入済プログラム(ソースコード)3は、プログラム(ソースコード)1内の監視対象となるメモリアクセス用I/F内に、図8、図9で例示した監視用コードCheckを挿入したものである。
The monitoring code inserted program (source code) 3 generated by the
監視用コード生成部15は、監視テーブル4(検出用テーブル)を生成する生成手段としての機能を有する。すなわち、監視用コード生成部15は、メモリアクセス用I/Fを特定する順序情報、監視位置情報、前述の命令コードのアドレスを関連付けた監視テーブル4を生成する。
The monitoring
図10は監視テーブル4の一例を示す説明図である。図10に示すように、監視テーブル4は、関連テーブル1の各メモリアクセス用I/Fに対応する命令コードのアドレスを関連テーブル1に追加した構成をなす。監視テーブル4においても、関連テーブル1と同様に、関数名、番号は省略することができる。また、監視テーブル4に系列毎に先頭ID(最初に実行される対象コードのID)及び末尾ID(最後に実行される対象コードのID)を加えることもできる。 FIG. 10 is an explanatory diagram showing an example of the monitoring table 4. As shown in FIG. 10, the monitoring table 4 has a configuration in which the address of the instruction code corresponding to each memory access I / F of the related table 1 is added to the related table 1. In the monitoring table 4 as well, the function name and number can be omitted as in the related table 1. In addition, a head ID (ID of a target code executed first) and a tail ID (ID of a target code executed last) can be added to the monitoring table 4 for each series.
次に、本実施の形態のプログラム生成装置100の動作について説明する。図11は本実施の形態のプログラム生成装置100による監視用コードが挿入されたソースコード3の生成処理の一例を示すフローチャートである。なお、以下の説明では便宜上処理の主体を制御部10とする。
Next, the operation of the
制御部10は、プログラムのソースコード1を取得し(S11)、予めユーザが定義した関連テーブル2を取得する(S12)。制御部10は、例えば、関数名を用いてソースコード1を検索し(S13)、監視対象となる対象コード、すなわちメモリアクセス用I/Fを特定する(S14)。
The
制御部10は、特定した対象コードがメモリからの読込みコード(読込み用のメモリアクセス用I/F)であるか否かを判定し(S15)、対象コードがメモリからの読込みコードである場合(S15でYES)、メモリからの読込みのための監視用コードを対象コードであるメモリアクセス用I/F内に挿入する(S16)。
The
対象コードがメモリからの読込みコードでない場合(S15でNO)、すなわち対象コードがメモリへの書込みコード(書込み用のメモリアクセス用I/F)である場合、制御部10は、メモリへの書込みのための監視用コードを対象コードであるメモリアクセス用I/F内に挿入する(S17)。
When the target code is not a read code from the memory (NO in S15), that is, when the target code is a write code to the memory (memory access I / F for writing), the
制御部10は、ソースコード1内のすべての対象コードを検索したか否かを判定し(S18)、すべての対象コードを検索していない場合(S18でNO)、ステップS13以降の処理を繰り返す。すべての対象コードを検索した場合(S18でYES)、制御部10は、監視用コードが挿入されたソースコード3を生成し(S19)、処理を終了する。
The
図12は本実施の形態のプログラム生成装置100による監視テーブル4の生成処理の一例を示すフローチャートである。制御部10は、図11に例示の処理により生成された監視用コード挿入済のソースコード3をコンパイルし(S31)、ソースコードをオブジェクトコードに変換する。なお、オブジェクトコードに変換することにより、メモリアクセス用I/F(対象コード)に対応する命令コードのアドレスを得ることができる。
FIG. 12 is a flowchart showing an example of the generation process of the monitoring table 4 by the
制御部10は、監視用コード挿入済のソースコード3を検索して、関連テーブル2の監視位置情報に対応する対象コード(メモリアクセス用I/F)を特定する(S32)。制御部10は、特定した対象コードに対応する命令コードのアドレスを取得する(S33)。
The
制御部10は、関連テーブル2のすべての監視位置情報について対象コードの特定を完了したか否かを判定し(S34)、完了していない場合(S34でNO)、ステップS33以降の処理を繰り返す。
The
関連テーブル2のすべての監視位置情報について対象コードの特定を完了した場合(S34でYES)、制御部10は、関連テーブル2から、特定した対象コードの順序情報を取得する(S35)。
When the identification of the target code is completed for all the monitoring position information in the related table 2 (YES in S34), the
制御部10は、取得した順序情報に基づいて系列ごとに先頭ID(最初に実行される対象コードのID)、及び末尾ID(最後に実行される対象コードのID)を特定し(S36)、特定した先頭ID、末尾ID、及びステップS33で取得した命令コードのアドレスを関連テーブル2に付加して監視テーブル4を生成し(S37)、処理を終了する。
Based on the acquired order information, the
上述のように、本実施の形態によれば、プログラムが複数のモジュール(例えば、系列X、Y、…)で構成され、それぞれのモジュール内に複数のメモリアクセスを実行する対象コードが存在する場合に、当該対象コード内に監視用コードを挿入し(組み込み)、挿入した監視用コードが検出する固有情報の順序に応じて、実行される対象コードの順序が判るので、対象コードが行うメモリアクセス処理が正しい順序で実行されているか否かを判定することができるプログラム(ソースコード)を生成することができる。また、割込み処理からのメモリアクセスの順序も監視することができるプログラムを生成することができる。 As described above, according to the present embodiment, a program is composed of a plurality of modules (for example, series X, Y,...), And there is a target code for executing a plurality of memory accesses in each module. In addition, the monitoring code is inserted (embedded) into the target code, and the order of the target code to be executed is determined according to the order of the specific information detected by the inserted monitoring code. It is possible to generate a program (source code) that can determine whether the processes are executed in the correct order. Further, it is possible to generate a program that can monitor the order of memory access from interrupt processing.
また、本実施の形態によれば、ソースコード内の対象コード(メモリアクセスを行うコード)それぞれを識別(区別)することができる固有情報として各対象コードに個別かつ固有に対応するオブジェクトのアドレスを用いることにより、対象コードの実行順序を正確に監視することができるプログラムを生成することができる。 Further, according to the present embodiment, the address of an object individually and uniquely corresponding to each target code is identified as unique information that can identify (distinguish) each target code (code that performs memory access) in the source code. By using it, a program capable of accurately monitoring the execution order of the target code can be generated.
また、本実施の形態によれば、対象コード毎に、例えば、系列、ID、命令コードのアドレスを関連付けた監視テーブル4を生成することにより、対象コードに対応する命令コードのアドレスが判れば、当該対象コードの順序情報が特定され、対象コードの実行順序を監視することができるプログラムを生成することができる。 Further, according to the present embodiment, for example, by generating the monitoring table 4 that associates the address of the sequence, ID, and instruction code for each target code, if the address of the instruction code corresponding to the target code is known, The order information of the target code is specified, and a program that can monitor the execution order of the target code can be generated.
また、本実施の形態によれば、メモリからの読込みに関する位置監視情報又はメモリへの書込みに関する位置監視情報を検出することができる監視用コードを対象コード内に挿入するので、対象コードに対応するメモリからの読込みに関する位置監視情報又はメモリへの書込みに関する位置監視情報が判れば、当該対象コードの順序情報が特定され、対象コードの実行順序を監視することができるプログラムを生成することができる。 According to the present embodiment, since the monitoring code that can detect the position monitoring information related to reading from the memory or the position monitoring information related to writing to the memory is inserted into the target code, it corresponds to the target code. If the position monitoring information related to reading from the memory or the position monitoring information related to writing to the memory is known, the order information of the target code can be specified, and a program that can monitor the execution order of the target code can be generated.
また、監視用コードを挿入する方法として、例えば、監視対象のコードの前段又は後段に、監視対象のコードの数だけの監視用コードを挿入する方法も考えられる。しかし、このような場合には、監視対象のコードとは別に監視用コードがソースコードに追加されることになり、プログラムのサイズが監視用コードを挿入することで飛躍的に増加してしまう可能性がある。特に監視対象のコードが多数存在する場合には、プログラムのROMサイズが増大するという問題が顕著になる。しかし、本実施の形態によれば、対象コードであるメモリアクセス用I/Fの内部に監視用コードを埋め込む構成とするので、プログラムのROM消費量は監視対象の処理数には比例せず、プログラムのROMサイズが増大するという問題がない。 Further, as a method of inserting the monitoring code, for example, a method of inserting as many monitoring codes as the number of the monitoring target codes before or after the monitoring target code may be considered. However, in such a case, the monitoring code is added to the source code separately from the monitoring target code, and the size of the program can increase dramatically by inserting the monitoring code. There is sex. In particular, when there are a large number of codes to be monitored, the problem that the ROM size of the program increases becomes significant. However, according to the present embodiment, since the monitoring code is embedded in the memory access I / F that is the target code, the ROM consumption of the program is not proportional to the number of processes to be monitored. There is no problem that the ROM size of the program increases.
本実施の形態で説明した関連テーブル2は、上述の図7の例に限定されるものではない。以下に関連テーブルの他の例について説明する。 The association table 2 described in the present embodiment is not limited to the example of FIG. Another example of the related table will be described below.
図13はメモリアクセス用I/Fの指定機能が設定された場合の関連データベース2bの例を示す説明図である。指定機能とは、同じ読出し又は書込み処理であっても複数の異なる機能のいずれかを指定するものであり、例えば、読出すデータのサイズ、あるいは書込むデータのサイズによってメモリアクセス用I/Fを使い分けることができる。
FIG. 13 is an explanatory diagram showing an example of the
図13の例では、データのサイズが8ビットである場合、Write08又はRead08を用い、データのサイズが16ビットである場合、Write16又はRead16を用いる。また、この場合、Write08、Read08、Write16、Read16には、それぞれ異なる命令コードアドレスが対応する。図10の例と同様に、図13に命令コードのアドレスをメモリアクセス用I/F毎に加えることにより監視テーブルを生成することができる。 In the example of FIG. 13, when the data size is 8 bits, Write08 or Read08 is used, and when the data size is 16 bits, Write16 or Read16 is used. In this case, different instruction code addresses correspond to Write08, Read08, Write16, and Read16. Similar to the example of FIG. 10, the monitoring table can be generated by adding the address of the instruction code to each memory access I / F in FIG.
図13の例のような関連テーブル2bで実行順序が定義されたプログラムでは、特定のメモリアクセス用I/Fからアクセスされた場合にのみ予定順序通りに実行されていると判断し、指定外のメモリアクセス用I/Fからのアクセスをエラーとして検出する機能を設けることができる。例えば、8ビット用の読出し用I/Fで読出されるべきメモリ領域が、16ビット用の読出し用I/Fで読出された場合には、エラーであると判断することができる。 In the program in which the execution order is defined in the relation table 2b as in the example of FIG. 13, it is determined that the program is executed in the planned order only when accessed from a specific memory access I / F. A function for detecting an access from the memory access I / F as an error can be provided. For example, when a memory area to be read by an 8-bit read I / F is read by a 16-bit read I / F, it can be determined that an error has occurred.
また、関連テーブルの別の例として、位置情報の末尾IDの次に実行するID(先頭IDと異なるID)を設定する機能(繰返先頭ID設定機能)を設けることもできる。 As another example of the related table, a function (repetitive head ID setting function) for setting an ID (an ID different from the head ID) to be executed next to the tail ID of the position information can be provided.
図14は繰返先頭IDが設定された場合のメモリアクセス用I/Fの予め定義された実行順序の例を示す説明図であり、図15は繰返先頭IDが設定された場合の関連データベース2cの例を示す説明図である。 FIG. 14 is an explanatory diagram showing an example of a predefined execution order of the memory access I / F when the repeated head ID is set. FIG. 15 is a related database when the repeated head ID is set. It is explanatory drawing which shows the example of 2c.
図14の例では、系列Xについては、末尾ID=4のメモリアクセス用I/Fが実行された後には、先頭ID=1のメモリアクセス用I/Fを実行するのではなく、繰返先頭ID=2のメモリアクセス用I/Fから再び末尾IDに向かって繰り返し実行するように設定されている。また、系列Yについては、末尾ID=3のメモリアクセス用I/Fが実行された後には、先頭ID=1のメモリアクセス用I/Fを実行するのではなく、繰返先頭ID=3のメモリアクセス用I/Fを繰り返し実行するように設定されている。 In the example of FIG. 14, for the series X, after the memory access I / F with the tail ID = 4 is executed, the memory access I / F with the head ID = 1 is not executed, but the repeated head. The memory access I / F with ID = 2 is set to repeatedly execute toward the end ID again. For the series Y, after the memory access I / F with the tail ID = 3 is executed, the memory access I / F with the head ID = 1 is not executed, but the repeated head ID = 3. The memory access I / F is set to be repeatedly executed.
また、図15に示すように、関連テーブル2cには、順序情報の中に繰返先頭IDが系列X、Y毎に設けられている。図10の例と同様に、図15に命令コードのアドレスをメモリアクセス用I/F毎に加えることにより監視テーブルを生成することができる。 Further, as shown in FIG. 15, in the related table 2 c, a repeated head ID is provided for each of the series X and Y in the order information. Similar to the example of FIG. 10, the monitoring table can be generated by adding the address of the instruction code to each memory access I / F in FIG. 15.
繰返先頭IDを設定することにより、例えば、電源オンなどの特定の条件が充足したときに、データを初期化する初期化関数を呼び出し、その後は一定周期経過の都度、データを処理する周期処理関数を呼び出すようなプログラム内のメモリアクセスの実行順序を監視するプログラムを生成することができる。図14、図15の例では、関数moduleA_initが初期化関数であり、関数moduleA_mainが周期処理関数となる。 By setting the repetition head ID, for example, when a specific condition such as power-on is satisfied, an initialization function that initializes the data is called, and thereafter a periodic process that processes the data every time a certain period elapses A program for monitoring the execution order of memory access in a program that calls a function can be generated. In the examples of FIGS. 14 and 15, the function moduleA_init is an initialization function, and the function moduleA_main is a periodic processing function.
また、繰返先頭IDを設定することにより、例えば、スリープ状態からの復帰時などの特定条件下でのみ起動し、起動後は停止し続ける停止処理関数を呼び出すようなプログラム内のメモリアクセスの実行順序を監視するプログラムを生成することができる。図14、図15の例では、関数moduleB_wakeup、関数moduleC_wakeupが特定条件下で呼び出される関数であり、関数moduleB_mainが停止処理関数となる。
また、関連テーブルの別の例として、順序情報のIDが複数の通知予定IDを設定する機能を設けることもできる。通知予定IDとは、現在実行しているメモリアクセス用I/Fの次に実行されるメモリアクセス用I/FのIDである。すなわち、上述の例では、メモリアクセス用I/FのIDが定数C(例えば、1)ずつ増加する連番とし、現在のIDに定数Cを加算したIDを通知予定IDとした。しかし、個々のIDに通知予定IDを予め設定してもよく、通知予定IDを設定する場合に複数の通知予定IDを設定することもできる。
Also, by setting the repeated head ID, for example, executing memory access in a program that starts only under specific conditions such as when returning from the sleep state and calls a stop processing function that continues to stop after startup A program for monitoring the order can be generated. In the examples of FIGS. 14 and 15, the function moduleB_wakeup and the function moduleC_wakeup are functions that are called under specific conditions, and the function moduleB_main is a stop processing function.
In addition, as another example of the related table, a function of setting a plurality of notification schedule IDs with the ID of the order information may be provided. The notification schedule ID is an ID of a memory access I / F executed next to the memory access I / F currently being executed. That is, in the above-described example, the ID of the memory access I / F is a serial number that increases by a constant C (for example, 1), and the ID obtained by adding the constant C to the current ID is the notification schedule ID. However, a notification schedule ID may be set in advance for each ID, and a plurality of notification schedule IDs can be set when setting a notification schedule ID.
図16は通知予定IDが設定された場合のプログラム(ソースコード)1bの例を示す説明図であり、図17は通知予定IDが設定された場合のメモリアクセス用I/Fの予め定義された実行順序の例を示す説明図であり、図18は通知予定IDが設定された場合の関連データベース2dの例を示す説明図である。
FIG. 16 is an explanatory diagram showing an example of a program (source code) 1b when a notification schedule ID is set, and FIG. 17 shows a predefined memory access I / F when a notification schedule ID is set. FIG. 18 is an explanatory diagram illustrating an example of an execution order, and FIG. 18 is an explanatory diagram illustrating an example of the
図16、図17の例では、関数moduleB_mainにてメモリ領域Qから読出したデータを変数qに格納した(ID=1)後、所要の条件にしたがってメモリ領域Kに1を書込む(ID=2)か、あるいはメモリ領域Kに0を書込む(ID=3)処理のいずれかを実行する。そして、メモリ領域Kに1を書込む(ID=2)処理を行った場合には、メモリ領域Lに変数mを書込む(ID=4)処理を行って先頭ID=1の処理に戻る。一方、メモリ領域Kに0を書込む(ID=3)処理を行った場合には、メモリ領域Lに変数nを書込む(ID=5)処理を行って先頭ID=1の処理に戻る。 In the example of FIGS. 16 and 17, data read from the memory area Q by the function moduleB_main is stored in the variable q (ID = 1), and then 1 is written in the memory area K according to a required condition (ID = 2 ) Or a process of writing 0 to the memory area K (ID = 3). When the process of writing 1 to the memory area K (ID = 2) is performed, the process of writing the variable m to the memory area L (ID = 4) is performed, and the process returns to the process of the head ID = 1. On the other hand, when the process of writing 0 in the memory area K (ID = 3) is performed, the process of writing the variable n in the memory area L (ID = 5) is performed, and the process returns to the process of the head ID = 1.
図18に示すように、関連テーブル2dには、系列Xに対して、通知予定IDが設けられている。系列Xでは、ID=1の次には条件に応じてID=2又は3のいずれかのメモリアクセス用I/Fが実行され、ID=2の次にはID=4のメモリアクセス用I/Fが実行され、ID=3の次にはID=5のメモリアクセス用I/Fが実行される。また、図10の例と同様に、図18に命令コードのアドレスをメモリアクセス用I/F毎に加えることにより監視テーブルを生成することができる。 As shown in FIG. 18, a notification schedule ID is provided for the series X in the related table 2d. In the series X, the memory access I / F with ID = 2 or 3 is executed next to ID = 1 depending on the condition, and the memory access I / F with ID = 4 is executed next to ID = 2. F is executed, and after ID = 3, a memory access I / F with ID = 5 is executed. Similarly to the example of FIG. 10, the monitoring table can be generated by adding the address of the instruction code to each memory access I / F in FIG. 18.
図18に示すような関連テーブル2dを用いることにより、プログラムの動作中の状況に応じて複数の処理に分岐する条件分岐処理を監視することができるプログラムを生成することができる。 By using the relation table 2d as shown in FIG. 18, it is possible to generate a program that can monitor conditional branch processing that branches into a plurality of processes depending on the operating state of the program.
また、関連テーブルの別の例として、あるメモリアクセス用I/Fが実行された後、次のメモリアクセス用I/Fが実行されるまでの時間を計測して、所定のデッドライン(閾値時間)を超えた場合には、エラーとして取り扱うこともできる。 As another example of the related table, after a certain memory access I / F is executed, the time until the next memory access I / F is executed is measured to obtain a predetermined deadline (threshold time). ) Can be handled as an error.
図19はデッドライン(閾値時間)が設けられた場合の関連テーブル2eの例を示す説明図である。図19に示すように、関連テーブル2eには、順序情報、監視位置情報に加えて時間計測用情報を設けてあり、時間計測用情報は、例えば、時間計測要否、デッドライン(閾値時間)などの情報を含む。 FIG. 19 is an explanatory diagram showing an example of the association table 2e when a deadline (threshold time) is provided. As shown in FIG. 19, the related table 2e is provided with time measurement information in addition to the order information and the monitoring position information. The time measurement information includes, for example, whether or not time measurement is necessary, deadline (threshold time). Information.
時間計測要否が「必要」となっているメモリアクセス用I/Fは、処理を開始してからの経過時間が計測される。そして経過時間がデッドラインを超える前に次にIDのメモリアクセス用I/Fが実行された場合には、正常であると判定し、経過時間がデッドラインを超えた後に次にIDのメモリアクセス用I/Fが実行された場合には、異常であると判定する。 For the memory access I / F whose time measurement necessity is “necessary”, the elapsed time from the start of processing is measured. If the ID memory access I / F is executed next before the elapsed time exceeds the deadline, it is determined to be normal, and after the elapsed time exceeds the deadline, the next ID memory access is performed. When the use I / F is executed, it is determined that there is an abnormality.
プログラム生成装置100は、関連テーブルから系列、ID、時間計測用情報を取得し、取得した情報をメモリアクセス用I/F毎に纏めて監視テーブル4を生成する。この場合、監視位置情報は、監視テーブル4に格納してもよく、あるいは格納しなくてもよい。
The
また、プログラム生成装置100は、経過時間計測関数を、一定時間ごとに発生する割込み処理から呼び出される関数として、プログラムのソースコード1に埋め込むことで監視用コードが挿入されたソースコード3を生成する。
Further, the
また、図7等に例示した関連テーブルにおいて、監視位置情報の関数名に代えてソースファイル名を指定することもできる。この場合、指定されたソースファイルの先頭から関連テーブルのメモリ領域、処理内容、書込み値、番号に該当するメモリアクセス用I/Fを検索し、検索したメモリアクセス用I/Fに対応する命令コードのアドレスを当該メモリアクセス用I/Fの呼出し元のアドレスとすることができる。 In the related table illustrated in FIG. 7 and the like, a source file name can be designated instead of the function name of the monitoring position information. In this case, the memory access I / F corresponding to the memory area, processing contents, write value, and number of the related table is searched from the head of the specified source file, and the instruction code corresponding to the searched memory access I / F Can be used as the address of the caller of the memory access I / F.
また、図7等に例示した関連テーブルにおいて、監視位置情報からメモリ領域、処理内容及び書込み値以外の情報を省略することもできる。例えば、系列Xに対して、ID=1(先頭)がメモリ領域への書込み処理、ID=2(末尾)がメモリ領域からの読出し処理であるような関連テーブルの如くである。これにより、特定のメモリ領域にデータが書込まれてからデータが読出されたことは監視したいが、その処理を行ったプログラムの関数、書込んだデータの値は何でもよいというような監視を行うことができるプログラムを生成することができる。 Further, in the related table illustrated in FIG. 7 and the like, information other than the memory area, the processing content, and the written value can be omitted from the monitoring position information. For example, for the series X, a relation table in which ID = 1 (first) is a write process to the memory area and ID = 2 (end) is a read process from the memory area. As a result, it is desired to monitor that the data has been read after the data has been written to a specific memory area, but the function of the program that performed the processing and the value of the written data are monitored. Can be generated.
上述のプログラム生成装置100は、CPU、RAMなどを備えたコンピュータを用いて実現することもできる。すなわち、図11及び図12に示すような、各処理手順を定めたコンピュータプログラムを記録した記録媒体をコンピュータに備えられた記録媒体読取部で読み取り、読み取って得られたコンピュータプログラムをRAMにロードし、コンピュータプログラムをCPUで実行することにより、コンピュータ上でプログラム生成装置100を実現することができる。
The above-described
次に、本実施の形態の監視装置200について説明する。図20は本実施の形態の監視装置200の構成の一例を示すブロック図である。監視装置200は、例えば、車両に搭載されるECU(Electronic Control Unit)であり、監視対象プログラム(監視用コード挿入済ソースコード)3内の各処理が所定の順序で実行されているか否かを監視する。
Next, the
監視装置200は、マイクロコンピュータ(以下、マイコンと称する)20、記憶部24、25、機器インタフェース26、通信インタフェース27などを備える。また、マイコン20は、実行部21、監視部22、エラー処理部23などを備える。監視部22は、ID特定部221、メモリアクセス順序判定部222、対応決定部223などを備える。
The
機器インタフェース26は、車両に搭載された車載機器300とのインタフェース機能を有し、マイコン20は、車載機器300を制御することができる。車載機器300は、例えば、車内照明、ヘッドライト、ブレーキランプ、ヒータ、エアコン、警報器、ドアロック機構、メータ類、ウインカー、カーナビゲーション装置等であるが、これらに限定されない。
The
通信インタフェース27は、車載LANを経由して他のECU210等とのインタフェース機能を有する。マイコン20は、通信インタフェース27を介して他のECU210等との間でデータの送受信を行うことができる。
The
記憶部24には、監視対象プログラム3を記憶してある。監視対象プログラム3は、例えば、上述のプログラム生成装置100が生成する監視用コードが挿入されたプログラムである。なお、監視対象プログラム3は、実行形式のプログラムである。
The
また、記憶部25には、監視テーブル4を記憶してある。監視テーブル4は、例えば、図10に例示するテーブルであり、上述のプログラム生成装置100が生成する監視テーブルである。なお、記憶部24、25は、例えば、書き換え可能な不揮発性メモリであり、1つに纏めることもできる。
The
実行部21は、演算処理を行うCPU(Central Processor Unit)、RAM等で構成され、記憶部24に記憶された監視対象プログラム3を読み出し、監視対象プログラム3内の複数の処理(インストラクション、命令)を実行することにより、車載機器300の制御を行う。
The
実行部21で監視対象プログラム3が実行されると、監視対象プログラム3内の監視対象の対象コード、すなわちメモリアクセス用I/Fに挿入(埋め込まれた)監視用コード(検出コード)は、(1)メモリアクセス用I/Fがアクセスするメモリ領域(メモリアドレス)、(2)メモリアクセス用I/Fの処理内容(読出し、書込み)、(3)メモリアクセス用I/Fの処理内容が書込みである場合の書込み値、(4)メモリアクセス用I/Fの呼出し元である命令コードのアドレスなどの監視位置情報(メモリアクセスに関する固有情報)を監視部22へ通知(出力)する。
When the
すなわち、実行部21又は監視用コードは、メモリへのアクセス処理によるメモリアクセスに関する監視位置情報(固有情報)を検出する検出手段としての機能を有する。
That is, the
図21は監視対象プログラム3が実行された場合に対象コードに挿入された監視用コードが監視部22に通知する監視位置情報の一例を示す説明図である。図21に示すように、系列Xの監視対象プログラム内に、メモリアクセス用I/FであるRead(mem、area)、Write(mem、data)がこの順序で実行されるとする。この場合、Read(mem、area)には、図8で例示した監視用コードCheck(r1、0、0、r3)が挿入されているので、Read(mem、area)がアクセスするメモリアドレス(例えば、MEM_J)、処理内容(読出し)を示す「0」、命令コードのアドレス(例えば、「36AC」)などの監視位置情報を監視部22へ通知する。
FIG. 21 is an explanatory diagram showing an example of monitoring position information notified to the
また、同様に、Write(mem、data)には、図9で例示した監視用コードCheck(r1、1、r2、r3)が挿入されているので、Write(mem、data)がアクセスするメモリアドレス(例えば、MEM_J)、処理内容(書込み)を示す「1」、命令コードのアドレス(例えば、「5A1F」)などの監視位置情報を監視部22へ通知する。
Similarly, since the monitoring code Check (r1, 1, r2, r3) illustrated in FIG. 9 is inserted into Write (mem, data), the memory address accessed by Write (mem, data) Monitoring position information such as (for example, MEM_J), “1” indicating the processing content (writing), and the address of the instruction code (for example, “5A1F”) is notified to the
ID特定部221は、監視位置情報に対応する順序情報を特定する特定手段としての機能を有する。ID特定部221は、監視テーブル4を用いて、実行部21(監視用コード)から順位通知された監視位置情報毎に、当該監視位置情報に対応する順序情報を順次特定する。複数のメモリアクセス用I/Fが順番に実行される都度、当該メモリアクセス用I/Fに固有の監視位置情報がID特定部221に通知されるので、通知された監視位置情報に対応する順序情報を順次特定することにより、アクセス処理の実行順序を検出することができる。
The
監視部22は、監視対象のアクセス処理(メモリアクセス用I/Fによる処理)の順序を監視する監視手段としての機能を有する。監視部22は、特定した順序情報に応じて実行部21が実行する監視対象のメモリアクセス用I/Fの実行順序を監視する。例えば、監視対象のメモリアクセス用I/Fの実行順序が予定順序のとおりであれば、正しい順序でアクセス処理が行われていると判定することができ、また、監視対象のメモリアクセス用I/Fの実行順序が予定順序と異なる場合には、誤った順序でアクセス処理が行われていると判定することができ、監視対象プログラム内の複数のメモリアクセス処理の実行順序を監視することができる。
The
また、ID特定部221は、実行部21から通知された監視位置情報に対応する順序情報が監視テーブル4に存在するか否かを判定する判定手段としての機能を有する。ID特定部221は、実行部21から通知された監視位置情報に対応する順序情報が監視テーブル4に存在すると判定した場合に、当該順序情報を特定する。すなわち、監視テーブル4により監視対象のアクセス処理の順序情報及び監視位置情報を関連付けておくことにより、仮に監視対象プログラム3内に監視対象のアクセス処理と監視対象でないアクセス処理とが混在する場合でも、監視対象外のアクセス処理を除外して、監視が必要なアクセス処理だけを抽出して監視することができる。これにより、監視対象プログラム3の仕様変更、機能変更等により監視対象のアクセス処理が異なるようになったときでも、監視が必要なアクセス処理は、監視テーブル4を用いて特定することができるので、監視対象プログラム3のメモリアクセス用I/Fから監視用コードを削除するなどの変更せずにそのまま使用することができる。
The
メモリアクセス順序判定部222は、順序判定手段としての機能を有する。メモリアクセス順序判定部222は、ID特定部221で特定した順序情報と一致する監視テーブル4内の順序情報に応じて、実行部21で実行する監視対象のメモリアクセス用I/Fの実行順序が所定の実行順序(予定の実行順序)であるか否かを判定する。例えば、複数のアクセス処理が実行されることにより検出したIDと監視テーブル4内のIDとが一致する場合、予定の順序でアクセス処理が実行されていると判定することができ、検出したIDと監視テーブル内のIDとが一致しない場合、誤った順序でアクセス処理が実行されていると判定することができる。
The memory access
以下では、監視対象プログラム3内の各モジュール(系列)が所定の順序で実行されている場合でも、それぞれモジュール内の複数のメモリアクセス処理が必ずしも正しい順序で実行されるとは限らず、そのような場合でも、本実施の形態の監視装置200であれば、メモリアクセス処理の実行順序を監視することができる点について説明する。
In the following, even when the modules (series) in the
図22は監視対象プログラム3内の各系列の実行順序の一例を示す説明図である。各系列X、Yは、モジュールX、Yと考えることができる。図22の例では、系列Y(モジュールY)が実行された後、その次に系列X(モジュールX)が実行され、さらにその後に系列Y(モジュールY)が実行されるものとし、正しい実行順序は、系列Y、X、Yの順序であるとする。なお、特許文献1のような従来の装置では、図22に例示するような各モジュールの実行順序は監視することができる。
FIG. 22 is an explanatory diagram showing an example of the execution order of each series in the
図23は監視テーブル4の各系列X、Yの順序情報の一例を示す説明図である。図23Aは系列X内のメモリアクセス用I/Fの順序を定義してあり、ID=1、2、3、4に対応するメモリアクセス用I/Fがこの順序で実行される。ID=4(末尾ID)のメモリアクセス用I/Fが実行された後は、ID=1(先頭ID)のメモリアクセス用I/Fから同様の順序で実行が繰り返される。 FIG. 23 is an explanatory diagram showing an example of order information of each series X, Y of the monitoring table 4. FIG. 23A defines the order of memory access I / Fs in the series X, and the memory access I / Fs corresponding to ID = 1, 2, 3, 4 are executed in this order. After the memory access I / F with ID = 4 (end ID) is executed, the execution is repeated in the same order from the memory access I / F with ID = 1 (start ID).
図23Bは系列Y内のメモリアクセス用I/Fの順序を定義してあり、ID=1、2、3に対応するメモリアクセス用I/Fがこの順序で実行される。ID=3(末尾ID)のメモリアクセス用I/Fが実行された後は、ID=1(先頭ID)のメモリアクセス用I/Fから同様の順序で実行が繰り返される。 FIG. 23B defines the order of the memory access I / Fs in the series Y, and the memory access I / Fs corresponding to ID = 1, 2, and 3 are executed in this order. After the memory access I / F with ID = 3 (end ID) is executed, the execution is repeated in the same order from the memory access I / F with ID = 1 (start ID).
図24はメモリアクセス順序判定部222で判定したメモリアクセス用I/Fの実行順序の一例を示す説明図である。図24Aの場合、メモリアクセス順序判定部222が順次特定(検出)した位置情報内のIDは、ID=1、2、3、4、1、…であり、図23で例示した監視テーブル4内の実行順序と一致しているので、メモリアクセス用I/Fの実行順序は正しいと判定することができる。
FIG. 24 is an explanatory diagram showing an example of the execution order of the memory access I / F determined by the memory access
一方、図24Bの場合、メモリアクセス順序判定部222が順次特定(検出)した位置情報内のIDは、ID=1、2、4であり、図23で例示した監視テーブル4内の実行順序と一致しないので、メモリアクセス用I/Fの実行順序は誤っていると判定することができる。このように、本実施の形態の監視装置200によれば、図22に示すように、仮に各モジュールが正しい順序で実行されているとしても、モジュール内のメモリアクセス処理が所定の順序で実行されていないときは、実行順序に関わるエラーが発生したことを判定することができる。
On the other hand, in the case of FIG. 24B, the IDs in the position information sequentially identified (detected) by the memory access
対応決定部223は、監視テーブル4に格納された順序情報のID、及びID特定部221で特定した順序情報のIDに基づいて、通知予定IDの値を更新する。通知予定IDは、現在実行しているメモリアクセス用I/Fの次に実行されるメモリアクセス用I/FのIDである。例えば、メモリアクセス用I/FのIDが定数C(例えば、1)ずつ増加する連番とし、現在のIDに定数Cを加算したIDを通知予定IDとすることができる。
The
また、対応決定部223は、メモリアクセス用I/Fの実行順序に誤りがある場合、誤りの内容に応じて、対応内容を決定し、決定した対応内容をエラー処理部23へ出力する。対応内容は、例えば、実行順序が誤っていると判定されたアクセス処理の前段の処理であって、所定のポイントからの再度実行(リトライ)を行うとともに、実行順序に誤りが発生したことを示すエラーログを記録する。また、別の対応内容としては、例えば、実行順序が誤っていると判定された時点でモジュールの実行を一旦停止し、実行順序に誤りが発生したことを通知する。
Further, when there is an error in the execution order of the memory access I / F, the
エラー処理部23は、対応決定部223で決定した対応内容の処理を行う。上述の対応内容の例では、エラー処理部23は、再度実行(リトライ)処理及びエラーログの記録処理を行う。あるいはモジュールの実行を停止する処理及びエラーの発生を通知する処理を行う。
The
次に、本実施の形態の監視装置200の動作について説明する。図25は本実施の形態の監視装置200による順序情報の特定処理の手順の一例を示すフローチャートである。なお、以下の説明では便宜上処理の主体をマイコン20とする。
Next, the operation of the
マイコン20は、メモリアクセス処理が通知した監視位置情報を取得する(S101)。すなわち、実行部21又は監視用コードが検出したメモリへのアクセス処理によるメモリアクセスに関する監視位置情報を取得する。マイコン20は、取得した監視位置情報に対応する順序情報(系列、ID)を監視テーブル4にて検索する(S102)。
The
マイコン20は、監視位置情報内の命令コードのアドレスに対応する順序情報(系列、ID)が監視テーブル4内にあるか否かを判定し(S103)、対応する順序情報がある場合(S103でYES)、当該順序情報(系列、ID)を監視部22へ出力し(S104)、処理を終了する。
The
ステップS103で、対応する順序情報がない場合(S103でNO)、マイコン20は、メモリアクセス処理でアクセスするメモリアドレス(メモリ領域)、アクセス処理の内容、書込み処理の場合の書込み値に対応する順序情報(系列、ID)が監視テーブル4内にあるか否かを判定する(S105)。
If there is no corresponding order information in step S103 (NO in S103), the
対応する順序情報がある場合(S105でYES)、マイコン20は、ステップS104の処理を行い、対応する順序情報がない場合(S105でNO)、メモリアクセス処理に対応する順序情報がない旨の情報を監視部22へ出力し(S106)、処理を終了する。なお、図25の処理は、メモリアクセス処理が実行される都度行われる。
If there is corresponding order information (YES in S105), the
図26は本実施の形態の監視装置200による監視処理の手順の一例を示すフローチャートである。マイコン20は、図25に例示の処理で出力された順序情報(系列、ID)を取得する(S110)。取得した順序情報は通知IDである。取得した順序情報と予定順序情報(系列、ID)が一致するか否かを判定する(S111)。予定順序情報は、対応決定部223が更新する通知予定IDである。
FIG. 26 is a flowchart illustrating an example of a procedure of monitoring processing by the
取得した順序情報(通知ID)と予定順序情報(通知予定ID)が一致する場合(S111でYES)、マイコン20は、メモリアクセス処理は正しい順序で実行されていると判定し(S112)、取得した順序情報(通知ID)は、末尾の順序情報(末尾ID)であるか否かを判定する(S113)。
If the acquired order information (notification ID) matches the scheduled order information (notification schedule ID) (YES in S111), the
取得した順序情報(通知ID)が末尾の順序情報(末尾ID)でない場合(S113でNO)、マイコン20は、次の順序情報を予定順序情報とし(S114)、処理を終了する。すなわち、当該系列において通知された通知IDに定数Cを加算した値を通知予定IDに設定する。
When the acquired order information (notification ID) is not the end order information (end ID) (NO in S113), the
取得した順序情報(通知ID)が末尾の順序情報(末尾ID)である場合(S113でYES)、マイコン20は、次の順序情報を先頭順序情報とし(S115)、処理を終了する。すなわち、当該系列の先頭IDを通知予定IDに設定する。
When the acquired order information (notification ID) is the end order information (end ID) (YES in S113), the
ステップS111で取得した順序情報(通知ID)と予定順序情報(通知予定ID)が一致しない場合(S111でNO)、マイコン20は、取得した順序情報に応じたエラー処理を決定し(S116)、決定したエラー処理を実行して(S117)、ステップS113以降の処理を行う。
If the order information (notification ID) acquired in step S111 does not match the scheduled order information (notification schedule ID) (NO in S111), the
上述のように、本実施の形態の監視装置200によれば、プログラム内の複数のメモリアクセス処理の実行順序を監視することができる。特に、モジュールが正しい順序で行われている場合に、いずれかのモジュール内のメモリアクセス処理が誤った順序で行われたときでも、かかるメモリアクセス処理の実行順序を的確に監視して判定することができる。
As described above, according to the
また、上述のように、監視位置情報(固有情報)は、監視対象のアクセス処理に対応する機械語のメモリアドレスを含む。機械語は、オブジェクトコード、命令コード、目的コードとも称される。機械語(命令コード)のアドレスは、メモリのアクセス処理の呼び出し元のアドレスとみなすことができる。監視用プログラム内の監視対象のアクセス処理それぞれを識別(区別)することができる固有の情報として機械語のアドレスを用いるので、監視対象のアクセス処理の実行順序を正確に監視することができる。 Further, as described above, the monitoring position information (unique information) includes a machine language memory address corresponding to the monitoring target access processing. The machine language is also referred to as an object code, an instruction code, and a purpose code. The address of the machine language (instruction code) can be regarded as the address of the caller of the memory access process. Since the machine language address is used as unique information that can identify (discriminate) each access process to be monitored in the monitoring program, the execution order of the access processes to be monitored can be accurately monitored.
また、上述のように、監視位置情報(固有情報)は、メモリからの読み込み処理若しくはメモリへの書き込みの処理の種別、アクセスするメモリのアドレス又はメモリへの書き込み値に関する情報を含む。これにより、メモリからの読込みに関する固有の情報又はメモリへの書込みに関する固有の情報が判れば、アクセス処理の順序情報が特定され、当該アクセス処理の実行順序を監視することができる。 Further, as described above, the monitoring position information (unique information) includes information regarding the type of processing for reading from or writing to the memory, the address of the memory to be accessed, or the value written to the memory. As a result, if the specific information related to reading from the memory or the specific information related to writing to the memory is known, the order information of the access processing can be specified, and the execution order of the access processing can be monitored.
次に、本実施の形態の監視装置200によるメモリアクセス処理の実行順序の他の判定例について説明する。
Next, another determination example of the execution order of the memory access processing by the
図27は図13に例示の関連テーブル2bに基づく監視テーブルを用いた場合の判定例を示す説明図である。図13には、メモリアクセス用I/Fの指定機能が設定された場合の関連データベースが例示されている。ここで、指定機能とは、同じ読出し又は書込み処理であっても複数の異なる機能のいずれかを指定するものであり、例えば、読出すデータのサイズ、あるいは書込むデータのサイズによってメモリアクセス用I/Fを使い分けることができる。 FIG. 27 is an explanatory diagram showing a determination example when a monitoring table based on the related table 2b illustrated in FIG. 13 is used. FIG. 13 illustrates a related database when the memory access I / F designation function is set. Here, the designation function designates any one of a plurality of different functions even in the same read or write process. For example, the memory access I is determined depending on the size of data to be read or the size of data to be written. / F can be used properly.
図13の例では、データのサイズが8ビットである場合、Write08又はRead08を用い、データのサイズが16ビットである場合、Write16又はRead16を用いる。また、この場合、Write08、Read08、Write16、Read16には、それぞれ異なる命令コードアドレスが対応する。 In the example of FIG. 13, when the data size is 8 bits, Write08 or Read08 is used, and when the data size is 16 bits, Write16 or Read16 is used. In this case, different instruction code addresses correspond to Write08, Read08, Write16, and Read16.
図13の例のような関連テーブル2bで実行順序が定義されたプログラムでは、図27Aに示すように、系列Xについて、ID=1、2、1、2、…の順序で位置情報が特定された場合、メモリアクセス処理は正しい順序で行われていると判定することができる。 In the program in which the execution order is defined in the relation table 2b as in the example of FIG. 13, the position information is specified in the order of ID = 1, 2, 1, 2,... In this case, it can be determined that the memory access processing is performed in the correct order.
しかし、図27Bに示すように、系列XのID=1、系列YのID=2の順序で位置情報が特定された場合には、例えば、8ビット用の読出し用I/Fで読出されるべきメモリ領域が、16ビット用の読出し用I/Fで読出されたことになり、メモリアクセス処理は誤った順序で行われていると判定することができ、実行順序に関するエラーを検出してエラー処理を行うことができる。 However, as shown in FIG. 27B, when position information is specified in the order of series X ID = 1 and series Y ID = 2, it is read out by, for example, an 8-bit read I / F. The memory area to be read is read by the 16-bit read I / F, and it can be determined that the memory access processing is performed in the wrong order. Processing can be performed.
図28は図15に例示の関連テーブル2cに基づく監視テーブルを用いた場合の判定例を示す説明図である。図15には、順序情報の中に繰返先頭IDが系列X、Y毎に設けられた関連テーブル2cが例示されている。 FIG. 28 is an explanatory diagram showing a determination example when a monitoring table based on the related table 2c illustrated in FIG. 15 is used. FIG. 15 illustrates a related table 2c in which the repeated head ID is provided for each of the series X and Y in the order information.
図15の例のような関連テーブル2cで実行順序が定義されたプログラムでは、図28Aに示すように、系列Xについて、ID=1、2、3、4、2、…の順序で位置情報が特定された場合、繰返先頭ID=2でメモリアクセス処理が繰り返されているので、メモリアクセス処理は正しい順序で行われていると判定することができる。 In the program in which the execution order is defined in the related table 2c as in the example of FIG. 15, the position information is stored in the order of ID = 1, 2, 3, 4, 2,. If specified, the memory access process is repeated with the repeated head ID = 2, so that it can be determined that the memory access process is performed in the correct order.
しかし、図28Bに示すように、例えば、ID=1、2、3、4、1の順序で位置情報が特定された場合、繰返先頭ID=2でメモリアクセス処理が繰り返されていないので、メモリアクセス処理は誤った順序で行われていると判定することができ、実行順序に関するエラーを検出してエラー処理を行うことができる。 However, as shown in FIG. 28B, for example, when the position information is specified in the order of ID = 1, 2, 3, 4, 1, the memory access process is not repeated with repeated head ID = 2. It can be determined that the memory access processing is performed in the wrong order, and an error relating to the execution order can be detected and error processing can be performed.
図29は図18に例示の関連テーブル2dに基づく監視テーブルを用いた場合の判定例を示す説明図である。図18には、通知予定IDが設定された場合の関連データベース2dが例示されている。
FIG. 29 is an explanatory diagram showing a determination example when a monitoring table based on the related table 2d illustrated in FIG. 18 is used. FIG. 18 illustrates the
図18の例のような関連テーブル2dで実行順序が定義されたプログラムでは、図29Aに示すように、系列Xについて、ID=1、2、4、1、…の順序で位置情報が特定された場合、ID=1の通知予定IDがID=2又は3であり、ID=2の通知予定IDがID=4であり、ID=4の通知予定IDがID=1であり、通知予定IDで特定された順序でメモリアクセス処理が実行されているので、メモリアクセス処理は正しい順序で行われていると判定することができる。 In the program in which the execution order is defined in the related table 2d as in the example of FIG. 18, the position information is specified in the order of ID = 1, 2, 4, 1,... The notification schedule ID of ID = 1 is ID = 2 or 3, the notification schedule ID of ID = 2 is ID = 4, the notification schedule ID of ID = 4 is ID = 1, and the notification schedule ID Since the memory access processes are executed in the order specified in (1), it can be determined that the memory access processes are performed in the correct order.
しかし、図29Bに示すように、例えば、ID=1、2、4、3の順序で位置情報が特定された場合、ID=4の通知予定IDがID=1であるのに、ID=4の次にID=3のメモリアクセス処理が行われているため、メモリアクセス処理は誤った順序で行われていると判定することができ、実行順序に関するエラーを検出してエラー処理を行うことができる。 However, as shown in FIG. 29B, for example, when position information is specified in the order of ID = 1, 2, 4, 3, ID = 4 although the notification schedule ID of ID = 4 is ID = 1. Since the memory access process with ID = 3 is performed next to the memory access process, it can be determined that the memory access process is performed in the wrong order, and an error related to the execution order can be detected and the error process can be performed. it can.
図30は図19に例示の関連テーブル2eに基づく監視テーブルを用いた場合の判定例を示す説明図である。図19には、デッドライン(閾値時間)が設けられた場合の関連テーブル2eが例示されている。 FIG. 30 is an explanatory diagram showing a determination example when a monitoring table based on the related table 2e illustrated in FIG. 19 is used. FIG. 19 illustrates an association table 2e when a deadline (threshold time) is provided.
図19の例のような関連テーブル2eで実行順序が定義されたプログラムでは、図30Aに示すように、系列Xについて、ID=2のメモリアクセス処理後、例えば、50ms(<閾値時間である100ms)後にID=3のメモリアクセス処理が実行されているので、メモリアクセス処理は正しいと判定することができる。 In the program in which the execution order is defined in the association table 2e as in the example of FIG. 19, for example, 50 ms (<100 ms which is the threshold time) after the memory access process of ID = 2 for the series X as shown in FIG. 30A. ) Since the memory access process with ID = 3 is executed later, it can be determined that the memory access process is correct.
しかし、図30Bに示すように、例えば、系列Xについて、ID=2のメモリアクセス処理後、例えば、300ms(>閾値時間である100ms)後にID=3のメモリアクセス処理が実行された場合には、ID=2のメモリアクセス処理が開始された後、ID=3のメモリアクセス処理が開始されるまでの経過時間がデッドライン(閾値時間)を超えているので、メモリアクセス処理は誤っていると判定することができ、エラー処理を行うことができる。 However, as shown in FIG. 30B, for example, for the series X, after the memory access process with ID = 2, for example, when the memory access process with ID = 3 is executed after 300 ms (> 100 ms which is the threshold time). Since the elapsed time from the start of the memory access process of ID = 2 to the start of the memory access process of ID = 3 exceeds the deadline (threshold time), the memory access process is erroneous Can be determined, and error processing can be performed.
上述の監視装置200は、CPU、RAMなどを備えたコンピュータを用いて実現することもできる。すなわち、図25及び図26に示すような、各処理手順を定めたコンピュータプログラムを記録した記録媒体をコンピュータに備えられた記録媒体読取部で読み取り、読み取って得られたコンピュータプログラムをRAMにロードし、コンピュータプログラムをCPUで実行することにより、コンピュータ上で監視装置200を実現することができる。
The
開示された実施の形態は、すべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味及び範囲内でのすべての変更が含まれることが意図される。 The disclosed embodiments are to be considered in all respects as illustrative and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
1 プログラム(ソースコード)
2、2a、2b、2c、2d、2e 関連テーブル
3 監視用コード挿入済プログラム(監視対象プログラム)
4 監視テーブル
10 制御部
14 監視対象特定部
15 監視用コード生成部
20 マイコン
21 実行部
22 監視部
221 ID特定部
222 メモリアクセス順序判定部
223 対応決定部
23 エラー処理部
24、25 記憶部
1 program (source code)
2, 2a, 2b, 2c, 2d, 2e Related table 3 Monitoring code inserted program (monitoring target program)
DESCRIPTION OF
Claims (8)
メモリのアクセスに関する複数の監視対象のアクセス処理の実行順序を定める順序情報と該監視対象のアクセス処理によるメモリアクセスに関する固有情報とを関連付けた監視テーブルを記憶する記憶部と、
前記実行部で複数のアクセス処理を順次実行した場合に、該アクセス処理によるメモリアクセスに関する固有情報を順次検出する検出手段と、
前記監視テーブルを用いて、前記検出手段で検出した固有情報に対応する順序情報を順次特定する特定手段と、
該特定手段で特定した順序情報に応じて前記実行部が実行する監視対象のアクセス処理の順序を監視する監視手段と
を備えることを特徴とする監視装置。 In a monitoring apparatus that includes an execution unit that executes a plurality of processes in a program, and that monitors the order of processes executed by the execution unit,
A storage unit for storing a monitoring table in which order information for determining an execution order of a plurality of monitoring target access processes related to memory access and specific information regarding memory access by the monitoring target access process are associated;
Detecting means for sequentially detecting specific information related to memory access by the access processing when a plurality of access processing is sequentially executed by the execution unit;
Using the monitoring table, specifying means for sequentially specifying order information corresponding to the unique information detected by the detecting means;
A monitoring device comprising: monitoring means for monitoring the order of access processing to be executed by the execution unit according to the order information specified by the specifying means.
前記特定手段は、
前記判定手段が存在すると判定した順序情報を特定するようにしてあることを特徴とする請求項1に記載の監視装置。 Determining means for determining whether or not order information corresponding to the unique information detected by the detecting means exists in the monitoring table;
The specifying means is:
The monitoring apparatus according to claim 1, wherein order information determined to include the determination unit is specified.
前記順序情報により前記監視対象のアクセス処理の所定の実行順序を特定するようにしてあり、
前記監視手段は、
前記特定手段が特定した順序情報と一致する前記監視テーブル内の順序情報に応じて、前記実行部で実行する監視対象のアクセス処理の順序が前記所定の実行順序であるか否かを判定する順序判定手段を備えることを特徴とする請求項1又は請求項2に記載の監視装置。 The monitoring table is
A predetermined execution order of the monitoring target access processing is specified by the order information;
The monitoring means includes
An order for determining whether or not the order of access processing to be executed by the execution unit is the predetermined execution order according to the order information in the monitoring table that matches the order information specified by the specifying unit The monitoring apparatus according to claim 1, further comprising a determination unit.
前記監視対象のアクセス処理に対応する機械語のメモリアドレスを含むことを特徴とする請求項1乃至請求項4のいずれか1項に記載の監視装置。 The specific information is
5. The monitoring apparatus according to claim 1, further comprising a machine language memory address corresponding to the monitoring target access processing.
メモリからの読み込み処理若しくはメモリへの書き込みの処理の種別、アクセスするメモリのアドレス又はメモリへの書き込み値に関する情報を含むことを特徴とする請求項1乃至請求項5のいずれか1項に記載の監視装置。 The specific information is
6. The information according to claim 1, further comprising information on a type of a process of reading from or writing to a memory, an address of a memory to be accessed, or a write value to the memory. Monitoring device.
コンピュータに、
前記実行部で複数のアクセス処理を順次実行した場合に、該アクセス処理によるメモリアクセスに関する固有情報を順次検出するステップと、
メモリのアクセスに関する複数の監視対象のアクセス処理の実行順序を定める順序情報と該監視対象のアクセス処理によるメモリアクセスに関する固有情報とを関連付けた監視テーブルを用いて、検出した固有情報に対応する順序情報を順次特定するステップと、
特定した順序情報に応じて前記実行部が実行する監視対象のアクセス処理の順序を監視するステップと
を実行させることを特徴とするコンピュータプログラム。 In a computer program for causing a computer to monitor the order of processes executed by an execution unit that executes a plurality of processes constituting the program,
On the computer,
When the execution unit sequentially executes a plurality of access processes, detecting specific information regarding memory access by the access processes sequentially;
Order information corresponding to detected unique information using a monitoring table in which order information for determining the execution order of a plurality of monitoring target access processes related to memory access is associated with specific information related to memory access by the monitored target access process Sequentially identifying
And a step of monitoring the order of the monitored access processing executed by the execution unit in accordance with the specified order information.
メモリのアクセスに関する複数の監視対象のアクセス処理の実行順序を定める順序情報と該監視対象のアクセス処理によるメモリアクセスに関する固有情報とを関連付けた監視テーブルを記憶しておくステップと、
前記実行部で複数のアクセス処理を順次実行した場合に、該アクセス処理によるメモリアクセスに関する固有情報を順次検出するステップと、
前記監視テーブルを用いて、検出された固有情報に対応する順序情報を順次特定するステップと、
特定された順序情報に応じて前記実行部が実行する監視対象のアクセス処理の順序を監視するステップと
を含むことを特徴とする監視方法。 In a monitoring method by a monitoring device that includes an execution unit that executes a plurality of processes constituting a program, and that monitors the order of processes executed by the execution unit,
Storing a monitoring table associating sequence information for determining an execution order of a plurality of monitoring target access processes related to memory access and specific information regarding memory access by the monitoring target access process;
When the execution unit sequentially executes a plurality of access processes, detecting specific information regarding memory access by the access processes sequentially;
Sequentially identifying order information corresponding to the detected unique information using the monitoring table;
Monitoring the order of the monitoring target access processes executed by the execution unit according to the specified order information.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012164155A JP2014026347A (en) | 2012-07-24 | 2012-07-24 | Monitoring device, computer program, and monitoring method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012164155A JP2014026347A (en) | 2012-07-24 | 2012-07-24 | Monitoring device, computer program, and monitoring method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2014026347A true JP2014026347A (en) | 2014-02-06 |
Family
ID=50199957
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2012164155A Pending JP2014026347A (en) | 2012-07-24 | 2012-07-24 | Monitoring device, computer program, and monitoring method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2014026347A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2017174463A (en) * | 2014-09-25 | 2017-09-28 | 日本精工株式会社 | Control device and control method for in-vehicle electronic device |
| WO2017163302A1 (en) * | 2016-03-22 | 2017-09-28 | 株式会社東芝 | Control apparatus |
| JP2017208108A (en) * | 2014-09-25 | 2017-11-24 | 日本精工株式会社 | Device and method for controlling vehicle-mounted electronic devices |
| JP2019145065A (en) * | 2018-02-21 | 2019-08-29 | 株式会社デンソー | Parallelizing method, parallelizing tool, multi-core microcomputer and on-vehicle unit |
| FR3101972A1 (en) * | 2019-10-10 | 2021-04-16 | Continental Automotive | Monitoring device |
-
2012
- 2012-07-24 JP JP2012164155A patent/JP2014026347A/en active Pending
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2017174463A (en) * | 2014-09-25 | 2017-09-28 | 日本精工株式会社 | Control device and control method for in-vehicle electronic device |
| JP2017199403A (en) * | 2014-09-25 | 2017-11-02 | 日本精工株式会社 | Control device and control method for in-vehicle electronic device |
| JP2017208108A (en) * | 2014-09-25 | 2017-11-24 | 日本精工株式会社 | Device and method for controlling vehicle-mounted electronic devices |
| JP2017215973A (en) * | 2014-09-25 | 2017-12-07 | 日本精工株式会社 | Control device and control method for on-vehicle electronic apparatus |
| JP2017224304A (en) * | 2014-09-25 | 2017-12-21 | 日本精工株式会社 | Control device and control method for in-vehicle electronic device |
| US10017205B2 (en) | 2014-09-25 | 2018-07-10 | Nsk Ltd. | Control apparatus and control method of on-vehicle electronic equipment |
| WO2017163302A1 (en) * | 2016-03-22 | 2017-09-28 | 株式会社東芝 | Control apparatus |
| JP2019145065A (en) * | 2018-02-21 | 2019-08-29 | 株式会社デンソー | Parallelizing method, parallelizing tool, multi-core microcomputer and on-vehicle unit |
| JP7095513B2 (en) | 2018-02-21 | 2022-07-05 | 株式会社デンソー | Multi-core microcomputers and in-vehicle devices |
| FR3101972A1 (en) * | 2019-10-10 | 2021-04-16 | Continental Automotive | Monitoring device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8381194B2 (en) | Methods and apparatuses for selective code coverage | |
| US11748072B2 (en) | Apparatus and method for source code optimisation | |
| EP3387536B1 (en) | Method and device for non-intrusively collecting function trace data | |
| JP2014026347A (en) | Monitoring device, computer program, and monitoring method | |
| CN111142469B (en) | A debugging method and debugging system of PLC configuration program | |
| CN100478877C (en) | Method for configuring a computer program | |
| CN109144874A (en) | A kind of monitoring method and device for testing environment | |
| CN114090430A (en) | Coverage test method, system, storage medium and computing device | |
| US20090106546A1 (en) | Method and Software System for Configuring a Modular System | |
| CN103765390A (en) | Data race analysis with improved detection filtering | |
| CN110795129B (en) | Data refreshing method, device and equipment | |
| CN104461880A (en) | Method for automatically detecting heap corruption in embedded system | |
| US8832670B2 (en) | Programmable controller and programming tool for communication with legacy equipment | |
| JP2014026346A (en) | Program generation device, computer program, and program generation method | |
| CN112558982A (en) | Code detection method and device and computer equipment | |
| US9063723B2 (en) | Function-based software comparison method | |
| CN108614704B (en) | Code compiling method and device | |
| US9940068B2 (en) | Device and method for determining memory leaks | |
| CN114564326B (en) | A method and system for performing abnormal scanning on applications of a kubernetes cluster | |
| JP2009223714A (en) | Arithmetic circuit and failure analysis method of arithmetic circuit | |
| CN112559370A (en) | Front-end-based React project unit testing method and related equipment | |
| CN111221701A (en) | Chip and circuit logic reconfiguration system thereof | |
| JP2019159931A (en) | Parallelization method, parallelization tool, and multicore microcomputer | |
| JP2012238252A (en) | Control program development support device | |
| JP5762229B2 (en) | How to measure program performance |