如何在Visual Studio C ++(Express)中使用GDB来调试我的GCC Makefile项目?

时间:2022-09-01 14:35:15

I've a couple of Makefile projects on my visual studio (express) 2005/2008 (doesn't matter for now) to compile some application using the MinGW GCC compiler. I don't want to use the MS compiler because there are features that only are available on GCC.

我在我的visual studio(express)2005/2008上有几个Makefile项目(现在没关系)使用MinGW GCC编译器编译一些应用程序。我不想使用MS编译器,因为有些功能只能在GCC上使用。

Now I'd like to debug from inside VS since I'm coding from it but this requires me to use GDB (it works from the command line) but i prefer to use the IDE tools.

现在我想从VS内部进行调试,因为我正在编码,但这需要我使用GDB(它可以在命令行中运行),但我更喜欢使用IDE工具。

Is there a way to do this? Even if the Express version is limited and doesn't support it can it be done using the full version?

有没有办法做到这一点?即使Express版本有限且不支持,也可以使用完整版本完成?

3 个解决方案

#1


If you prefer IDE working under Windows you may be interested in Code Blocks or Qt Creator. They are free.

如果您更喜欢在Windows下工作,那么您可能对Code Blocks或Qt Creator感兴趣。他们是免费的。

There are commercial dev-tools for Unixes too: MagicC++ (IDE), debuggers like TotalView, Allinea, Zero-bugs, UndoDB ...

Unix上也有商业开发工具:MagicC ++(IDE),TotalView,Allinea,Zero-bugs,UndoDB等调试器......

If you want to stay with Visual Studio check this WinGDB. It is not supported by Express edition (extensions are not supported at all). But Microsoft have recently released free Visual Studio Community (has almost all features of Professional Edition), which is free and can be legally used by students/hobbyists/startups - free for individuals for developing commercial applications, free for organizations for developing open source applications, free for organizations (for up to 5 individual users) for developing commercial applications only if the organization has less than 250 computers and has less than $10M annual revenue. Refer VS 2013 Community License for more information.

如果您想继续使用Visual Studio,请检查此WinGDB。 Express版不支持它(根本不支持扩展)。但微软最近发布了免费的Visual Studio社区(几乎具有专业版的所有功能),这是免费的,可以由学生/业余爱好者/初创公司合法使用 - 免费为个人开发商业应用程序,免费为组织开发开源应用程序,只有当组织的计算机少于250台并且年收入低于1000万美元时,才能为组织(最多5个用户)免费开发商业应用程序。有关更多信息,请参阅VS 2013社区许可。

By the way VirtualBox may be very helpful (I debug (Open)Solaris or Linux as VBox machines very frequently) ;-).

顺便说一句,VirtualBox可能非常有用(我非常频繁地调试(打开)Solaris或Linux作为VBox机器);-)。

#2


Normally you cannot use it with Visual Studio Express, as VS Express does not support third-party add-ins and will only work with Microsoft debugger (requiring symbol information from Microsoft compiler).

通常,您无法在Visual Studio Express中使用它,因为VS Express不支持第三方加载项,并且只能与Microsoft调试器一起使用(需要Microsoft编译器的符号信息)。

However, you can make Visual Studio Professional (or higher) work with GDB by installing a third-party plugin such as VisualGDB.

但是,您可以通过安装第三方插件(如VisualGDB)使Visual Studio Professional(或更高版本)与GDB一起使用。

Note that there are several ways to get Visual Studio Professional for free:

请注意,有几种方法可以免费获得Visual Studio Professional:

  1. If your software company is a product-oriented startup, you can get free Visual Studio via BizSpark
  2. 如果您的软件公司是面向产品的初创公司,您可以通过BizSpark获得免费的Visual Studio

  3. If you are a student, you can also get a free Visual Studio license via DreamSpark
  4. 如果您是学生,您还可以通过DreamSpark获得免费的Visual Studio许可

#3


As far as I know, you can only debug from within the IDE if you have compiled your code with the Microsoft compiler. Otherwise, the Visual Studio debugger doesn't have a clue what to do with the GDB debug information.

据我所知,如果您使用Microsoft编译器编译代码,则只能在IDE中进行调试。否则,Visual Studio调试器不知道如何处理GDB调试信息。

#1


If you prefer IDE working under Windows you may be interested in Code Blocks or Qt Creator. They are free.

如果您更喜欢在Windows下工作,那么您可能对Code Blocks或Qt Creator感兴趣。他们是免费的。

There are commercial dev-tools for Unixes too: MagicC++ (IDE), debuggers like TotalView, Allinea, Zero-bugs, UndoDB ...

Unix上也有商业开发工具:MagicC ++(IDE),TotalView,Allinea,Zero-bugs,UndoDB等调试器......

If you want to stay with Visual Studio check this WinGDB. It is not supported by Express edition (extensions are not supported at all). But Microsoft have recently released free Visual Studio Community (has almost all features of Professional Edition), which is free and can be legally used by students/hobbyists/startups - free for individuals for developing commercial applications, free for organizations for developing open source applications, free for organizations (for up to 5 individual users) for developing commercial applications only if the organization has less than 250 computers and has less than $10M annual revenue. Refer VS 2013 Community License for more information.

如果您想继续使用Visual Studio,请检查此WinGDB。 Express版不支持它(根本不支持扩展)。但微软最近发布了免费的Visual Studio社区(几乎具有专业版的所有功能),这是免费的,可以由学生/业余爱好者/初创公司合法使用 - 免费为个人开发商业应用程序,免费为组织开发开源应用程序,只有当组织的计算机少于250台并且年收入低于1000万美元时,才能为组织(最多5个用户)免费开发商业应用程序。有关更多信息,请参阅VS 2013社区许可。

By the way VirtualBox may be very helpful (I debug (Open)Solaris or Linux as VBox machines very frequently) ;-).

顺便说一句,VirtualBox可能非常有用(我非常频繁地调试(打开)Solaris或Linux作为VBox机器);-)。

#2


Normally you cannot use it with Visual Studio Express, as VS Express does not support third-party add-ins and will only work with Microsoft debugger (requiring symbol information from Microsoft compiler).

通常,您无法在Visual Studio Express中使用它,因为VS Express不支持第三方加载项,并且只能与Microsoft调试器一起使用(需要Microsoft编译器的符号信息)。

However, you can make Visual Studio Professional (or higher) work with GDB by installing a third-party plugin such as VisualGDB.

但是,您可以通过安装第三方插件(如VisualGDB)使Visual Studio Professional(或更高版本)与GDB一起使用。

Note that there are several ways to get Visual Studio Professional for free:

请注意,有几种方法可以免费获得Visual Studio Professional:

  1. If your software company is a product-oriented startup, you can get free Visual Studio via BizSpark
  2. 如果您的软件公司是面向产品的初创公司,您可以通过BizSpark获得免费的Visual Studio

  3. If you are a student, you can also get a free Visual Studio license via DreamSpark
  4. 如果您是学生,您还可以通过DreamSpark获得免费的Visual Studio许可

#3


As far as I know, you can only debug from within the IDE if you have compiled your code with the Microsoft compiler. Otherwise, the Visual Studio debugger doesn't have a clue what to do with the GDB debug information.

据我所知,如果您使用Microsoft编译器编译代码,则只能在IDE中进行调试。否则,Visual Studio调试器不知道如何处理GDB调试信息。