avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] Re: sprintf


From: David Brown
Subject: [avr-gcc-list] Re: sprintf
Date: Mon, 02 Mar 2009 19:03:43 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

David Kelly wrote:
On Mon, Mar 02, 2009 at 10:16:39AM -0500, David VanHorn wrote:
Disable optimizations, -O0 I believe, and the source code debugger
will more closely track the actual lines of code.
Ouch!  That takes me from about 1.8k to over 7k.

Yes, but the larger code is a more literal translation of your source
code which the debugger can more easily map source code 1:1 to generated
assembly.

-O0 is handy when learning C and wanting to see an assembly translation.

I find it a lot easier with -O1 than -O0. With no optimisation, there is so much extra code handling local variables on the stack and the like that it is difficult to follow what is actually happening. With -O1 you get a fairly literal translation, but local data is in registers.

> Code should be debugged using the same optimization one will ultimately
> ship code no matter the debugger seems to jump around.
>

That depends on why you are debugging. If you are debugging your algorithms, it doesn't matter what optimisation you are using. If you are debugging timing or implementation problems, then obviously it does matter.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]