JPH05181700A - How to create a multi-process debugger - Google Patents
How to create a multi-process debuggerInfo
- Publication number
- JPH05181700A JPH05181700A JP3347206A JP34720691A JPH05181700A JP H05181700 A JPH05181700 A JP H05181700A JP 3347206 A JP3347206 A JP 3347206A JP 34720691 A JP34720691 A JP 34720691A JP H05181700 A JPH05181700 A JP H05181700A
- Authority
- JP
- Japan
- Prior art keywords
- debugger
- program
- inspected
- duplicated
- inspected program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
(57)【要約】 (修正有)
【目的】 マルチプロセスプログラムを総合的にデバッ
グ可能なマルチプロセスデバッガを簡易に作成する方法
を提供する。
【構成】 第1の被検査プログラムAで発生した複製命
令に応じて第1の被検査プログラム用の第1のデバッガ
DAの複製を実行した後、複製したデバッガDA′を第
2のデバッガDBに変化させ、一方、第1の被検査プロ
グラムAの複製を実行し、複製した被検査プログラム
A′を第2のデバッガDBの制御下で第2の被検査プロ
グラムBに変化させ、さらに第1及び第2のデバッガ間
に連絡経路Cを作成する。
(57) [Summary] (Modified) [Purpose] To provide a method for easily creating a multi-process debugger capable of comprehensively debugging a multi-process program. According to a duplication instruction generated in a first inspected program A, a first debugger D A for the first inspected program is duplicated, and then the duplicated debugger D A ′ is replaced with a second debugger. D B , while executing the duplication of the first inspected program A and changing the duplicated inspected program A ′ to the second inspected program B under the control of the second debugger D B , Further, a communication path C is created between the first and second debuggers.
Description
【0001】[0001]
【産業上の利用分野】本発明は、複数の並行して処理さ
れる処理系列のデバッグを総合的に行うマルチプロセス
デバッガを作成する方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for creating a multi-process debugger that comprehensively debugs a plurality of processing sequences processed in parallel.
【0002】[0002]
【従来の技術】従来のデバッガは、デバッグの対象とな
る被検査プログラムによって実現される処理系列が単一
である場合にのみデバッグ可能であり、複数の並行して
処理される処理系列を総合的にデバッグすることはでき
なかった。即ち、各デバッガは各処理系列をそれぞれ別
個に独立して検査するのみであり、複数処理系列が並行
的に動く場合、これを総合的に追跡することは不可能で
あった。例えば、Aというプログラムがaまで進んだ際
にBというプログラムがbまで進んだ時の状態を見ると
いった要求を満たすことはできなかった。2. Description of the Related Art A conventional debugger can debug only when there is a single processing sequence realized by a program to be inspected as a debug target, and a plurality of processing sequences to be processed in parallel can be comprehensively processed. Couldn't debug to. That is, each debugger only individually and independently inspects each processing sequence, and when a plurality of processing sequences move in parallel, it is impossible to comprehensively trace them. For example, it has not been possible to satisfy the requirement that the program A should see the state when the program B has progressed to b when the program A has progressed to a.
【0003】このため、RDB(リレーショナルデータ
ベース)を多人数で利用する際の障害調査やプログラム
開発を行う場合、次のような検査方法がとられていた。
即ち、プログラム側の必要箇所にテストメッセージをそ
れぞれ挿入しておくことにより個々のプログラムの書き
換えをまず行い、このように書き換えたプログラムの実
行によって表示されるテストメッセージからオペレータ
が推測でその動きをつかむことが行われていた。For this reason, the following inspection method has been adopted when conducting a failure investigation or program development when a large number of people use the RDB (relational database).
That is, each program is first rewritten by inserting a test message into a required part on the program side, and the operator guesses the movement from the test message displayed by executing the rewritten program in this way. Was being done.
【0004】[0004]
【発明が解決しようとする課題】しかしながら上述のご
とき従来技術は、非常に多大な労力及び時間を要しこれ
を各マルチプロセスプログラムについて行うことは効率
的に著しく不利である。従って本発明は、マルチプロセ
スプログラムを総合的にデバッグ可能なマルチプロセス
デバッガを簡易に作成する方法を提供するものである。However, the above-mentioned conventional techniques require a great deal of labor and time, and it is very disadvantageous to perform this for each multi-process program. Therefore, the present invention provides a method for easily creating a multi-process debugger capable of comprehensively debugging a multi-process program.
【0005】[0005]
【課題を解決するための手段】本発明によれば、第1の
被検査プログラムで発生した複製命令に応じて第1の被
検査プログラム用の第1のデバッガの複製を実行した
後、複製したデバッガを第2のデバッガに変化させ、一
方、第1の被検査プログラムの複製を実行し、複製した
被検査プログラムを第2のデバッガの制御下で第2の被
検査プログラムに変化させ、さらに第1及び第2のデバ
ッガ間に連絡経路を作成するようにしたマルチプロセス
デバッガの作成方法が提供される。According to the present invention, the duplication of the first debugger for the first inspected program is executed after the duplication of the first debugger for the first inspected program in response to the duplication instruction generated in the first inspected program. The debugger is changed to the second debugger, while the copy of the first inspected program is executed, the copied inspected program is changed to the second inspected program under the control of the second debugger, and A method of creating a multi-process debugger is provided which creates a communication path between the first and second debuggers.
【0006】[0006]
【作用】被検査プログラムAが途中で複製されてプログ
ラムBとなり、ある時点からプログラムAとBとが並行
して処理を行うとすると、図1に示すように、プログラ
ムAで複製命令が発生するとそれに応じてこのプログラ
ムA用のデバッガDA の複製をまず実行してデバッガD
A ′を作成する。その後、複製デバッガDA ′をデバッ
ガDB に変化させる。一方、プログラムAの複製を実行
して得たプログラムA′をデバッガDB の制御下でプロ
グラムBに変化させ、さらにデバッガDA及びDB 間に
連絡経路Cを作成する。When the program A to be inspected is duplicated in the middle to become the program B, and the programs A and B perform processing in parallel from a certain point in time, as shown in FIG. Accordingly, a copy of the debugger DA for this program A is executed first and the debugger D
Create A ′. After that, the replica debugger DA 'is changed to the debugger DB. On the other hand, the program A'obtained by executing the duplication of the program A is changed to the program B under the control of the debugger DB, and the communication path C is created between the debuggers DA and DB.
【0007】[0007]
【実施例】図2は本発明の一実施例としてマルチプロセ
スデバッガを作成するシステムの構成を概略的に示すブ
ロック図である。FIG. 2 is a block diagram schematically showing the structure of a system for producing a multi-process debugger as an embodiment of the present invention.
【0008】同図において、10はCPUから主として
構成される制御装置を示しており、この制御装置10に
はキーボード等による入力装置11、表示装置12、後
述する共有メモリが存在する内部記憶装置13、及び外
部記憶装置14が接続されている。In FIG. 1, reference numeral 10 denotes a control device mainly composed of a CPU. The control device 10 includes an input device 11 such as a keyboard, a display device 12, and an internal storage device 13 in which a shared memory described later exists. , And the external storage device 14 are connected.
【0009】図3は図2のシステムにおけるマルチプロ
セスデバッガ作成プログラムのフローチャートであり、
以下この図を用いて本発明を詳細に説明する。FIG. 3 is a flow chart of a multi-process debugger creation program in the system of FIG.
The present invention will be described in detail below with reference to this drawing.
【0010】UNIXのOS(オペレーションシステ
ム)には、「fork」及び「exec」という2つの
処理があり、通常これら2つの処理を用いてマルチプロ
セスの処理が実現されている。ここで、fork命令
は、プログラムAがメモリの状態をも含めて全く同一に
複製する命令であり、システムとしては2つのプロセス
として別個に管理される。exec命令は、プログラム
Aを別のプログラムBに変える命令であり、システムと
しては全く同一のプロセスとして管理される。これら2
つの処理は、ライブラリィという形でプログラムにリン
クされてマルチプロセスプログラムの形成等が行われ
る。The UNIX OS (operation system) has two processes, "fork" and "exec", and usually, these two processes are used to realize multi-process. Here, the fork instruction is an instruction that the program A duplicates exactly the same including the state of the memory, and is separately managed as two processes in the system. The exec instruction is an instruction for changing the program A to another program B, and is managed as the same process as the system. These two
The two processes are linked to a program in the form of a library to form a multi-process program.
【0011】本発明においては、このような通常のライ
ブラリィではなく、以下に説明するような動作を行うデ
バッガ専用ライブラリィが被検査プログラムにリンクさ
れてマルチプロセスデバッガ作成が行われる。In the present invention, a multi-process debugger is created by linking a debugger-dedicated library, which operates as described below, with the program to be inspected, instead of such an ordinary library.
【0012】被検査プログラムp1のデバッガdp1
は、まず、共有メモリを確保してその先頭に自己のプロ
セス番号(dp1)と被検査プログラムp1のプロセス
番号(p1)とを書き込む(図4参照)。この共有メモ
リは、全てのデバッガから見ることができるように構成
されている。Debugger dp1 of the program to be inspected p1
First, the shared memory is secured and the self process number (dp1) and the process number (p1) of the program to be inspected p1 are written at the head of the shared memory (see FIG. 4). This shared memory is configured to be visible to all debuggers.
【0013】被検査プログラムp1でfork命令が発
せられると、この被検査プログラムにリンクされている
デバッガ専用ライブラリィは、まずステップS1におい
て、デバッガdp1に対して信号(UNIXではsig
nal)を送り、疑似fork状態となったことをこの
デバッガdp1へ通告する。この信号によりデバッガd
p1はマルチプロセスの状態遷移を知ることが可能とな
る。When a fork instruction is issued in the program to be inspected p1, the debugger-dedicated library linked to the program to be inspected first sends a signal (in UNIX, sig in UNIX) to the debugger dp1 in step S1.
nal) to notify the debugger dp1 that the pseudo-fork state has been entered. This signal causes the debugger d
It becomes possible for p1 to know the state transition of multi-process.
【0014】次いでステップS2において、fork命
令を実際に実行する。これにより、親プロセスであるデ
バッガdp1及びプログラムp1を複製してなる子プロ
セスができ、さらにこの子プロセスがforkを実行し
て孫プロセスが発生する。Next, in step S2, the fork instruction is actually executed. As a result, a child process is formed by duplicating the debugger dp1 and the program p1 which are parent processes, and this child process executes fork to generate a grandchild process.
【0015】次のステップS3では、子プロセスが共有
メモリをアタッチし(アクセス可能とし)、子プロセス
のプロセス番号dp2をデバッガプロセス番号、孫プロ
セスのプロセス番号p2をその被検査プログラムプロセ
ス番号としてこの共有メモリに書き込む。In the next step S3, the child process attaches (makes accessible) the shared memory, the process number dp2 of the child process is the debugger process number, and the process number p2 of the grandchild process is its inspected program process number. Write to memory.
【0016】次いでステップS4において、exec命
令を実行して子プロセスをデバッガdp2に変化させ
る。Then, in step S4, the exec instruction is executed to change the child process to the debugger dp2.
【0017】デバッガdp2は共有メモリに再度アタッ
チしデバッガdp1とブレークポイント等の必要情報を
交換する(ステップS5)。なお、デバッガdp1はs
ignalを受け取った時点から割り込み処理となり、
情報交換の準備をしてデバッガdp2との交信待ちとな
っている。デバッガdp2との交信が終わると、デバッ
ガdp1は、デバッガdp2及びその被検査プログラム
p2(この時点ではプログラムp1の複製p1′)の準
備完了を待って通常の処理に復帰する。The debugger dp2 attaches to the shared memory again and exchanges necessary information such as a breakpoint with the debugger dp1 (step S5). Note that the debugger dp1 is s
From the point of receiving the signal, it becomes an interrupt process,
It is ready for information exchange and is waiting for communication with the debugger dp2. When the communication with the debugger dp2 is completed, the debugger dp1 waits for the preparation of the debugger dp2 and its inspected program p2 (the copy p1 'of the program p1 at this point) and returns to the normal processing.
【0018】次のステップS6において、プログラムp
1′はptrace(0)を実行してデバッガdp2に
よるトレースを可能にする。In the next step S6, the program p
1'executes ptrace (0) to enable tracing by the debugger dp2.
【0019】最終的にデバッガdp2及びプログラムp
1′の準備が整ったところで、共有メモリの通信用連絡
経路テーブル(図4参照)を用いて準備が整った旨をデ
バッガdp1及びプログラムp1に伝える(ステップS
7)。これによりデバッガdp1はリターン値としてプ
ログラムp1′のプロセス番号p2を返し、プログラム
p1′側はリターン値として0を返す。この連絡経路
は、OSの有するIPC(インタープロセスコミュニケ
ーション)を用いることによって容易に実現できる。Finally, the debugger dp2 and the program p
When 1'is ready, the debugger dp1 and the program p1 are notified of the completion by using the communication communication route table of the shared memory (see FIG. 4) (step S
7). As a result, the debugger dp1 returns the process number p2 of the program p1 'as a return value, and the program p1' side returns 0 as a return value. This communication path can be easily realized by using IPC (Inter Process Communication) of the OS.
【0020】以上のように、デバッガdp1はプログラ
ムp1′が自分の子プロセスであるとして認識している
が、実際にはプログラムp1′はデバッガdp2の支配
下にあることとなり、並行処理が行われている場合にも
両プログラムp1及びp2を共にデバッグ可能である。As described above, the debugger dp1 recognizes that the program p1 'is its own child process, but in reality the program p1' is under the control of the debugger dp2, and parallel processing is performed. In this case, both programs p1 and p2 can be debugged together.
【0021】次いでステップS8において、デバッガd
p2へ信号を送ることによってこのデバッガdp2がe
xec命令を実行し、プログラムp1′を被検査プログ
ラムp2に変化させる。Then, in step S8, the debugger d
By sending a signal to p2, this debugger dp2
The xec instruction is executed to change the program p1 'into the program to be inspected p2.
【0022】これにより、デバッガdp1がプログラム
p1を検査し、デバッガdp2がプログラムp2を検査
し、なおかつ両デバッガがお互いに連絡をとりながらデ
バッグを行うので、並行処理が行われるマルチプロセス
においてもデバッグを行うことができる。As a result, the debugger dp1 inspects the program p1, the debugger dp2 inspects the program p2, and both debuggers perform debugging while communicating with each other. It can be carried out.
【0023】上述の共有メモリはマルチプロセスデバッ
グにおける入出力の切り換えの通知にも用いることが可
能である。例えば、入力、出力を全て最初のデバッガが
管理するものとし、他のプロセスに切り換える場合は特
別のキー操作により最初のデバッガに通告する。このデ
バッガは、自分以外への応答を求められた場合、共有メ
モリの通信用連絡経路テーブルへ対応するデバッガのプ
ロセス番号と共にオペレータのキー入力を書き込む。他
のデバッガは入力待ちの状態で常にこの共有メモリを見
ており、自分への指示であれば実行し、その結果をまた
この共有メモリに書き込む。同期(待ち合わせ)につい
ては、セマフォア等の機能を用いてもよい。The shared memory described above can also be used for notification of input / output switching in multi-process debugging. For example, it is assumed that the input and output are all managed by the first debugger, and when switching to another process, the first debugger is notified by a special key operation. This debugger writes the key input of the operator together with the process number of the corresponding debugger in the communication communication route table of the shared memory when the response to other than itself is requested. Other debuggers are always looking at this shared memory while waiting for input, execute any instruction to themselves, and write the result to this shared memory again. For synchronization (waiting), a function such as a semaphore may be used.
【0024】[0024]
【発明の効果】以上詳細に説明したように本発明によれ
ば、第1の被検査プログラムで発生した複製命令に応じ
て第1の被検査プログラム用の第1のデバッガの複製を
実行した後、複製したデバッガを第2のデバッガに変化
させ、一方、第1の被検査プログラムの複製を実行し、
複製した被検査プログラムを第2のデバッガの制御下で
第2の被検査プログラムに変化させ、さらに第1及び第
2のデバッガ間に連絡経路を作成するようにしているた
め、マルチプロセスプログラムをいじることなく短期間
にかつ容易に総合的にデバッグ可能なマルチプロセスデ
バッガを簡易に作成することができる。As described above in detail, according to the present invention, after the copy of the first debugger for the first inspected program is executed according to the copy instruction generated in the first inspected program. , Change the duplicated debugger to a second debugger, while executing the duplicate of the first inspected program,
The duplicated program to be inspected is changed to the second program to be inspected under the control of the second debugger, and a communication path is created between the first and second debuggers. It is possible to easily create a multi-process debugger that can be comprehensively debugged easily in a short period of time.
【図1】本発明のマルチプロセスデバッガ作成機能を概
略的に示す説明図である。FIG. 1 is an explanatory diagram schematically showing a multi-process debugger creation function of the present invention.
【図2】本発明の一実施例としてマルチプロセスデバッ
ガを作成するシステムの構成を概略的に示すブロック図
である。FIG. 2 is a block diagram schematically showing a configuration of a system for creating a multi-process debugger as an embodiment of the present invention.
【図3】図2のシステムにおけるマルチプロセスデバッ
ガ作成プログラムのフローチャートである。3 is a flowchart of a multi-process debugger creation program in the system of FIG.
【図4】共有メモリの通信用連絡経路テーブルを示す図
である。FIG. 4 is a diagram showing a communication contact route table in a shared memory.
10 制御装置 11 入力装置 12 表示装置 13 内部記憶装置 14 外部記憶装置 10 Control Device 11 Input Device 12 Display Device 13 Internal Storage Device 14 External Storage Device
Claims (1)
命令に応じて該第1の被検査プログラム用の第1のデバ
ッガの複製を実行した後、該複製したデバッガを第2の
デバッガに変化させ、一方、該第1の被検査プログラム
の複製を実行し、複製した被検査プログラムを該第2の
デバッガの制御下で第2の被検査プログラムに変化さ
せ、さらに前記第1及び第2のデバッガ間に連絡経路を
作成することを特徴とするマルチプロセスデバッガの作
成方法。1. A copy of a first debugger for the first inspected program is executed in response to a copy instruction generated in the first inspected program, and then the copied debugger is changed to a second debugger. On the other hand, the first inspected program is duplicated, the duplicated inspected program is changed to the second inspected program under the control of the second debugger, and the first and second A method for creating a multi-process debugger characterized by creating a communication path between debuggers.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3347206A JPH05181700A (en) | 1991-12-27 | 1991-12-27 | How to create a multi-process debugger |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3347206A JPH05181700A (en) | 1991-12-27 | 1991-12-27 | How to create a multi-process debugger |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH05181700A true JPH05181700A (en) | 1993-07-23 |
Family
ID=18388643
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP3347206A Pending JPH05181700A (en) | 1991-12-27 | 1991-12-27 | How to create a multi-process debugger |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH05181700A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH07200347A (en) * | 1993-12-28 | 1995-08-04 | Nec Corp | Process compatible debug system |
-
1991
- 1991-12-27 JP JP3347206A patent/JPH05181700A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH07200347A (en) * | 1993-12-28 | 1995-08-04 | Nec Corp | Process compatible debug system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5926638A (en) | Program debugging system for debugging a program having graphical user interface | |
| US7246052B2 (en) | Bus master and bus slave simulation using function manager and thread manager | |
| US3659272A (en) | Digital computer with a program-trace facility | |
| JPS6116100B2 (en) | ||
| US6389383B1 (en) | System and method for interfacing software and hardware | |
| GB2425859A (en) | Modelling of programmable devices | |
| JPH05181700A (en) | How to create a multi-process debugger | |
| JP3206096B2 (en) | Input data processing device | |
| JPH0721058A (en) | Program test system | |
| JP3085730B2 (en) | Parallel simulation method for complex CPU system | |
| CN120104509B (en) | CAD-oriented interactive and parametric modeling automatic testing method and system | |
| JPH09237191A (en) | Programming support device, programming support method, and medium recording programming support program | |
| JPH021571A (en) | Faulty simulation device | |
| JPH04138574A (en) | Device for displaying circuit information | |
| JP2943161B2 (en) | Failure simulation method | |
| JPH03130839A (en) | On-line simulation system | |
| Dolotta et al. | The LEAP load and test driver | |
| JP2602983B2 (en) | Diagnostic system | |
| JP2525913Y2 (en) | LSI logic simulation device | |
| JP2005092609A (en) | Sequence diagram display apparatus and sequence diagram display program | |
| DE69126584T2 (en) | Error handling in a central processing unit from VLSI that uses an address and execution pipeline module | |
| JPH02103644A (en) | Method for testing software module | |
| CN115952102A (en) | A visual self-test test method, device and storage medium | |
| Parkinson | Classification of Programmable Electronic Systems Operation for Testability | |
| JPS59151247A (en) | Testing device of information processing device |