可以使用JclDebug从引发异常的方法中获取参数值吗? [英] Is possible to use JclDebug to get the parameters values from the method that raised the exception?

查看:126
本文介绍了可以使用JclDebug从引发异常的方法中获取参数值吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用函数 JclGetExceptStackList来记录引发异常的调用堆栈。

I use the function 'JclGetExceptStackList' to log the call stack of the raised exceptions.

我希望,如果可能的话,还要记录引发异常的方法中的参数值。

I wish, that if possible to also log the parameters value from the method that raised the exception.

我不知道是否可以用JclDebug做到这一点,或者存在任何其他方式可以做到这一点。

I dont know if is possible to do that with JclDebug, or that exists any other way to do that.

有人可以帮我吗?

谢谢!

推荐答案

同时用JclDebug不可能做到这一点,尽管手工完成可能需要很多工作,但是您可能会发现任何日志记录工具(包括Log4D,CodeSite甚至是outputdebugString)都可以减少工作量。实际上,它将在您选择插入此类日志记录的任何位置插入代码以记录参数调用。当引发异常时,它也可以插入一个特殊的标记,使您可以重建导致崩溃的确切情况。

While it's not possible to do it with JclDebug, and while doing it by hand might be a lot of work, you might find that any logging tool, including Log4D, or CodeSite or even outputdebugString, could do it with less work. It will in fact be inserting code to log your parameter calls, in any place where you choose to insert such logging. It can also insert a special marker when an exception is raised, allowing you to reconstruct the exact scenario that lead to your crash.

但是,由于CodeSite不仅会这样做当异常将要发生时(怎么办?),这并不是您想要的。但是,我确实发现,将合理的跟踪日志与jcl堆栈跟踪(或madeexcept或eurekalog)结合使用绰绰有余,并且,如果我真的需要知道调用中涉及的所有参数值,我应该返回并添加更多跟踪消息。

But since CodeSite doesn't do it only when an exception is going to happen (how would it?) this isn't exactly what you wanted. I do find however, that a reasonable trace log, combined with the jcl stack traceback (or madeexcept or eurekalog) is more than enough and that if I really need to know all the parameter values involved in a call, I should go back and add more trace messages.

这篇关于可以使用JclDebug从引发异常的方法中获取参数值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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