Author Topic: GDB Skips break points  (Read 7269 times)

Offline Geoffles

  • Multiple posting newcomer
  • *
  • Posts: 12
GDB Skips break points
« 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 :)


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2874
Re: GDB Skips break points
« Reply #1 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.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2874
Re: GDB Skips break points
« Reply #2 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.

Offline Geoffles

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: GDB Skips break points
« Reply #3 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!

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2874
Re: GDB Skips break points
« Reply #4 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.
« Last Edit: May 24, 2008, 02:01:19 pm by Pecan »

Offline darcwader

  • Single posting newcomer
  • *
  • Posts: 7
Re: GDB Skips break points
« Reply #5 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.