RE: Step by Step skips large chunks of code

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.


.



Relevant Pages

  • RE: Step by Step skips large chunks of code
    ... The interesting thing is that it still skips code during debug but not ... has been correctly complied into assembly code. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.debugging)
  • RE: Step by Step skips large chunks of code
    ... Compiler will ... has been correctly complied into assembly code. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.debugging)
  • RE: Slower with AJAX?
    ... You now put the MultiView in UpdatePanel to switch using AJAX, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: 2.6.23-rc8-mm2
    ... duplicate filename 'switch' can not be created ... 2000-2006 Netfilter Core Team ... # IPVS transport protocol load balancing support ... # Device Drivers ...
    (Linux-Kernel)
  • Re: Pomposity, thy name is Berlinski
    ... scam outfit. ... since the ID perps started running the bait and switch on their own ... but only after the ID perps lost in Dover. ... creationist support base, and that would have been the time to get ...
    (talk.origins)