Author Topic: [MinGW] Debugger not pausing at breakpoints  (Read 4016 times)

Offline Abi79

  • Newcomer
  • *
  • Posts: 2
[MinGW] Debugger not pausing at breakpoints
« on: March 28, 2012, 07:32:55 am »
Hello. When trying to debug a C++ project (build target set to debug, compiler flag -g set, toolchain executables for MinGW set correctly, OS Windows 7 32 bits), the debugger will not stop at any breakpoints. The debugger only stops when it catches a signal like SIGSEGV or when input is required from the keyboard. "Run to cursor", "Start [F8]" and "Step into" all have the same behaviour.

Tried both CodeBlocks 10.05, and nightly 7789.

I tried searching, but I couldn't find something similar on the forums. Would appreciate any help to get it to work. Thanks :)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 7788
Re: [MinGW] Debugger not pausing at breakpoints
« Reply #1 on: March 28, 2012, 08:02:48 am »
Read this: http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

Try a debugger's branch nightly.
Try a console debugging session.
If all doesn't work post the full log of the debugger.
<debugger plugin maintainer>
(most of the time I ignore long posts)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4185
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [MinGW] Debugger not pausing at breakpoints
« Reply #2 on: March 28, 2012, 08:10:52 am »
What's the exact steps we can reproduce your bug? Code, complier, gdb. We need all those information.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Abi79

  • Newcomer
  • *
  • Posts: 2
Re: [MinGW] Debugger not pausing at breakpoints
« Reply #3 on: April 02, 2012, 02:12:36 pm »
Follow up to this, a regression in GDB 7.4 was the reason, because I had spaces in my file path.
http://sourceware.org/bugzilla/show_bug.cgi?id=13798

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4185
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [MinGW] Debugger not pausing at breakpoints
« Reply #4 on: April 02, 2012, 02:24:57 pm »
Follow up to this, a regression in GDB 7.4 was the reason, because I had spaces in my file path.
http://sourceware.org/bugzilla/show_bug.cgi?id=13798
OK, so it is a gdb bug.
You can check out/clone that gdb line spec re-write branch, and build a gdb yourself. I have some experience some days ago under MSYS+mingw, we also have some discussion in our c::b forum about how to specify a breakpoint command.

See:
http://forums.codeblocks.org/index.php/topic,16116.0.html
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.