I just want to step through my program with Visual Studio 2005, but when I try to copy what my teacher (kinda) showed me, I start stepping through some other files that spontaneously appear in my window. They're called random things like "xstring" and "ios" and I'm really frustrated. Please, how do I step through my code?
问题:
回答1:
The best way to avoid stepping into such methods is to set NoStepInto rules in the registry. Check out this blog post for exactly how to do it.
If you want to avoid the whole of the standard library, just set the following rule:
10 std\:\:.*=NoStepInto
For Visual Studio 2005 you need to add the rule to the following key
HKLM\Software\Microsoft\VisualStudio\8.0\NativeDE\StepOver
回答2:
Why it's happening: you're using objects from the Standard Template Library. Some of your statements are explicitly or implicitly invoking methods of these STL classes. You're stepping into these methods with your debugger.
There are two ways to fix this:
If you know that you're on a statment which invokes an STL method, then choose the debugger's "Step Over" (F10) command instead of its "Step Into" (F11) command.
If you get into one of these methods by mistake, then use the debugger's "Step Out" (Shift-F11) command.
回答3:
Most likely what's happening is that you're stepping into built-in methods in the framework. When that happens, just click "step out" and you'll be back in your own code.
You can also use "step over" for those methods that you know are built in - of course risking to step over methods you want to step into.
My recommendation is that you make sure to place breakpoints at every line where you want to check the state of the application - that way you can just use the play button (F5).
回答4:
http://mark.michaelis.net/Blog/VisualStudioKeyboardShortcutsWrapupMSDNFlashFeb22009.aspx
Basically speaking you should use F10(step-over) and not F11(step-in) when current line of code contains call to not your function.