Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug program compiled in MS VC++ 2010 Express with gdb

Is it possible to build executable with Microsoft Visual C++ Express, so it could be debugged with gdb?

I tried C7 compatible /Z7 compiler option with /debug linker option, but resulting .pdb file is not recognized by gdb:

(gdb) symbol-file HelloWorldVC.pdb
`HelloWorldVC.pdb': can't read symbols: File format not recognized.
like image 991
rmflow Avatar asked Nov 10 '14 14:11

rmflow


People also ask

Does Visual Studio have GDB?

Visual Studio Code supports the following debuggers for C/C++ depending on the operating system you are using: Linux: GDB. macOS: LLDB or GDB. Windows: the Visual Studio Windows Debugger or GDB (using Cygwin or MinGW)

How do I debug a program in Dev C++?

To set a breakpoint on a line, just click on the gutter (the gray band on the left), or press Ctrl-F5. Now you are ready to launch the debugger, by pressing F8 or clicking the debug button. If everything goes well, the program will start, and then stop at the first breakpoint.

How do I make debug mode in Visual Studio?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).


1 Answers

GDB has a different debug format than Microsoft's compiler. Indeed the PDB format is not documented. So you can't use the debug information generated by a Microsoft compiler with GDB.

Honestly I can't find any benefit of GDB that I would use it instead of the debugger of Microsoft Visual Studio.

like image 91
harper Avatar answered Sep 21 '22 17:09

harper