Hi Rich,
I'd like to run the source level debugger on a program other than the
main program.
I'm going to assume you mean a different module other than the entry
module. (Because a *PGM object only contains 1 program...)
I'm assuming that you're using the green screen debugger, invoked via
STRDBG. This is /not/ the only source-level debugger that IBM provides
-- and indeed, it's even possible to invoke a GUI debugger via the
STRDBG command, not just the green-screen one.
1) Run STRDBG PGM(your-program) before running your program. This should
show you the source code of your entry module.
2) Hit F14. This will give you a list of the modules in the program.
3) Find the module you want to debug, and put 5=Display Module Source
next to that module. Press ENTER.
4) You should now see the source code of the other module. Set a
breakpoint where you want the debugger to stop.
5) Press F12 to return to the command line, and run your program.
Alternately, you can use F22=Step Into (this is Shift-F10) to step
line-by-line through the code. The difference between F22 and F10 is
that when you press F22, it will step into a subprocedure call and show
you the code in that procedure (even if it's in a different module,
service program, or program). Whereas F10 will only step within the
same routine (it will run the called procedure/program but it will not
step through it in the debugger like F22 does.)
So that's two alternatives... one where you set a breakpoint in the
particular procedure you want to debug, and another where you step into
the procedure you want to run. Both should work.
As an Amazon Associate we earn from qualifying purchases.