Ryan Mansfield(deleted)
|
Re: RE: RE: the right -g option to be able to use gdb effectively
|
Ryan Mansfield(deleted)
11/28/2007 3:14 PM
post3062
|
Re: RE: RE: the right -g option to be able to use gdb effectively
> You should be able to use gdb with any optimization level (with -g option,
> of course).
>
> The difference you will probably see with higher optimization levels is, for
> example, not being able to set a breakpoint using function name of a
> function that was inlined by the compiler (you should still be able to set a
> breakpoint using filename:linenumber format).
>
Yep, another one is that line information tends to become skewed as the dead code/variables are removed. It is important
to understand -g does not change how code is generated but optimization impacts the correctness of the debug
information generated. I generally find "-O2 -g" to be easily debugged under GDB.
Regards,
Ryan Mansfield
|
|
|