如何将windbg命令重定向到文件而不在windbg控制台上回显输出?

编程入门 行业动态 更新时间:2024-10-25 10:26:08
本文介绍了如何将windbg命令重定向到文件而不在windbg控制台上回显输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

.logopen 不是答案,因为它让命令输出到 windbg 控制台.

.logopen is not the answer, because it lets the command output to the windbg console.

例如,!sosex.dumpgen 2 会产生大量输出,我不想在调试器控制台中看到这些输出.现在我正在使用以下内容:

For example, !sosex.dumpgen 2 produces a helluva lot of output, which I do not want to see in the debugger console. Right now I am using the following:

.shell -i- -ci "!dumpgen 2" cmd /c more > D:\tmp\dumpgen2.log

我的问题是 more 命令是交互式的,在输出一定数量的数据后需要用户输入.这对我来说是个大问题.

My problem is that the more command is interactive and requires user input after outputting certain amount of data. This is a huge problem for me.

一种解决方案可能是使用脚本以非交互方式运行调试器本身,并在那里使用 .logopen 命令.

One solution could be running the debugger itself non interactively with a script and use the .logopen command there.

我想知道我是否可以同时实现我想要的:

I wonder if I could achieve what I want while:

从交互式 WinDbg 会话中执行此操作使用普通的标准 shell 命令(也可以是 cmd.exe 或 powershell.exe).我知道编写一个只是将 stdin 转发到 stdout 的小实用程序是一项微不足道的工作,但我还是不想这样做.

推荐答案

.shell -i- -ci "!dumpgen 2" findstr "^" >D:\tmp\dumpgen2.log

^ 会找到任何一行的开头,所以它应该是一个 1:1 的副本.

^ will find the beginning of any line, so it should be a 1:1 copy.

这篇关于如何将windbg命令重定向到文件而不在windbg控制台上回显输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-25 23:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125435.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上回   控制台   如何将   重定向   命令

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!