JPH06161817A - Thread online debug device - Google Patents
Thread online debug deviceInfo
- Publication number
- JPH06161817A JPH06161817A JP4308852A JP30885292A JPH06161817A JP H06161817 A JPH06161817 A JP H06161817A JP 4308852 A JP4308852 A JP 4308852A JP 30885292 A JP30885292 A JP 30885292A JP H06161817 A JPH06161817 A JP H06161817A
- Authority
- JP
- Japan
- Prior art keywords
- thread
- debug
- debugged
- breakpoint
- command
- 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)【要約】
【目的】スレッドを複数動作させながら一部のスレッド
をオンラインデバッグすることのできるスレッドオンラ
インデバッグ装置を実現する。
【構成】 シングルステップやブレイクポイントなどの
ターゲットマイクロプロセッサユニットに依存した実行
制御とデータアクセス機能を有するアセンブラレベルの
リモート・デバッグ・モニタと、通信で前記リモートデ
バッグモニタに接続して用いられるリモート・ソースコ
ード・デバッガを備えたオンラインデバッグ装置であっ
て、前記リモート・デバッグ・モニタは、スレッドとし
て被デバッグプロセス内で動作すると同時に被デバッグ
プロセスとは独立したプロセスとして扱われ、ブレイク
ポイントヒットの不正命令シグナルを非同期シグナルハ
ンドラを介して受信するように構成する。
(57) [Abstract] [Purpose] To realize a thread online debug device that can online debug some threads while operating multiple threads. [Configuration] Assembler level remote debug monitor having execution control and data access functions depending on target microprocessor unit such as single step and breakpoint, and remote source used by connecting to the remote debug monitor by communication An online debug device equipped with a code debugger, wherein the remote debug monitor operates as a thread in the debugged process, and at the same time is treated as a process independent of the debugged process. To receive via an asynchronous signal handler.
Description
【0001】[0001]
【産業上の利用分野】本発明は、デバッグ装置に関し、
詳しくはUNIX(登録商標)の1ユーザプロセス内で
更に並列実行可能な単位であるスレッドをユーザプロセ
スの動作中に個別にデバッグすることを可能にするデバ
ッグ装置に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debugging device,
More specifically, the present invention relates to a debug device that enables individual threads, which are units that can be executed in parallel in a UNIX (registered trademark) user process, to be individually debugged while the user process is operating.
【0002】[0002]
【従来の技術】UNIXにおいてはsdbと呼ばれるプ
ロセスデバッガがあり、次のような手法で実現されてい
る。なお、図8はsdbのデバッグ形態を示す図であ
り、図9はsdbの基本処理の流れを示した図(プログ
ラムリスト)である。2. Description of the Related Art In UNIX, there is a process debugger called sdb, which is realized by the following method. 8 is a diagram showing a debug mode of sdb, and FIG. 9 is a diagram (program list) showing a flow of basic processing of sdb.
【0003】子プロセスの起動 sdbはforkコマンドを用いて被デバッグプロセスを子
プロセスとして生成する。この時sdbは親プロセスに
なる。次に子プロセスの仮コードへ制御が一旦移り(ま
だ子プロセスの実体はない)、ptrace(0,0,0,0) を実行
して自分はデバッグ対象であることをUNIXに知らせ
る。UNIXは被デバッグプロセスの管理テーブルにト
レースフラグをセットする。最後に、被デバッグプロセ
スの実体がロードされ(execコマンド実行)、再びsd
bに制御が移る。sdbは子プロセス待ち(wait)が解
除され、ユーザのコマンド待ちに入る(read)。Activation of child process sdb uses the fork command to generate the process to be debugged as a child process. At this time, sdb becomes the parent process. Then, control is temporarily transferred to the temporary code of the child process (the child process does not exist yet), and ptrace (0,0,0,0) is executed to inform UNIX that it is the debug target. UNIX sets a trace flag in the management table of the process to be debugged. Finally, the substance of the debugged process is loaded (exec command execution), and sd is restarted.
Control is transferred to b. The sdb waits for the child process (wait) to be released and waits for the user's command (read).
【0004】子プロセスの実行制御とデータアクセス 子プロセスの実行制御とデータアクセスのコマンドはす
べてUNIXのptraceシステムコールをブレイクダウン
して実行する。ブレイクポイントも同様にptraceを用い
て、プロセッサ不正命令またはブレイク命令を子プロセ
スの論理空間に書き込むことにより実現している。そし
て実行コマンドにより子プロセスを起動し、sdbはブ
レイクポイントのヒット待ちに入る(wait)。Execution control of child process and data access Commands for execution control of child process and data access are all executed by breaking down the ptrace system call of UNIX. Breakpoints are also realized by using ptrace to write an illegal processor instruction or a break instruction into the logical space of the child process. Then, the child process is activated by the execution command, and sdb waits for a hit at the breakpoint (wait).
【0005】ブレイクポイントヒット通知 ブレイクポイントのヒットは、親プロセスであるsdb
に通知される。waitしていたデバッガはwakeup(起床)
され、ブレークポイントを解除して再びコマンド入力待
ちに入る。Breakpoint hit notification Breakpoint hits are sent to the parent process, sdb.
Will be notified. Debugger waiting was wakeup
Then, the breakpoint is released and the command input is waited again.
【0006】[0006]
【発明が解決しようとする課題】ところで、UNIXの
プロセスデバッガでは、ブレイクポイントのヒットで被
デバッグプロセスが停止してしまうため、被デバッグプ
ロセス内にある並行実行可能な単位であるスレッドを複
数動作させながら一部のスレッドをオンラインデバッグ
することは不可能であるという問題がある。これを可能
とするためには以下のような課題を解決する必要があ
る。By the way, in the UNIX process debugger, the process to be debugged stops due to a breakpoint hit. Therefore, a plurality of threads, which are units that can be concurrently executed in the process to be debugged, are operated. However, there is a problem that it is impossible to debug some threads online. To make this possible, it is necessary to solve the following problems.
【0007】(1) スレッドデバッガ構成 sdbの機能の内ブレイクポイント、シングルステップ
や継続実行などの実行制御に係わるコマンド処理部分
は、基本的に被デバッグプロセス内に存在する必要があ
る。 (2) スレッドデバッグ機能 ユーザスレッドのオンラインデバッグを可能にするに
は、ブレイクポイントセット、シングルステップなどの
デバッグ機能と、継続実行、停止、メッセージ(コマン
ドとして扱うもの)の非同期受信などUNIXのスレッ
ド管理機能が必要である。ただし、UNIXのプロセス
デバッグ機能を使用する場合、ブレイクヒットやシング
ルステップでプロセス全体が停止せず、当該スレッドの
み停止させる工夫が必要である。 (3) 非同期コマンド処理の方法 プロセス内部のスレッドモニタのデバッグコマンド受信
待ちにかかわらず、被デバッグプロセスは停止せず実行
を継続できなければならない。(1) Thread Debugger Configuration The command processing part related to execution control such as breakpoints, single step and continuous execution in the function of sdb basically needs to be present in the process to be debugged. (2) Thread debug function To enable online debugging of user threads, debug functions such as breakpoint set and single step, and UNIX thread management such as continuous execution, stop, asynchronous reception of messages (handled as commands), etc. Function is required. However, when using the process debug function of UNIX, it is necessary to devise to stop only the relevant thread without stopping the entire process due to a break hit or a single step. (3) Asynchronous command processing method The debugged process must be able to continue execution without stopping, regardless of the wait for the debug command reception of the thread monitor inside the process.
【0008】本発明の目的は、上記のような課題を解決
し、スレッドを複数動作させながら一部のスレッドをオ
ンラインデバッグすることのできるスレッドオンライン
デバッグ装置を提供することにある。SUMMARY OF THE INVENTION An object of the present invention is to solve the above problems and to provide a thread online debug device capable of online debugging a part of threads while operating a plurality of threads.
【0009】[0009]
【課題を解決するための手段】このような目的を達成す
るために本発明では、シングルステップやブレイクポイ
ントなどのターゲットマイクロプロセッサユニットに依
存した実行制御とデータアクセス機能を有するアセンブ
ラレベルのリモート・デバッグ・モニタと、通信で前記
リモートデバッグモニタに接続して用いられるリモート
・ソースコード・デバッガを備えたオンラインデバッグ
装置であって、前記リモート・デバッグ・モニタは、ス
レッドとして被デバッグプロセス内で動作すると同時に
被デバッグプロセスとは独立したプロセスとして扱わ
れ、ブレイクポイントヒットの不正命令シグナルを非同
期シグナルハンドラを介して受信するように構成したこ
とを特徴とする。In order to achieve such an object, according to the present invention, an assembler level remote debug having execution control and data access functions depending on a target microprocessor unit such as a single step or a breakpoint is provided. An online debug device comprising a monitor and a remote source code debugger used in communication with the remote debug monitor, the remote debug monitor operating as a thread in the debugged process at the same time. It is treated as a process independent of the debugged process, and is characterized in that it receives an illegal instruction signal of a breakpoint hit via an asynchronous signal handler.
【0010】[0010]
【作用】C言語ソースコードデバッガを、コマンド処理
部、ソースコード表示部とシンボル操作部から成る部分
(rSDB)と、実行制御部とメモリアクセス部から成
る部分(rDBM)とに大別する。rSDBは常にワー
クステーション上で動作し通信でrDBMと接続して利
用される。rDBMはスレッドとして被デバッグプロセ
ス内で動作し、被デバッグプロセスとは独立したプロセ
スとして扱われる。ブレイクポイントヒットの不正命令
シグナルを被デバッグプロセスの不正命令シグナルハン
ドラが直接受信し、これをメッセージ機能を使用してr
DBMに通知するようにしている。スレッドブレイク機
能の実現にホストマシンの不正命令とUNIXの不正命
令シグナルを使用することはsdbと同様であるが、ブ
レイクポイントヒットの不正命令シグナルをUNIXか
ら受信するのはrSDBではなく被デバッグプロセス内
のrDBMが非同期シグナルハンドラを介して受信した
点が従来のものと異なる。The C language source code debugger is roughly divided into a command processing section, a source code display section and a symbol operating section (rSDB), and an execution control section and a memory access section (rDBM). The rSDB always operates on the workstation and is used by connecting to the rDBM for communication. The rDBM operates as a thread in the debugged process and is treated as a process independent of the debugged process. The illegal instruction signal handler of the debugged process directly receives the illegal instruction signal of the breakpoint hit, and r
The DBM is notified. It is the same as sdb that the illegal instruction of the host machine and the illegal instruction signal of UNIX are used to realize the thread break function, but the illegal instruction signal of the breakpoint hit is received from UNIX instead of rSDB. Is different from the conventional one in that the rDBM is received via an asynchronous signal handler.
【0011】[0011]
【実施例】以下図面を用いて本発明を詳しく説明する。
まず、本発明を適用するシミュレーション開発環境につ
いて説明する。図1に示すシミュレーション開発環境に
おいて、10はシステム・プロセスであり、ターゲット
のソフトウェアシステムを模擬するプロセスで、非同期
シグナルハンドラ20、リモート・デバッグ・モニタ
(以下rDBMと略記)11、スレッド12より構成さ
れている。The present invention will be described in detail below with reference to the drawings.
First, a simulation development environment to which the present invention is applied will be described. In the simulation development environment shown in FIG. 1, reference numeral 10 denotes a system process, which is a process simulating a target software system and is composed of an asynchronous signal handler 20, a remote debug monitor (hereinafter abbreviated as rDBM) 11, and a thread 12. ing.
【0012】30はソースコードとシンボルの管理や制
御を司どり同時使用が可能なリモート・ソースコード・
デバッガ(以下rSDBと略記)であり、rDBM11
と対になってC言語レベルデバッガと成り得るものであ
る。なお、複数のrSDBを用意することにより各種デ
バッグモードに効果的に対応することができる。40は
UNIXのOSであり、シグナルハンドラ20に必要な
シグナルを与える。Reference numeral 30 is a remote source code which controls and controls the source code and symbols and can be used simultaneously.
Debugger (hereinafter abbreviated as rSDB), rDBM11
Can be used as a C language level debugger. By preparing a plurality of rSDBs, various debug modes can be effectively dealt with. Reference numeral 40 denotes a UNIX OS, which gives necessary signals to the signal handler 20.
【0013】図2は図1に示すシステム・プロセスにお
いて用られるC言語ソースコードデバッガの概念的構成
図である。一般のC言語ソースコードデバッガは、基本
的にコマンド処理部、ソースコード表示部、シンボル操
作部、実行制御部、メモリアクセス部から構成されてい
る。特に、シンボル操作部はオブジェクト形式に依存
し、そして実行制御部はシングルステップやブレイクポ
イントなどマイクロプロセッサユニット(以下MPUと
略記する)に依存している。本発明では、これらを2つ
の独立した機能に分離し、汎用化している。FIG. 2 is a conceptual block diagram of a C language source code debugger used in the system process shown in FIG. A general C language source code debugger is basically composed of a command processing unit, a source code display unit, a symbol operation unit, an execution control unit, and a memory access unit. In particular, the symbol operation unit depends on the object format, and the execution control unit depends on a microprocessor unit (hereinafter abbreviated as MPU) such as a single step or a breakpoint. In the present invention, these are separated into two independent functions for generalization.
【0014】図2において、100はC言語レベルデバ
ッガであり、コマンド処理やソースコード表示、シンボ
ル操作等の機能を有するC言語レベルデバッグ支援環境
110と、コマンドの実行制御やメモリアクセス等の機
能を有するアセンブラデバッガ120より構成される。
そして両者は独立分離され、通信により信号の送受が可
能になっている。なお、図中の符号Pはそのプロセス
(例えばrSDB)がUNIXプロセスであることを表
わし、また符号P/TはそのプロセスがUNIXプロセ
スまたはリアルタイムタスクであることを表わす。In FIG. 2, reference numeral 100 denotes a C language level debugger, which has a C language level debug support environment 110 having functions such as command processing, source code display and symbol manipulation, and functions such as command execution control and memory access. The assembler debugger 120 is included.
Both are independently separated, and signals can be transmitted and received by communication. The symbol P in the figure indicates that the process (for example, rSDB) is a UNIX process, and the symbol P / T indicates that the process is a UNIX process or a real-time task.
【0015】C言語レベルデバッグ支援環境110内の
rSDB30は、C言語レベルのデバッグを支援する部
分であり、常にワークステーション上で動作し通信で接
続されているrDBM11と対になって用いられる(1
つのrDBM11に対してN個のrSDBを接続でき
る)。rSDB30とrDBM11は、ネットワークイ
ンタフェース111,121を介して結合されている。The rSDB 30 in the C language level debug support environment 110 is a part that supports C language level debugging, and is always used in pair with the rDBM 11 that operates on a workstation and is connected by communication (1
N rSDBs can be connected to one rDBM11). The rSDB 30 and the rDBM 11 are connected via the network interfaces 111 and 121.
【0016】rDBM11はアセンブラレベルのデバッ
ガであり、シングルステップやブレイクポイントなどの
ターゲットマイクロプロセッサに依存した実行制御とデ
ータアクセス機能を分担する。このrDBM11はシス
テムプロセス10やターゲット上で動作する。そして、
複数のタスクを同時にデバッグすることができるマルチ
タスクデバッグ、複数のrSDBからのコマンドを同時
に処理することができるマルチrSDB対応、オンライ
ンあるいはオフラインの動作モードを有するマルチデバ
ッグモードなどの機能を有する。The rDBM 11 is an assembler-level debugger and shares execution control and data access functions depending on the target microprocessor such as single step and breakpoint. The rDBM 11 operates on the system process 10 and the target. And
It has functions such as multi-task debug capable of simultaneously debugging a plurality of tasks, multi-rSDB correspondence capable of simultaneously processing commands from a plurality of rSDBs, and a multi-debug mode having an online or offline operation mode.
【0017】本発明は、以上のような構成を基盤とし、
更にこれに次のようなスレッドデバッグ機構を付加した
ものである。 rDBM11をスレッドとして被デバッグプロセス内
で動作させる。この場合、従来のsdbは被デバッグ対
象を子プロセスとして扱うのに対して、rSDB30と
被デバッグプロセスの関係は親子の関係ではなく、独立
したプロセスとして扱う。 スレッドブレイク機能の実現にホストマシンの不正命
令とUNIXの不正命令シグナル(SIGILL)を使用する
ことはsdbと同様であるが、ブレイクポイントヒット
の不正命令シグナルをUNIXから受信するのは、rS
DB30ではなく被デバッグプロセス内のrSDB11
が非同期シグナルハンドラを介して受信する。本発明で
特に強調する点は、ブレイクポイントヒットの不正命令
シグナルを被デバッグプロセスの不正命令シグナルハン
ドラが直接受信し、これをメッセージ機能を使用してr
DBM11に通知するメカニズムである。この不正命令
シグナルは、非デバッグプロセスに対して非同期に発生
しrDBM11に通知されるので、rDBM以外のスレ
ッドの動作には影響しない。The present invention is based on the above configuration,
Furthermore, the following thread debug mechanism is added to this. The rDBM 11 is operated as a thread in the debugged process. In this case, the conventional sdb handles the debugged object as a child process, whereas the relationship between the rSDB 30 and the debugged process is not a parent-child relationship but an independent process. The illegal instruction signal of the host machine and the illegal instruction signal of UNIX (SIGILL) are used for the realization of the thread break function in the same way as sdb, but the illegal instruction signal of the breakpoint hit is received from UNIX by rS.
RSDB11 in the debugged process instead of DB30
Received via an asynchronous signal handler. It is particularly emphasized in the present invention that the illegal instruction signal handler of the debugged process directly receives the illegal instruction signal of the breakpoint hit, and r
This is a mechanism for notifying the DBM 11. This illegal instruction signal is generated asynchronously to the non-debug process and is notified to the rDBM 11, so that it does not affect the operation of threads other than the rDBM.
【0018】上記のようなデバッガを用いてデバッグを
行う際の全体構成を図3に示す。図において、符号Pは
当該プロセスがUNIXプロセスであることを表わし、
符号Sは当該プロセスがスレッドであることを表わす。
200は被デバッグプロセスであり、ライブラリ20
1、非同期シグナルハンドラとしてのSIGILLハン
ドラ202とSIGIOハンドラ203、被デバッグス
レッドであるユーザスレッド204、そしてrDBM3
0より成る。SIGILLハンドラ202は、不正命令
実行時にrSDB30からのコマンド受信用非同期割込
みハンドラである。SIGIOハンドラ203は、rS
DB30からのコマンド受信用非同期割込みハンドラで
ある。FIG. 3 shows the overall configuration when debugging is performed using the above-mentioned debugger. In the figure, the symbol P indicates that the process is a UNIX process,
The symbol S indicates that the process is a thread.
Reference numeral 200 is a debugged process, and the library 20
1. SIGILL handler 202 and SIGIO handler 203 as asynchronous signal handlers, user thread 204 as debugged thread, and rDBM3
It consists of zero. The SIGILL handler 202 is an asynchronous interrupt handler for command reception from the rSDB 30 when executing an illegal instruction. The SIGIO handler 203 uses rS
It is an asynchronous interrupt handler for receiving a command from the DB 30.
【0019】上記ライブラリ201は、スレッドデバッ
グ機能を実現するために以下のライブラリを備えてい
る。 スレッド管理ライブラリ UNIXが提供するカーネルインプリメントスレッド
(コルーチンライブラリではない)で、スレッドコンテ
キストスイッチはUNIXが行う。 メッセージ管理ライブラリThe library 201 includes the following libraries for realizing the thread debug function. Thread management library A kernel implementation thread (not a coroutine library) provided by UNIX, and thread context switching is performed by UNIX. Message management library
【0020】次表はスレッド管理用およびスレッド間メ
ッセージに係るコマンドとその機能の一覧表である。 The following table is a list of commands relating to thread management and inter-thread messages and their functions.
【0021】SIGIOハンドラ203からrDBM1
1に送信されるメッセージには、ブレイクポイントヒッ
トとrSDB30からのコマンドがあり、例えば次のよ
うな構造体で定義する。 #define unsigned char string; #define unsigned long UW; struct t_knlmsgp{ /* シグナルハンドラからのメッセージ */ string cmd[8]; /* * "BREAKHIT" - ブレイクヒット * "********" - RSDBからのコマンド * */ UW rsdb_sid; /* RSDB通信ソケット識別子 */ UW break_adr; /* ブレイクアドレス(32ビット) */ };From SIGIO handler 203 to rDBM1
The message sent to 1 includes a breakpoint hit and a command from the rSDB 30, which is defined by the following structure, for example. #define unsigned char string; #define unsigned long UW; struct t_knlmsgp {/ * Message from the signal handler * / string cmd [8]; / * * "BREAKHIT"-Break hit * "********" -Command from RSDB * * / UW rsdb_sid; / * RSDB communication socket identifier * / UW break_adr; / * Break address (32 bits) * /};
【0022】このような構成における各部の動作を次に
説明する。 (1) rDBM11の処理 図4にこの処理に係るプログラムのリストを示す。な
お、このプログラムは引数がなく返値もない関数であ
る。またこのリストは説明用であって完全なプログラム
リストではない。この処理においては、まずメッセージ
バッファの型が上記メッセージ構造体の型であるとし、
次にrSDB30との非同期通信ソケットの初期化、不
正命令(SIGILL)シグナル受信用ハンドラを定義し、コ
マンド受信用シグナルハンドラ(SIGIO )を定義する。
その後次のメッセージ待ちの処理に入る。メッセージ源
はrSDB30とシグナルハンドラである。メッセージ
を受けると、そのコマンドの種類によって次の3つの処
理に分かれる。The operation of each section in such a configuration will be described below. (1) Processing of rDBM 11 FIG. 4 shows a list of programs related to this processing. This program is a function that has no arguments and no return value. Also, this listing is for illustration only and is not a complete program listing. In this process, first assume that the message buffer type is the above message structure type, and
Next, an asynchronous communication socket with the rSDB30 is initialized, an illegal command (SIGILL) signal reception handler is defined, and a command reception signal handler (SIGIO) is defined.
After that, the process for waiting for the next message is started. The message sources are rSDB30 and the signal handler. When a message is received, it is divided into the following three processes depending on the type of command.
【0023】コマンドが、ブレークポイントのヒット
であった場合 意図したものか否かを判断し、ブレイクポイントであれ
ば以下の処理を継続し、そうでなければ例外処理を起動
し、再びメッセージ待ちへ戻る。ブレイクポイントであ
れば、ブレークポイントを解除する。そしてブレークポ
イントをブレークポイント管理テーブルから削除する。
続いて、ソケット識別子を用い、要求したrSDB30
にブレイクを通知する。そして再び上記メッセージ待ち
へ戻る。 コマンドが、ブレイクポイントセットであった場合 ブレイクポイントのデータをセーブする。続いて、不正
命令をセットし、ブレークポイント管理テーブルにブレ
ークポイントデータを登録する。次にソケット識別子を
用いて、要求元のrSDB30に結果を通知する。それ
が終了すると再び上記メッセージ待ちへ戻る。 コマンドが、その他のrSDBコマンドであった場合 各rSDBコマンド処理を行う。続いてソケット識別子
を用い、要求元のrSDBに結果を通知する。その後上
記メッセージ待ちへ移行する。If the command is a breakpoint hit, it is judged whether or not it is the one intended, and if it is a breakpoint, the following processing is continued, and if not, exception processing is started and the processing waits for a message again. Return. If it is a breakpoint, cancel the breakpoint. Then, the breakpoint is deleted from the breakpoint management table.
Then, using the socket identifier, the requested rSDB30
Notify the break. Then, the process returns to the above message waiting state. If the command is a breakpoint set, save the breakpoint data. Then, the illegal instruction is set and the breakpoint data is registered in the breakpoint management table. Next, the result is notified to the requesting rSDB 30 using the socket identifier. When it ends, it returns to the above message waiting again. When the command is another rSDB command, each rSDB command process is performed. Subsequently, the socket identifier is used to notify the result to the requesting rSDB. After that, the process shifts to the above message waiting.
【0024】(2) 不正命令シグナル(SIGILL)ハ
ンドラの処理 図5に処理プログラムを示す。不正命令が実行されたと
きこのハンドラの処理(sigillhdr() )が実行される。
そしてrDBM11にブレイク情報が送信される。以下
処理の内容を説明する。メッセージバッファの型は前記
メッセージ構造体の型であるとし、メッセージバッファ
に"BREAKHIT"コマンドとブレイクアドレスをセットす
る。そしてメッセージバッファ内の情報をrDBM11
に送信する。ブレイクアドレスか否かはrDBM11が
判断する。(2) Processing of illegal instruction signal (SIGILL) handler FIG. 5 shows a processing program. When an illegal instruction is executed, the processing of this handler (sigillhdr ()) is executed.
Then, the break information is transmitted to the rDBM 11. The contents of the processing will be described below. It is assumed that the message buffer type is the message structure type, and the "BREAKHIT" command and the break address are set in the message buffer. Then, the information in the message buffer is stored in rDBM11.
Send to. The rDBM 11 determines whether the address is a break address.
【0025】(3) コマンド受信シグナル(SIGIO)
ハンドラの処理 rSDB30からコマンドを受信すると図6に示される
コマンド受信シグナルハンドラ(sigiohdr())が実行さ
れ、rDBM11にコマンドを送信する。処理内容は次
の通りである。メッセージバッファが前記メッセージ構
造体型であるとし、メッセージバッファにrSDBコマ
ンドとrSDBソケット識別子をセットする。次に、r
DBM11にそれを送信する。(3) Command reception signal (SIGIO)
Processing of Handler Upon receiving a command from the rSDB 30, the command reception signal handler (sigiohdr ()) shown in FIG. 6 is executed, and the command is transmitted to the rDBM 11. The processing contents are as follows. Assume that the message buffer is of the message structure type, and set the rSDB command and rSDB socket identifier in the message buffer. Then r
Send it to DBM11.
【0026】(4) ブレイクポイントのセットとヒットの
動作 図7を参照してその動作を順を追って説明する。なお、
項目番号a,b,c,...は図中の円囲みのa,b,
c,...に対応する。 (a) rSDB30からブレイクコマンドが送信される。 (b) システムプロセスのSIGIOハンドラ203が起
動し、ソケットから前記コマンドを読み取る。 (c) SIGIO203ハンドラからrDBM11にその
コマンドを送信する。rDBMのメッセージ受信待ちは
解除される。 (d) SIGIOハンドラを終了し、rDBM11へスレ
ッドを切り替える。rDBMはユーザスレッド204よ
り常に高い優先度である。 (e) rDBM11は前記ブレイクコマンドを識別する。(4) Break Point Setting and Hit Operation The operation will be described step by step with reference to FIG. In addition,
Item numbers a, b, c ,. . . Are circled a, b,
c ,. . . Corresponding to. (a) A break command is transmitted from the rSDB30. (b) The SIGIO handler 203 of the system process is activated to read the command from the socket. (c) The SIGIO203 handler sends the command to the rDBM11. The waiting of the rDBM message reception is released. (d) Terminate the SIGIO handler and switch the thread to the rDBM11. rDBM is always a higher priority than user thread 204. (e) The rDBM 11 identifies the break command.
【0027】(f) rDBM11はrSDB30から得た
ブレイクポイントアドレスの内容を保存する。ブレイク
ポイントアドレスには直接MPU不正命令をセットす
る。そしてrDBMは再びコマンド受信待ちになる。 (g) rSDB30からrDBM11に実行継続コマンド
が送信される。上記(b) から(e) を順に実行し、被デバ
ッグスレッドを継続実行する。そしてrDBMは再びコ
マンド受信待ちとなる。 (h) 被デバッグスレッド(ユーザスレッド204)へス
レッドが切り替わる。 (i) ブレイクヒットし、SIGILLハンドラが起動さ
れる。 (j) SIGILLハンドラはバッファ(sigcontext構造
体)から不正命令実行アドレスを抽出する。 (k) rDBM11にブレイクヒットコマンドと不正命令
実行アドレスを送信する。(F) The rDBM 11 saves the contents of the breakpoint address obtained from the rSDB 30. The MPU illegal instruction is directly set to the breakpoint address. Then, the rDBM again waits for a command to be received. (g) The execution continuation command is transmitted from the rSDB30 to the rDBM11. Execute the above (b) to (e) in order to continuously execute the thread to be debugged. The rDBM then waits again for command reception. (h) The thread is switched to the debugged thread (user thread 204). (i) A break hit occurs and the SIGILL handler is activated. (j) The SIGILL handler extracts the illegal instruction execution address from the buffer (sigcontext structure). (k) Send a break hit command and an illegal instruction execution address to the rDBM11.
【0028】(l) SIGIOハンドラを終了し、rDB
M11へスレッドを切り替える。 (m) rDBM11は不正命令実行アドレスがブレイクポ
イントアドレスであるかどうか判定する。 (n) ブレイクポイントアドレスであればヒットしたスレ
ッドを強制停止し、ブレイクポイントアドレスでなけれ
ば例外処理を起動する。 (o) ブレイクポイントを修復しrDBM11は再びコマ
ンド受信待ちになる。 (p) 被デバッグスレッド204はrSDB30からの継
続実行コマンドにより実行を再開する。 以上のようにして容易にスレッドのみをオンラインデバ
ッグすることができる。(L) Terminate the SIGIO handler and rDB
Switch threads to M11. (m) The rDBM 11 determines whether the illegal instruction execution address is a breakpoint address. (n) If it is a breakpoint address, the hit thread is forcibly stopped, and if it is not a breakpoint address, exception processing is started. (o) The breakpoint is repaired, and the rDBM 11 waits again for command reception. (p) The debugged thread 204 resumes execution by the continuous execution command from the rSDB30. As described above, it is possible to easily online debug only the thread.
【0029】[0029]
【発明の効果】以上説明したように本発明によれば次の
ような効果がある。スレッドサービスの普及によってU
NIXプロセスを停止することなく部分的に特定のスレ
ッドのみをオンラインデバッグすることが要求される。
本発明によれば、スレッド管理機能やスレッド間メッセ
ージ機能を利用してオンラインスレッドデバッグを容易
に実現することができる。As described above, the present invention has the following effects. U due to the spread of thread services
It is required to partially online debug only certain threads without stopping the NIX process.
According to the present invention, online thread debugging can be easily realized by utilizing the thread management function and the inter-thread message function.
【図1】本発明を実現するためのシミュレーション開発
環境の一例を示す構成図である。FIG. 1 is a configuration diagram showing an example of a simulation development environment for realizing the present invention.
【図2】C言語レベルデバッガの実施例構成図である。FIG. 2 is a configuration diagram of an embodiment of a C language level debugger.
【図3】本発明に係るスレッドオンラインデバッグ装置
の一実施例を示す構成図である。FIG. 3 is a configuration diagram showing an embodiment of a thread online debug device according to the present invention.
【図4】rDBMの処理内容を説明するための図であ
る。FIG. 4 is a diagram for explaining processing contents of rDBM.
【図5】不正命令シグナルハンドラの処理内容を説明す
るための図である。FIG. 5 is a diagram for explaining processing contents of an illegal instruction signal handler.
【図6】コマンド受信シグナルハンドラの処理内容を説
明するための図である。FIG. 6 is a diagram for explaining processing contents of a command reception signal handler.
【図7】ブレイクポイントセットおよびヒットの動作を
説明するための図である。FIG. 7 is a diagram for explaining a breakpoint setting operation and a hit operation.
【図8】sdbのデバッグ形態を示す図である。FIG. 8 is a diagram showing a debug mode of sdb.
【図9】sdbの基本処理の流れを示した図である.FIG. 9 is a diagram showing a flow of basic processing of sdb.
10 システムプロセス 11 rDBM 12 スレッド 20 非同期シグナルハンドラ 30 rSDB 40 UNIX 100 C言語レベルデバッガ 110 C言語レベルデバッグ支援環境 120 アセンブラレベルデバッガ 200 被デバッグプロセス 201 ライブラリ 202 SIGIOハンドラ 203 SIGILLハンドラ 204 被デバッグスレッド 10 system process 11 rDBM 12 thread 20 asynchronous signal handler 30 rSDB 40 UNIX 100 C language level debugger 110 C language level debugging support environment 120 assembler level debugger 200 debugged process 201 library 202 SIGIO handler 203 SIGILL handler 204 debugged thread
Claims (1)
ングルステップやブレイクポイントなどのターゲットマ
イクロプロセッサユニットに依存した実行制御とデータ
アクセス機能を有するリモート・デバッグ・モニタと、 C言語レベルのデバッグを支援する部分であり、通信で
前記リモート・デバッグ・モニタに接続して用いられる
リモート・ソースコード・デバッガを備えたオンライン
デバッグ装置であって、 前記リモート・デバッグ・モニタは、スレッドとして被
デバッグプロセス内で動作すると同時に被デバッグプロ
セスとは独立したプロセスとして扱われ、ブレイクポイ
ントヒットの不正命令シグナルを非同期シグナルハンド
ラを介して受信するように構成したことを特徴とするス
レッドオンラインデバッグ装置。1. A assembler-level debugger that supports C-level debugging and a remote debug monitor having execution control and data access functions dependent on the target microprocessor unit such as single step and breakpoints. An online debug device comprising a remote source code debugger used in communication with the remote debug monitor, the remote debug monitor operating as a thread in a debugged process. At the same time, it is treated as a process independent from the process to be debugged, and the illegal online instruction signal of breakpoint hit is received via an asynchronous signal handler.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4308852A JPH06161817A (en) | 1992-11-18 | 1992-11-18 | Thread online debug device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4308852A JPH06161817A (en) | 1992-11-18 | 1992-11-18 | Thread online debug device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH06161817A true JPH06161817A (en) | 1994-06-10 |
Family
ID=17986048
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP4308852A Pending JPH06161817A (en) | 1992-11-18 | 1992-11-18 | Thread online debug device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH06161817A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2012124162A1 (en) * | 2011-03-15 | 2012-09-20 | オムロン株式会社 | Debugging device |
| JP2013127782A (en) * | 2004-09-14 | 2013-06-27 | Synopsys Inc | Debug in multi-core architecture |
-
1992
- 1992-11-18 JP JP4308852A patent/JPH06161817A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2013127782A (en) * | 2004-09-14 | 2013-06-27 | Synopsys Inc | Debug in multi-core architecture |
| WO2012124162A1 (en) * | 2011-03-15 | 2012-09-20 | オムロン株式会社 | Debugging device |
| JP2012194632A (en) * | 2011-03-15 | 2012-10-11 | Omron Corp | Debug device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5630049A (en) | Method and apparatus for testing software on a computer network | |
| US5889988A (en) | Debugger for debugging tasks in an operating system virtual device driver | |
| US10191835B2 (en) | Multi-threaded debugger support | |
| US5675800A (en) | Method and apparatus for remotely booting a computer system | |
| JP3339482B2 (en) | Distributed debugging apparatus, debugging method, and recording medium recording control program | |
| US7020871B2 (en) | Breakpoint method for parallel hardware threads in multithreaded processor | |
| US4819234A (en) | Operating system debugger | |
| US6718294B1 (en) | System and method for synchronized control of system simulators with multiple processor cores | |
| US5903728A (en) | Plug-in control including an independent plug-in process | |
| US6944850B2 (en) | Hop method for stepping parallel hardware threads | |
| US6658650B1 (en) | Service entry point for use in debugging multi-job computer programs | |
| US20020129337A1 (en) | Debugger probe for object oriented programming | |
| US20100153786A1 (en) | Processor, multiprocessor, and debugging method | |
| JP2000029737A (en) | Processor having real-time outer instruction insertion for debugging functions | |
| JP2007128132A (en) | Thread debugging device, thread debugging method and program | |
| US20040098639A1 (en) | Debugging kernel-loadable modules and suspending and replacing functions in non-microkernel operating systems | |
| EP0588473B1 (en) | Method and apparatus for emulating the environment of a microprocessor | |
| JP2000066904A (en) | Multitask control method and storage medium | |
| US5544307A (en) | Microcomputer development support system operable with only background monitor and without cache replacement | |
| US7320044B1 (en) | System, method, and computer program product for interrupt scheduling in processing communication | |
| JP2713124B2 (en) | In-circuit emulator | |
| JP2913991B2 (en) | Real-time system debug device | |
| JP2004094800A (en) | Program simulation device and program simulation method | |
| JP2000181748A (en) | Multi-memory space program debugging system and debugging method | |
| JPH09282196A (en) | Program run control method for complex logic processor system. |