Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect windbg command to a file without echoing the output on the windbg console?

Tags:

windbg

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

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

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.

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:

  1. Doing it from the interactive WinDbg session
  2. Using plain standard shell commands (which could also be cmd.exe or powershell.exe). I know that writing a small utility that just forwards stdin to stdout is a trivial piece of work, still I prefer not doing it.
like image 753
mark Avatar asked Jan 07 '23 06:01

mark


1 Answers

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

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

like image 102
Thomas Weller Avatar answered May 12 '23 07:05

Thomas Weller