OpenEdge Progress-4GL 开发:如何从错误消息中知道我是 运行 的程序?

OpenEdge Progress-4GL development: how to know from an error message the procedure I'm running?

如前面的问题所述,我对 Progress-4GL 开发还很陌生。

我刚刚创建了一个 windows (*.w file),以及一个基于包含文件 (*.i file).[=22= 的过程文件 (*.p file) ]

我做错了什么,我收到一条错误消息,复制粘贴显示以下内容:

---------------------------
Fout
---------------------------
** Begin positie voor SUBSTRING, OVERLAY, enz. moet 1 of groter zijn. (82)
---------------------------
OK   
---------------------------

如您所见,这是错误 82 的荷兰语翻译:

** Starting position for SUBSTRING, OVERLAY, etc. must be 1 or greater. (82)

The SUBSTRING, OVERLAY, etc, functions require that the start position (second argument) be greater than or equal to 1. 
P

我想知道是哪个 procedure/function 发出了这条错误消息。我正在使用 AppBuilder 11.6 版和相应的过程编辑器,因此调试的可能性非常有限。我正在考虑的一件事是转储 Windows 进程,以确定调用堆栈,但我不确定如何执行此操作。我还尝试使用 Process Explorer 并检查“procwin32.exe”进程内线程的各个堆栈的堆栈,但我不确定如何进行。

顺便说一句,我经常在我的代码中添加消息框,如下所示(只是一个例子):

MESSAGE "begin procedure combobox-value-changed" VIEW-AS ALERT-BOX.

如您所见,过程的名称是硬编码的,而在其他编程语言(如 C++)中,procedure/function 名称可以显示如下:

OUTPUT("begin procedure %s", __FUNCTION__);

__FUNCTION__ 旁边,C++ 还知道 __FILE__(文件名)和 __LINE__(行号)。
Progress 4GL 中是否也存在这样的预定义值,最好是 11.6 版或更早版本?

由于 ABL 代码未编译成 Windows 字节码,因此 windows 调试器不会真正有用。

您应该首先将 -debugalert 启动参数添加到 prowin/prowin32.exe。或者添加这个

ASSIGN SESSION:DEBUG-ALERT = TRUE .

这将为所有(错误)消息添加一个帮助按钮,这将打开一个带有 ABL 堆栈跟踪的对话框。

当您使用包含文件时,请注意堆栈跟踪中引用的行号基于调试列表,而不是实际的源代码。所以执行

COMPILE myfile.w DEBUG-LIST c:\temp\myfile.debuglist .

接收具有正确行号的调试列表文件。

您知道可用于 AVM 的可视化调试器吗? https://docs.progress.com/de-DE/bundle/openedge-abl-troubleshoot-applications-117/page/Introduction.html

%DLC%\bin\proDebugger.bat

或者 AppBuilder 中的编译 -> 调试菜单。

虽然看起来有点古色古香,但总的来说还行。

需要在 proenv 中以管理员身份启用调试:

prodebugenable -enable-all

当然,当您切换到 Progress Developer Studio 作为您的 IDE 时,草会更绿。

关于你问题的第二部分。请参阅 PROGRAM-NAME 函数。

message
  program-name(1) skip
  program-name(2)
  .

另外请参阅 {} preprocessor name reference

message 'file: {&file-name} line: {&line-number}'.