Cannot set the following statement from catch in Visual Studio on 64-bit OS

We recently switched to 64-bit OS (Windows 7) and installed Visual Studio 2008. Now that you are debugging after an exception, I cannot set the next statement back to the code in the try block. I searched for this article and ended up in this article.

http://blogs.msdn.com/b/dougste/archive/2007/03/21/unable-to-set-next-statement-when-debugging-a-64-bit-debuggee-in-visual-studio- 2005-sometimes.aspx

This explains it, but it dates back to 2007. Is there any solution or work around?

+4
source share
2 answers

.NET uses the basic structure of structured Windows exception handling. There is a big difference in the way x64 exceptions are handled. It uses the address tables generated by the compiler to find the appropriate exception filter. x86 uses a linked list of function pointers, much easier to implement by the compiler.

One of the reasons the x64 method was changed was due to security reasons, the virus code managed to inject itself, correcting the linked list and throwing an exception, allowing it to carry its payload. There were counter measures against this in XP SP1 at the cost of efficiency. Reorganizing x64 avoids this cost.

Well, you can see where this heading is. You must debug code with the target platform installed on x86. It also allows Edit + Continue, a very valuable debugging tool. This is the default value for VS2010 projects. Just go to AnyCPU to build Release.

+9
source

Crazy answer: put only variable binding in catch and if / process below.

+1
source

Source: https://habr.com/ru/post/1336214/


All Articles