Sign in to follow this  
godmodder

GDB troubles

Recommended Posts

godmodder    828
Hello, I use the GDB debugger in combination with the Code::Blocks IDE and everytime I want to debug in a constructor, it can't see any of my watches or local variables. In regular functions everything works perfectly. Does anybody have the same problem or know how to fix it? I'm using gdb 6.7.1 Thanx in advance for any help, Jeroen

Share this post


Link to post
Share on other sites
Adam_42    3629
Sounds like it might be down to this gcc bug

I'd suggest either:

- Make the constructors you need to debug call a separate initialization function instead of doing the initialization directly.

- Use a different compiler.

Share this post


Link to post
Share on other sites
It isn't a bug, but a "feature" of the 3.4 series which makes it impossible for the debugger to correctly resolve the constructor. Use the 4.2.x version, and you will be good.

I'm using MinGW gcc 4.2.1 / gdb 6.7.50 / Code::Blocks now, and setting breakpoints in constructors works just fine. It is also worth using the 4.2 branch for the truly awesome optimisation capabilities (something that isn't so great with the 3.4 branch).
Note that you will have to adjust your compiler settings ("toolchain executables") when switching to gcc 4.2, as the programs have a -dw2 or -sjlj postfix (depending on which one you choose).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this