RE: Step by Step skips large chunks of code
- From: Scott <snorberg@xxxxxxxxxxxxxxxxx>
- Date: Fri, 26 Sep 2008 09:49:03 -0700
OK, I tried switching to the disassembly window and then continue to step
through the code. It would go normally for several lines and then jump to the
next breakup point.
--
Scott
""Hongye Sun [MSFT]"" wrote:
Hello Scott,.
Thanks for your post.
One of the reason for such kind of problem is code optimized. Compiler will
decide to skip some code if they are not necessary to execute.
In order to check if the project code has been optimized. Could you please
check the following settings:
1. Is the project compiled as debug mode or release mode?
2. In project properties page, switch to [Build] tab, and check if the
[optimize code] option is checked?
Visual Studio also provide a powerful tool for us to check if the C# code
has been correctly complied into assembly code.
When a breakpoint is hit, open menu [Debug] / [Windows] / [Disassembly]. It
will switch the source code tab to a Disassembly tab. Inside the
Disassembly tab, we could see that every C# statement with its associated
assembly code below. If there is no assembly code below the C# code, that
tells us this C# code has been optimized. We could also use F10 (Step Over)
to debug it at assembly code level to check if the debugger skips assembly
code.
The solution to code optimized is to uncheck the [optimize code] and switch
compile mode to debug.
If the solution does not work, I would suggest you to create a new project
with default project settings and copy the debugged code into the new
project. Debugging the same code with another project let us eliminating
the project settings' impaction.
In the meanwhile, you could send me your project zip file, so that I could
help you analyze the code and project settings. (My email address is
hongyes@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Please feel free to let me know if you have any question. I will be more
than happy to be assistance.
Regards,
Hongye Sun (hongyes@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
- References:
- Step by Step skips large chunks of code
- From: Scott
- RE: Step by Step skips large chunks of code
- From: "Hongye Sun [MSFT]"
- Step by Step skips large chunks of code
- Prev by Date: RE: Step by Step skips large chunks of code
- Next by Date: Re: ADO Record Count Issue
- Previous by thread: RE: Step by Step skips large chunks of code
- Next by thread: RE: Step by Step skips large chunks of code
- Index(es):
Relevant Pages
|
Loading