异常的 JEDI 代码库行号

发布于 2024-08-22 06:38:54 字数 142 浏览 4 评论 0原文

我有一个 codegear C++ 构建器项目,并添加了 JCL 库以在发生异常时获取堆栈转储。我得到了堆栈转储,但缺少最重要的东西,即实际发生异常的行号。我得到了函数名称,但如果函数有 30 行那么长,就不容易猜到问题出在哪里。

我在这里错过了什么吗?

I have a codegear C++ builder project and added the JCL library to get a stackdump when an exception occurs. I get the stackdump, but the most important thing is missing, the line number where the exception actually happened. I get the function name, but if the function is 30 lines long it's not easy to guess where the problem is.

Am I missing something here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山人契 2024-08-29 06:38:54

我进一步研究它,它至少对我现在使用 Delphi 2007 有用。我认为它对 C++ Builder 的工作方式相同。

我的猜测是您没有在编译器选项中检查调试信息以及“使用调试 DCU”。
我尝试了 JCL 中包含的用 Delphi 编译的示例
examples\windows\debug\stacktrack\StackTrackDemoMain.pas

以下是输出示例:

[0047C478]{StackTrackExample.exe} StackTrackDemoMain.TMainForm.Button1Click (Line 49, "StackTrackDemoMain.pas")
[00442590]{StackTrackExample.exe} Controls.TControl.Click (Line 5229, "Controls.pas")
[00446083]{StackTrackExample.exe} Controls.TWinControl.WndProc (Line 7304, "Controls.pas")
[0042ECB8]{StackTrackExample.exe} StdCtrls.TButtonControl.WndProc (Line 3684, "StdCtrls.pas")
[004461D3]{StackTrackExample.exe} Controls.DoControlMsg (Line 7353, "Controls.pas")
[00446083]{StackTrackExample.exe} Controls.TWinControl.WndProc (Line 7304, "Controls.pas")
[004577A3]{StackTrackExample.exe} Forms.TCustomForm.WndProc (Line 3512, "Forms.pas")
[004457AC]{StackTrackExample.exe} Controls.TWinControl.MainWndProc (Line 7073, "Controls.pas")
[0041EC14]{StackTrackExample.exe} Classes.StdWndProc (Line 11583, "common\Classes.pas")
[0044617F]{StackTrackExample.exe} Controls.TWinControl.DefaultHandler (Line 7334, "Controls.pas")
[00446083]{StackTrackExample.exe} Controls.TWinControl.WndProc (Line 7304, "Controls.pas")
[0042ECB8]{StackTrackExample.exe} StdCtrls.TButtonControl.WndProc (Line 3684, "StdCtrls.pas")
[0041EC14]{StackTrackExample.exe} Classes.StdWndProc (Line 11583, "common\Classes.pas")

注意:我已将文件 StackTrackDemoMain.pas 方法 TMainForm.ApplicationEventsException 更改

JclLastExceptStackListToStrings(ExceptionLogMemo.Lines, True, False, False, False);

祝你好运!

I investigate it further and it works for me at least now using Delphi 2007. I think it works the same way for C++ Builder.

My guess is that you have not checked the Debug information also "Use debug DCU's" in compiler options.
I tried the included example in JCL that is compiled with Delphi
examples\windows\debug\stacktrack\StackTrackDemoMain.pas.

Here is an example of the output:

[0047C478]{StackTrackExample.exe} StackTrackDemoMain.TMainForm.Button1Click (Line 49, "StackTrackDemoMain.pas")
[00442590]{StackTrackExample.exe} Controls.TControl.Click (Line 5229, "Controls.pas")
[00446083]{StackTrackExample.exe} Controls.TWinControl.WndProc (Line 7304, "Controls.pas")
[0042ECB8]{StackTrackExample.exe} StdCtrls.TButtonControl.WndProc (Line 3684, "StdCtrls.pas")
[004461D3]{StackTrackExample.exe} Controls.DoControlMsg (Line 7353, "Controls.pas")
[00446083]{StackTrackExample.exe} Controls.TWinControl.WndProc (Line 7304, "Controls.pas")
[004577A3]{StackTrackExample.exe} Forms.TCustomForm.WndProc (Line 3512, "Forms.pas")
[004457AC]{StackTrackExample.exe} Controls.TWinControl.MainWndProc (Line 7073, "Controls.pas")
[0041EC14]{StackTrackExample.exe} Classes.StdWndProc (Line 11583, "common\Classes.pas")
[0044617F]{StackTrackExample.exe} Controls.TWinControl.DefaultHandler (Line 7334, "Controls.pas")
[00446083]{StackTrackExample.exe} Controls.TWinControl.WndProc (Line 7304, "Controls.pas")
[0042ECB8]{StackTrackExample.exe} StdCtrls.TButtonControl.WndProc (Line 3684, "StdCtrls.pas")
[0041EC14]{StackTrackExample.exe} Classes.StdWndProc (Line 11583, "common\Classes.pas")

NOTE: I have changed in file StackTrackDemoMain.pas method TMainForm.ApplicationEventsException

to

JclLastExceptStackListToStrings(ExceptionLogMemo.Lines, True, False, False, False);

Good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文