RE: Step by Step skips large chunks of code



OK, I created a new project and copied the original code back to it.

The interesting thing is that it still skips code during debug but not
nearly as bad as the original project. That makes no sense to me at all!
--
Scott Norberg


""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: debug build crashes when calling managed code
    ... enable debug info you *should* be able to still debug. ... Look forward to your response. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.language)
  • RE: Unable to copy file. ... Access to the path ... is denied.
    ... The Debug Directory was included in the project. ... ** it the service app used(configured in windows Service manager) when you ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.general)
  • 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: Step by Step skips large chunks of code
    ... In project properties page, switch to tab, and check if the ... 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: attach to process not started in debug mode?
    ... Jeffrey - I've got a box at a remote ISP where I may need to debug the app from ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)