News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Can't debug with CodeBlocks

Started by realruntime, August 27, 2005, 10:24:36 PM

Previous topic - Next topic

realruntime

Hello,
       I tried to debug using CodeBlocks but I didn't know how and I didn't find any resource to debug with gdb.
Thanks,
Mustafa ELBanna

rickg22

Um... currently it's a bit complicated. See, the debug button just runs the program unless you have set breakpoints before.

This is fixed in CVS, where you can just advance one line and start debugging from there.

Anyway, to debug your program in codeblocks, make sure you compile with the "produce debugging symbols" option, and you can use the "run to this line" button to start debugging.

Good luck! :)

realruntime

Hello,
       Thanks, But I did this before I post and it didn't work. after choosing produce debugging symbols option. then try to make a break poing and debug using gdb, this message appears The project/Target has no debugging info. Please change this in the project's build options and retry...
        Waiting for help.
Thanks,
Mustafa ELBanna

Urxae

Quote from: realruntime on August 29, 2005, 10:11:56 AM
Hello,
       Thanks, But I did this before I post and it didn't work. after choosing produce debugging symbols option. then try to make a break poing and debug using gdb, this message appears The project/Target has no debugging info. Please change this in the project's build options and retry...
        Waiting for help.
Did you recompile (ie Compile -> Rebuild or just Ctrl-F11) after setting that option? Just setting it doesn't magically add debugging symbols to already compiled binaries, I'm afraid ;).

Maybe that message should be clearer about what "retry" in this case is, as it isn't just trying to debug again.

realruntime

Hello,
      I sure rebuild the app. after changing the option but it doesn't really works and the message appears again. and the GDB debugger generate this message:
"No symbol table is loaded.  Use the "file" command.
error"

Thanks,
Mustafa ELBanna

Urxae

Wait, what compiler are you using? Compilers other than MinGW/GCC (depending on whether you're using Windows or Linux/Unix) may not be supported by the GDB debugger...
For other compilers you may have to use an external debugger or wait until Code::Blocks supports more debuggers :(.
Well, that or switch compilers, ofcourse :mrgreen:.

realruntime

Hello,
      Thanks, I really Microsoft C++ 2003 compiler so it appears that it's not compatible with gdb. can you tell me what debugger can I use now with MS compiler?!
Thanks,
Mustafa ELBanna

grv575

download the platform sdk.
make sure produce debugging symbols is checked
add /debug to extra link options :\
rebuild
psdk->install debugging tools for windows
debug with windbg
this gives you source level debugging.
windbg tutorial here: http://www.codeproject.com/debug/windbg_part1.asp

realruntime

Hello,
      Command window of WinDbg opens and this message generates for me
"Could not create process 'w -annotate=2 -silent', Win32 error 2
The system cannot find the file specified"

!!??
Thanks,
Mustafa ELBanna

rickg22

Quote from: realruntime on August 29, 2005, 03:09:13 PM
Hello,
      Thanks, I really Microsoft C++ 2003 compiler so it appears that it's not compatible with gdb.

:roll: Why, oh why, didn't we add a "Debugging is only supported for GCC and compatibles" message?

realruntime

Hello,
       I'm sorry but when I use GCC with DirectX it generate linking error and when I use the same options with MS C++ it builds successfully. So I use MS.
Thanks,
Mustafa ELBanna

yop

That's because it uses the precompiled libs shipping with your version of the compiler. You should expect that using an MS API would rely on the MS tools...
Life would be so much easier if we could just look at the source code.

rickg22

A little off-topic, but this might help...

http://mywebpage.netscape.com/PtrPck/progtopics.htm
http://www.spacejack.org/games/mingw/mingw-dx.html

Tells how to link DirectX with GCC programs...
(All hail Google! :P )

grv575

So it looks like mingw can just use standard .lib files as well (in addition to the included .a files).  Didn't look like it was too difficult to get mingw gcc & directx working.

realruntime

Hello,
       really don't understand you, besides that is the a files related to linux??
Thanks,
Mustafa ELBanna