Code::Blocks Forums

User forums => Help => Topic started by: Geoffles on May 23, 2008, 04:55:09 pm

Title: GDB Skips break points
Post by: Geoffles on May 23, 2008, 04:55:09 pm
Hi there,

I seem to be having some problems while trying to debug. Although i can set break points in my different source files, GDB doesnt seem to stop on them except for my main source file. I can step through the program, but commands such as run to cursor just finish running the program and don't stop.

Is this normal GDB behaviour? Is it something I am doing or is this a code::blocks problem?

I'm using CB 8.02 with MinGW 3.4.5, and its GDB 5.2.1

Any help would be greatly appreciated, thanks :)

Title: Re: GDB Skips break points
Post by: Pecan on May 23, 2008, 07:23:04 pm
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks
Debugging with Code::Blocks - CodeBlocks

Maybe the workaround for breakpoints in ctors/dtors will help.
Title: Re: GDB Skips break points
Post by: Pecan on May 23, 2008, 07:32:03 pm
That GDB version should be at least 6.3.

You could just use the one suggested by the CodeBlocks install.
Title: Re: GDB Skips break points
Post by: Geoffles on May 24, 2008, 01:22:16 pm
Thanks for your reply, I have updated my GDB to 6.8 now, and I have read the link you posted and I tried a little experiment.

I don't know quite what is going on, but when I first tried the debugging after updating GDB it didn't make any difference, then I tried doing a clean build, and it still didn't work. Then I tried making dummy class which then worked, even from the constructor. I then removed it and suddenly it was stopping at my break points Oo

Other thing I tried changing was explicit inclusion of all the header files my main source file, and i cant seem to replicate it not stopping at the break points any more, which is a good thing, unless it happens again :P

Thanks for your help!
Title: Re: GDB Skips break points
Post by: Pecan on May 24, 2008, 01:59:26 pm
Another suggestion:

Make sure that all your debugged source files are part of (included in) a CodeBlocks project so that CodeBlocks can effectively handle handing off the source files and their location to GDB.
Title: Re: GDB Skips break points
Post by: darcwader on May 27, 2008, 01:17:53 pm
i had faced similar issue, but i was using a custom makefile. after i set the execution directory proper for debug target ... Project  >  Properties > build targets :: execution working dir (same as debug dir) it worked for me.