简体   繁体   English

C#程序员的C ++调试帮助

[英]C++ debugging help for C# programmer

I'm embarrassed to post this but it's been awhile since I worked in C++, been with C# for awhile. 我不好意思发表这篇文章,但是自从我从事C ++工作以来已经有一段时间了,与C#在一起已经有一段时间了。 I'm converting old (not written by me) vs2003 and 05 C++ code to vs 08. In addition to lots of lumps during conversion, I want to add debug logging so I can monitor what is going on when I attach with windbg. 我正在将旧的(不是我自己写的)vs2003和05 C ++代码转换为vs08。除了在转换过程中出现很多麻烦之外,我还想添加调试日志记录,以便可以在连接windbg时监视发生的情况。 I've searched the archives here and ms and I think it's using Debugger.Log(...) but not sure. 我在这里和ms搜索过档案,我认为它使用的是Debugger.Log(...),但不确定。 I also remember years ago launching a debug monitor to catch the logging. 我还记得几年前启动调试监视器来捕获日志记录。 So the call to some experts that have a better memory than I. What call(s) can I make (without the DEBUG compile directive - need to watch release code) to catch the logging in wind bag? 因此,请那些记忆力比我更好的专家打电话。我可以拨打什么电话(没有DEBUG编译指令-需要监视发布代码)来捕获日志? I followed a couple of debugging links from SO posts but they were dead. 我跟踪了SO帖子中的几个调试链接,但是它们已经死了。 Thanx - Old Man. 谢谢-老人。

如果附加了WinAPI函数OutputDebugString() ,则将字符串发送到附加的调试器。

You can use outputdebugstring and log the data you want to monitor. 您可以使用outputdebugstring并记录要监视的数据。 Additionally open Dbgview.exe tool to check the data being logged. 此外,打开Dbgview.exe工具以检查正在记录的数据。 This is the best way to capture data by running the service in release mode. 这是通过在发布模式下运行服务来捕获数据的最佳方法。 The data you capture in dbgview you can store in a file and use for different purposes at a later point of time. 在dbgview中捕获的数据可以存储在文件中,并在以后用于不同目的。 Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM