Delphi 7中的GetStackTrace? [英] GetStackTrace in Delphi 7?

查看:121
本文介绍了Delphi 7中的GetStackTrace?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Delphi 7,如何从 Exception 中获取表示堆栈跟踪的字符串?

Using Delphi 7, how can I get a string representing the stack-trace from an Exception?

try
  SomethingDodgy();
except
  on E:Exception do begin
    // print stack trace
    Log.Write(/* ??? */);
  end;
end;

我听说最新的delphi中有一个GetStackTrace函数,但是我找不到delphi 7的任何东西不,升级不是一种选择:)

I hear there's a GetStackTrace function in the latest delp but I can't find anything for delphi 7. No, upgrading is not an option :)

推荐答案

您可以尝试使用 madExcept ,一个很棒的异常处理框架。

You could try using madExcept, a wonderful Exception handling framework.

madshi那里有大量的示例代码。我确定我以前曾经在其中使用过堆栈跟踪内容。

madshi has heaps of sample code in there; I'm sure I've used the stack-trace stuff in there before.

正如Dmitriy指出的那样, JCL 也具有堆栈跟踪代码;旧示例是此处

As Dmitriy noted, the JCL also has stack-trace code; an old sample is here.

这篇关于Delphi 7中的GetStackTrace?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆