IBM AS/400 manual a Statement, View, Program for Debugging, Creating

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 193
Image 193

 

 

Preparing a

Program for Debugging

members into the

module object. There

is

no dependency on the sourc

upon

which it is based, once the listing

view

is created.

For

example, to create a listing view for

a

program TEST1 that contai

DDS

type:

 

 

 

 

CRTBNDRPG PGM(MYLIB/TEST1) SRCFILE(MYLIB/QRPGLESRC)

 

 

 

 

SRCMBR(TEST1)

OUTPUT(*PRINT)

 

 

 

 

TEXT('ILE RPG/400 program TEST1')

 

 

 

 

OPTION(*EXPDDS) DBGVIEW(*LIST)

 

 

 

Specifying DBGVIEW(*LIST) for the DBGVIEW parameter and *EXPDDS for th OPTION parameter on either create command creates a listing view with DDS for debugging the source for TEST1. Note that OUTPUT(*PRINT) and OPTION(*EXPDDS) are both default values.

Creating

a Statement

View

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A statement

view

 

allows

 

the

module

object

to

be debugged

using

stateme

numbers and

the

debug

commands.

Since

the

source will not be display

must

make

 

use

of

statement

numbers which are shown in the

source

se

compiler

listing.

In

 

other

words, to effectively use this view, you

listing.

In

addition,

the

statement

numbers

generated

for

debugging

on whether *SRCSTMT or *NOSRCSTMT

is specified for the OPTION parameter.

*NOSRCSTMT means that statement numbers are assigned sequentially and are

displayed

as

Line

Numbers

on the left-most

column

of

the

source sect

compiler

listing. *SRCSTMT

allows

you to request that the compiler use SE

sequence

 

numbers and source IDs when generating

statement

numbers

fo

ging. The

Statement

Numbers

are

shown

on the right-most column

of

the

section

of

the

compiler

listing.

 

 

 

 

 

 

 

 

 

 

You create a statement view to debug a module by using the *STMT o DBGVIEW parameter for either the CRTRPGMOD or CRTBNDRPG commands

when you create a module.

Use this view when:

¹You have storage constraints, but do not want to recompile the mo

program if you need to debug it.

¹ You are sending compiled objects

to

other users and want to be

nose problems in your code using

the

debugger, but you do not w

users to see your actual code.

 

 

For example, to create a statement view for the program DEBUGEX usi CRTBNDRPG, type:

CRTBNDRPG PGM(MYLIB/DEBUGEX) SRCFILE(MYLIB/QRPGLESRC)

TEXT('ILE RPG/400 program DEBUGEX')

To create a statement view for a module using CRTRPGMOD, type:

CRTRPGMOD MODULE(MYLIB/DBGEX) SRCFILE(MYLIB/QRPGLESRC)

TEXT('Entry module for program DEBUGEX')

By default a compiler listing and a statement view are produced. U listing to obtain the statement numbers, you debug the program using commands.

Chapter 11. Debugging Programs169

Page 193
Image 193
IBM AS/400 manual a Statement, View, Program for Debugging, Creating