1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WinDbg で実行結果をログファイルへ出力する方法

Posted at

コマンドの実行結果が長いとき、スクロールしても最初のほうがきれてしまい実行結果を確認できないことがあると思います。また、実行結果を他の人に渡す場合も文字を選択後にコピー&ペーストするのは、なんだかなぁーって感じがします。

WinDbg には、実行したコマンドとその結果を自動的にログに出力してくれる機能があるので、その方法を紹介します。特に難しくなく、ログファイルを指定後、コマンドを実行、ログファイルを閉じるといった流れです。

WinDbg って何?という人は、こちらの投稿をチェックしてください。

コマンド

# ログファイル指定
# /t オプションでタイムスタンプをファイルの末尾につけてくれます。
.logopen /t c:\path\to\windbg.log

# いろいろコマンドを実行
!analyze -show

!mex.crash

!mex.tasklist

!vm 1

# ログファイルを閉じて、ログ終了
.logclose

参考URL:
.logopen (Open Log File) - Windows drivers | Microsoft Learn
https://learn.microsoft.com/en-us/windows-hardware/drivers/debuggercmds/-logopen--open-log-file-

.logclose (Close Log File) - Windows drivers | Microsoft Learn
https://learn.microsoft.com/en-us/windows-hardware/drivers/debuggercmds/-logclose--close-log-file-

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?