SKIP executable lines during Debugging

Hi,

Like the way we skip(while debugging COBOL programs) execution of lines in Xpediter using S, is there a way to accomplish this in Natural Debugger?

Thanks,
Mishra
[/quote]

Hi Mishra,

Try setting up multiple break points and then use GO and LIST BREAK option given in Natural Debugger. This should achieve that you are looking for.

Hi Ats,

Thank you for your suggestion. That is one way.

Setting multiple break points and just jumping from one to other is not the aim. Aim is to skip a statement.

The command STEP command is the answer to my aim. I tried this andi is working.

What I understand is jumping will execute all the statements in between to break points and STEP will simply pass the control to the next statement with out executing the statement.

Please clarify, if I am wrong.

Hi Mishra,

Thanks for your note.

The SoftwareAG manual says:

===============================================
STEP
When you enter the direct command STEP (or choose PF2), an interrupted Natural programming object is continued for n statement lines. The default value for n is 1.

I understand that PF2 is being used for single stepping and if n is set to 1 it will go line by line. If it is set to grater than one, YES! the debugging will not go line by line but will it exclude middle code from being executed? Or simply will jump to the n value set executing the code at backgroung like in GO and LIST BREAK?

Can anyone throw some extra light on background process?

Hi Mishra,
You are correct that STEP is the solution.
But the wording of your statement is a bit misleading …
.
We can’t “pass control to the next statement without executing the (intervening) statement(s)”. That implies (wrongly) that we could magically not execute program statements - this is an impossibility.
.
The TEST DEBUG direct command STEP performs a single step and then pauses.
So STEP is equivalent to “STEP 1”.
Or we can skip forward by “N” number of statements (and all of the intervening statements are executed, of course).
Example1 :
Use “STEP 3” to skip forward by 3 statements and pause.
.
A nice feature of "STEP " is that we can use it to skip over (ie. not execute) any intervening Break Points.
Example 2:
0010 DEFINE DATA
0020 LOCAL
0030 1 #OP1 (N2)
0040 1 #OP2 (N1)
0050 1 #PI (N1.7)
0060 END-DEFINE
0070 *
0080 #OP1 := 22
0090 #OP2 := 7
0100 #PI := #OP1 / #OP2
0110 *
0120 DISPLAY #OP1 #OP2 #PI
0130 *
0140 END

  1. STOW this program as MISHRA
  2. Set Break Points on lines 0080 and 0100 then execute the program
  3. TEST ON
  4. MISHRA /* This will execute the BP on line 0080.
  5. Type G to continue. This will execute the BP on line 0100
  6. Type G to complete the program execution
  7. Repeat Steps 1 to 4
  8. Now type STEP 3, which will skip forward to line 0120
  9. Type G to complete the program execution

Hi Peter,

Thank you for your detailed example. Also thank you Ats for bringing in more information from the Manual.

Firstly, in my last post I did not write clearly on how I used the STEP command. Which led to the confusion.

2ndly to add to the recent post, the STEP SKIPSUBLEVEL is also a good feature of this command as it does not let the control go to the sub level calls (callnat for example) and just continue to execute the following statement.

Thanks to forum all forum members.

As Peter points out, you cannot skip the execution of statements within the debugger. SKIPSUBLEVEL does not bypass the execution of sublevel. The sublevel is still executed but the debugger does not stop until the statement following the sublevel.