NOPs and debug

It's often necessary to edit source code during debug. To make this fixes to take effect, usually, you need to rebuild your application and restart the debug session. But there is edit-and-continue feature in Microsoft Visual Studio, which allows these fixes to take effect without restarting of the application. Ever thought about how it works?

The secret is in NOP instructions, which compiler inserts in certain places of executable code. These instructions can be replaced with new code later. Also, they allow to place breakpoints at those source code lines, which have no correspondent executable code. E.g., at the beginning of code block (opening brace in C++ and C#). Or at the operator, that would otherwise be replaced during optimization.

BTW: NOP-instructions may also be reasonable in application's release-version. E.g., to align code block for better caching.

Labels: , ,


Post a Comment

Subscribe to Post Comments [Atom]

<< Home

Optixsoft - Software Development For Fiber Optics. Copyright 2013. All rights Reserved.
Home  |   Company  |   Services  |   Products and solutions  |   Portfolio  |   Client care  |   Contacts  |   Blog  |   Site map