从C ++中的DLL捕获调试信息 [英] Capture debug information from a dll in C++

查看:354
本文介绍了从C ++中的DLL捕获调试信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个使用C ++ dll的exe,该dll输出调试信息.我可以在Visual Studio的输出窗口中查看输出信息.您能否提出一些示例,这些示例在C ++中实现侦听器,这些侦听器可以拦截此信息并将其保存到日志文件或缓冲区中.我不希望所有调试数据(例如exe已加载/卸载),而只希望从此dll输出的数据.

I am running an exe which makes use of a C++ dll and the dll outputs debug information. I can view the output info in the output window of Visual Studio. Can you suggest samples which implement listeners in C++ which can intercept this information and save it to a log file or a buffer. I do not want all the debugging data (for example exe has loaded/unloaded) but only the data that is output from this dll. Is there a way of doing it?

推荐答案

此处有一篇文章向您展示如何捕获对OutputDebugString的调用:

OutputDebugString的机制 [
Here''s an article that show you how to capture calls to OutputDebugString:

Mechanism of OutputDebugString[^]

Assuming that''s what the DLL is calling, you should be able to make that code work for your purposes.


该站点有一些有用的资源
http://www.debuginfo.com/examples/dbgexamples.html
This site has some useful resources
http://www.debuginfo.com/examples/dbgexamples.html


这篇关于从C ++中的DLL捕获调试信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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