JP2007328501A - Program debug support processor, adapter for communication and program debug support processing program - Google Patents
Program debug support processor, adapter for communication and program debug support processing program Download PDFInfo
- Publication number
- JP2007328501A JP2007328501A JP2006158482A JP2006158482A JP2007328501A JP 2007328501 A JP2007328501 A JP 2007328501A JP 2006158482 A JP2006158482 A JP 2006158482A JP 2006158482 A JP2006158482 A JP 2006158482A JP 2007328501 A JP2007328501 A JP 2007328501A
- Authority
- JP
- Japan
- Prior art keywords
- program
- debug
- data
- command
- 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.)
- Granted
Links
Images
Abstract
Description
この発明は、例えば、組み込み機器に機能を実行させるために搭載するプログラムのデバッグ(バグ(プログラムの誤り)の修正)を支援するための処理装置及びその処理を実現するためのプログラムに関するものである。 The present invention relates to, for example, a processing apparatus for supporting debugging (correction of a bug (program error)) of a program mounted for causing an embedded device to execute a function, and a program for realizing the processing. .
従来のプログラムデバッグ装置は、プログラム本体のほか、デバッグ支援処理(メモリに記憶された変数等の値の出力、レジスタの参照等)を行うためのコマンドのデータ(以下、デバッグコマンドという)を受信し、解釈し、実行し、その結果を返答する機能(プログラム)を行う手段を付加し、機能動作を行わせることにより、エミュレータ等を用いずにプログラム本体のデバッグ支援処理を直接行うことができるように構成している(例えば特許文献1参照)。 In addition to the program itself, a conventional program debugging device receives command data (hereinafter referred to as a debug command) for performing debugging support processing (output of values of variables and the like stored in memory, reference of registers, etc.). By adding a means for performing a function (program) that interprets, executes, and responds to the result, it is possible to directly perform debugging support processing of the program body without using an emulator or the like. (For example, refer to Patent Document 1).
従来のプログラムデバッグ支援処理装置では、デバッグコマンドの受信・解釈・実行・返答を実行する手段が予めファームウェア内に組み込まれる構成となっており、プログラム本体のデバッグのために必要な情報を得る(出力させる)ためには、レジスタやメモリ内の特定のアドレス値等、ハードウェアのリソースを直接指定する必要があった。従って、例えば高級言語等でプログラムが記述されているような、変数の値の参照など、直接どのハードウェアのリソースを参照すべきかを指定できない場合には、このような処理が困難であるという問題点があった。 In the conventional program debug support processing apparatus, means for receiving, interpreting, executing and responding to a debug command is built in the firmware in advance, and information necessary for debugging the program body is obtained (output) In order to do so, it is necessary to directly specify hardware resources such as a register and a specific address value in the memory. Therefore, such a process is difficult when it is not possible to directly specify which hardware resource should be referred to, such as reference to a variable value such as a program written in a high-level language. There was a point.
また、デバッグ支援処理に係る各手段の機能が固定され、変更が容易でないため、例えば、デバッグコマンドについても、プログラム本体の処理に係るコマンド等のデータに応じて変更することが困難である。このため、プログラム本体の受信インタフェース(受信部)と、デバッグ用の手段の受信インタフェースが共有されている場合、インタフェースの違いにより特定できないため、プログラム本体の処理に係るデータ(コマンド等の制御信号)とデバッグコマンドとが(データの内容として)重ならないように通信しなければならないが、その設定が容易に行えないという問題点があった。 Further, since the functions of the respective units related to the debug support process are fixed and cannot be easily changed, for example, it is difficult to change the debug command according to the data such as the command related to the process of the program body. For this reason, when the reception interface (reception unit) of the program main body and the reception interface of the debugging means are shared, the data related to the processing of the program main body (control signal such as a command) cannot be specified due to the difference in interface. However, there is a problem that the setting cannot be easily performed.
この発明は、上記のような問題点を解決するためになされたもので、エミュレータ等の高価な装置を利用しなくても、機器に組み込まれた高級言語で記述されたプログラム、主としてインタプリタで解釈されるスクリプト言語のプログラムについてもデバッグ支援処理を可能にするプログラムデバッグ支援処理装置を得るものである。 The present invention has been made to solve the above-described problems, and can be interpreted by a program written in a high-level language embedded in a device, mainly by an interpreter, without using an expensive device such as an emulator. A program debugging support processing apparatus that enables debugging support processing for a script language program to be obtained is also obtained.
さらに、プログラムの処理に係るコマンドが拡張されたり書き換えられたりしたとき、プログラム本体の受信インタフェースとデバッグ用の手段の受信インタフェースが共有されている場合でも、デバッグコマンドに関する定義の設定を容易に変えることができ、プログラムの処理に係るデータとデバッグコマンドとが重ならないようにするプログラムデバッグ支援処理装置を得るものである。 Furthermore, when a command related to program processing is expanded or rewritten, even if the reception interface of the program main body and the reception interface of the debugging means are shared, the definition settings for debug commands can be easily changed. Thus, a program debug support processing apparatus is provided which prevents data related to program processing and debug commands from overlapping.
この発明に係るプログラムデバッグ支援装置は、データを含む信号の送受信処理を実行する通信処理部と、デバッグ対象となる本体プログラム及び少なくともデバッグ支援処理に係るデバッグコマンドに関するデータを含み、本体プログラムの誤りを検出するデバッグ支援処理のためのデバッグプログラムを記憶する、データ変更可能な記憶部に記憶されたデバッグプログラムに基づき、本体プログラムに基づく処理を実行中に通信処理部が受信した信号に係るデータがデバッグコマンドであるかどうかを判定するコマンド判定部を有し、コマンド判定部の判定に基づいて本体プログラム又はデバッグプログラムに基づく処理を行う記述プログラム解釈部とを備える。 A program debug support apparatus according to the present invention includes a communication processing unit that executes transmission / reception processing of a signal including data, a main body program to be debugged, and at least data related to a debug command related to the debug support processing. Based on the debug program stored in the data changeable storage unit that stores the debug program for debugging support processing to be detected, the data related to the signal received by the communication processing unit during execution of the process based on the main body program is debugged. A command determination unit that determines whether the command is a command, and a description program interpretation unit that performs processing based on the main program or the debug program based on the determination of the command determination unit.
この発明によれば、本体プログラムだけでなく、デバッグプログラムについてもデータ変更可能な記憶部にデータとして記憶するようにしたので、本体プログラムのプログラム記述形式等に対応したデバッグプログラムを容易に記憶させ、記述プログラム解釈部に実行させることが可能になり、エミュレータ等の高価な装置を用いなくても、例えば、高級言語により記述されたプログラムに対応したデバッグプログラムに基づいてデバッグ支援処理を行うことができる。 According to the present invention, since not only the main body program but also the debug program is stored as data in the storage unit where data can be changed, the debug program corresponding to the program description format of the main body program can be easily stored, It is possible to execute the description program interpretation unit, and for example, debug support processing can be performed based on a debug program corresponding to a program described in a high-level language without using an expensive device such as an emulator. .
実施の形態1.
図1はこの発明の実施の形態1によるプログラムデバッグ支援装置を中心とする構成を示すブロック図である。本実施の形態では、家電機器とホームネットワークとを接続するための通信用アダプタ100(以下、アダプタ100という)の機能を実現するために組み込まれるプログラム(以下、本体プログラムという)をデバッグ対象のプログラムとして説明する。したがってアダプタ100が、本体プログラムの処理を実行する装置であるとともに、実行装置自体が本体プログラムに係るデバッグを支援するためのプログラムデバッグ支援装置の役割を果たす。さらに具体的には、家電機器であるエアコンの制御を行うプロトコルと、家電機器同士を連携させつつ制御を行うホームネットワークの規格であるECHONET (ECHONET はECHONET コンソーシアムの商標)で規定されたプロトコルとの相互変換を行う本体プログラムのデバッグを支援する装置を例に説明する。
1 is a block diagram showing a configuration centering on a program debugging support apparatus according to
図2はアダプタ100を利用して家電機器をECHONET に接続したホームネットワークの構成を示す図である。例えば、家電機器では、機種ごとの独自のプロトコルに従って動作の制御を行い、一方で、ECHONET では、規格化されたプロトコルに従って電文(各種データ等を含む信号)の送受信を行う。そのため、家電機器をホームネットワークに接続するアダプタ機能を実現する場合等において、プロトコル変換処理が必要になる。ここで、各家電機器のプロトコルに対応してプロトコル変換処理の手順をプロトコル変換プログラムとしておけば、プロトコル変換プログラムのみを書き換えて記憶手段に記憶させることで、(例えば物理的構成が)同じアダプタであれば異なる種類の家電機器に対応させることができ、ホームネットワークに各家電機器を接続することができる。そのため、プロトコル変換プログラムは、家電機器本体や、パーソナルコンピュータ、インターネット上に公開されたサーバなどの外部装置110からダウンロードできるようにし、アダプタ100を外部装置110と接続すると、記憶部101の書き換え可能な記憶領域に書き込まれるようにする。
FIG. 2 is a diagram illustrating a configuration of a home network in which home appliances are connected to ECHONET using the
また、本実施の形態で例とするプロトコル変換プログラムは、アダプタ100を構成するハードウェア(特に記述プログラム解釈部105等の機能を実現するCPU(Central Processing Unit )等のデータ処理手段)に依存しないスクリプト言語(高級言語)で記述されているものとする。そのため、アダプタ100がハードウェア的に異なっても同じプログラムで対応させることができる。
Further, the protocol conversion program exemplified in the present embodiment does not depend on hardware (particularly, data processing means such as a CPU (Central Processing Unit) that implements the function of the description
図1において、アダプタ100は、プログラムを記憶する記憶部101、そのプログラムを外部装置110からダウンロード処理するプログラムダウンロード管理部102、記憶部101に記憶されたプログラムに記述された内容に基づいて処理を実行する記述プログラム解釈部105、及び、記述プログラム解釈部105と、電文中のデータを一時的に家電機器シミュレータ112(家電機器)、ECHONET のコントローラ116とが電文を送受信するための処理を行う通信処理部106から構成される。
In FIG. 1, the
ここで、アダプタ100内の各部(特にプログラムダウンロード管理部102、記述プログラム解釈部105)に関しては、機器(ハードウェア)として独立して構成することもできるが、例えば、CPU(Central Processing Unit )を中心とするデータ処理手段(コンピュータ)でハードウェアを構成し、後述する各部によるフローチャートの手順(本体プログラム、デバッグプログラムに従って処理を行うための前段階としての手順)をあらかじめプログラム化してソフトウェア、ファームウェア等としてアダプタ100内に記憶し、コンピュータに処理させることもできる。
Here, each unit (especially the program
記憶部101には、前述した本体プログラムが例えばファイル形式のデータとして記憶される(以下、記憶された本体プログラムの記述内容を本体プログラム記述部103という)。また、本体プログラムをデバッグするためのデバッグプログラムも同様にファイル形式のデータとして記憶される(以下、記憶されたデバッグプログラムの記述内容をデバッグプログラム記述部104という)。そして、デバッグプログラム記述部104は、さらに、デバッグコマンドの定義や処理に基づいて出力すべきデバッグ情報の指定に係る記述がなされたデバッグコマンド設定記述部107と、デバッグ情報を出力する実行手順が記述されたデバッグコマンド実行記述部108とからなる。後述するように、デバッグコマンド設定記述部107に記述された内容は、記述プログラム解釈部105が行う処理により、デバッグに係る処理を行う際に参照とするデータとしてデバッグ情報格納部109に登録され、格納される。そして、デバッグ情報格納部109は、通信処理部106が受信した電文内のデバッグコマンドに関して、その定義等に関するデータをデバッグコマンドデータとして登録したデバッグコマンド登録部116と、出力すべきデバッグ情報の指定等に関するデータをデバッグデータとして登録したデバッグデータ登録部117から構成される。これらについては後述する。
The storage unit 101 stores the above-described main body program as, for example, data in a file format (hereinafter, the description content of the stored main body program is referred to as a main body program description unit 103). Similarly, a debug program for debugging the main body program is also stored as data in a file format (hereinafter, the description content of the stored debug program is referred to as a debug program description unit 104). The debug
電文送受信部114から送信された電文を、アダプタ100の通信処理部106が受信する。記述プログラム解釈部105のデバッグコマンド判定部105aは、デバッグコマンド登録部116に登録したデバッグコマンドデータを参照して、電文中のデータがデバッグコマンドであるか否かを判定する。デバッグコマンドであると判定すると、デバッグプログラムによる処理を行うものと判定して、記述プログラム解釈部105は、デバッグコマンド実行記述部108の記述に従った処理を実行する。一方、デバッグコマンドでないと判定すると、本体プログラム記述部103の記述に従った処理を実行する。ここで、記述プログラム解釈部105が各プログラムの記述に基づく処理を行う際、後述するように辞書を参照して処理を行う。辞書記憶部105cは、この辞書に関するデータが登録され、記憶されている。また、記述プログラム解釈部105には、例えば、処理を実行中に、その処理に係る指示命令、データを例えば一時的に記憶しておくキャッシュメモリ(RAM)、レジスタ等の処理記憶部105bを有するものとする。デバッグ支援処理においては、特に本体プログラムに基づく処理実行時における処理記憶部105bに記憶された変数、配列(バッファ等)の値をデバッグ情報として出力する等の処理が行われる。
The
家電機器シミュレータ112は、実際の家電機器の代わりに、デバッグ段階において、その家電機器に対応した通信電文、デバッグコマンド等のデータを含む電文を送受信するための装置であり、例えばパーソナルコンピュータ等によって構成される。ここで、家電機器シミュレータ112は、アダプタ100に送信する電文を作成する電文作成部113と、アダプタ100との間で電文の送受信電文を行う電文送受信部114及びアダプタ100との間で送受信を行った電文内容を表示する電文表示部118から構成される。
The home appliance simulator 112 is a device for transmitting and receiving a telegram including data such as a communication telegram and a debug command corresponding to the home appliance in the debugging stage instead of an actual home appliance, and is configured by, for example, a personal computer Is done. Here, the home appliance simulator 112 performs transmission / reception between the message generation unit 113 that generates a message to be transmitted to the
コントローラ115は、ECHONET の電文を送受信する装置である。特に限定はしないが、家電機器シミュレータ112と同様に、パーソナルコンピュータ等によって構成されるシミュレータでも良い。以下、家電機器シミュレータ112とアダプタ100(通信処理部106)との間を家電機器側とし、コントローラ115とアダプタ100との間をECHONET 側とする。
The controller 115 is a device that transmits and receives ECHONET messages. Although not particularly limited, a simulator constituted by a personal computer or the like may be used in the same manner as the home appliance simulator 112. Hereinafter, the portion between the home appliance simulator 112 and the adapter 100 (communication processing unit 106) is the home appliance side, and the space between the controller 115 and the
図3は、プログラムダウンロード管理部102の処理動作を表すフローチャートを示す図である。接続端子(図示せず)等を介して、プログラムを保持した外部装置110にアダプタ100が接続されると、ステップST301において、プログラムダウンロード管理部102は、例えば電圧の変化等により外部装置110との接続を検知する。接続により、プログラムダウンロード管理部102(アダプタ100)とプログラム保持部(外部装置110)との間で通信が可能となる。次に、ステップST302で、プログラム保持部111に保持されたプログラムをダウンロード処理する。本体プログラム及び/又はデバッグプログラムは、それぞれ例えばファイル形式のデータとしてアダプタ100の記憶部101に記憶される。そして、ステップST303において、記述プログラム解釈部105に処理を引き継ぎ実行させる。
FIG. 3 is a flowchart illustrating the processing operation of the program
図4は、アダプタ100のプロトコル変換と通信処理における動作を記述した本体プログラムの例を示す図である。ここで、プログラムは1又は複数の実行コードで構成される。実行コードは、記述プログラム解釈部105においてインタプリタにより逐次に実行処理を行う際の単位となる。本実施の形態においては、プログラムを記述する言語としてForth を用いる。Forth はスタック(LIFO(Last In First Out)によるデータ構造)を利用した逆ポーランド記法に基づく言語であり、構文解析が不要なため、処理系が小さく、省資源(記憶容量を必要としない)でインタプリタが動作するという特徴を持つ。このため、家電機器に接続する通信用のアダプタのように、低コストで実現することが要求される機器に搭載するインタプリタとしては最適な言語である。
FIG. 4 is a diagram illustrating an example of a main body program describing operations in the protocol conversion and communication processing of the
Forth では、実行すべき処理を表すデータをWordと呼ぶ。実行コードは、Wordと、Wordに基づく処理のためのデータとで構成され、データ、Wordの順に記述される。各Wordについては、その処理内容のデータとあらかじめ定義づけられて(関連づけられて)、辞書として辞書記憶部105cに登録され、管理されている。実行コードに記述された文字列等のデータにおいて、辞書として登録されていればWordであり、登録されていなければ処理のためのデータとなる。また、Wordはあらかじめ決められたものだけではなく、さらに処理内容を定義して辞書として辞書記憶部105cにデータとして登録することで、新たな処理機能を追加できる。プログラムの解釈・実行において、記述プログラム解釈部105は、プログラムを処理する際、読み込んだ文字列が辞書に存在しない場合は処理のためのデータとみなしてスタックに積み、辞書に存在する場合は、Wordとみなして(その時点において)スタックに積まれた各データに対して処理を実行する。
In Forth, data representing the process to be executed is called Word. The execution code includes Word and data for processing based on Word, and is described in the order of data and Word. Each word is defined (associated) with the data of the processing contents in advance and is registered and managed as a dictionary in the
例えば、図4では、ANS規格で規定されたForthのWord(Programming Languages-Forth X3J14 dpANS-6 -June 30,1993)に加え、プロトコル変換用の拡張Wordとして、「SET_SEND_EPC」、「GET_EPC 」、「FROM_ECHONET」、「TO_EQUIPMENT」、及び「FROM_EQUIPMENT 」というWordを定義し、登録して用いるものとする。 For example, in FIG. 4, in addition to Forth Word (Programming Languages-Forth X3J14 dpANS-6 -June 30,1993) defined in the ANS standard, extended words for protocol conversion include “SET_SEND_EPC”, “GET_EPC”, “GET_EPC”, “ Words “FROM_ECHONET”, “TO_EQUIPMENT”, and “FROM_EQUIPMENT” are defined, registered, and used.
「SET_SEND_EPC」は、ECHONET プロパティとその値のデータを、ECHONET 規格の電文に変換してECHONET 側に送信する処理を記述プログラム解釈部105に行わせるためのWordである。「GET_EPC 」は、ECHONET 側からの受信からECHONET プロパティの値を取得する処理を行わせるためのWordである。ここで、ECHONET プロパティとは、例えば、エアコンにおける風量設定状態等、家電機器に応じて設定可能なプロパティのコードを表すものとする。そして、そのコードに対する値はそれぞれECHONET の規格で定められている。
“SET_SEND_EPC” is a word for causing the
「FROM_ECHONET」は、ECHONET 側からの電文の受信の有無をチェックする処理を行わせるWordである。「TO_EQUIPMENT」は、送信バッファに格納されたデータを含む電文を家電機器側に送信処理させるWordである。「FROM_EQUIPMENT」は、家電機器側から受信した電文中のデータ(コマンド等。以下、受信データという)を受信バッファに格納させる処理を行わせる、受信処理を行うためのWordである。 “FROM_ECHONET” is a word that performs processing to check whether or not a message has been received from the ECHONET side. “TO_EQUIPMENT” is a word that causes a home appliance to transmit a message including data stored in a transmission buffer. “FROM_EQUIPMENT” is a word for performing a reception process for causing a reception buffer to store data (commands, etc., hereinafter referred to as reception data) in a message received from the home appliance side.
次に、記述プログラム解釈部105が行う処理内容について図4の本体プログラムに基づいて説明する。ここで、アダプタ100と接続する家電機器がエアコン(空気調和装置)であるものとして説明する。1行目は、このプログラムで扱う数値が16進数であることを示している。2行目と3行目は、受信バッファとなる「RV_BUF」と送信バッファとなる「TR_BUF」とがそれぞれ22バイトの配列であることを宣言している。4行目と5行目は、「IDT 」と「EDT 」がそれぞれ整数型の変数であることを宣言している。
Next, the processing contents performed by the description
7行目から14行目は、エアコン(家電機器)側からの受信電文を解釈するWord「PROC_RV_DATA」の処理内容を定義している。9行目から12行目は、エアコン側からの受信電文が格納された受信バッファ「RV_BUF」の8バイト目の値が、電源ON/OFFの状態を示すことを仮定して記述したコードである。例えば「RV_BUF」の8バイト目の値が「0 」のときはエアコンの電源がOFFであり、「1 」のときはエアコンの電源がONを表すものとする。9行目で、受信バッファ「RV_BUF」の8バイト目を取り出し、変数「IDT 」に代入処理する。10行目で、「IDT 」の値が「0 」であれば、変数「EDT 」に「31」を代入処理し、11行目で、「IDT 」の値が「1 」であれば、変数「EDT 」に「30」を代入処理する。12行目で、Word「SET_SEND_EPC」を実行処理し、「EDT 」の値を電文に含み、ECHONET 側に送信する処理を行う。ここで、12行目の「80」はECHONET 規格で規定された電源ON/OFFを表すECHONET プロパティである。ECHONET 規格では、ECHONET プロパティ「80」における値が「31」のときは電源OFFを、「30」のときは電源ONを表すことが規定されている。つまり、12行目は、ECHONET 規格の仕様に変換されたプロパティの値をデータとして送信電文に含み、ECHONET 側に送信する処理を行うことになる。
The 7th to 14th lines define the processing content of the word “PROC_RV_DATA” that interprets the received message from the air conditioner (home appliance) side. The 9th to 12th lines are code written assuming that the value of the 8th byte of the reception buffer “RV_BUF” storing the received message from the air conditioner indicates the power ON / OFF state. . For example, when the value of the eighth byte of “RV_BUF” is “0”, the power supply of the air conditioner is OFF, and when it is “1”, the power supply of the air conditioner is ON. In the ninth line, the eighth byte of the reception buffer “RV_BUF” is extracted and assigned to the variable “IDT”. In the 10th line, if the value of “IDT” is “0”, “31” is assigned to the variable “EDT”, and if the value of “IDT” is “1” in the 11th line, the variable Substitute “30” into “EDT”. On
16行目から25行目は、エアコン側に送信する電文を設定する処理を行うWord「PROC_TR_DATA」の処理内容を定義している。17行目では、エアコンに送信する電文を格納する送信バッファ「TR_BUF」の0バイト目に値「FC」を代入処理する。18行目では「TR_BUF」の1バイト目に値「41」を代入処理する。20行目から23行目は「TR_BUF」の8バイト目の値が、エアコンの電源ON/OFFの状態を示すことを仮定して記述したコードである。「TR_BUF」の8バイト目の値が「0 」のときはエアコンの電源をOFFに設定し、「1 」のときはエアコンの電源をONに設定するものとする。20行目で、Word「GET_EPC 」によって、ECHONET 側から受信したECHONET プロパティ「80」に対する値を取得して、変数「EDT 」に代入処理する。21行目で、「EDT 」の値が「31」であれば、変数「IDT 」に「0 」を代入処理し、22行目で、「EDT 」の値が「30」であれば、変数「IDT 」に「1 」を代入処理する。23行目で、「IDT 」の値を送信バッファ「TR_BUF」の8バイト目に代入処理する。
The 16th to 25th lines define the processing content of the word “PROC_TR_DATA” that performs processing for setting a message to be transmitted to the air conditioner side. In the 17th line, the value “FC” is assigned to the 0th byte of the transmission buffer “TR_BUF” for storing the message to be transmitted to the air conditioner. In the 18th line, the value “41” is assigned to the first byte of “TR_BUF”. The 20th to 23rd lines are codes described assuming that the value of the eighth byte of “TR_BUF” indicates the power ON / OFF state of the air conditioner. When the value of the eighth byte of “TR_BUF” is “0”, the power supply of the air conditioner is set to OFF, and when the value is “1”, the power supply of the air conditioner is set to ON. On
27行目から39行目のメイン処理は、無限ループになっており、ECHONET 側から電文を受信したら、ECHONET プロパティ及びその値をエアコン側に送信する電文に変換してエアコン側に送信し、エアコン側から電文を受信したら、ECHONET プロパティに変換して電文をECHONET 側に送信する、という処理を行う。 The main processing from the 27th line to the 39th line is an infinite loop. When a message is received from the ECHONET side, the ECHONET property and its value are converted into a message to be sent to the air conditioner side, and sent to the air conditioner side. When a message is received from the side, the ECHONET property is converted and the message is sent to the ECHONET side.
30行目では、Word「FROM_ECHONET」によって、ECHONET 側からの受信をチェックしている。「FROM_ECHONET」は、受信があった場合は値「1 」をスタックに積み、受信がなかった場合は値「0 」をスタックに積む。31行目から34行目は、ECHONET 側から受信があった場合の処理内容を表す。32行目でWord「PROC_TR_DATA」を呼び出して、16行目から25行目に記述された内容に基づく処理を実行し、エアコン側への送信電文の内容を送信バッファ「TR_BUF」に格納する。33行目で、Word「TO_EQUIPMENT」によって、「TR_BUF」の内容を送信電文としてエアコン側に送信処理する。
On
一方、35行目では、受信処理のためのWord「FROM_EQUIPMENT」によって、エアコン側からの受信をチェックする。「FROM_EQUIPMENT」は、受信があった場合は受信電文を受信バッファ「RV_BUF」に格納して値「1 」をスタックに積み、受信がなかった場合は値「0 」をスタックに積む。36行目から38行目は、エアコン側から受信があった場合の処理を表す。37行目でWord「PROC_TR_DATA」を呼び出して、7行目から14行目に記述された内容に基づく処理を実行し、送信バッファ「RV_BUF」の各バイトの値をECHONET プロパティに変換してECHONET 側に送信電文として送信する。 On the other hand, on the 35th line, reception from the air conditioner side is checked by the word “FROM_EQUIPMENT” for reception processing. “FROM_EQUIPMENT” stores the received message in the reception buffer “RV_BUF” when receiving, and stacks the value “1” on the stack, and stacks the value “0” on the stack when there is no reception. The 36th line to the 38th line represent processing when receiving from the air conditioner side. The word "PROC_TR_DATA" is called on the 37th line, the processing based on the contents described in the 7th to 14th lines is executed, the value of each byte of the transmission buffer "RV_BUF" is converted into the ECHONET property, and the ECHONET side As a transmission message.
図5は本体プログラムの別例を表す図である。図4では、説明のために、本体プログラムにコメントを付与してインデントを施したが、実際にダウンロードされる本体プログラムの記述としては、図5のように、コメントや余分な空白を削除した形式であっても良い。 FIG. 5 shows another example of the main body program. In FIG. 4, for the sake of explanation, a comment is given to the main body program and indented. However, as a description of the main program that is actually downloaded, a form in which comments and extra blanks are deleted as shown in FIG. It may be.
図6は、デバッグプログラムの例を示す図である。本実施の形態では、デバッグプログラムについても、本体プログラム同様、プログラムの記述をForth によって行い、デバッグ用の拡張Wordを加えた言語を用いて記述している。本例で用いる「SET_DBG_CMD 」は、本体プログラム上の指定された位置で受信するデバッグコマンドに関するデータをデバッグコマンド登録部116に登録する処理を記述プログラム解釈部105に行わせるためのWordである。また、「SET_DBG_DATA」は、本体プログラム上の指定された位置におけるデータの値を記録する処理を行わせるため、デバッグデータをデバッグデータ登録部118に登録処理するためのWordである。「GET_DBG_CMD 」は、アダプタ100が受信した電文がデバッグコマンドであった場合に、デバッグコマンドを取得する処理を行わせるためのWordである。「DUMP_DATA 」は、デバッグ情報に係るデータの内容を出力する処理を行わせるためのWordである。
FIG. 6 is a diagram illustrating an example of a debug program. In the present embodiment, the debugging program is also described using Forth in the same manner as the main body program, with a description of the program written in Forth and the extended Word for debugging. “SET_DBG_CMD” used in this example is a word for causing the description
次に、記述プログラム解釈部105が行うデバッグ処理内容について図6のデバッグプログラムの記述に基づいて説明する。1行目は、このプログラムで扱う数値が16進数であることを示している。2行目は、「CODE」が整数型の変数であることを示している。
Next, the contents of debug processing performed by the description
3行目から11行目は、デバッグコマンド設定記述部107であることを示すWordである「RGST_DBG_CMD」の処理内容を定義している。4行目の「SET_DBG_CMD 」の1つ右のデータ「1 」は、デバッグコマンド情報を識別するコマンドIDのデータである。2つ右の「64」は、本体プログラム上において、デバッグコマンドの受信を確認(チェック)する位置(ポイント)を表すデータである。本実施の形態では、本体プログラム上の位置を、先頭から何番目のシンボル(名前)であるかという値で示すものとする。ここでは、「64」は図4のLOC401の位置を示すものとする。3つ右の「2 」は、デバッグコマンドの長さを表すものとする。5つ右と4つ右の「FF 1」は、デバッグコマンドのバイト列を示すものとする。4行目の記述は、図4のLOC401の位置における受信チェックによって得られるバイト列「FF 1」のデバッグコマンドのコマンドIDを「1 」と定義したことを示す。
The third to eleventh lines define the processing content of “RGST_DBG_CMD”, which is a Word indicating that it is the debug command setting description unit 107. Data “1” to the right of “SET_DBG_CMD” on the fourth line is data of a command ID for identifying debug command information. “64” on the right is data representing a position (point) in the main body program for confirming (checking) reception of the debug command. In this embodiment, the position on the main body program is indicated by a value indicating what number symbol (name) is from the top. Here, “64” indicates the position of the LOC 401 in FIG. “2” on the right of 3 represents the length of the debug command. “
同様に、5行目の記述は、図4のLOC402の位置における受信チェックによって得られるバイト列「FF 2」のデバッグコマンドのコマンドIDを「2 」と定義したことを示す。6行目の記述は、図4のLOC403の位置における受信チェックによって得られるバイト列「FF 3」のデバッグコマンドのコマンドIDを「3 」と定義したことを示す。
Similarly, the description on the fifth line indicates that the command ID of the debug command of the byte string “
7行目において、Word「SET_DBG_DATA」の1つ右の「1 」は、出力すべきデバッグ情報のデバッグデータを識別するデータIDである。2つ右の「1 」は記録すべきデータのタイプを表す値である。「1 」のときは変数の値を、「2 」のときは配列の値を、「3 」のときはスタックの状態を記録するものとする。3つ右の「78」は、本体プログラム上でデバッグ情報を記録する位置である。本実施の形態では、プログラム上の位置を、先頭から何番目のシンボルであるかという値で示すものとする。ここでは、「78」は図4のLOC402の位置を示すものとする。5つ右と4つ右の「C"EDT"」は「EDT 」というシンボルを表す記述である。7行目の記述は、図4のLOC402の位置における変数「EDT 」の値の記録をデータID「1 」と定義したことを示す。 In the seventh line, “1” to the right of the word “SET_DBG_DATA” is a data ID for identifying debug data of debug information to be output. “1” on the right is a value indicating the type of data to be recorded. When “1”, the value of the variable is recorded, when “2”, the value of the array is recorded, and when “3”, the state of the stack is recorded. “78” to the right of three is a position where debug information is recorded on the main body program. In the present embodiment, the position on the program is indicated by a value indicating what number symbol is from the beginning. Here, “78” indicates the position of the LOC 402 in FIG. "C" EDT "" on the 5th right and 4th right are descriptions representing the symbol "EDT". The description on the seventh line indicates that the record of the value of the variable “EDT” at the position of the LOC 402 in FIG. 4 is defined as the data ID “1”.
8行目は、記録するデータが配列の場合の記述である。「SET_DBG_DATA」の4つ右の「16」は、配列長(10進数では22バイト)を示す。8行目の記述は、図4のLOC401の位置における22バイトの配列「RV_BUF」の値の記録をデータID「2 」と定義したことを示す。9行目と10行目は、記録するデータがスタックの場合の記述である。本体プログラムがスタックを利用した逆ポーランド記法に基づいた言語で記述されている場合、スタックの内容を確認する機能を設けることにより、スタックのオーバーフローなど、入出力される電文内容の確認だけでは検出しにくいバグも検出可能となる。スタックの状態を記録する場合は、シンボルの指定は不要である。9行目の記述は、図4のLOC403の位置におけるスタックの状態の記録をデータID「3 」と定義し、10行目の記述は、図4のLOC404の位置におけるスタックの状態の記録をデータID「4 」と定義したことを示す。 The eighth line is a description when the data to be recorded is an array. “16” to the right of “SET_DBG_DATA” indicates the array length (22 bytes in decimal). The description on the eighth line indicates that the recording of the value of the 22-byte array “RV_BUF” at the position of the LOC 401 in FIG. 4 is defined as the data ID “2”. The ninth and tenth lines are descriptions when the data to be recorded is a stack. When the main program is written in a language based on the reverse Polish notation using the stack, a function to check the contents of the stack is provided to detect only by checking the contents of input / output messages such as stack overflow. Difficult bugs can be detected. When recording the stack status, it is not necessary to specify a symbol. The description in the ninth line defines the record of the stack state at the position of the LOC 403 in FIG. 4 as the data ID “3”, and the description in the tenth line describes the record of the stack state at the position of the LOC 404 in FIG. Indicates that the ID is defined as “4”.
13行目から25行目は、デバッグコマンド実行記述部108であることを示すWordである「EXEC_DBG_CMD」の処理内容を定義している。このデバッグコマンド実行記述部108の記載に基づいて記述プログラム解釈部105が行う処理内容については後述する。
The 13th to 25th lines define the processing content of “EXEC_DBG_CMD”, which is a Word indicating that it is the debug command execution description part 108. The processing contents performed by the description
なお、プログラム保持部111は、必ずしも本体プログラムとデバッグプログラムの両方を保持している必要はない。例えば本体プログラムのデータのみ保持している場合は、そのデータを記憶部101に記憶させてもよい。このときは本体プログラム記述部103の記述内容が変更される。また、同様に、デバッグプログラムのデータのみ保持している場合は、デバッグプログラム記述部104の記述内容が変更される。また、本体プログラム記述記憶部103とデバッグプログラム記述記憶部104を、物理的に別の記憶手段で記憶させるようにしてもよい(この場合、プログラムダウンロード管理部102は、ダウンロードしたプログラムが本体プログラムであるかデバッグプログラムであるかを判断してそれぞれの記憶手段に記憶させる必要がある)。また、本体プログラムとデバッグプログラムとをそれぞれ別のファイル形式のデータとして記憶させているが、別のファイルである必要は無く、同一のファイル中に記述してもよい(この場合、記述プログラム解釈部105は、Wordによって機能実行の処理かデバッグに係る処理かの区別を行う)。
Note that the program holding unit 111 does not necessarily have to hold both the main body program and the debug program. For example, when only the data of the main body program is held, the data may be stored in the storage unit 101. At this time, the description content of the main body program description unit 103 is changed. Similarly, when only the debug program data is held, the description content of the debug
プログラムダウンロード管理部102により、上記のような本体プログラムとデバッグプログラムが、それぞれ本体プログラム記述記憶部103とデバッグプログラム記述記憶部104に格納された後、ステップST303によって、記述プログラム解釈部105が処理を実行する。
After the main program and the debug program as described above are stored in the main program description storage unit 103 and the debug program
図7は、記述プログラム解釈部105の処理動作のフローチャートを表す図である。まず、ステップST701において、記述プログラム解釈部105は、例えば、ファイル名等により、デバッグプログラムが記述された部分のデータを記憶部101から検索し、デバッグプログラムに記述された処理を開始する。記述プログラム解釈部105は、Word「RGST_DBG_CMD」に基づいて、そのWordに係る実行コードに記述されたデータを、デバッグコマンドデータとしてデバッグコマンド登録部116に登録させる。また、Word「SET_DBG_DATA」が記述されていると判断すると、そのWordに係る実行コードに記述されたデータを、デバッグデータとしてデバッグデータ登録部117に登録させる。
FIG. 7 is a diagram illustrating a flowchart of the processing operation of the description
図8は、図6のデバッグコマンド設定記述部107の記述に基づいて登録処理されたデバッグコマンド登録部116の内容を示す図である。ここで、各データについてはテーブル形式で登録されるものとする。コマンドID格納欄801は、各デバッグコマンドを識別するコマンドIDのデータを格納する欄である。デバッグコマンド受信ポイント格納欄802は、デバッグコマンドの受信確認をする本体プログラム上のポイント(位置)のデータを格納する欄である。コマンド長格納欄803は、登録されるデバッグコマンドの長さのデータを格納する欄である。デバッグコマンドバイト列格納欄804は、デバッグコマンドのバイト列のデータを格納する欄である。
FIG. 8 is a diagram showing the contents of the debug command registration unit 116 that has been registered based on the description of the debug command setting description unit 107 of FIG. Here, each data is registered in a table format. The command
図9は、図6のデバッグコマンド設定記述部107の記述に基づいて登録処理されたデバッグデータ登録部117の内容を示す図である。ここでも、各データについてテーブル形式で登録されているものとする。データID格納欄901は、出力すべき各デバッグ情報のデバッグデータを識別するデータIDのデータを格納する欄である。デバッグ情報設定ポイント格納欄902は、デバッグ情報を記録する処理を行う本体プログラム上の位置のデータを格納する欄である。データ種別格納欄903は、デバッグ情報が、変数であるか、シンボルであるか、スタックであるかの種別を表すデータを格納する欄である。デバッグシンボル格納欄904は、デバッグ種別が変数または配列のときに設定され、変数または配列のシンボルを格納する欄である。型格納欄905は、デバッグ種別が変数または配列のときに設定され、変数または配列のデータ型(type)のデータを格納する欄である。配列サイズ格納欄906は、デバッグ種別が配列のときに設定され、配列のサイズのデータを格納する欄である。データ内容格納欄907は、デバッグ情報の内容のデータを格納する欄である。
FIG. 9 is a diagram showing the contents of the debug data registration unit 117 that has been registered based on the description of the debug command setting description unit 107 of FIG. Again, it is assumed that each data is registered in a table format. The data
図10は、ST702を詳細化した、記述プログラム解釈部105が行うデバッグ支援に係る本体プログラムの実行処理時に行う処理動作を示したフローチャートを表す図である。ST701によってデバッグを行う際に参照するデータをデバッグ情報格納部109に登録処理した後、ST702によって、デバッグ支援のために本体プログラムの処理を実行する。まず、デバッグ支援処理段階を実行する。ステップST1001で、本体プログラムの読み込み位置を更新(設定)する。登録処理の直後であれば、読み込み位置は本体プログラム記述記憶部103の先頭に設定し、その他の場合であれば、処理を実行したシンボルの次のシンボルに更新する。
FIG. 10 is a detailed flowchart of ST702 showing processing operations performed during the execution processing of the main body program related to debugging support performed by the description
次に、ステップST1002で、読み込み位置がデバッグ情報設定ポイントであるか否かを判定する。デバッグ情報設定ポイントは、デバッグデータ登録部117のデバッグ情報設定ポイント格納部902に格納されているため、記述プログラム解釈部105は、判定の際にデバッグ情報設定ポイント格納欄902に登録されたデータを参照する。
Next, in step ST1002, it is determined whether or not the reading position is a debug information setting point. Since the debug information setting point is stored in the debug information setting
「YES 」と判定すれば、ステップST1003で処理記憶部105bに記憶されたデータのうち、対応するデバッグ情報を記録する処理を行う。例えば図9のデバッグデータ登録部117に従うと、読み込み位置が「64」(図4のLOC401)であれば配列「RV_BUF」の値を、読み込み位置が「78」(図4のLOC402)であれば変数「EDT 」の値を、読み込み位置が「12C 」(図4のLOC403)であればスタックの状態を、読み込み位置が「134 」(図4のLOC404)であればスタックの状態を、デバッグデータ登録部117のデータ内容格納欄907にデバッグ情報として記録する。
If “YES” is determined, processing for recording corresponding debugging information among the data stored in the
図11はデバッグ情報設定ポイントにおける最新の値が、データ内容格納欄907にデータとして記録されたデバッグデータ登録部117の例を示す図である。ST1003の処理を行った結果、デバッグデータ登録部117のデータ内容格納欄907には、常に各デバッグ情報について、デバッグ情報設定ポイントにおける最新の値がデータとして記録された状態となる。
FIG. 11 is a diagram showing an example of the debug data registration unit 117 in which the latest value at the debug information setting point is recorded as data in the data
次に、ステップST1004で、読み込み位置がデバッグコマンド受信ポイントであるか否かを判定する。デバッグコマンド受信ポイントのデータは、デバッグコマンド登録部116のデバッグコマンド受信ポイント格納欄802に格納されており、判定の際には登録されたデバッグコマンドデータを参照する。
Next, in step ST1004, it is determined whether or not the reading position is a debug command reception point. The debug command reception point data is stored in the debug command reception
「YES 」と判定すれば、ステップST1005で、デバッグコマンド判定部105aが、受信電文に基づく未処理の受信データをチェック処理する。ステップST1006において、デバッグコマンド判定部105aは、デバッグコマンド登録部116に登録されているデバッグコマンド受信ポイント欄802とデバッグコマンドバイト列欄804のデータを参照し、未処理の受信データと比較する。そして、受信データがデバッグコマンド登録部116に登録されているデバッグコマンドと合致したかどうかを条件にして判定を行う。「YES 」と判定すれば、ステップST1007において、デバッグプログラム中のデバッグコマンド実行記述部108に記述された実行コードに基づいて処理を実行する。
If “YES” is determined, in step ST1005, the debug
図6の13行目から25行目は、デバッグコマンド実行記述部108を示すWordである「EXEC_DBG_CMD」の処理内容を定義している。まず、Word「GET_DBG_CODE」によって、デバッグコマンド登録部116を参照して、受信データに基づくコマンドIDのデータを返す処理を実行する。「DUMP_DATA 」は、データID901に対応するデータを出力するWordである。図6のデバッグコマンド実行記述部108の記述に従うと、受信したデバッグコマンドのコマンドIDが「1 」のときは、データIDが「2 」に対応するデータである読み込み位置が図4のLOC401のときの配列「RV_BUF」の値(データ内容格納欄907に記録されたデバッグ情報のデータ。以下同じ)をデータとして出力する。コマンドIDが「2 」のときは、データIDが「1 」に対応するデータである読み込み位置が図4のLOC402のときの変数「EDT 」の値をデータとして出力する。コマンドIDが「3 」のときは、データIDが「3 」に対応するデータである図4の読み込み位置がLOC403のときのスタックの状態と、データIDが4に対応するデータである図4の読み込み位置がLOC404のときのスタックの状態をデータとして出力する。通信処理部106は、出力したデータを含む信号を送信電文として家電機器シミュレータ112(家電機器側)に送信する。
The 13th to 25th lines in FIG. 6 define the processing contents of “EXEC_DBG_CMD” which is a Word indicating the debug command execution description part 108. First, referring to the debug command registration unit 116 by using the word “GET_DBG_CODE”, a process of returning data of a command ID based on the received data is executed. “DUMP_DATA” is a Word that outputs data corresponding to the
図12は電文表示部118に表示された電文の内容を示す図である。アダプタ100へ送信する電文内容と、アダプタ100から受信した電文内容を表示する。図12は本実施の形態において、デバッグデータ登録部117の状態が図11である状態で、電文「FF 03 」を送信したときにアダプタ100から送信された電文を受信し、電文表示部118に表示した状態の例を示したものである。ここで、読み込み位置が「12C 」(図4のLOC403)及び「134 」(図4のLOC404)のスタックの状態「00」「01」が電文として送信されるが、スタックの要素のサイズは2バイトのリトルエンディアンで、スタックデータの始まりには、「FFFF」が付与されるものとする。また、Word「DUNP_DATA 」によって、アダプタ100から出力する電文は、データの内容そのままではなく、データの区切りや、データの種別となる情報を付与した形式であってもよい。
FIG. 12 is a diagram showing the contents of the message displayed on the message display unit 118. The message content to be transmitted to the
一方、ステップST1006において「NO」と判定すると、受信データを未処理にしたままステップST1008に進む。これにより、デバッグ支援処理段階は終了する。 On the other hand, if “NO” is determined in step ST1006, the process proceeds to step ST1008 while the received data remains unprocessed. As a result, the debug support processing stage is completed.
次に、本体プログラム処理段階を実行する。ステップST1008で、本体プログラムの読み込み位置におけるシンボル(文字列)を読み込む。次にステップST1009で、シンボルが受信処理用のWordであるか否かを判定する。本実施の形態では、家電機器側の受信インタフェースからデバッグコマンドを受信する可能性があるので、ST1009の判定が「YES」となるのは、読み込んだ文字列が「FROM_EQUIPMENT」の場合である。 Next, the main body program processing stage is executed. In step ST1008, a symbol (character string) at the reading position of the main body program is read. Next, in step ST1009, it is determined whether the symbol is a word for reception processing. In this embodiment, there is a possibility that a debug command may be received from the reception interface on the home appliance side, so the determination in ST1009 is “YES” when the read character string is “FROM_EQUIPMENT”.
ステップST1009において「YES 」と判定すると、ステップST1010で、受信データがデバッグコマンド登録部116に登録されているデバッグコマンドであるか否かをデバッグコマンド判定部105aがチェックする。デバッグコマンドの場合はステップST1011の判定が「YES 」となる。ここは本体プログラム処理段階であるため、デバッグコマンドに基づいて処理を行わない。そこで、以後の読み込み位置におけるデバッグ支援処理段階で処理させるため、ステップ1014で受信データなしとみなし、受信データを未処理のままにする。
If “YES” is determined in step ST1009, the debug
一方、ステップST1011において「NO」と判定すれば、受信データは本体プログラムに基づく処理を行うために用いられるデータであるため、ステップST1013で、本体プログラムに従って受信データの処理等を行う。 On the other hand, if “NO” is determined in step ST 1011, the received data is data used for processing based on the main body program. Therefore, in step ST 1013, the received data is processed according to the main body program.
また、ステップST1008で読み込んだ文字列が「FROM_EQUIPMENT」以外の場合は、ステップST1009において「NO」と判定することになる。ステップST1012で、シンボルに対する通常の処理を行う。次に、ステップST1015で本体プログラムが終了したか否かを判定し、終了していない場合は、ステップ1001に戻って、本体プログラムの読み込み位置を更新する。以上のようにして、デバッグ支援処理を行い、例えば、電文表示部118に表示された電文の内容に基づいて本体プログラムのバグを発見することによりデバッグが行われる。 If the character string read in step ST1008 is other than “FROM_EQUIPMENT”, it is determined as “NO” in step ST1009. In step ST1012, normal processing for symbols is performed. Next, it is determined in step ST1015 whether or not the main body program has ended. If not, the flow returns to step 1001 to update the reading position of the main body program. As described above, debugging support processing is performed, and for example, debugging is performed by finding a bug in the main body program based on the contents of the message displayed on the message display unit 118.
このようなデバッグの段階を経て、バグのない本体プログラムに基づくアダプタ100の機能を実用段階で用いる場合、例えば、デバッグ情報格納部109に格納するデータを空にしたり、デバッグプログラム自体を記憶部101から消去したりすれば、記述プログラム解釈部105は、デバッグ支援処理を実行することなく、本体プログラムだけに基づいた処理を実行することができる。
When the functions of the
以上のように、本実施の形態の装置(アダプタ100)では、プログラムダウンロード管理部102により、本体プログラムだけでなく、デバッグプログラムについても外部装置110からダウンロード可能にし、従来のようなファームウェア形式ではなく、データ変更(書き換え)可能な記憶部101に記憶するようにしたので、本体プログラムのプログラム記述形式等に対応したデバッグプログラムを容易に記憶させ、記述プログラム解釈部105に実行させることが可能になり、エミュレータ等の高価な装置を用いなくても、例えば、高級言語により記述された本体プログラムに対応したデバッグプログラムに基づいてデバッグ支援処理を行うことができる。また、デバッグ情報格納部109にデバッグ支援処理に関するデータを格納することで、デバッグコマンドの判断、デバッグ情報を取得する本体プログラムの実行位置をデバッグプログラムに基づいて容易に設定することができる。さらに、プログラムダウンロード管理部102により、例えば、家電機器、サーバ等に接続することにより、機能実行、デバッグ支援処理等に必要なプログラムをダウンロードすることができる。
As described above, in the apparatus (adapter 100) of the present embodiment, the program
また、デバッグプログラムのデータ内容の変更が容易に行えるので、デバッグコマンド設定記述部107の記述に基づいて、デバッグ支援処理を行うためのデバッグコマンドの設定(定義)変更も容易に行うことができる。そのため、例えば通信処理部106において受信インタフェースが共有され、本体プログラムの処理に係るコマンド等の受信データとデバッグコマンドとの内容に重なりが認められない場合でも、重ならないように振り分けできる設定を容易に行うことができる。このため、特にデバッグ支援処理の対象装置が通信用のアダプタ100のような場合、搭載する本体プログラムを実機で動作検証可能となる。
Further, since the data contents of the debug program can be easily changed, the setting (definition) of the debug command for performing the debug support process can be easily performed based on the description of the debug command setting description unit 107. Therefore, for example, even when the
さらに、処理記憶部105bに記憶された変数や配列の値をデバッグ情報として出力するだけでなく、本体プログラムを記述する言語がスタックを利用した逆ポーランド記法に基づいた言語の場合には、スタックの状態もデバッグ情報として出力できるようにしたので、例えば、スタックのオーバーフローなど、入出力の信号を確認しただけでは検出しにくいバグも検出可能となる。
In addition to outputting variables and array values stored in the
実施の形態2.
上述の実施の形態では、外部装置110から本体プログラム、デバッグプログラムをダウンロードし、記憶部101に記憶させるようにしたが、これに限定するものではない。例えば、装置から着脱可能なメモリカード等の記憶手段を記憶部101として、別の装置で各プログラムを記憶させることもできる。
In the above-described embodiment, the main body program and the debug program are downloaded from the external device 110 and stored in the storage unit 101. However, the present invention is not limited to this. For example, each program can be stored in another device using a storage unit 101 such as a memory card that can be detached from the device as the storage unit 101.
以上のように、この発明に係るアダプタ(変換装置)は、小型軽量化、省スペース化、低コストを図るのに、さらに製品の品質向上するのに有用である。 As described above, the adapter (conversion device) according to the present invention is useful for reducing the size and weight, saving the space, and reducing the cost, and further improving the quality of the product.
100 アダプタ、101 記憶部、102 プログラムダウンロード管理部、103 本体プログラム記述部、104 デバッグプログラム記述部、105 記述プログラム解釈部、105a デバッグコマンド判定部、105b 処理記憶部、105c 辞書記憶部、106 通信処理部、107 デバッグコマンド設定記述部、108 デバッグコマンド実行記述部、109 デバッグ情報格納部、110 外部装置、111 プログラム保持部、112 家電機器シミュレータ、113 電文作成部、114 電文送受信部、115 コントローラ、116 デバッグコマンド登録部、117 デバッグデータ登録部、118 電文表示部、801 コマンドID格納欄、802 デバッグコマンド受信ポイント格納欄、803 コマンド長格納欄、804 デバッグコマンドバイト列格納欄、901 データID格納欄、902 デバッグ情報設定ポイント格納欄、903 データ種別格納欄、904 デバッグシンボル格納欄、905 型格納欄、906 配列サイズ格納欄、907 データ内容格納欄。
DESCRIPTION OF
Claims (8)
デバッグ対象となる本体プログラム及び少なくとも前記デバッグ支援処理に係るデバッグコマンドに関するデータを含み、前記本体プログラムの誤りを検出するデバッグ支援処理のためのデバッグプログラムを記憶する、データ変更可能な記憶部に記憶された前記デバッグプログラムに基づき、前記本体プログラムに基づく処理を実行中に前記通信処理部が受信した信号に係るデータが前記デバッグコマンドであるかどうかを判定するコマンド判定部を有し、前記コマンド判定部の判定に基づいて前記本体プログラム又は前記デバッグプログラムに基づく処理を行う記述プログラム解釈部と
を備えることを特徴とするプログラムデバッグ支援装置。 A communication processing unit that executes transmission / reception processing of a signal including data;
Stored in a data-changeable storage unit, which includes a main program to be debugged and data related to at least a debug command related to the debug support process, and stores a debug program for a debug support process for detecting an error in the main program. A command determination unit for determining whether data related to a signal received by the communication processing unit during execution of processing based on the main body program is the debug command based on the debug program; And a description program interpretation unit that performs processing based on the main program or the debug program based on the determination.
データを含む信号の送受信処理を実行する通信処理部と、
前記記憶部に記憶された前記デバッグプログラムに基づき、前記本体プログラムに基づく処理を実行中に前記通信処理部が受信した信号に係るデータが前記デバッグコマンドであるかどうかを判定するコマンド判定部を有し、前記コマンド判定部の判定に基づいて前記本体プログラム又は前記デバッグプログラムに基づく処理を行う記述プログラム解釈部と
を備えることを特徴とするプログラムデバッグ支援装置。 A data-changeable storage unit that stores data related to a debugging program for debugging support processing for detecting an error in the body program, including data related to a debugging program related to the debugging program and at least a debugging command related to the debugging support processing; ,
A communication processing unit that executes transmission / reception processing of a signal including data;
Based on the debug program stored in the storage unit, there is a command determination unit that determines whether the data related to the signal received by the communication processing unit during execution of the process based on the main body program is the debug command. And a description program interpretation unit that performs processing based on the main body program or the debug program based on the determination of the command determination unit.
前記本体プログラムに基づく処理を実行中に、前記デバッグ情報格納部のデータに基づいて前記所定実行位置における前記デバッグ情報のデータを検出して記録し、
前記コマンド判定部が、前記受信した信号に係るデータを前記デバッグコマンドであると判定すると、そのデバッグコマンドに対応する前記デバッグ情報のデータを含む信号を前記通信処理部に送信させることを特徴とする請求項1〜3のいずれかに記載のプログラムデバッグ支援装置。 The description program interpretation unit further includes a debug information storage unit for registering data relating to the debug command and data for detecting and recording debug information data at a predetermined execution position of the main body program,
During execution of the process based on the main body program, the data of the debug information at the predetermined execution position is detected and recorded based on the data of the debug information storage unit,
When the command determination unit determines that the data related to the received signal is the debug command, the command determination unit causes the communication processing unit to transmit a signal including the debug information data corresponding to the debug command. The program debugging support device according to claim 1.
前記記述プログラム解釈部は、前記本体プログラムの所定位置における記述の処理を実行する際に、前記スタックに基づくデータをデバッグ情報のデータとして検出して記録し、前記デバッグコマンドに基づいて、前記検出したデバッグ情報のデータを含む信号を通信処理部に送信させることを特徴とする請求項1〜4のいずれかに記載のプログラムデバッグ支援装置。 The main body program is composed of data written in a language based on reverse Polish notation using a data structure by a stack,
The description program interpretation unit detects and records data based on the stack as debug information data when executing a description process at a predetermined position of the main body program, and detects the detection based on the debug command. The program debugging support apparatus according to claim 1, wherein a signal including debug information data is transmitted to the communication processing unit.
前記判定に基づいて前記通信処理部による信号及び記憶部に記憶されたプログラムに基づく処理を実行する工程と
を有することを特徴とするプログラムデバッグ支援処理プログラム。
The main body program based on a debug program for debugging support processing that is stored in a data changeable storage unit and includes at least data related to a debug command related to the debugging support processing, and detects an error in the main program to be debugged Determining whether the data related to the signal received by the communication processing unit is the debug command while executing the processing based on
And a step of executing a process based on a signal stored in the storage unit and a signal stored in the storage unit based on the determination.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006158482A JP4716929B2 (en) | 2006-06-07 | 2006-06-07 | Program debug support processing apparatus, communication adapter, and program debug support processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006158482A JP4716929B2 (en) | 2006-06-07 | 2006-06-07 | Program debug support processing apparatus, communication adapter, and program debug support processing program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2007328501A true JP2007328501A (en) | 2007-12-20 |
JP4716929B2 JP4716929B2 (en) | 2011-07-06 |
Family
ID=38928938
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006158482A Active JP4716929B2 (en) | 2006-06-07 | 2006-06-07 | Program debug support processing apparatus, communication adapter, and program debug support processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4716929B2 (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS62267841A (en) * | 1986-05-16 | 1987-11-20 | Omron Tateisi Electronics Co | Program debug device |
JPS63189948A (en) * | 1987-02-03 | 1988-08-05 | Fujitsu Ltd | Batch type debugging system in interactive debugger |
JPH08221297A (en) * | 1995-02-16 | 1996-08-30 | Chiyoufu Seisakusho:Kk | Program debugging device |
JPH09319727A (en) * | 1996-05-31 | 1997-12-12 | Hitachi Ltd | Data processor and data processing system |
JPH11167501A (en) * | 1997-12-04 | 1999-06-22 | Oki Tsushin System Kk | Program debugging system and program debugging method |
JP2003323317A (en) * | 2002-05-08 | 2003-11-14 | Nec Corp | System, method, and program for system debugging in network monitoring system |
-
2006
- 2006-06-07 JP JP2006158482A patent/JP4716929B2/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS62267841A (en) * | 1986-05-16 | 1987-11-20 | Omron Tateisi Electronics Co | Program debug device |
JPS63189948A (en) * | 1987-02-03 | 1988-08-05 | Fujitsu Ltd | Batch type debugging system in interactive debugger |
JPH08221297A (en) * | 1995-02-16 | 1996-08-30 | Chiyoufu Seisakusho:Kk | Program debugging device |
JPH09319727A (en) * | 1996-05-31 | 1997-12-12 | Hitachi Ltd | Data processor and data processing system |
JPH11167501A (en) * | 1997-12-04 | 1999-06-22 | Oki Tsushin System Kk | Program debugging system and program debugging method |
JP2003323317A (en) * | 2002-05-08 | 2003-11-14 | Nec Corp | System, method, and program for system debugging in network monitoring system |
Also Published As
Publication number | Publication date |
---|---|
JP4716929B2 (en) | 2011-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8898638B1 (en) | Method and system for remote software debugging | |
JP5423830B2 (en) | Update data transmission method, firmware update system, and host device | |
CN111414325B (en) | Method for converting Avalon bus into Axi4 bus | |
US7895376B2 (en) | Hardware configuration information system, method, and computer program product | |
EP1635255A2 (en) | Information processing system | |
CN100489777C (en) | Intelligent platform management interface firmware architecture and method of building the same | |
CN109426511B (en) | Soft core updating method and system | |
US20120011490A1 (en) | Development system | |
JP2008293076A (en) | Error decision program, error decision method, and electronic equipment | |
US8291270B2 (en) | Request processing device, request processing system, and access testing method | |
JP4716929B2 (en) | Program debug support processing apparatus, communication adapter, and program debug support processing program | |
US20060080636A1 (en) | Method of building intelligent platform management interface firmware architecture | |
JP2010086318A (en) | Debugging system | |
WO2020129324A1 (en) | Module, information processing device equipped with same, and program data updating method for updating program data of module | |
CN101562007A (en) | Display control device capable of automatically updating firmware and update method thereof | |
US9779012B1 (en) | Dynamic and global in-system debugger | |
JP2010218083A (en) | Method and support program for developing communication device, and communication device | |
JP2010020416A (en) | Data transfer method and data transfer unit | |
JP2005115440A (en) | Computer program for making computer perform uninstallation | |
JP2007219843A (en) | Node management system and method, and program | |
JP2005010912A (en) | Program and computer | |
US11714608B2 (en) | Device and method for handling programming language function | |
CN116069349A (en) | Board parameter modification method, device and system | |
CN114416444A (en) | Method, system, equipment and storage medium for debugging PCIe board firmware | |
JP2008071107A (en) | Flash rom update method of dsp card, and flash rom update device of dsp card |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080718 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100423 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100518 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100706 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110322 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110329 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140408 Year of fee payment: 3 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |