有没有办法使用 Visual Studio 命令提示符进行调试?

发布于 2024-09-14 07:22:14 字数 179 浏览 4 评论 0原文

我有一个项目需要使用 3 个编译器(Borland、gnu 和 Microsoft)。它可以在 2/3 上运行,现在我只需要让它与 Microsoft 一起运行。它似乎在与其他编译器配合良好的地方崩溃,所以我想知道是否有一种方法可以使用命令行进行调试,也许可以获取堆栈跟踪或获取导致崩溃的行,类似于gdb 与 gnu。

I've got a project that I need to get working with 3 compilers (Borland, gnu, and Microsoft). It works on 2/3 and now I just need to get it working with Microsofts. It seems to crash in places where it works fine with the other compilers, so I'm wondering if there is a way to debug with the command line, maybe to get a stack trace or get the line which caused the crash, something similar to gdb with gnu.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

她比我温柔 2024-09-21 07:22:14

(全面披露:我在 Visual Studio 团队工作)

如果您使用的是 Microsoft C++ 编译器,您是否已经安装了 Visual Studio?如果是这样,您可以使用内置的调试器。如果没有,我建议免费尝试 Visual C++ 2010 Express 。它有一个优秀的本机调试器。您可以在第一次出现异常(C++、SEH、Win32 异常)时中断,并直接转到发生异常的行以及调用堆栈、局部变量等。

(Full disclosure: I work on the Visual Studio team)

If you're using the Microsoft C++ compiler, do you have Visual Studio installed already? If so, you can use the built-in debugger. If not, I would recommend trying Visual C++ 2010 Express for free. It has an excellent native debugger. You can break on first chance exceptions (C++, SEH, Win32 exceptions) and go right to the line where it happened along with the call stack, locals, etc.

今天小雨转甜 2024-09-21 07:22:14

Windows 调试工具 - 一个出色的调试工具包,其中包括cdbntsd 控制台调试器(除了 GUI WinDBG 调试器)。

该软件包有很棒的文档,可以轻松设置为处理崩溃的“及时”调试器,并且可以很好地处理崩溃转储。

这些是 Microsoft 用于崩溃分析(及更多)的核心调试工具。

请注意,Windows 附带了一个版本的 ntsd 调试器(至少以前是这样 - 看起来它不在我的 Win7 机器上的工具包安装之外),但无论如何获取该包都是一个好主意这样您就拥有了最新的工具 - 正如我所说,这些文档包含大量重要信息。

Debugging Tools for Windows - an outstanding package of debugging tools that includes the cdb and ntsd console debugger (in addition to the GUI WinDBG debugger).

The package has fantastic docs, can easily be set up to be the 'just in time' debuggers that handle a crash, and works very very nicely with crash dumps.

These are the hardcore debugging tools that Microsoft uses for crash analysis (and more).

Note that Windows comes with a version of ntsd debugger (at least it used to - looks like it's not on my Win7 box outside of the tools package installation), but it's a great idea to get the package anyway so you have the latest tools - and like I said the docs are a wealth of great information.

少钕鈤記 2024-09-21 07:22:14

好吧,您遇到了一个编译器的麻烦,它会非常努力故意使您的程序崩溃。它称为“运行时错误检查”,即 /RTC 选项编译选项。您可以将其关闭以使其表现得像其他的一样。或者你可以从“这里出了问题”的角度出发。 /RTC 的 MSDN 库文章对此进行了详细记录。

Well, you are having trouble with the one compiler that tries very hard to crash your program on purpose. It's called "Run-time error checks", the /RTC option compile option. You can turn it off to make it behave like those other ones. Or you could pursue the "something's wrong here" angle. It's well documented in the MSDN Library article for /RTC.

彩虹直至黑白 2024-09-21 07:22:14

Codeview 是一个较旧的产品,可以做到这一点,但是您没有理由不能使用 Visual Studio 来做同样的事情。

Codeview is an older product which does that, but there's no reason why you couldn't use visual studio to do the same thing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文