Code::Blocks
October 25, 2014, 08:57:01 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: When registered with our forums, feel free to send a "here I am" post in http://forums.codeblocks.org/index.php/topic,14168.0.html to differ human beings from SPAM bots.
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: MSVC 8 debugger  (Read 10447 times)
Halan
Advanced newcomer
*
Offline Offline

Posts: 43


« 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 Sad

thanks for any help,
halan
Logged
johne53
Regular
***
Offline Offline

Posts: 251


« 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.
Logged
TDragon
Lives here!
****
Offline Offline

Posts: 918



WWW
« 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 » Logged

http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 4.8.1 2013-10-06 with 32/64-bit, fixed exceptions/DLLs)
cacb
Regular
***
Offline Offline

Posts: 259


« 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
Logged
TDragon
Lives here!
****
Offline Offline

Posts: 918



WWW
« 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...
Logged

http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 4.8.1 2013-10-06 with 32/64-bit, fixed exceptions/DLLs)
johne53
Regular
***
Offline Offline

Posts: 251


« 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.  Sad
Logged
cacb
Regular
***
Offline Offline

Posts: 259


« 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 :-)
Logged
koen
Advanced newcomer
*
Offline Offline

Posts: 13


« 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.
Logged
Albenejean
Advanced newcomer
*
Offline Offline

Posts: 65


« 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 » Logged
MortenMacFly
Administrator
Lives here!
*****
Offline Offline

Posts: 8677



« 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.
Logged

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ
Albenejean
Advanced newcomer
*
Offline Offline

Posts: 65


« 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"
Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!