Author Topic: debugger terminates application  (Read 2784 times)

jhinrichs

  • Guest
debugger terminates application
« on: March 08, 2008, 09:44:15 pm »
Hi, first timer here, i just downloaded CodeBlocks 8.0.2 and i have some problems with the debugger.

What happens:
The program builds ok, i start it using debug, this is the output:

Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Entwicklung\Wesnoth\Wesnoth_SVN_Work\Wesnoth SVN\
Adding source dir: C:\Entwicklung\Wesnoth\Wesnoth_SVN_Work\
Adding file: ..\Wesnoth_cb.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.3
Child process PID: 7368
Program exited normally.
Debugger finished with status 0

Same thing if i start the program first and attack the process via PID: The program gets terminated immediately.

What i use:
WinXP SP2
CodeBlocks 8.0.2
gcc 3.4.5
gdb 6.3

What else:
yes, i did a search on the forum before posting this. Some topics seem close but didn't enlighten me.
yes, i compiled with -g and without -s
yes, i rebuilt the whole project again to make sure every object file got it
the project is a windows GUI project, using SDL (but not an SDL project)

It's not the code itself since it runs ok. I can debug with gdb from the command line without problems, though if i use it within dev-cpp it's next to useless (all kind of strange behaviour, hangs, freezes etc).

Also for some reason i can't make it use the gdb version delivered with CodeBlocks (which is 6.7) by changing the toolset-chain-executables.

Any help on this is very much appreciated.
In fact, CodeBlocks feels more comfortable than dev-cpp and about the only reason i tried using it is the hope, that there is a decent debugger with a visual interface (i used vc++ for a long time but for a couple of reasons it's not an option for this project anymore).

Offline severach

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: debugger terminates application
« Reply #1 on: March 12, 2008, 04:13:36 am »
You mentioned most of the obvious things but I don't see anything about placing a breakpoint. Code::Blocks debugger does not stop at the first line in main if there are no breakpoints set. Place a breakpoint.

Keep your  optimizations low or off. Heavy optimization tends to scramble the output code up to where debugging can get funny. Lines may not be compiled in the order they show on the screen or functions may be automatically inlined.