Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++: How to debug a C++ application compiled using the "Microsoft Visual C++" toolchain in eclipse?

Tags:

c++

eclipse

I have installed Eclipse CDT and CDT Visual C++ Support (from the Yoxos Marketplace).

This lets me compiled and run a C++ application, however, I cannot debug it.

So, I have installed a gdb windows binary using the mingw distribution. Now, when I try to debug, the following message is displayed in the console - No symbol table is loaded. Use the "file" command.

My uneducated guess is that gdb cannot debug binaries produced by the Visual C++ compiler.

My question is - how do I debug C++ code in eclipse built using the Visual C++ toolchain?

My environment:

  • Windows 7 64 bits
  • Eclipse Indigo (the latest version at the moment)
  • Visual Studio 2010, hence Visual C++ ver 10
  • GNU gdb (GDB) 7.3.1
  • I do not know how to get the version of CDT, but I have this jar - org.eclipse.cdt_8.0.0.201109151620.jar, so I guess the version is 8.0

Thanks.

P.S.

Moving to the MinGW g++ compiler is off scope for this question, so please - do not suggest it as the answer.

like image 505
mark Avatar asked Jan 11 '12 09:01

mark


2 Answers

Please follow this https://bugs.eclipse.org/bugs/show_bug.cgi?id=162108

Summary: As of the last comment (Doug Schaefer 2012-03-13 10:49:27 EDT) in this bug it seems there are plans to integrate this but it is not yet working.

like image 155
matteo Avatar answered Oct 24 '22 02:10

matteo


As far as I know you can't debug Visual C++ applications using gdb which is only supported by CDT plug-in.

Debugger for Visual C++ toolchain is called CDB and you have to search for the tool that can use it. For sure Visual C++ IDE (even from Express Edition) can be use to debug application that are compiled under Eclipse+CDT. I think that also some nightly builds of CodeBlocks IDE can cooperate with CDB.

like image 4
Zuljin Avatar answered Oct 24 '22 03:10

Zuljin