Il 23/09/2016 00:52, Konstantin Shegunov ha scritto:
> What's the rationale of having -O2 for debug builds on Linux (g++)? As
> the compiler moves the assembly around it becomes hell stepping through
> with the debugger. Is the flag passed intentionally (and why)?

This kind of builds ("profile" builds, or "release with debug info") is
not usually used to step, rather to be able to profile the application
and still be able to map costs to the correct functions / lines in the
original source. Running profilers on unoptimized binaries is absolutely

(Then, sure, you can also step through in a debugger, but you'll have a
*hard*, *hard* *time* understanding what the compiler did to your code...).

Hope this helps,
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

Interest mailing list

Reply via email to