[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why -g flag?



Richard Braakman <dark@xs4all.nl> writes:

> Strange.  I usually debug binaries compiled with -O2 -g, and I've
> never had any problems doing so.  How could it be "all but useless"
> for you?

Because -O2 can cause the compiler to reorder instructions, move some
things out of loops, etc.  Stepping through a file can leave you at
different lines than expected.  Similarly, instructions previously on
one line may have been split up into rather separate areas.

This is documented somewhere, probably the gdb info pages.

> 
> Richard Braakman
> 
> 
> --  
> To UNSUBSCRIBE, email to debian-policy-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: