简体   繁体   English

带有 WinDbg 和 DbgView 的 OutputDebugString

[英]OutputDebugString with both WinDbg and DbgView

With DebugView is simple: I clear its output window with "DBGVIEWCLEAR" (in OutputDebugString , ODS ), and then I show some 10 lines of info.使用DebugView很简单:我用“DBGVIEWCLEAR”(在OutputDebugString , ODS中)清除它的输出窗口,然后我显示大约 10 行信息。 I do this with a timer, 10 times per second.我用一个定时器来做这个,每秒 10 次。

But, while using WinDbg , DebugView doesn't get any output from ODS .但是,在使用WinDbg时,DebugView 不会从ODS获得任何输出。

Q1: can WinDbg ignore / pass-through ODS , so that DebugView can catch it? Q1:WinDbg 是否可以忽略/传递ODS ,以便 DebugView 可以捕获它?

Or, maybe I could use WinDbg only: first, I'd have to setup .ocommand WINDBGCMD , then I could clear its output window with OutputDebugString("WINDBGCMD.cls;g");或者,也许我只能使用 WinDbg:首先,我必须设置.ocommand WINDBGCMD ,然后我可以使用OutputDebugString("WINDBGCMD.cls;g");清除它的输出窗口。 ... but that fails with WinDbg telling me "Syntax error in '.cls;g'". ...但是失败了,WinDbg 告诉我“'.cls;g' 中的语法错误”。

Strange, but if I use OutputDebugString("WINDBGCMD.echo\"Hello\";g");奇怪,但是如果我使用OutputDebugString("WINDBGCMD.echo\"Hello\";g"); that works just fine.效果很好。

Q2: how to clear the output window of WinDbg (using ODS )? Q2:如何清除WinDbg的输出窗口(使用ODS )?

Q3: finally, it would be better if I could use WM_COPYDATA with some external APP that would be able to clear its output window and show my 10 lines of info - is there such an APP? Q3:最后,如果我可以将WM_COPYDATA与一些能够清除其输出窗口并显示我的 10 行信息的外部应用程序一起使用会更好 - 有这样的应用程序吗? Maybe TraceTool , but that looks complicated.也许是TraceTool ,但这看起来很复杂。 Also, it looks as it requires C++, not C.此外,它看起来需要 C++,而不是 C。

Note: before ODS , I used to simply TextOut on the desktop.注意:在ODS之前,我曾经只是在桌面上简单地使用TextOut That worked just fine, but visually interfered.这工作得很好,但在视觉上受到干扰。

I've solved my problem by using DebugView++我已经使用DebugView++解决了我的问题

DebugView++ can receive debug string using SendMessage: DebugView++ 可以使用 SendMessage 接收调试字符串:

HWND debugviewpp = FindWindow(NULL, "[Capture Win32] - DebugView++");
SendMessage(debugviewpp, EM_REPLACESEL, GetCurrentProcessId(), (LPARAM) "Text 2 send");

Thus, WinDbg is out of the way.因此,WinDbg 不在话下。

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

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