在不使用第三方组件的情况下如何获取堆栈跟踪? [英] How can I obtain a stack trace without using third party components?

查看:49
本文介绍了在不使用第三方组件的情况下如何获取堆栈跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以使用madExcept,EurekaLog,JclDebug等组件来获取堆栈跟踪.但是如何在不使用此类组件的情况下获取堆栈跟踪?

I know that I can use components like madExcept, EurekaLog, JclDebug etc. to obtain stack traces. But how can I obtain stack traces without using such components?

推荐答案

Windows API提供了一个将返回堆栈跟踪的函数.它是 RtlCaptureStackBackTrace .

The Windows API provides a function that will return stack traces. It is RtlCaptureStackBackTrace.

将返回代码地址而不是函数名称.如果要显示提及的第三方组件之类的信息,则需要做更多的工作.您需要访问Delphi链接器发出的映射文件中的信息.

The will return code addresses rather than function names. If you want to display information like the third party components you mention, then you'll need to do more work. You need access to the information from the map file emitted by the Delphi linker.

这篇关于在不使用第三方组件的情况下如何获取堆栈跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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