简体   繁体   中英

Stepping into a function, but not into the evaluation of the arguments with VS2017

If often encounter following situation:

 int HelperFunction(int somevalue)
 {
    ...
 }

 void FunctionToDebug(int somearg)
 {
    ...
 }

    ...
    SomeFunction();
 >> FunctionToDebug(HelperFunction(somevalue))    
    ...

Now I'm stepping through my code and I arrive at the function call marked with >> in the code snippet above.

When I use the "step into" command, the debugger will first step into HelperFunction and then into FunctionToDebug which is expected but which can be annoying eg if HelperFunction is fully debugged.

Is there some functionality or trick that would allow me to step directly into FunctionToDebug without stepping into the functions called during the evaluation of the arguments ( HelperFunction here)?

EDIT

Its not really a duplicate of this:

Is there a way to automatically avoiding stepping into certain functions in Visual Studio?

as I'd like to decide on the spot if I want to step into the arguments or not, but it's interesting anyway though.

Yes, but it's well hidden and easy to forget - not in the Debug drop-down menu. Put the cursor on the function call, then

right-click -> Step Into Specific -> [name of function]

I have repeatedly sent suggestions to MS that they add a version of Step Into that steps directly into the outermost function call. I ask you to do the same. It should be listed in the Debug menu along with Step Into, Step Out Of, and Step Over. Nothing is more tedious than stumbling into that maze of twisty passages that is Dinkumware.

如何将一次性(如果可用)断点设置到FunctionToDebug并让代码运行?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM