6

I'm working on a C++ project using the free Microsoft Visual C++ Toolkit 2003 (compiler VC++ 7.1) and the CodeBlocks IDE. As you might know, this free package does not include the debugger tool, just compiler and linker.

Is there any way to include a debugger in my current scenario? What are my chances of debug this project without using Visual Studio?

cdonts
  • 9,304
  • 4
  • 46
  • 72
  • 1
    I'm not sure what the Visual C++ "Toolkit" is, but the free editions of VC++/VS have always had a debugger (at least since 2008 which is the first one I used). You can download the latest one here (choose the Community Edition): https://www.visualstudio.com/ – user1610015 Jul 27 '15 at 21:04
  • @user1610015 The toolkit doesn't include the VS IDE, just compiler and linker. I'd prefer keep using CodeBlocks, but being able to use VC++'s debugger. Can the debugger be downloaded as a standalone tool to be included in C::B just like the compiler? – cdonts Jul 27 '15 at 21:35
  • No, the debugger is integrated in VS as part of the UI. – user1610015 Jul 27 '15 at 21:55
  • @user1610015 Fine. Any other solution? Installing VS is my last option. – cdonts Jul 27 '15 at 22:36
  • I think there's a standalone debugger called WinDbg, and others, but I can't really suggest anything because I haven't used them. – user1610015 Jul 27 '15 at 22:48
  • @user1610015 Yes. Actually, WinDbg is included by default at least on Windows 8. However, it seems it can't be integrated with CB. It would be better if the debugger shows me the specified line when an exception is raised. – cdonts Jul 28 '15 at 02:39
  • Is there a reason why you have to use the very old Microsoft Visual C++ Toolkit 2003 rather than a GCC Windows toolchain, that would include a debugger? – Mike Kinghan Jul 31 '15 at 11:11
  • @MikeKinghan Well, the project is somewhat large and uses compiler specific features such as `__asm` and naked functions. Moving to mingw is a good idea, but will take some time. And I really don't know if gdb supports remote process debugging. Newer Microsoft compilers, as far as I know, are not available as standalone downloads. However I've tried building with VS2008 and I still have to do some migration stuff in my code. Also I feel very comfortable with C::B. – cdonts Jul 31 '15 at 19:43
  • See http://stackoverflow.com/questions/4659754/the-gs-g-option-equivalent-to-vs2010-cl-compiler then use WinDbg. – ThatOneDude Aug 05 '15 at 18:44

2 Answers2

1

Don't know about Microsoft Visual C++ Toolkit 2003 but CodeBlocks IDE comes with a default debugger(GDB/CDB). During the installation the wizard asks to GDB as the default debugger.

If you have installed the debugger and if there is some configuration problem then you can goto Settings->Debugger and set the debuggers path.

If the debugger is not installed the you can install it by going to Plugins->Manage Plugins->Install New Plugin

Can't Post images sorry.

Build3r
  • 1,748
  • 16
  • 22
1

Since Code::Blocks is your preference, and you wish to use remote debugging, and you have experience with the VC compiler, the easiest and smoothest solution may be to stay on that path. As @user1610015 suggested, update to VS2015 Community Edition, which most certainly contains a standalone compiler (cl) and linker (link). Of course, CL will call the linker on your behalf, unless you specify otherwise.

Here is the comparison chart (select 'expand all') of VS editions.

As a bonus, you will receive some tremendous updates with respect to modern C++ (11 and 14), better remote debugging, better code generations, countless optimizations, improved error reporting and analysis, and others.

However with respect to __asm (as of VS2013), you will be limited to x86. When requiring x64, some have chosen to port this to intrinics, but many simply move the assembler to a separate .asm file, and a small configuration change to have VS compile the file:

  • Select the project (not .sln)
  • From the menu, select Project --> Build Custizations...
  • Check the box next to masm

If you intend to target x86, no changes will be necessary. You didn't specify the migration changes with your reference to VS2008, but having migrated several large old projects from early VS compilers, I have found the experience to be pretty painless.

If your compiler specific code is not overwhelming, consider Clang and gcc (MinGW). I like to use CLion, and use gcc to compile the same projects (CMake) which I have a VS2015 project and solution for. I am sometimes surprised at some necessary corrections. I haven't tried Code::Blocks, but I suspect it is a similar exercise.

Good Luck. I am certain you will crush it.

Jeff
  • 2,495
  • 18
  • 38
  • Thanks. I'll give VS2015 a try. It seems very powerful and I'm working with a somewhat old compiler! – cdonts Aug 06 '15 at 01:54
  • @cdonts - let me know if you need a bit of help with a specific migration issue – Jeff Aug 06 '15 at 21:07