MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Debug tool and skipping code

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Mon Jul 19, 2021 6:08 am    Post subject: Debug tool and skipping code Reply with quote

I looked in the manual, but I'm guessing this is not supported.
In Xpediter, I can specify the prefix command S so as to skip lines of code that I don't want to be executed. (an example of this might be if I have old and new code in the same program. I might want to skip all calls to the old code while testing the new and vice-versa).
In debug tool, the only option I've found is along the lines of putting a breakpoint on the unwanted lines and then doing a J(ump) to the line(s) I want to execute.
Is this the only way?
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jul 19, 2021 8:05 am    Post subject: Reply with quote

misi01,

You can define source markers to specify that the source line with the special indicator be included or excluded when the code coverage percentage is calculated.


https://www.ibm.com/docs/it/adfz/developer-for-zos/14.2.0?topic=observations-source-markers

https://www.ibm.com/docs/it/adfz/developer-for-zos/14.2.0?topic=observations-source-marker-use-case-example


https://www.ibm.com/docs/it/adfz/developer-for-zos/14.2.0?topic=debugger-zos-utilities-option-e
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Mon Jul 19, 2021 8:13 am    Post subject: Reply with quote

I'm not sure that's what I'm after. Based on the first link

Quote:
The source markers provide a way to select the source lines that are to be marked in the report file and called out in the statistics calculation for code coverage

strikes me as simply including/excluding which lines are used as the basis for various stats/reports.

What I mean (and I don't think this is the same) is a simple way of marking a line such that it isn't executed when debugging. For example
Code:
move 1      to a
move 2      to b
move 3      to c

Now, since this is a pretty stupid example, I want a simple way of debugging the program and marking the b line so that it isn't executed.
I'm not interested in code coverage or reports, just a simple method to run (normally) ALL the lines of code except for the b line.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jul 19, 2021 8:59 am    Post subject: Reply with quote

misi01,

Did you check the 2nd link ?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Wed Jul 21, 2021 5:50 am    Post subject: Reply with quote

Quote:
Did you check the 2nd link ?

Yes, I did, but it feels as if we're talking at x-purposes. Your links seem to be all about the report contents of code coverage.

I'm simply asking if there is a simple way to mark lines such that they are not executed in the debug session. I'm not in the slightest bit interested in any code coverage reports.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jul 21, 2021 11:10 am    Post subject: Reply with quote

misi01 wrote:

Yes, I did, but it feels as if we're talking at x-purposes. Your links seem to be all about the report contents of code coverage.
I'm simply asking if there is a simple way to mark lines such that they are not executed in the debug session. I'm not in the slightest bit interested in any code coverage reports.


Sigh !
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Thu Jul 22, 2021 4:31 am    Post subject: Reply with quote

A simple question - can I skip lines of code when debugging or not.
Xpediter allows you to enter the prefix command S on the lines you want to skip.
Maybe (and I haven't found it) the command is something like skip 1200-1205 or similar.
If the answer is based on the links you pointed to, then that is a solution, but I would consider it to be a really clumsy one compared to Xpediter.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Spolacek
Beginner


Joined: 17 Dec 2002
Posts: 17
Topics: 2
Location: NJ, USA

PostPosted: Fri Jul 23, 2021 4:07 pm    Post subject: Reply with quote

I've worked with Xpediter and Debug. I don't believe there is a Debug command that is equivalent to the Xpediter 'SKIP' command.

However, the same functionality can be achieved by using the Debug 'RUNTO' and 'GOTO' commands.

Assume that you are testing lines 100 thru 105 in your program. You want to execute lines 100 and 101, skip line 102, and then resume execution at line 103.

You tell Debug to execute lines 100 and 101 and then stop by typing a R in the prefix area to the left of line 101 or by typing RUNTO 101 on the command line and then press enter.

When you start the test session, Debug will execute up to line 101 and then stop. At this point, you type GOTO 103 on the command line and press enter. Debug should skip statement 102 and resume execution at statement 103.

Here's a link to the IBM Debug documentation that lists all the test commands. I hope this helps.

https://www.ibm.com/docs/en/debug-tool-for-zos/13.1?topic=messages-debug-tool-commands
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Thu Jul 29, 2021 1:41 am    Post subject: Reply with quote

Thanks. The jump/run to commands were ones I knew of.
Basically what you're also saying is that there is no one-to-one corresponding skip command, just work-arounds.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group