0

これは本当に簡単に聞こえますが、私はそれを機能させることができません。Windows SDK 7.1 をインストールし、Windows SDK 7.1 コマンド プロンプトを開きました。

次のようなコード test.c があります。

#include <stdio.h>
#include <math.h>

void main()
{
    int i;
    for(i=1; i<10; i++)
        printf("Hello world! This is line %d \n", i);
}

そして今、私はそれをデバッグしたいと思います。最初に次を使用してコンパイルしました:

cl test.c /Z7

そして、開いた:

mdbg test.exe

次に起こったことは次のとおりです。

MDbg (Managed debugger) v4.0.30319.1 (RTMRel.030319-0100) started.
Copyright (C) Microsoft Corporation. All rights reserved.

For information about commands type "help";
to exit program type "quit".
run test.exe
Hello world! This is line 1
Hello world! This is line 2
Hello world! This is line 3
Hello world! This is line 4
Hello world! This is line 5
Hello world! This is line 6
Hello world! This is line 7
Hello world! This is line 8
Hello world! This is line 9
STOP: Process Exited

まったく止まることなく、まっすぐ最後まで走りました。ブレークポイントを設定する機会すらありません...

私は何をすべきか?

どうもありがとうございました。

4

1 に答える 1

2

この目的のために間違ったツールを使用しています。Mdbg (その名前が示すように) はマネージデバッガーであるため、.NET アセンブリで動作し、ネイティブ アプリケーションをデバッグしようとしています。コマンド ライン デバッガーを使用する場合は、 windbgまたはcdbを使用することをお勧めします。どちらのツールも、Windows SDK で無料で利用できます。Debugging Tools for Windows をインストールするだけです。また、優れたドキュメントもあります。

于 2014-02-12T05:34:02.857 に答える