Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: skywriter on May 19, 2008, 01:19:33 pm
-
I use Code::Blocks 8.02 under WinXP.
I've got MS Visual Studio 2008 Express (VC++ 9.0) installed.
I adjusted Code::Block to use Microsoft Visual C++ 2005/2008 compiler.
But when i try to debug project it says "The debugger executable is not set".
I obtained that Code::Blocks is adjusted for using "cdb.exe" as debugger.
But there is no such file in my system!
At the same time MS Visual Studio starts debug OK.
What application should i set up as debug tool?
-
I have the same problem and was searching the CodeBlocks Wiki for an answer...
It appears that you have to download the debugging tools for Visual C++ separately - see
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#a (http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#a)
Seems a bit like car with optional steering wheel... but with MinGW, you have to download gdb separately as well!
Haven't got round to trying it yet as my PC has decided to download XP SP3....
Pls. post if you get it working.
pir
-
PS - Anybody who knows what they are doing with a Wiki able to modify the links to the MS compilers? The current ones are not correct. Maybe also put a note on where to find the debugging tools...
pir
-
Right then!
I have installed the debugging tools. (You need to specify the install path - C:/Program Files/Debugging Tools for Windows - on the "Additional Paths" tab where the toolchain executables are specified in CodeBlocks. The debugger starts but then immediately caves in with a "Symbol file could not be found" error! Basically it is looking for a *.pdb file which presumably cdb can't find because it is looking in it's local directory.
Any ideas?
(See http://msdn.microsoft.com/en-us/library/aa139733.aspx (http://msdn.microsoft.com/en-us/library/aa139733.aspx) for further information on the Windows debuggers.)
pir
-
I give up! Setting the debugger output to verbose, I can see that the project path, etc. are all being passed to cdb. Also, it seems to be looking in the right place for the 'missing' symbol file (vc90.pdb) but cannot find it. I have even tried explicitly telling the debugger where to find the .pdb file via an initial command. I conclude there is some 'feature' of the way cdb is being spawned from within CodeBlocks that is causing the problem. If anyone has any insight into how this happens, please share!
Meantime, guess I need to debug this one-off project (that uses a precomplied DLL) with print statements and go back to MinGW...
pir
-
Hei, guids, I have the same problem and try to solve it the whole morning. Now I guess I find out an way to avoid the annoying ERROR
"*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll -".
If you use CDB.EXE in the commandline without any parameters, it will print many useful informations, one of which is
Environment Variables:
_NT_SYMBOL_PATH=[Drive:][Path]
Specify symbol image path.
Now you can add the environment variable _NT_SYMBOL_PATH with value :
SRV*C:\MyLocalSymbols*http://msdl.microsoft.com/download/symbols
Here the folder C:\MyLocalSymbols is used by CDB.EXE to download symbols from Internet, you can change it to any other locations as you wish.
If you think it terrible to wait for downloading necessary symbols when you are debugging. You can download all symle packages once and install and set the install folder to the environment variable _NT_SYMBOL_PATH. The download link is http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx (http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx).
Have fun with CodeBlocks!
-
Link renamed to http://www.microsoft.com/whdc/DevTools/Debugging/symbolpkg.mspx (http://www.microsoft.com/whdc/DevTools/Debugging/symbolpkg.mspx)
looks like an change in case only.
Another link to look at is
http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx
Tim S
-
So did this solve? Can you now debug?
-
I tried to debug with cdb.exe in codeblocks but it doesn't work.
First step:
I have installed Codeblock v5716, visual c++ express 2008, Debugging Tools for Windows 32-bit Version. And set environment variable _NT_SYMBOL_PATH with
SRV*C:\MyLocalSymbols*http://msdl.microsoft.com/download/symbols.
Second step:
I add the path, C:\Program Files\Debugging Tools for Windows (x86), and Codeblocks can find cdb.exe.
Third step:
I create a default Helloworld project and add getchar() after the cout. Select Debug target and build test.exe.
( Because breakpoint does'nt work now for cdb.exe in Codeblocks, I use getchar(). )
Forth step:
[Debug]-->[Start(F8)] and Debugger said "*** WARNING: Unable to verify checksum for test.exe".
There was not any console. It looked like work because cdb.exe and test.exe run in the memory.
If I run it handily in the windows console,
C:\Program Files\Debugging Tools for Windows (x86)>cdb C:\test\bin\Debug\test.exe and use "g" command to
continue, it has the
same problem, no console. After finding the relational argument "-2", I tried to run C:\~>cdb -2 C:\~\test.exe.
The result is different. The console for test.exe is open.
cdb.exe and WinDbg are really not convenient. I like Codeblocks more. How to solve codeblocks has no console and breakpoint is down?
-
Hi, I use MS compiler on windows as well, exactly because the debugging features are very good.
Unfortunately, the only way I have found to be able to debug code written in Code::Blocks is to use the integrated debugger in the Visual Studio IDE..., but fortunaetly it is quite easy to write an entry in the Code::Blocks Tools menu that will launch the VS IDE for debugging, complete with source files etc.
See this old thread for details.
http://forums.codeblocks.org/index.php/topic,6419.0.html (http://forums.codeblocks.org/index.php/topic,6419.0.html)
On Linux I use GCC with the same project, but I feel my hands are completely tied wrt. debugging. Is there somewhere a "hold my hand" tutorial on how to do debugging in Code::Blocks under Linux?