使用 MSVC 进行调试

huangapple go评论76阅读模式
英文:

Debugging using MSVC

问题

In GNU toolset, I can easily understand the debugging process of a cpp program. It uses an executable called GDB for the same. However, I don't really understand the debugging process in MSVC toolset. I use VSCode along with Visual Studio Build Tools.

我可以轻松理解GNU工具集中C++程序的调试过程。它使用一个名为GDB的可执行文件来实现。然而,我并不真正了解MSVC工具集中的调试过程。我使用VSCode以及Visual Studio Build Tools。

I first believed that there is an executable like GDB in MSVC toolset which allows this to happen. However, I am not able to find one.

我最初认为在MSVC工具集中有一个类似GDB的可执行文件,可以实现这个功能。然而,我找不到一个。

So what actually happens during debugging in MSVC?? In case of GDB, I can easily debug using the command line. Can I do the same by in MSVC?? What are the different executables in the toolset that allow this to happen?? Or, is there a completely different process involved?

那么在MSVC中调试实际上发生了什么?在GDB的情况下,我可以轻松使用命令行进行调试。在MSVC中是否也可以这样做?工具集中有哪些不同的可执行文件允许这样做?或者,是否涉及完全不同的流程?

英文:

In GNU toolset, i can easily understand the debugging process of a cpp program. It uses an executable called GDB for the same. However, I don't really understand the debugging process in MSVC toolset. I use VSCode along with Visual Studio Build Tools.

I first believed that there is an executable like GDB in MSVC toolset which allows this to happen. However, i am not able to find one.

So what actually happens during debugging in MSVC?? In case of GDB, i can easily debug using the command line. Can i do the same by in MSVC?? What are the different executables in the toolset that allow this to happen?? Or, is there a completly different process involved??

答案1

得分: 1

在MSVC工具集中实际上没有独立的调试器(我不是在谈论Visual Studio,请参考此链接)。

在VSCode中,C/C++扩展带有一个名为vsdbg.exe的独立调试器,用于调试使用MSVC工具集编译的应用程序。

因此,要通过命令行使用MSVC工具集进行调试,可以直接在终端中调用vsdbg.exe并传递所需的参数。

在评论中提到的WinDBG是一种更通用和高级的软件调试工具,可以调试任何编写在任何语言中的代码。

英文:

There are actually no standalone Debuggers shipped with MSVC toolset (I am not talking about Visual Studio, refer to this).

In VSCode, the c/c++ extension comes with a standalone debugger called vsdbg.exe which is used to debug application compiled using the MSVC toolset.

So to debug through the command line using the MSVC toolset, one can directly call vsdbg.exe in a terminal and pass the required arguments.

The WinDBG talked about in the comments is a more universal and advance software debugging tool which can debug any code written in any language.

huangapple
  • 本文由 发表于 2023年6月8日 18:59:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76431140.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定