This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Gcc options for improving debugging?


On Wed, Jul 19, 2006 at 01:49:54PM -0400, Paul Koning wrote:
> >>>>> "Alex" == Alex Bennee <kernel-hacker@bennee.com> writes:
> 
>  Alex> Is it the inlineing that's causing the variables to get
>  Alex> optimised away??? 
> 
> No.  GCC can make variables go away without any inlining.  And even if
> a variable isn't optimized away completely, it can become "dead" at
> some point (when it is not needed in the rest of the function).  When
> that happens, the register gets reused but GDB doesn't necessarily
> know that.  So you can still see the variable but the values it
> appears to have are wrong because that register now contains something
> else.

In addition to what Paul said:  Alex, you may want to try upgrading to
GDB 6.5.  Previous versions had a much more annoying behavior when this
happened, but 6.5 is better about it; from your initial report I guess
you're using something earlier.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]