简体   繁体   English

与MSVC ++ 2010编译器一起使用的调试器

[英]Debugger to Use with MSVC++ 2010 Compiler

Assuming I'm using not-Visual Studio, and building at the command line with cl.exe , what debugger should I use? 假设我使用的不是Visual Studio,并使用cl.exe在命令行中进行构建,应该使用哪种调试器?

I tried using gdb.exe from MinGW but it doesn't seem compatible with the debugging symbols that cl.exe outputs (it reports " no debugging symbols found "). 我尝试使用MinGW的gdb.exe ,但它似乎与cl.exe输出的调试符号不兼容(它报告“ 未找到调试符号 ”)。

I feel like this is a kind of ridiculous question to be asking, but it seems to be literally impossible to find information on MSVC++ that isn't VS-specific. 我觉得这是一个很荒谬的问题,但是在MSVC ++上找到非VS特定的信息似乎几乎是不可能的。

Right now I'm using an install of Visual Studio 2010 Express just for access to cl.exe , but I do not use it as an IDE. 现在,我仅使用Visual Studio 2010 Express的安装来访问cl.exe ,但并未将其用作IDE。

You should learn WinDBG, it can debug both user-mode and kernel-mode code. 您应该学习WinDBG,它可以调试用户模式和内核模式代码。 As you're referring to GDB, I assume the command line interface of WinDBG won't be a problem for you :) 当您指的是GDB时,我认为WinDBG的命令行界面对您来说不是问题:)

By the way, WinDBG is the official debugger of the Windows developers, so you can expect it to be supported for a long time. 顺便说一下,WinDBG是Windows开发人员的官方调试器,因此可以期望它得到长期的支持。

Use WinDbg . 使用WinDbg This is an excellent debugging tool, although it might get some time to get into. 尽管可能需要花费一些时间,但它是一种出色的调试工具。 MinGW won't cut it, as it uses a different symbol format. MinGW不会削减它,因为它使用了不同的符号格式。 WinDBG is also part of Windows SDK, that you likely have already installed, so just check if you have it already. WinDBG也是Windows SDK的一部分,您可能已经安装了它,因此只需检查是否已安装它即可。

If you have Visual Studios (and I don't think you can get cl.exe without it), you can still use its debugger. 如果您拥有Visual Studios(我认为没有它,您将无法获得cl.exe ),您仍然可以使用其调试器。 It's a bit wieldy, because it will insist on creating all sorts of project and solution files you'll have to delete later, but it does work. 这有点怪异,因为它将坚持创建各种项目和解决方案文件,您稍后必须删除它们,但它确实可以工作。

What I've usually done in such cases in the past is to develop using g++ and gdb (preferably under Linux), then port the working code to Windows. 在过去的这种情况下,我通常要做的是使用g ++和gdb(最好在Linux下)进行开发,然后将工作代码移植到Windows。 This means that you almost never need the VS debugger (and gdb is far more powerful than the VS debugger). 这意味着您几乎不需要VS调试器(而gdb比VS调试器强大得多)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM