There are two cases for inlining:
1. The performed paragraph was only performed from one place
2. The performed paragraph was performed from multiple places
I just tested CA InterTest Batch with COBOL 6.2 at OPT(2),INLINE. It definitely
can stop (i.e. catch a breakpoint) set in case 1. For case 2, it only caught it
in one of the places where it was inlined.
Note that InterTest Batch runs the application code in a VM.
The program I tested is:
----------------------------------
identification division.
program-id. cobtest.
data division.
linkage section.
01 parm pic s9(04) binary.
procedure division using parm.
mainline section.
perform inline.
display parm.
if parm not = 42
perform inline
end-if.
display parm.
goback.
inline section.
add parm to parm. *> breakpoint set here
compute parm = parm * parm.
----------------------------------
I don't know why this would be different in COBOL 6 than in previous COBOL. IBM
COBOL has inlined code for a long time, and there's no difference in the
generated code in that respect that I know of.
Except for one thing: COBOL 6 is not good at identifying the inlined statements
in the compile listing pmap. In the above case, the listing only gives the "add
parm to parm" and "computer parm = parm * parm" statements once (where it first
is inlined). The second time it is definitely inlining them, but just as
generated instructions belonging to the "if parm not = 42" statement.
I'd consider this to be a bug in the compiler. The listing pmap should show all
source statements, at the place where they are executed. If they are inlined
twice, they should be listed twice.
-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of
Farley, Peter
Sent: Friday, February 10, 2023 11:47 AM
To: [email protected]
Subject: Re: How to get MetalC "INLINE" report
AFAIK, not the way inlining works on any z/OS compiler output I have ever seen.
Recent versions of Enterprise COBOL, for instance, can inline performed
paragraphs (and tell you that they did so) such that no HLL debugger known to
me can let you stop inside the inlined code. If you have to debug E.COBOL
inlined code you must recompile with the NOINLINE compiler option (or in the
worst cases, NOOPT).
Peter
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN