可以在MicroFocus Cobol中设置系统跟踪功能吗?

时间:2013-06-04 10:02:22

标签: python cobol microfocus

MicroFocus Cobol或其他任何一种功能是否具有与Python的sys.settrace()相当的功能? 在执行源代码的每一行之后,将调用作为参数传递给这种跟踪函数的函数。

2 个答案:

答案 0 :(得分:1)

它不是一个确切的等价物,但您可以使用READY TRACE进行调试。使用TRACE编译器指令启用它。

答案 1 :(得分:1)

OpenCOBOL支持

-ftrace               Generate trace code
                    - Executed SECTION/PARAGRAPH
-ftraceall            Generate trace code
                    - Executed SECTION/PARAGRAPH/STATEMENTS
                    - Turned on by -debug

cobc命令行选项。这与Python的观点并不完全相同,但在启用时输入段,段落和句子的跟踪输出。毫无疑问,其他编译器会有相同的东西。与READY TRACE一起,调试和>> D其他调试功能,如DECLARATIVES允许的功能。 http://opencobol.add1tocobol.com/#declaratives

procedure division.
declaratives.
handle-errors section.
    use after standard error procedure on filename-1.
handle-error.
    display "Something bad happened with " filename-1 end-display.
.
helpful-debug section.
    use for debugging on main-file.
help-me.
    display "Just touched " main-file end-display.
.
end declaratives.