IBM Version 4 manual Debugging the MI Program, Sav, Rst

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 147
Image 147

 

 

RTVJOBA

USER(&USR)

 

 

 

CALL

PGM(MIð1) PARM(&ARG1 &ARG2 &RESULT)

 

 

CHGVAR

VAR(&MSG) VALUE(&RESULT)

 

 

SNDMSG

MSG(&MSG) TOUSR(&USR)

 

 

 

ENDPGM

 

 

 

 

The

following statement

calls

the CL01

program:

CALL CLð1 (-5

6)

 

 

 

 

This

test

should

cause

a

message to

be sent to your user message

following value:

 

 

 

 

ððððððððððððð6.ððððð

 

 

 

 

Debugging the MI Program

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The

MI

 

program

(MI01)

that

you

created

is

a

standard

*PGM

object o

system.

 

As you would expect, you can call MI01

from

other

high-level

You

can

delete

MI01

with

the

Delete

Program (DLTPGM)

command,

 

save

and

restore

MI01 using

the

standard

save

(SAV)

and

restore

(RST)

commands,

on.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You

can

also debug it using the standard debugger

on

the

AS/400

sys

debug

it,

you

need

to

look at

the

listing

produced

by the

QPRCRTPG

mine the MI instruction number. Then use that

number with the Add Bre

(ADDBKP)

 

CL command. For example, when creating

MI01 in the previous exe

cise,

the

following

listing

was generated

by

QPRCRTPG:

 

 

 

 

 

5763SS1 V3R1Mð 94ð9ð9

 

 

Generated Output

ð8/ð8/94 ð9:46:36 Page

1

SEQ.1/INST Offset

Generated Code

\

1 ... ... 2 ... ... 3 ... ... 4 ... ... 5 ... ... 6 ... ... 7 ... ... 8

 

ðððð1

 

 

 

 

ENTRY \ (PARM_LIST) EXT

;

 

ðððð2

 

 

 

 

DCL SPCPTR ARG1@ PARM

;

 

ðððð3

 

 

 

 

DCL SPCPTR ARG2@ PARM

;

 

ðððð4

 

 

 

 

DCL SPCPTR RESULT@ PARM

;

 

ðððð5

 

 

 

 

DCL OL PARM_LIST (ARG1@, ARG2@, RESULT@) PARM EXT

;

 

ðððð6

 

 

 

 

DCL DD ARG1 PKD(15,5) BAS(ARG1@)

;

 

ðððð7

 

 

 

 

DCL DD ARG2 PKD(15,5) BAS(ARG2@)

;

 

ðððð8

 

 

 

 

DCL DD RESULT PKD(15,5) BAS(RESULT@)

;

 

ðððð9

ððð1 ððððð4

3C46

2ððð ððð6 ððð7

 

CMPNV(B) ARG1,ARG2 / LO(ITS2)

;

 

 

 

ððð9

 

 

 

 

 

ððð1ð

ððð2 ðððððE

1ð42 ððð8 ððð6

 

CPYNV RESULT,ARG1

;

 

ððð11

ððð3 ðððð14

1ð11 ðððA

 

B RETURN

;

 

ððð12

ððð4 ðððð18

3ð42 ððð8 ððð7

ITS2:

CPYNV RESULT,ARG2

;

 

ððð13

ððð5 ðððð1E

22A1

ðððð .2/

RETURN:

RTX \

;

 

ððð14

ððð6 ðððð22

ð26ð

 

 

PEND

;

 

5763SS1 V3R1Mð 94ð9ð9

Generated

Output

ð8/ð8/94

ð9:46:36

Page

2

MSGID

ODT

ODT Name

 

Semantics and ODT Syntax Diagnostics

 

 

 

 

5763SS1 V3R1Mð 94ð9ð9

Generated

Output

ð8/ð8/94

ð9:46:36

Page

3

MSGID

MI Instruction Stream Semantic Diagnostics

 

 

 

 

 

 

Setting Breakpoints in the MI

Program

To view the value

of RESULT at label RETURN, you first determine tha

corresponds

to MI

instruction.1/) 0005 (.2/) and enter the following CL com-

mands:

 

 

STRDBG

PGM(MIð1)

 

ADDBKP

STMT('/ððð5') PGMVAR((RESULT ()))

CALL CLð1 (-5

6)

The following

display is shown:

Chapter 7. Machine Interface Programming7-7

Page 147
Image 147
IBM Version 4 manual Debugging the MI Program, Sav, Rst