User forums > Using Code::Blocks
Don't understand debugging..???
johne53:
I'm using Code::Blocks under OpenSuse Linux. When I first downloaded C::B I tried a simple "Hello World" type app (writen in C++, using gcc compiler) and everything seemed fine. I was able to set breakpoints / single-step through the code etc.
Now I'm trying to debug a more complex project. I've definitely built a Debug version and I've set some breakpoints - but the debugger doesn't stop at them. I see this ouput in the debugger window....
--- Quote ---Setting breakpoints
Debugger name and version: GNU gdb 6.5
Continuing...
No symbol table is loaded. Use the "file" command.
--- End quote ---
So I've gone back to my simple 'Hello World' app and I can't get that to work either!!! I've updated C::B several times since I first installed it - so wither something's stopped working (unlikely) or there's something that I did last time that I've forgotten about in the interim.
Can anyone suggest a reason why my breakpoints don't work any more??
johne53:
I can hardly believe this.... all of a sudden it's started working again - though not very well. For example, if I stop at a breakpoint, CTRL+F7 doesn't continue whereas dropping down the Debug menu and selecting 'Continue' does continue. Under Linux, I've had various problems in the past with CTRL. But I always found that F4 could be used in its place. So I tried pressing F4+F7 instead of CTRL+F7. This does cause the program to continue - but it also adds a strange 'Ś' character at the current cursor position. Also, stepping into a function (which I'd expect to be almost instantaneous) can take anywhere from 5 to 30 seconds. On top of those problems, I can't seem to set a new breakpoint whilst my app is running in the debugger. I have to stop it, set the breakpoint and then re-start.
Also, if I set a new breakpoint then re-start the debugger, a message box appears telling me that the default C::B layout has changed and asking if I want to save it. This gives me the impression that my breakpoints will get saved - but they aren't. If I close the session, then re-open it later, all my breakpoints have vanished.
Surely debugging can't be this bad with C::B and gdb..???
dempl_dempl:
Go to Project->Build Options . Check "-g" option ( Build with debugging symbols ).
If that doesn't do the job, use apt-get to upgrade and install all relevant code::blocks debs/rpms .
It worked for me.
johne53:
Thanks. I already checked the -g option which is selected for every source file.
My real concern is the fact that this was working perfectly - then it wouldn't work at all - now it suddenly works very badly. When I first dowloaded C::B (in April) I did lots of tests on it and was hugely impressed. But each time I upgrade to a newer version it seems to get gradually less & less reliable. I now have features that work when they feel like it and a couple of bugs which are 100% repeatable for me but nobody else seems to be able to reproduce them.
The only things I've been updating are Code::Blocks itself and wxWidgets. Are there other elements that I should have been updating too?
I've tried updating from RPM's and also building from source (which required me to obtain wxWidgets_devel). But no matter how I updated C::B, wxWidgets was the only other thing I updated along with it. Should I have been doing more?
Jenna:
have you tried to clean the sourcetree and rebuild your project (not just buil or rebuild), and unset (if set) all optimization and stripping for debug-target ?
Navigation
[0] Message Index
[#] Next page
Go to full version