JPH04248634A - Debugger - Google Patents

Debugger

Info

Publication number
JPH04248634A
JPH04248634A JP3014124A JP1412491A JPH04248634A JP H04248634 A JPH04248634 A JP H04248634A JP 3014124 A JP3014124 A JP 3014124A JP 1412491 A JP1412491 A JP 1412491A JP H04248634 A JPH04248634 A JP H04248634A
Authority
JP
Japan
Prior art keywords
data
data structure
arrangement information
label
debugger
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP3014124A
Other languages
Japanese (ja)
Inventor
Satoshi Imai
智 今井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP3014124A priority Critical patent/JPH04248634A/en
Publication of JPH04248634A publication Critical patent/JPH04248634A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To easily find latent bugs by eliminating a need to recognize the arrangement of addresses belonging to data in plural data structures of a prescribed data structure and a non-data structure and efficiently finding overrun from the prescribed data structure at the time of program execution. CONSTITUTION:A means 11 which generates data of the non-data structure to which a label is added is provided. Non-data structure data in a source code 2 is interposed between labels of dummy data of global variables. A data arrangement information generating means 12 is provided to generate arrangement information of data of non-data structure data to which the label is added. An access data detecting means 13 is provided to collate data arrangement information and detects that the accessed address is within the range of the area of non-data structure data to which the label is added.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はデバッガに関し、特にマ
イクロプロセッサ等のコンピュータのプログラムのデバ
ッグ用のデバッガに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debugger, and more particularly to a debugger for debugging programs of computers such as microprocessors.

【0002】0002

【従来の技術】従来のデバッガは、デバッグの対象であ
るマイクロプロセッサ等のプログラムが、主記憶装置等
のデータをアクセスするときに、そのプログラムに関係
するデータ構造(以下所定データ構造)に属しないデー
タ型のデータをアクセスしたことを効率的に検出する手
段がなかった。
[Prior Art] When a program such as a microprocessor to be debugged accesses data in a main memory device, etc., a conventional debugger uses a debugger that does not belong to a data structure related to the program (hereinafter referred to as a "predetermined data structure"). There was no way to efficiently detect that data of a data type was accessed.

【0003】図6に、主記憶装置上の配列データの一例
を示す。これは、リンク表現型のデータ型の一例であり
、A〜C等の配列データは、所定データ構造の部分であ
り、L〜N等の配列データは、所定データ構造に属しな
いデータ型のデータ(以下非データ構造データ)の部分
である。
FIG. 6 shows an example of array data on the main memory. This is an example of the data type of the link expression type, and the array data such as A to C is part of a predetermined data structure, and the array data such as L to N is data of a data type that does not belong to the predetermined data structure. (hereinafter referred to as non-data structure data).

【0004】このようなデータをアクセスするには、プ
ログラムを結合するツールであるリンクエディタ(リン
カ)により、図7のようなテーブルを作成し、それぞれ
の配列データの先頭番地を指すポインタを用いて行なう
のが一般的である。図7の例では、配列データAの先頭
番地は100であり、データのサイズは10バイト、配
列データBの先頭番地は200であり、データのサイズ
は20バイト、また、配列データCの先頭番地は300
であり、データのサイズは30バイト等であることを示
す。
[0004] To access such data, create a table like the one shown in Figure 7 using a link editor (linker), which is a tool for linking programs, and use a pointer pointing to the first address of each array data. It is common to do so. In the example of FIG. 7, the first address of array data A is 100 and the data size is 10 bytes, the first address of array data B is 200 and the data size is 20 bytes, and the first address of array data C is is 300
This indicates that the data size is 30 bytes or the like.

【0005】従来のデバッガにおいて、非データ構造デ
ータをアクセスしたかどうかの検出は図8に示すような
手作業で行なっていた。
In conventional debuggers, detection of whether non-data structure data has been accessed is performed manually as shown in FIG.

【0006】まず、ステップP1で、プログラムの実行
命令をマシン語からアセンブラに逆変換する作業である
逆アセンブルを行なう。
First, in step P1, disassembly is performed, which is a process of converting program execution instructions from machine language to assembler language.

【0007】次に、命令のアクセスするアドレスを点検
する(ステップP2)。
Next, the address accessed by the instruction is checked (step P2).

【0008】次に、アドレスがリンカの作成したテーブ
ルの範囲内であるかどうかを点検する(ステップP3)
Next, check whether the address is within the range of the table created by the linker (step P3)
.

【0009】次に、アドレスが非データ構造データのア
ドレスであるかどうかの判定をする(ステップP4)。 イエスの場合は、エラーであるのでステップP5に進み
、エラーメッセージを出力するとともにプログラムカウ
ンタ(以下PC)の該当命令名を記録して処理を中断す
る。ノーの場合は、ステップP6に進み、その1つの命
令を実行する。
Next, it is determined whether the address is an address of non-data structure data (step P4). If YES, it is an error, and the process proceeds to step P5, where an error message is output, the corresponding command name is recorded in the program counter (hereinafter referred to as PC), and the process is interrupted. If no, the process proceeds to step P6 and executes that one instruction.

【0010】次に、プログラムが終了したかどうかを判
定する(ステップP7)。イエスの場合は、終了する。 ノーの場合は、ステップP1に戻り、次の命令について
以上のフローと同様の作業を繰返すというものであった
Next, it is determined whether the program has ended (step P7). If yes, exit. If the answer is no, the process returns to step P1 and the same process as the above flow is repeated for the next command.

【0011】[0011]

【発明が解決しようとする課題】上述した従来のデバッ
ガは、非データ構造データ型のデータをアクセスしてデ
バッグを実行するためには、デバッグ作業者が所定デー
タ構造とその非データ構造データとの複数のデータ構造
のデータに属するアドレスの配置を把握する必要がある
という欠点があった。また、プログラム実行時の所定デ
ータ構造からのオーバランを効率的に発見することがで
きないので、潜在的なバグの発見が困難であるという欠
点があった。
[Problems to be Solved by the Invention] In the conventional debugger described above, in order to access data of a non-data structure data type and execute debugging, a debugger needs to understand the difference between a predetermined data structure and its non-data structure data. This method has the disadvantage that it is necessary to grasp the arrangement of addresses belonging to data in multiple data structures. Furthermore, since overruns from a predetermined data structure during program execution cannot be efficiently discovered, there is a drawback that it is difficult to discover potential bugs.

【0012】0012

【課題を解決するための手段】第1の発明のデバッガは
、ソースコード内の予め定めたデータ構造のデータに属
さないデータである非データ構造データの前後をグロー
バル変数のダミーのデータであるラベルではさみ込んだ
ラベル付加非データ構造データを作成するラベル付加非
データ構造データ作成手段と、前記ラベル付加非データ
構造データの配置情報であるデータ配置情報を作成する
データ配置情報作成手段と、前記データ配置情報を照合
し、アクセスするアドレスが前記ラベル付加非データ構
造データの領域の範囲内であることを検出するアクセス
データ検出手段とを備えて構成されている。
[Means for Solving the Problems] The debugger of the first invention includes a label that is dummy data of a global variable before and after non-data structure data that is data that does not belong to a predetermined data structure in a source code. a labeled non-data structure data creation means for creating labeled non-data structure data sandwiched between the labeled non-data structure data; a data arrangement information creation means for creating data arrangement information that is arrangement information of the labeled non-data structure data; and access data detection means that collates the arrangement information and detects that the address to be accessed is within the area of the labeled non-data structure data.

【0013】[0013]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments Next, embodiments of the present invention will be described with reference to the drawings.

【0014】図1は本発明のデバッガの一実施例を示す
ブロック図である。
FIG. 1 is a block diagram showing an embodiment of the debugger of the present invention.

【0015】本実施例のデバッガ1は、図1に示すよう
に、ラベル付加非データ構造データ作成手段11と、デ
ータ配置情報作成手段12と、アクセスデータ検出手段
13とを備えて構成されている。
As shown in FIG. 1, the debugger 1 of this embodiment includes a labeled non-data structure data creation means 11, a data arrangement information creation means 12, and an access data detection means 13. .

【0016】ラベル付加非データ構造データ作成手段1
1は、ソースコード2内の所定のデータ構造のデータあ
るデータ構造データに属さないデータ、すなわち、非デ
ータ構造データの前後を、システム共通の変数であるグ
ローバル変数のダミーのデータで構成したラベルではさ
み込みラベル付加非データ構造データを作成するもので
ある。
Label-added non-data structure data creation means 1
1 is a label that consists of dummy data of global variables that are common variables in the system before and after non-data structure data, data that does not belong to a certain data structure data in source code 2. This method creates non-data structure data with insert labels added.

【0017】データ配置情報作成手段12は、ラベル付
加非データ構造データの配置情報であるデータ配置情報
を作成するものである。
The data arrangement information creation means 12 is for creating data arrangement information that is arrangement information of labeled non-data structure data.

【0018】アクセスデータ検出手段13は、アクセス
するアドレスがラベル付加非データ構造データの領域の
範囲内であることを検出するものである。
The access data detection means 13 detects that the address to be accessed is within the area of labeled non-data structure data.

【0019】次に、本実施例の動作について説明する。Next, the operation of this embodiment will be explained.

【0020】図2は、ラベル付加非データ構造データ作
成手段11により、ソースコード2内の非データ構造デ
ータにラベルを付加したラベル付加非データ構造データ
を含む配列データの一例を示す。これは、従来例の場合
と同様のリンク表現型のデータ型の一例であり、A〜C
等の配列データは、所定データ構造の部分であり、L〜
N等の配列データは、非データ構造データの部分である
。そして、データLの前後にはラベルS1,E1を、デ
ータMの前後にはラベルS2,E2を、また、データN
の前後にはラベルS3,E3をそれぞれ付加している。
FIG. 2 shows an example of array data including labeled non-data structure data in which a label is added to the non-data structure data in the source code 2 by the labeled non-data structure data creation means 11. This is an example of the data type of the link expression type similar to the conventional example, and A to C
etc. is a part of a predetermined data structure, and L~
Array data such as N is part of non-data structure data. Then, labels S1 and E1 are placed before and after data L, labels S2 and E2 are placed before and after data M, and data N
Labels S3 and E3 are added before and after, respectively.

【0021】図3は、リンカにより作成した図2に示す
配列データのテーブルの一例を示す図である。本例では
、従来例と同様に、所定データ構造の配列データAの先
頭番地は100であり、データのサイズは10バイト等
であることを示す。そして、非データ構造データLの前
ラベルS1の先頭番地は110、サイズは1バイト、後
ラベルE1の先頭番地は199、サイズは1バイト等で
あることを示す。
FIG. 3 is a diagram showing an example of the array data table shown in FIG. 2 created by the linker. In this example, as in the conventional example, the starting address of array data A having a predetermined data structure is 100, indicating that the data size is 10 bytes or the like. The first address of the front label S1 of the non-data structure data L is 110 and the size is 1 byte, and the first address of the rear label E1 is 199 and the size is 1 byte.

【0022】図4は、データ配置情報作成手段12によ
り、図3のテーブルのデータを変換して作成したラベル
付加非データ構造データのデータ配置情報の一例である
FIG. 4 is an example of data arrangement information of labeled non-data structure data created by the data arrangement information creation means 12 by converting the data in the table shown in FIG.

【0023】図4において、非データ構造データ領域は
、最初のものがS1〜E1であり、先頭番地が110、
最終番地が199というように示されている。
In FIG. 4, the first non-data structure data area is S1 to E1, and the first address is 110,
The final address is shown as 199.

【0024】図5は、本実施例のデバッガのアクセスデ
ータ検出手段13の動作フローを示すフローチャートで
ある。
FIG. 5 is a flowchart showing the operation flow of the access data detection means 13 of the debugger of this embodiment.

【0025】まず、ステップS1で、プログラムの実行
命令をマシン語からアセンブラに逆変換する作業である
逆アセンブルを行なう。
First, in step S1, disassembly is performed, which is a process of converting program execution instructions from machine language to assembler language.

【0026】次に、命令のアクセスするアドレスを点検
する(ステップS2)。
Next, the address accessed by the instruction is checked (step S2).

【0027】次に、アドレスが図4のデータ配置情報の
テーブルの範囲内であるかどうかを点検する(ステップ
S3)。
Next, it is checked whether the address is within the range of the data arrangement information table in FIG. 4 (step S3).

【0028】次に、アドレスがデータ配置情報のテーブ
ルの範囲内のアドレスであるかどうかの判定をする(ス
テップS4)。イエスの場合は、エラーであるのでステ
ップS5に進み、エラーメッセージを出力するとともに
プログラムカウンタ(以下PC)の該当命令名を表示し
て処理を中断する。ノーの場合は、ステップS6に進み
、その1つの命令を実行する。
Next, it is determined whether the address is within the range of the data location information table (step S4). If YES, it is an error, so the process proceeds to step S5, where an error message is output, the name of the corresponding command on the program counter (hereinafter referred to as PC) is displayed, and the process is interrupted. If no, the process advances to step S6 and the one instruction is executed.

【0029】次に、プログラムが終了したかどうかを判
定する(ステップS7)。イエスの場合は、処理を終了
する。ノーの場合は、ステップS1に戻り、次の命令に
ついて以上のフローと同様の作業を繰返す。
Next, it is determined whether the program has ended (step S7). If yes, the process ends. If no, the process returns to step S1 and the same operations as the above flow are repeated for the next command.

【0030】[0030]

【発明の効果】以上説明したように、本発明のデバッガ
は、非データ構造データの領域へのアクセスを検出する
機能を設けることにより、所定データ構造とその非デー
タ構造データとの複数のデータ構造のデータに属するア
ドレスの配置を把握する必要がなくなるという効果があ
る。また、プログラム実行時の所定データ構造からのオ
ーバランを効率的に発見することができるので、潜在的
なバグの発見が容易であるという効果がある。
As explained above, the debugger of the present invention has a function of detecting access to an area of non-data structure data, so that multiple data structures of a predetermined data structure and its non-data structure data can be detected. This has the effect that there is no need to know the arrangement of addresses belonging to the data. Furthermore, since overruns from a predetermined data structure during program execution can be efficiently discovered, potential bugs can be easily discovered.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明のデバッガの一実施例を示すブロック図
である。
FIG. 1 is a block diagram showing an embodiment of a debugger of the present invention.

【図2】ラベル付加非データ構造データを含む配列デー
タの一例を示す図である。
FIG. 2 is a diagram illustrating an example of array data including labeled non-data structure data.

【図3】リンカが作成する図2で示した配列データのテ
ーブルの一例を示す図である。
FIG. 3 is a diagram showing an example of a table of array data shown in FIG. 2 created by a linker.

【図4】図3で示したテーブルから作成したデータ配置
情報のテーブルの一例を示す図である。
FIG. 4 is a diagram showing an example of a table of data arrangement information created from the table shown in FIG. 3;

【図5】本実施例のデバッガにおけるアクセスデータ検
出手段の動作の一例を示す流れ図である。
FIG. 5 is a flow chart showing an example of the operation of access data detection means in the debugger of this embodiment.

【図6】主記憶装置上の配列データの一例を示す図であ
る。
FIG. 6 is a diagram showing an example of array data on a main storage device.

【図7】リンカが作成する図6で示した配列データのテ
ーブルの一例を示す図である。
FIG. 7 is a diagram showing an example of a table of array data shown in FIG. 6 created by a linker.

【図8】従来のデバッガの動作の一例を示す流れ図であ
る。
FIG. 8 is a flow chart showing an example of the operation of a conventional debugger.

【符号の説明】[Explanation of symbols]

1    デバッガ 2    ソースコード 11    ラベル付加非データ構造データ作成手段1
2    データ配置情報作成手段 13    アクセスデータ検出手段
1 Debugger 2 Source code 11 Labeled non-data structure data creation means 1
2 Data arrangement information creation means 13 Access data detection means

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  ソースコード内の予め定めたデータ構
造のデータに属さないデータである非データ構造データ
の前後をグローバル変数のダミーのデータであるラベル
ではさみ込んだラベル付加非データ構造データを作成す
るラベル付加非データ構造データ作成手段と、前記ラベ
ル付加非データ構造データの配置情報であるデータ配置
情報を作成するデータ配置情報作成手段と、前記データ
配置情報を照合し、アクセスするアドレスが前記ラベル
付加非データ構造データの領域の範囲内であることを検
出するアクセスデータ検出手段とを備えることを特徴と
するデバッガ。
Claim 1: Create labeled non-data structure data by sandwiching the front and back of non-data structure data, which is data that does not belong to data in a predetermined data structure in the source code, with labels, which are dummy data of global variables. a labeled non-data structure data creation means for creating labeled non-data structure data; a data arrangement information creation means for creating data arrangement information that is arrangement information of the labeled non-data structure data; A debugger comprising access data detection means for detecting that the access data is within the range of additional non-data structure data.
JP3014124A 1991-02-05 1991-02-05 Debugger Pending JPH04248634A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3014124A JPH04248634A (en) 1991-02-05 1991-02-05 Debugger

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3014124A JPH04248634A (en) 1991-02-05 1991-02-05 Debugger

Publications (1)

Publication Number Publication Date
JPH04248634A true JPH04248634A (en) 1992-09-04

Family

ID=11852379

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3014124A Pending JPH04248634A (en) 1991-02-05 1991-02-05 Debugger

Country Status (1)

Country Link
JP (1) JPH04248634A (en)

Similar Documents

Publication Publication Date Title
US6964036B2 (en) Descriptive variables while debugging
US5956479A (en) Demand based generation of symbolic information
US20080127113A1 (en) Method and system for implementing watchpoints
US7178135B2 (en) Scope-based breakpoint selection and operation
JP2000305809A (en) Memory access analyzing method, memory access tracing device, and computer-readable recording medium
US7240334B1 (en) Methods, systems, and computer program products for deferred computer program tracing
CA2418670A1 (en) Method and system for generating executable code for formatiing and printing complex data structures
US20080010536A1 (en) Breakpoints with Separate Conditions
JPH03188535A (en) Assembly language programming error detecting process
US20030204837A1 (en) Software debugger having a monitor for monitoring conditional statements within a software program
US20070150866A1 (en) Displaying parameters associated with call statements
US6279104B1 (en) Debugging system for parallel processed program and debugging method thereof
US20020129336A1 (en) Automatic symbol table selection in a multi-cell environment
US6983454B2 (en) Extended “run to” function
JPH04248634A (en) Debugger
JP3461185B2 (en) Method and apparatus for registering source code line number to load module
JPH0510692B2 (en)
JP3085309B2 (en) Debug system
JPS6113615B2 (en)
JP3120434B2 (en) Program operation analysis method
CN115292076A (en) Linux system kernel debugging device and method
JPH04358232A (en) Function testing method for information processor
JPS60179847A (en) Matching check system between real array and virtual array
US7627859B2 (en) Method for configuring non-script language library files to be run as scripts
JPH04540A (en) Debugging device