JP2000010793A - OS macro issue PC determination method - Google Patents
OS macro issue PC determination methodInfo
- Publication number
- JP2000010793A JP2000010793A JP10174340A JP17434098A JP2000010793A JP 2000010793 A JP2000010793 A JP 2000010793A JP 10174340 A JP10174340 A JP 10174340A JP 17434098 A JP17434098 A JP 17434098A JP 2000010793 A JP2000010793 A JP 2000010793A
- Authority
- JP
- Japan
- Prior art keywords
- macro
- stack
- disp
- task
- address
- 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
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明はサブルーチンコール
及びエクセプション発生時のPCがスタックに積まれる
計算機システムにおいて、ユーザプログラムの仕事の単
位であるタスクからOSに対して処理を依頼するための
OSマクロが発行された時に、OSマクロを発行したタ
スクのPCを知るための判定方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer system in which a PC is loaded on a stack when a subroutine call and an exception occur, and an OS macro for requesting the OS from a task, which is a unit of work of a user program, to the OS. The present invention relates to a determination method for knowing a PC of a task that has issued an OS macro when issued.
【0002】[0002]
【従来の技術】一般に計算機システムにおいては、ユー
ザプログラムはタスクと呼ばれる仕事の単位で動作し、
タスクはOSマクロと呼ばれるOS機能を使いながらそ
の処理を進めていく。このOSマクロへリンクするため
に、マクロライブラリと呼ばれるサブルーチンが用意さ
れており、各タスクはこのマクロライブラリをコールす
ることによりOSマクロへリンク、すなわちOSに処理
を依頼することができる。ここで、OSマクロは依頼さ
れた処理に誤りがないかをチェックし、誤りがあれば誤
り箇所を早期かつ容易に解析できるように、OSマクロ
のコールPCをメッセージに出力してユーザに知らせ
る。2. Description of the Related Art Generally, in a computer system, a user program operates in units of work called tasks.
The task advances its processing while using an OS function called an OS macro. To link to the OS macro, a subroutine called a macro library is prepared, and each task can link to the OS macro, that is, request the OS to perform processing by calling the macro library. Here, the OS macro checks whether there is an error in the requested processing, and if there is an error, notifies the user by outputting a call PC of the OS macro to a message so that the error location can be analyzed quickly and easily.
【0003】従来の計算機システムにおいて、上記PC
の出力例を図2を用いて説明する。ここでスタック40
とは、メインプログラムからサブルーチンをコールした
ときの戻りPCの格納や、パラメータの受け渡しエリ
ア、およびプログラム内で使うワークエリア等として使
用されるエリアで、使うときに積み込み、使い終わった
ら減らしていく。スタックエリアの使用されている領域
は常に変化しており、どこまで使っているかをスタック
ポインタSPで管理するというものである。In a conventional computer system, the PC
Will be described with reference to FIG. Here the stack 40
An area is used to store a return PC when a subroutine is called from the main program, an area for transferring parameters, a work area used in the program, and the like. The used area of the stack area is constantly changing, and the extent to which the stack area is used is managed by the stack pointer SP.
【0004】計算機システムでタスクはユーザレベル
1,OSはカーネルレベル2というレベルで動作する。
タスク10はOSマクロにリンクするために、まず、サ
ブルーチンとして用意してあるマクロライブラリ20を
サブルーチンコール11,12,13とする。マクロラ
イブラリ20は、ユーザレベル1からカーネルレベル2
へ移行するための特別な命令trap22を実行し、エクセ
プションを発生(60)させることによりOSマクロ3
0へリンクする。このときのサブルーチンコールPC
や、エクセプション発生PCは、スタック40に積まれ
る。In a computer system, tasks operate at a user level of 1 and an OS at a kernel level of 2.
In order to link the task 10 to the OS macro, first, the macro library 20 prepared as a subroutine is called subroutine calls 11, 12, and 13. The macro library 20 is composed of user level 1 to kernel level 2
Executes the special instruction trap22 to move to OS macro 3 and generates an exception (60) to enable OS macro 3
Link to 0. Subroutine call PC at this time
Also, the exception generation PC is stacked on the stack 40.
【0005】すなわち、OSマクロ発行11または12
または13にてマクロライブラリをコールしたときのP
C(PC1またはPC2またはPC3)はスタックに積
まれ(46)、スタックをどこまで使っているかを示す
ポインタSP(スタックポインタ)(41)は(42−
1)を指す。That is, OS macro issuance 11 or 12
Or P when the macro library is called in step 13
C (PC1, PC2, or PC3) is stacked on the stack (46), and a pointer SP (stack pointer) (41) indicating how much the stack is used is (42-
Refers to 1).
【0006】次にtrap命令が実行されたときのPC4
は、マクロライブラリがワークとして使用した次のスタ
ックエリア43に積まれ、SPは(42−2)を指す。
OSマクロ30は依頼された処理の誤りが検出したとき
(31)、本来であればマクロ発行元である11または
12または13を知るためのPC(PC1またはPC2
またはPC3)をメッセージに出力33すべきである
が、SPは既に(42−2)まで進んでおり、OSマクロ
30では、SP(42−2)しかわからず、実際のスタ
ックにどう積まれているのか43,45,46の状態な
のかどうかはわからない。Next, PC4 when the trap instruction is executed
Is stored in the next stack area 43 used as a work by the macro library, and SP indicates (42-2).
When the OS macro 30 detects an error in the requested processing (31), the PC (PC1 or PC2) for knowing the macro issuer 11 or 12 or 13 originally.
Or PC3) should be output 33 in the message, but the SP has already progressed to (42-2), and the OS macro 30 knows only SP (42-2), and how it is loaded on the actual stack It is not known whether it is in the state of 43, 45 or 46.
【0007】したがって、このままではPC1またはP
C2またはPC3を覚えているスタックエリア46のア
ドレスを得る手段がなく、マクロライブラリのtrap実行
PC(PC4)をメッセージに出力するしかない。これ
では、タスク10が、同一のOSマクロを発行している
とき11,12,13、OSマクロで誤りを検出しても
メッセージ出力されるPCは、常にマクロライブラリの
PC(PC4)となりユーザは異常となったOSマクロ
発行が11なのか12なのか13なのかを知ることが困
難である。Therefore, PC1 or P
There is no way to obtain the address of the stack area 46 that remembers C2 or PC3, and there is no choice but to output the trap execution PC (PC4) of the macro library to the message. In this case, when the task 10 issues the same OS macro 11, 12, 13, even if an error is detected in the OS macro, the PC from which a message is output is always the macro library PC (PC4), and the user It is difficult to know whether the abnormal OS macro issuance is 11, 12, or 13.
【0008】[0008]
【発明が解決しようとする課題】前記の従来方法による
OSマクロ発行PC判定方式では、OSマクロは依頼さ
れた処理の誤りを検出したとき、メッセージで出力され
るリターンPCはマクロライブラリを指してしまい、ユ
ーザはタスク内で複数の同一のOSマクロを発行してい
るとき、異常となったマクロ発行箇所を知ることができ
ないという問題がある。In the OS macro issuing PC determination method according to the conventional method described above, when the OS macro detects an error in the requested processing, the return PC output as a message points to the macro library. However, when a user issues a plurality of identical OS macros in a task, there is a problem that the user cannot know the location of the abnormal macro issuance.
【0009】以上のことにより本発明では、タスクから
複数の同一OSマクロがマクロライブラリ経由で発行さ
れた場合にも本来のOSマクロ発行箇所をメッセージ中
に出力することにより、ユーザに異常となったマクロ発
行箇所を明確に知らせ、異常解析を容易とさせることを
課題とする。As described above, according to the present invention, even when a plurality of identical OS macros are issued from a task via a macro library, the original OS macro issuance location is output in the message, thereby causing an abnormality to the user. It is an object of the present invention to clearly notify a macro issuance location and facilitate anomaly analysis.
【0010】[0010]
【課題を解決するための手段】OSマクロ30におい
て、目的とするPC11,12,13がスタックのどこ
に格納されているかを知るための仕掛けとして、マクロ
ライブラリから、trapにてOSマクロへリンクする直前
に、現状のスタックポインタからタスク内でOSマクロ
発行した際のPCが格納されているスタックアドレスま
での相対位置を示すdispをスタックへ格納することによ
り、スタック上でOSマクロ発行PCがたどれるように
する。As a mechanism for knowing where the target PCs 11, 12, and 13 are stored in the stack in the OS macro 30, immediately before linking from the macro library to the OS macro by a trap. The disp indicating the relative position from the current stack pointer to the stack address where the PC at the time of issuing the OS macro in the task is stored in the stack, so that the OS macro issuing PC can be traced on the stack. I do.
【0011】[0011]
【発明の実施の形態】以下に本発明の実施例を図1を用
いて説明する。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to FIG.
【0012】タスク10がマクロライブラリ20をコー
ルするまでは従来と同じである。本実施例では、マクロ
ライブラリ20はtrap命令を実行22する直前に、マク
ロライブラリコール元であるタスクのPC(PC1また
はPC2またはPC3)が格納してあるエリア46のア
ドレスまで現状のスタックポインタからどれだけ離れて
いるかを計算し、その値をdispとして現状のSPが指す
(42−2)のアドレスに格納(21)したあと、trap
命令を実行する(22)。The operation is the same as before until the task 10 calls the macro library 20. In this embodiment, immediately before executing 22 the trap instruction, the macro library 20 determines from the current stack pointer up to the address of the area 46 where the PC (PC1, PC2, or PC3) of the task that is the macro library call source is stored. Is calculated, and the value is stored as a disp in the address (42-2) indicated by the current SP (21), and then trap
Execute the instruction (22).
【0013】これにより、OSマクロ30は依頼された
処理の誤りを検出したとき(31)、現状のSPが指す
(42−3)のアドレス+4番地のエリア44に格納さ
れているdispを取り出し、そこからdispで示される相対
値分離れたところのエリア46を読み出すことによりP
C1またはPC2またはPC3を得ることができる。Thus, when the OS macro 30 detects an error in the requested processing (31), the OS macro 30 extracts the disp stored in the area 44 of the address +4 address indicated by the current SP (42-3), and By reading out the area 46 separated from the relative value indicated by disp therefrom, P
C1 or PC2 or PC3 can be obtained.
【0014】これにより、OSマクロ発行元であるタス
クのPC(PC1またはPC2またはPC3)をメッセ
ージに出力することが可能となる。従って、タスク10
が、同一のマクロ発行11,12,13を行っていると
きでも、OSマクロで誤りを検出した場合メッセージ出
力されるPCは、マクロ発行元であるタスクのPCとな
りユーザは異常となったマクロ発行箇所を明確に知るこ
とが可能となり、プログラム異常の解析が容易かつ迅速
に行うことができる。Thus, it becomes possible to output the PC (PC1, PC2, or PC3) of the task from which the OS macro is issued as a message. Therefore, task 10
However, even when the same macro issuance 11, 12, and 13 are performed, if an error is detected in the OS macro, the PC that outputs a message becomes the PC of the task that is the macro issuance source, and the user issues the abnormal macro issuance. The location can be clearly known, and the program abnormality can be easily and quickly analyzed.
【0015】[0015]
【発明の効果】以上説明したように、本発明を用いれ
ば、スタックに格納したdisp情報より、OSマクロ内で
マクロ発行元タスクのPCを得ることができる。マクロ
発行元のPCをメッセージに出力することで、ユーザは
発行元のPCを容易に知ることが可能となり、プログラ
ム異常の解析が容易かつ迅速に行うことができる。As described above, according to the present invention, it is possible to obtain the PC of the macro issuing task in the OS macro from the disp information stored in the stack. By outputting the macro issuing PC to the message, the user can easily know the issuing PC, and the analysis of the program abnormality can be easily and quickly performed.
【図1】disp情報を使用したPC判定方式の説明図。FIG. 1 is an explanatory diagram of a PC determination method using disp information.
【図2】従来計算機システムにおいてのPC判定方式の
説明図。FIG. 2 is an explanatory diagram of a PC determination method in a conventional computer system.
1…ユーザレベル、2…カーネルレベル、10…タス
ク、11〜13…OSマクロ発行、20…マクロライブ
ラリ、21…disp情報格納、22…トラップ、30…マ
クロ、31…異常判定、32…エラーメッセージ出力、
40…スタック、41…スタックポインタ、42−1〜
42−3…スタックポインタの指すスタック、43…tr
ap実行PC、44…disp情報、45…マクロライブラリ
ワークエリア、46…マクロライブラリ実行PC、47
…dispの指すスタック。DESCRIPTION OF SYMBOLS 1 ... User level, 2 ... Kernel level, 10 ... Task, 11-13 ... OS macro issuance, 20 ... Macro library, 21 ... Disp information storage, 22 ... Trap, 30 ... Macro, 31 ... Abnormality determination, 32 ... Error message output,
40: stack, 41: stack pointer, 42-1
42-3: Stack pointed by stack pointer, 43 ... tr
ap execution PC, 44 disp information, 45 macro library work area, 46 macro library execution PC, 47
... Stack pointed to by disp.
───────────────────────────────────────────────────── フロントページの続き (72)発明者 桑原 啓二 茨城県日立市大みか町五丁目2番1号 株 式会社日立製作所大みか工場内 (72)発明者 小林 淳一 茨城県日立市大みか町五丁目2番1号 日 立プロセスコンピュータエンジニアリング 株式会社内 Fターム(参考) 5B098 BA05 BA06 GA02 GA04 JJ06 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Keiji Kuwahara 5-2-1 Omikacho, Hitachi City, Ibaraki Prefecture Inside the Omika Plant, Hitachi, Ltd. (72) Inventor Junichi Kobayashi 5-chome, Omikacho, Hitachi City, Ibaraki Prefecture No. 1 Hitachi Process Computer Engineering Co., Ltd. F-term (reference) 5B098 BA05 BA06 GA02 GA04 JJ06
Claims (1)
生時のPC(プログラムカウンタ)がスタックに積まれ
る計算機で、かつ、ユーザプログラムの仕事の単位であ
るタスクから、OSマクロと呼ばれるOSの機能にリン
クするマクロライブラリと呼ばれるサブルーチンが用意
されている計算機システムにおいて、マクロライブラリ
がエクセプションを発生させ、OSにリンクする直前に
マクロライブラリをコールしたタスクのPCが格納され
ているスタックエリアがどこにあるかを示すdispをスタ
ックに覚えることで、OSマクロがマクロ発行元のユー
ザタスクのPCを得ることができることを特徴とするO
SマクロPC判定方式。1. A macro library which is a computer on which a PC (program counter) at the time of occurrence of a subroutine call and an exception is stacked and which is linked from a task which is a unit of work of a user program to an OS function called an OS macro. In a computer system that has a subroutine called, the macro library generates an exception, and a disp indicating where the stack area where the PC of the task that called the macro library is stored immediately before linking to the OS is stored. , The OS macro can obtain the PC of the user task that issued the macro.
S macro PC determination method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10174340A JP2000010793A (en) | 1998-06-22 | 1998-06-22 | OS macro issue PC determination method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10174340A JP2000010793A (en) | 1998-06-22 | 1998-06-22 | OS macro issue PC determination method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2000010793A true JP2000010793A (en) | 2000-01-14 |
Family
ID=15976936
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10174340A Pending JP2000010793A (en) | 1998-06-22 | 1998-06-22 | OS macro issue PC determination method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2000010793A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8175843B2 (en) * | 2008-11-14 | 2012-05-08 | Boehringer Ingelheim Pharma Gmbh & Co. Kg | Computer-implemented methods for evaluating, summarizing and presenting data on stability of drug substances and drug products and software-modified computers for such methods |
-
1998
- 1998-06-22 JP JP10174340A patent/JP2000010793A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8175843B2 (en) * | 2008-11-14 | 2012-05-08 | Boehringer Ingelheim Pharma Gmbh & Co. Kg | Computer-implemented methods for evaluating, summarizing and presenting data on stability of drug substances and drug products and software-modified computers for such methods |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3365576B2 (en) | Object execution method and apparatus | |
| US7415699B2 (en) | Method and apparatus for controlling execution of a child process generated by a modified parent process | |
| JP2685747B2 (en) | Information processing device | |
| US20100115531A1 (en) | Method and system for associating parameters of containers and contained objects | |
| JP2883784B2 (en) | Microcomputer | |
| JPH0114611B2 (en) | ||
| JP2009199618A (en) | System and method for providing access to user interface information | |
| JPH0756866A (en) | Transaction management method and apparatus and computer program product | |
| CN103052941A (en) | Illegal mode change handling | |
| JP2001527234A (en) | Call mechanism for static and dynamic linked functions in an object-oriented controller using a heterogeneous development tool set | |
| WO2005055051A2 (en) | Determining the possibility of adverse effects arising from a code change | |
| US5978587A (en) | Method for propagating source code locations into objects in a compiler | |
| AU2003201954B2 (en) | Accessibility system events mechanism and method | |
| US20040221203A1 (en) | Method and system for handling an unexpected exception generated by an application | |
| JPH07175654A (en) | Context specifications in callback-style programming | |
| US5848272A (en) | Object-oriented intra-process messaging arrangement for windows environments | |
| JP2000010793A (en) | OS macro issue PC determination method | |
| CN104007956B (en) | A kind of operating system progress recognizing tracking and the method and apparatus of acquisition of information | |
| US20040268297A1 (en) | Generating a model of software in execution | |
| JP2009098907A (en) | Debugging apparatus and debugging method | |
| JPH05313864A (en) | System for exchanging dynamic revision information between host and terminal | |
| KR100214125B1 (en) | Function Parameter Tracking Method in Electronic Switching System | |
| JP3121062B2 (en) | Information processing device | |
| JPS6235944A (en) | Compiler processing method | |
| JPH03240831A (en) | Interruption processing system |