This is the mail archive of the 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: Debugging gnugcc optimized code (O1 or O3) on ar,

On Tue, Jan 6, 2009 at 10:43 PM, Naval Saini <> wrote:
> Hi:
> We have seen that a gdb issue when debugging an optimized code (-O1 or
> -O3), compiled by gnugcc toolchain.

So do you have a question, a suggestion, or are you just letting
us know that GDB doesn't work for you and therefore we should
refund the money you paid us for it?     :-)

> Basically, gdb is unable to keep a track of local variables when the
> code is sufficiently complex (depth of function calls is decently
> big). At times, a variable can go out of scope without gdb knowing
> about it OR it can start displaying incorrect values of the variables
> (indicating it is unaware of which variable is present in which
> register).

Yes, debugging sufficiently optimized code is hard, and GCC
often doesn't put correct debug info out. There is some work
on GCC to fix some of these problems; you may get better results
with gcc-4.3. Then again, it may also get worse -- there are some
new optimizations, and new "incorrect debug info" bugs as well.

If you want the situation to improve, rebuild GDB with '-g' and
start hacking, or at least write small test cases, and file bug

> Our sw configuration is following :-
>  1. gnugcc 4.1.1 toolchain - cross-compiling code for arm V6 (or arm 11)
>  2. gdb-6.7.1
>  3. OS - Linux , Library used - uclibc
> Regards,
> Naval

Paul Pluzhnikov

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