This is the mail archive of the
mailing list for the GDB project.
Re: Gcc options for improving debugging?
>>>>> "Alex" == Alex Bennee <firstname.lastname@example.org> 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