这听起来很简单,但我就是不能让它起作用。我安装了WindowsSDK7.1并打开了WindowsSDK7.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它直接跑到最后,一点也不停。我甚至没有机会设置断点..。
我该怎么办?
非常感谢大家。
发布于 2014-02-12 05:34:02
你为此使用了错误的工具。Mdbg (顾名思义)是一个托管调试器,因此它可以使用.NET程序集,并且您正在尝试调试本机应用程序。我建议使用windbg或cdb (如果您更喜欢命令行调试器)。这两种工具在Windows中都是免费的-只需安装Windows调试工具即可。他们也有很好的文件。
https://stackoverflow.com/questions/21711595
复制相似问题