Author Topic: Very Simple Debugger Issue  (Read 4958 times)

Offline solarwind

  • Multiple posting newcomer
  • *
  • Posts: 11
Very Simple Debugger Issue
« on: June 21, 2008, 10:20:30 am »
Hey all, I'm using Code::Blocks on winbloze and I have a simple debugger issue.

My program is as follows:



When I set the breakpoint and hit debug, Code::Blocks ignores it and continues execution until the end. It just jumps past the breakpoint... Is this supposed to happen?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Very Simple Debugger Issue
« Reply #1 on: June 21, 2008, 11:09:06 am »
make sure you build with debug settings on : project options : -g
and don't have the debug symbols stripped.

Offline solarwind

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Very Simple Debugger Issue
« Reply #2 on: June 21, 2008, 05:54:53 pm »
It IS building with -g:

Code
-------------- Build: Debug in Derek_Engine ---------------

mingw32-g++.exe -Wall -fexceptions  -g  -march=i686 -O3 -g    -c "C:\Documents and Settings\Administrator\My Documents\CppWorkspace\Derek_Engine\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe  -o bin\Debug\Derek_Engine.exe obj\Debug\main.o   
Output size is 585.07 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings
 

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
Re: Very Simple Debugger Issue
« Reply #3 on: June 21, 2008, 06:08:10 pm »
Are you debugging in Constructors and Destructors?
See warning and example at the end of:
   http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

Offline solarwind

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Very Simple Debugger Issue
« Reply #4 on: June 21, 2008, 06:31:58 pm »
No, it's just a single man.cpp helloworld file.... Looks exactly as it is in the screenshot.
« Last Edit: June 21, 2008, 06:33:31 pm by solarwind »

Offline rhf

  • Multiple posting newcomer
  • *
  • Posts: 123
Re: Very Simple Debugger Issue
« Reply #5 on: June 21, 2008, 10:13:31 pm »
Try turning off the optimize option:
Project->Build options...->Compiler Flags -> Uncheck Optimize fully [-03]

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Very Simple Debugger Issue
« Reply #6 on: June 21, 2008, 11:24:33 pm »
It IS building with -g:

Code
-------------- Build: Debug in Derek_Engine ---------------

mingw32-g++.exe -Wall -fexceptions  -g  -march=i686 -O3 -g    -c "C:\Documents and Settings\Administrator\My Documents\CppWorkspace\Derek_Engine\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe  -o bin\Debug\Derek_Engine.exe obj\Debug\main.o   
Output size is 585.07 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings
 

You do realize that -O3 will probably eliminate/alter a lot of the code and, obviously, you won't be able to put breakpoints on it?
Be patient!
This bug will be fixed soon...

Offline solarwind

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Very Simple Debugger Issue
« Reply #7 on: June 22, 2008, 12:20:40 am »
Try turning off the optimize option:
Project->Build options...->Compiler Flags -> Uncheck Optimize fully [-03]

It IS building with -g:

Code
-------------- Build: Debug in Derek_Engine ---------------

mingw32-g++.exe -Wall -fexceptions  -g  -march=i686 -O3 -g    -c "C:\Documents and Settings\Administrator\My Documents\CppWorkspace\Derek_Engine\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe  -o bin\Debug\Derek_Engine.exe obj\Debug\main.o   
Output size is 585.07 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings
 

You do realize that -O3 will probably eliminate/alter a lot of the code and, obviously, you won't be able to put breakpoints on it?

I totally did not realize that that could have been the issue. Thanks a lot! That fixed it!