Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3085309B2 - Debug system - Google Patents
[go: Go Back, main page]

JP3085309B2 - Debug system - Google Patents

Debug system

Info

Publication number
JP3085309B2
JP3085309B2 JP01301539A JP30153989A JP3085309B2 JP 3085309 B2 JP3085309 B2 JP 3085309B2 JP 01301539 A JP01301539 A JP 01301539A JP 30153989 A JP30153989 A JP 30153989A JP 3085309 B2 JP3085309 B2 JP 3085309B2
Authority
JP
Japan
Prior art keywords
variable
register
debugging
information
allocated
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.)
Expired - Fee Related
Application number
JP01301539A
Other languages
Japanese (ja)
Other versions
JPH03161842A (en
Inventor
浩司 松下
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP01301539A priority Critical patent/JP3085309B2/en
Publication of JPH03161842A publication Critical patent/JPH03161842A/en
Application granted granted Critical
Publication of JP3085309B2 publication Critical patent/JP3085309B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】 〔概要〕 レジスタ/領域割付けされた変数のデバッグを行うデ
バッグシステムに関し、 変数および変数の実体に割付けたレジスタ/領域をデ
バッグ情報として予め生成して保存しておき、デバッグ
時に中断点でこれを参照して該当するレジスタ/領域の
値を変更などし、利用者が最適化による変数の実体の場
所を意識することなく正しいデバッグを行い得るように
することを目的とし、 最適化によって変数に固定的に割付けたレジスタ/領
域および特定の時期だけ変数の実体に割付けたレジスタ
/領域の情報をデバッグ情報として予め生成して保存
し、デバッグ時にソースプログラムを展開した命令列の
中断した位置で、上記デバッグ情報を参照して変数およ
び変数の実体に割付けられているレジスタ/領域をアク
セスし、デバッグするように構成する。
DETAILED DESCRIPTION OF THE INVENTION [Overview] Regarding a debug system for debugging a variable assigned to a register / area, a register / area assigned to a variable and an entity of the variable is generated and stored as debug information in advance, and debugging is performed. The purpose is to change the value of the corresponding register / area by referring to this at the point of interruption sometimes, so that the user can perform correct debugging without being conscious of the actual location of the variable by optimization. The information of the registers / areas fixedly assigned to the variables by optimization and the registers / areas assigned to the entity of the variables only at a specific time is generated and stored as debug information in advance, and the instruction sequence in which the source program is expanded during debugging is stored. At the interrupted position, refer to the debug information above to access the register / area assigned to the variable and the entity of the variable. And configure it for debugging.

〔産業上の利用分野〕[Industrial applications]

本発明は、レジスタ/領域割付けされた変数のデバッ
グを行うデバッグシステムに関するものである。
The present invention relates to a debug system for debugging variables assigned to registers / areas.

〔従来の技術と発明が解決しようとする課題〕[Problems to be solved by conventional technology and invention]

従来、最適化によってある特定の時期だけ領域の他に
レジスタを割付ける変数についてデバッグする場合、固
定的な領域あるいはレジスタだけを意識していたため、
局所的にレジスタを割り付けた変数について正しくデバ
ッグし得ないという問題があった。例えば第4図に示す
ように、文3の矢印の位置でプログラムの実行を中断し
ている時に、変数Aをデバッガの機能によってその値を
変更しようとする場合、変数Aに割りつけられた領域の
みの値を変更しても、このときに変数Aの結果に対して
最適化により一時的に図示のようにレジスタreg1も割付
けられているため、文の結果に反映させることができ
ず、正しくデバッグできないという問題があった。
Conventionally, when debugging a variable that allocates registers in addition to an area only at a specific time due to optimization, since only fixed areas or registers were conscious,
There is a problem that variables cannot be debugged correctly for variables to which registers are assigned locally. For example, as shown in FIG. 4, when the execution of the program is interrupted at the position of the arrow in statement 3 and the value of the variable A is to be changed by the function of the debugger, the area allocated to the variable A Even if the value of only A is changed, at this time, the result of the variable A is temporarily allocated by optimization to the register reg1 as shown in the figure, so that the result cannot be reflected in the statement result. There was a problem that debugging was not possible.

本発明は、変数および変数の実体に割付けたレジスタ
/領域をデバッグ情報として予め生成して保存してお
き、デバッグ時に中断点でこれを参照して該当するレジ
スタ/領域の値を変更などし、利用者が最適化による変
数の実体の場所を意識することなく正しいデバッグを行
い得るようにすることを目的としている。
According to the present invention, a register / region allocated to a variable and an entity of the variable is generated and stored in advance as debug information, and the value of the register / region is changed by referring to the register / region at a break point during debugging. The purpose is to enable users to perform correct debugging without being conscious of the actual location of variables through optimization.

〔課題を解決する手段〕[Means to solve the problem]

第1図は、本発明の原理構成図を示す。 FIG. 1 shows a principle configuration diagram of the present invention.

第1図において、ソースプログラム1は、デバッグを
行おうとする展開前のプログラムである。
In FIG. 1, a source program 1 is a program before development to be debugged.

展開された命令列2は、ソースプログラム1を展開し
た命令列であって、デバッグを行おうとする機械語のプ
ログラムである。
The expanded instruction sequence 2 is an instruction sequence obtained by expanding the source program 1 and is a machine language program to be debugged.

デバッグ情報3は、最適化によって変数に固定的に割
付けたレジスタ/領域および特定の時期だけ変数の実体
に割付けたレジスタ/領域の情報を予め生成して保存し
たものである。ここでは、特定の時期(例えば文2から
文3までの時期)だけ変数の実体に割り付けたレジスタ
のみを示す。
The debug information 3 is information in which registers / areas fixedly allocated to variables by optimization and registers / areas allocated to the substance of variables only at a specific time are generated and stored in advance. Here, only the registers allocated to the entity of the variable only at a specific time (for example, the time from statement 2 to statement 3) are shown.

〔作用〕[Action]

本発明は、第1図に示すように、予めデバッグ情報3
を保存しておき、デバッグ時にソースプログラム1を展
開した命令列2の中断した位置で、デバッグ情報3を参
照して変数および変数の実体に割付けられているレジス
タ/領域を見つけ出してこれらをアクセスし、デバッグ
するようにしている。
According to the present invention, as shown in FIG.
Is stored, and at the interrupted position of the instruction sequence 2 in which the source program 1 has been expanded at the time of debugging, the debug information 3 is referenced to find a register / region allocated to the variable and the entity of the variable, and access these. I'm trying to debug.

従って、デバッガを用いてプログラムの実行を中断さ
せて変数の値を変更などしようとするときに、保存して
おいたデバッグ情報3を参照して該当するレジスタ/領
域の値を変更などすることにより、利用者が最適化によ
る変数の実体の場所を意識することなく、正しいデバッ
グを行うことが可能となる。
Therefore, when trying to change the value of a variable by interrupting the execution of a program using a debugger, the value of the corresponding register / area is changed by referring to the stored debug information 3. Thus, correct debugging can be performed without the user being aware of the actual location of the variable due to optimization.

〔実施例〕 次に、第1図から第3図を用いて本発明の1実施例の
構成および動作を順次詳細に説明する。
Embodiment Next, the configuration and operation of an embodiment of the present invention will be sequentially described in detail with reference to FIG. 1 to FIG.

第1図において、ソースプログラム1は、デバッグを
行おうとする展開前のプログラムであって、文1(A=
1)、文2(B=2)、文3(C=A+B)から構成さ
れている。
In FIG. 1, a source program 1 is a program before development to be debugged, and a statement 1 (A =
1), sentence 2 (B = 2), and sentence 3 (C = A + B).

展開された命令列2は、ソースプログラム1を展開し
た命令列であって、ソースプログラム1の文1、文2、
文3を図示のように展開した機械語の命令列である。例
えば文1(A=1、1を変数Aに代入するというソース
プログラム)を、 LOAD reg1,1 ・・・・・・・・・・・・・(1) STORE reg1,A ・・・・・・・・・・・・・(2) に展開する。ここで、(1)は1をレジスタreg1にロー
ド、(2)はレジスタreg1の内容を変数Aに割り付けら
れた領域にストアするという命令列である。以下同様に
文2、文3を展開する。
The expanded instruction sequence 2 is an instruction sequence obtained by expanding the source program 1.
This is a machine language instruction sequence obtained by expanding sentence 3 as illustrated. For example, statement 1 (a source program that assigns A = 1, 1 to variable A) is loaded as LOAD reg1,1 (1) STORE reg1, A・ ・ ・ ・ ・ ・ ・ ・ ・ (2) Here, (1) is an instruction sequence for loading 1 into the register reg1, and (2) is an instruction sequence for storing the contents of the register reg1 in the area allocated to the variable A. Hereinafter, sentences 2 and 3 are similarly expanded.

デバッグ情報3は、翻訳時の最適化によって変数に固
定的に割付けたレジスタ/領域および特定の時期だけ変
数の実体に割付けたレジスタ/領域の情報を予め生成し
て保存したものである。ここでは、図示のようにAを文
2〜3までreg1に割り付けたという情報、および図示し
ないがA、Bを領域にそれぞれ割り付けたという情報を
生成して保存している。従って、デバッガによって文3
で矢印を用いて示した位置で中断したとき、変数Aの値
を変更しようとするとき、デバッグ情報3を参照してA
の領域の内容および変数Aの実体が存在するレジスタre
g1の内容の両者を変更などすることにより、正しくデバ
ッグすることができる。
The debug information 3 is information in which registers / areas fixedly assigned to variables by optimization at the time of translation and registers / areas assigned to entities of variables only at specific times are generated and stored in advance. Here, as shown in the figure, information that A has been assigned to reg1 for sentences 2 to 3 and information (not shown) that A and B have been respectively assigned to areas are generated and stored. Therefore, statement 3
When trying to change the value of the variable A when interrupted at the position indicated by the arrow with
Register in which the contents of the area and the substance of the variable A exist
By changing both of the contents of g1, you can debug correctly.

第2図は、本発明に係るデバッグ情報例を示す。 FIG. 2 shows an example of debug information according to the present invention.

第2図(イ)は、ソースプログラム1およびこのソー
スプログラム1の展開された命令列2を示す。
FIG. 2A shows a source program 1 and an expanded instruction sequence 2 of the source program 1.

第2図(ロ)は、デバッグ情報3を示す。 FIG. 2B shows the debug information 3.

データの情報は、第2図(イ)文1、文2、文3を
、、に対応づけた変数名、変数の属性、レジスタ
/領域の割付け情報などを持っている。
The data information includes variable names, variable attributes, register / area allocation information, and the like corresponding to the statements 1, 2, and 3 in FIG.

文の情報は、第2図(イ)文1、文2、文3の順番に
、、としてソースプログラム1上の行番号、展開
された命令列2のオフセットアドレスの情報などを持っ
ている。
The statement information includes, in the order of statement 1, statement 2, statement 3 in FIG. 2 (a), the line number on the source program 1, the offset address of the expanded instruction string 2, and the like.

レジスタ割付け情報は、局所的に変数の割付け先が変
わる旨の情報を持っている。ここで“Aがレジスタreg1
に2〜3まで”は、変数Aの実体がレジスタreg1に文2
から文3まで割り付けられているという情報である。
尚、変数Aの領域への固定的な割付けは、データの情報
が持っている。
The register allocation information has information indicating that the allocation destination of the variable is locally changed. Here, "A is the register reg1
2 to 3 ”means that the substance of variable A is stored in register reg1 in statement 2.
It is the information that is assigned from to.
The fixed assignment of the variable A to the area is held by data information.

次に、第3図フローチャートに示す順序に従い、第2
図を参照して本発明の1実施例の構成の動作を具体的に
説明する。
Next, in the order shown in the flowchart of FIG.
The operation of the configuration of the embodiment of the present invention will be specifically described with reference to the drawings.

第3図において、は、文の情報より、現在どの文に
中断しているかを調べる。例えば第2図(イ)中断と記
載した位置で中断している場合、第2図(ロ)デバッグ
情報3のうちの文の情報のから文の先頭で中断してい
ることが判明する(具体的には中断点のオフセットアド
レスが含まれる文をの文3として見つけ出す)。
In FIG. 3, it is checked which sentence is currently interrupted from the sentence information. For example, in the case where the program is interrupted at the position described as “interrupted” in FIG. 2 (a), it is determined from the information of the statement in the debug information 3 that the program is interrupted at the beginning of the sentence (specifically, FIG. 2 (b)). Specifically, a sentence including the offset address of the interruption point is found as sentence 3).

は、レジスタ割付け情報より、変数の実体がレジス
タ上にあるか調べる。例えば第2図(ロ)レジスタ割付
け情報を参照し、変数A、変数Bについてレジスタに割
りつけられているか調べると、変数Aが現在中断してい
る文3でレジスタreg1に割付けられていることが判明す
る。従って、変数Aについてでレジスタに割付けられ
ていると判明したので、レジスタ(レジスタreg1)の内
容を変更すると共にで領域の内容を変更する。一方、
変数Bについてでレジスタに割付けられていないと判
明したので、で領域の内容のみを変更する。
Checks whether the substance of the variable is in the register from the register allocation information. For example, referring to the register allocation information in FIG. 2 (b), it is checked whether variables A and B are allocated to the registers. As a result, it is found that the variable A is allocated to the register reg1 by the statement 3 which is currently suspended. Prove. Therefore, since it is determined that the variable A is assigned to the register, the contents of the register (register reg1) are changed and the contents of the area are changed. on the other hand,
Since it has been determined that the variable B has not been allocated to the register, only the contents of the area are changed.

以上のように、デバッグ時に中断点で、デバッグ情報
3を参照して変数の実体が一時的にレジスタに割付けら
れていると判明したときに、この判明したレジスタの内
容および固定的に割付けられている領域の両者を変更す
ることにより、正しく変数の内容を変更してデバッグす
ることが可能となる。
As described above, when it is determined that the substance of the variable is temporarily allocated to the register by referring to the debug information 3 at the break point at the time of debugging, the contents of the determined register and the fixed allocation are performed. By changing both of the areas, it is possible to correctly change the contents of the variables and debug.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明によれば、デバッガを用
いてプログラムの実行を中断させて変数の値を変更など
しようとするときに、保存しておいたデバッグ情報3を
参照して変数に固定的に割付けられたレジスタ/領域お
よび一時的に変数の実体に割付けられたレジスタ/領域
の両者をアクセスする構成を採用しているため、利用者
が最適化による変数の実体の場所を意識することなく、
正しいデバッグを容易に行うことができる。
As described above, according to the present invention, when the execution of a program is interrupted using a debugger and the value of a variable is to be changed, the stored debug information 3 is referred to and fixed to the variable. The user is conscious of the location of the variable entity by optimization because it employs a configuration that accesses both the register / area temporarily allocated and the register / area temporarily allocated to the entity of the variable. Not
Correct debugging can be easily performed.

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明の原理構成図、第2図は本発明に係るデ
バッグ情報例、第3図は本発明の動作説明フローチャー
ト、第4図は従来技術の説明図を示す。 図中、1はソースプログラム、2は展開された命令列、
3はデバッグ情報を表す。
FIG. 1 is a block diagram showing the principle of the present invention, FIG. 2 is an example of debug information according to the present invention, FIG. 3 is a flowchart for explaining the operation of the present invention, and FIG. In the figure, 1 is a source program, 2 is an expanded instruction sequence,
3 represents debug information.

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 11/28,9/44 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 11 / 28,9 / 44

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】プログラムのデバッグを行うデバッグシス
テムにおいて、 プログラム内の各変数がどのレジスタにどの範囲で割付
られるかのレジスタ割付情報を含むデバッグ情報を記憶
する記憶手段と、 デバッグ時に、プログラム内のどの位置で中断されてい
るかを検出する検出手段と、 デバッグにより変数領域の内容を変更する場合、前記レ
ジスタ割付情報に基づいて当該中断位置で当該変数レジ
スタに割り付けられていると判定されるときは、当該レ
ジスタの内容と共に、当該変数の領域の内容を変更する
デバッグ手段とを有することを特徴とするデバッグシス
テム。
1. A debugging system for debugging a program, comprising: storage means for storing debug information including register allocation information indicating to which register each variable is allocated to which register in the program; Detecting means for detecting at which position the interrupt is interrupted; and when changing the contents of the variable area by debugging, when it is determined that the variable register is allocated to the variable register at the interrupted position based on the register allocation information, Debugging means for changing the contents of the variable area together with the contents of the register.
JP01301539A 1989-11-20 1989-11-20 Debug system Expired - Fee Related JP3085309B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01301539A JP3085309B2 (en) 1989-11-20 1989-11-20 Debug system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP01301539A JP3085309B2 (en) 1989-11-20 1989-11-20 Debug system

Publications (2)

Publication Number Publication Date
JPH03161842A JPH03161842A (en) 1991-07-11
JP3085309B2 true JP3085309B2 (en) 2000-09-04

Family

ID=17898156

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01301539A Expired - Fee Related JP3085309B2 (en) 1989-11-20 1989-11-20 Debug system

Country Status (1)

Country Link
JP (1) JP3085309B2 (en)

Also Published As

Publication number Publication date
JPH03161842A (en) 1991-07-11

Similar Documents

Publication Publication Date Title
JP3612294B2 (en) Debugging method and debugging device
Olsson et al. A dataflow approach to event‐based debugging
JPH06290084A (en) Method and equipment for restructuring symbol definition and computer system used for them
CN101482845A (en) Method and system for calling instant debugger
JPH0254337A (en) Data processing system for facilitating generation of executable image
US5062039A (en) Sharing of workspaces in interactive processing using workspace name tables for linking of workspaces
US20020129336A1 (en) Automatic symbol table selection in a multi-cell environment
JPH10214203A (en) Information processor
JP3085309B2 (en) Debug system
JP3372106B2 (en) Program debug device
JPS6220583B2 (en)
JP2865291B2 (en) Module connection control method
JPH07200350A (en) Software debugger
JPH10240581A (en) CPU time measuring device
JPH0283749A (en) Microprocessor internal interrupt control method
JP2502128B2 (en) Compiler device
JPH0652507B2 (en) Microcomputer development equipment
JP2591818B2 (en) Auxiliary function selection control method
Goeckelmann et al. Bootstrapping and Startup of an object-oriented Operating System “
JP2000227861A (en) Method and device for debugging
JP3098501B2 (en) Source step execution method and apparatus
JP2002189613A (en) Software development support apparatus, software development support method, and computer-readable recording medium storing software development support program
JPH03164835A (en) Compilation method for global variable processing in interpreted language processing systems
Cholerton Ada for closely coupled multiprocessor targets
JPH01188957A (en) Program exception processing system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees