User forums > Using Code::Blocks

general Qu about debugging in CB with mingw

<< < (2/2)

prokaion:
Thanks!! that was pretty clear!   :D

yop:

--- Quote from: thomas on May 04, 2006, 06:34:10 pm ---...gdb explicitely supports debugging optimised code.  :shock:

--- End quote ---
Have you ever tried that? It's really funny you step in the code and you just jump up and down as the optimisation has rearranged your code.

thomas:

--- Quote from: yop on May 04, 2006, 07:30:57 pm ---Have you ever tried that? It's really funny you step in the code and you just jump up and down as the optimisation has rearranged your code.
--- End quote ---
It is extremely cool that it works at all. :)

The explanation for this feature is cool, too:

--- Quote from: gcc documentation ---Unlike most other C compilers, GCC allows you to use -g with -O. The shortcuts taken by optimized code may occasionally produce surprising results: some variables you declared may not exist at all; flow of control may briefly move where you did not expect it; some statements may not be executed because they compute constant results or their values were already at hand; some statements may execute in different places because they were moved out of loops.
Nevertheless it proves possible to debug optimized output. This makes it reasonable to use the optimizer for programs that might have bugs.
--- End quote ---

Did I ever mention that gcc is the coolest compiler on this planet? :lol:

Navigation

[0] Message Index

[*] Previous page

Go to full version