Author Topic: MSVC 8 debugger  (Read 19401 times)

Offline Halan

  • Multiple posting newcomer
  • *
  • Posts: 43
MSVC 8 debugger
« on: July 12, 2007, 06:13:26 pm »
heya,

can someone explain me how to debug using msvc8 because when i try to "start debug" i always says that the debug executable is not set. But i dont know which executable the debug executeable is :(

thanks for any help,
halan

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: MSVC 8 debugger
« Reply #1 on: July 15, 2007, 07:37:07 pm »
I'm trying to find out the same information - but for MSVC 6. I've come to the conclusion that Microsoft's debugger is built into the IDE (in other words, part of the functionality of MSDEV.EXE) but it'd be great if anyone knows different.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: MSVC 8 debugger
« Reply #2 on: July 15, 2007, 09:41:50 pm »
You need Microsoft's Debugging Tools for Windows, to get the command-line debugger "cdb.exe". Make sure the folder containing cdb.exe is in the Additional Paths tab of the Toolchain executables tab of your compiler settings for MSVC. (And make sure "Debugger" is set to "cdb.exe" -- which it should be by default for Microsoft compilers.)
« Last Edit: July 15, 2007, 09:43:21 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: MSVC 8 debugger
« Reply #3 on: July 15, 2007, 10:50:32 pm »
Hi,

I use VC2005 Express with C::B, partly because the MSVC debugger is quite good. I have found the easiest is to make a global variable in C::B called VC2005IDE which points to the install dir of VC2005 Express in my case.

Then I configure a tool in the Tools menu

Name: VC2005 Debug
Executable: $(#VC2005IDE)\VCExpress.exe
Parameters: /debugexe ${TARGET_OUTPUT_FILE}
Working directory: ${TARGET_OUTPUT_DIR}
check the option "Launch tool visible detached"

So while I edit/compile/build in C::B, this simple fix launches the VC2005 Express for debugging when needed. Notice that you don't need a VS project/solution to do this.

cacb

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: MSVC 8 debugger
« Reply #4 on: July 15, 2007, 11:01:29 pm »
cacb: That's an excellent tip! I wonder if there's any way that could make it into the C::B Wiki...
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: MSVC 8 debugger
« Reply #5 on: July 16, 2007, 08:00:45 am »
cacb - it is indeed a useful tip, but what do you get at the end of it? Does it allow you to debug from within C::B or does it simply launch VCExpress as a separate process?

I tried the same kind of thing with Visual Studio 6 (whose exe happens to be called MSDev.exe) but all that happened was that it launched a separate VS6 debugging session (with the named exe already attached) but there was no source code.  :(

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: MSVC 8 debugger
« Reply #6 on: July 17, 2007, 11:54:35 am »
Hi,

Sorry for the late reply (internet connection lost for some time). When you debug this way, it launches the VC2005 Express IDE with its integrated debugger. You can then debug as if the program had been developed there. It would be preferrable to have the MS debugger integrated in C::B of course, but I think this is an acceptable work-around if C::B integration is not possible.

You can do the exact same thing in VC6, there is no difference really. In both cases you have to drop the source files into the IDE (because there is no source file project) to set breakpoints etc. We are simply using a standard feature of the VS debuggers here

If you start with an empty VS (no workspace/project open):
in VC6: Build | Start Debug | Attach to process...
in VC2005 Express: Tools | Attach to Process ...

All we are doing is to use this feature via C::B Tools menu and VS command line options. Full source debugging is available as normal, you just have to open some files explicitely to set breakpoints.

On Linux I use GCC and the integrated C::B debugger. What I miss there is to be able to set the keyboard shortcuts the way I am used to with the VS debugger, especially
F10 : Step over
F11 : Step Into
Shift+F11: Step out

I find myself trying to use these all the time on Linux and it doesn't work :-)

Offline koen

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: MSVC 8 debugger
« Reply #7 on: August 24, 2007, 11:42:55 am »
Note: I had to replace

/debugexe ${TARGET_OUTPUT_FILE}

by

/debugexe ${TARGET_OUTPUT_BASENAME}

otherwise some parts of the path were duplicated.

Offline Albenejean

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: MSVC 8 debugger
« Reply #8 on: August 24, 2007, 10:11:09 pm »
Hi,

I use VC2005 Express with C::B, partly because the MSVC debugger is quite good. I have found the easiest is to make a global variable in C::B called VC2005IDE which points to the install dir of VC2005 Express in my case.

Then I configure a tool in the Tools menu

Name: VC2005 Debug
Executable: $(#VC2005IDE)\VCExpress.exe
Parameters: /debugexe ${TARGET_OUTPUT_FILE}
Working directory: ${TARGET_OUTPUT_DIR}
check the option "Launch tool visible detached"

So while I edit/compile/build in C::B, this simple fix launches the VC2005 Express for debugging when needed. Notice that you don't need a VS project/solution to do this.

cacb

Excellent!!!!!!!!!!!  :mrgreen:

Thanks a lot!

Quote
cacb: That's an excellent tip! I wonder if there's any way that could make it into the C::B Wiki...
That would be great, because I had searched for this kind of trick so long.... And I hadn't find anything...
« Last Edit: August 24, 2007, 10:12:52 pm by Albenejean »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MSVC 8 debugger
« Reply #9 on: August 25, 2007, 07:52:01 am »
Quote
cacb: That's an excellent tip! I wonder if there's any way that could make it into the C::B Wiki...
That would be great, because I had searched for this kind of trick so long.... And I hadn't find anything...
Well - it's a WiKi. So everybody of you can do it.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Albenejean

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: MSVC 8 debugger
« Reply #10 on: August 25, 2007, 03:36:18 pm »
Quote
cacb: That's an excellent tip! I wonder if there's any way that could make it into the C::B Wiki...
That would be great, because I had searched for this kind of trick so long.... And I hadn't find anything...
Well - it's a WiKi. So everybody of you can do it.
I think I can do it...
I've looked the wiki for the right place to do it...
Do I write it in the FAQ, or under "Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE" and "Integrating Microsoft Visual C6 with Code::Blocks IDE"