11.6. Debugging Optimized Programs

An optimized program no longer has an exactly matching relationship between the programmer's sequence of instructions in assembly language or a high-level language and the generated sequence of machine instructions. Accordingly, the recommended practice is to inhibit or sharply curtail optimizations when using a debugger, in order to avoid confusion.

In rare instances, an unoptimized program may appear to work correctly, yet the optimized version seems to operate peculiarly. Some debugger capabilities can still be of use, such as stopping on entry to a routine or perhaps watching for changes to a variable. Optimized instruction sequences may keep variables from a high-level language in registers and update them ...

Get Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.