F11 Debug line by line only my .cpp?

谁说胖子不能爱 提交于 2021-02-19 02:46:05

问题


I am developing an OpenCV application and I need to debug my code (Visual studio 2010, opencv with cmake).

I would like to debug line by line to see where exactly my app crashes. I am trying to use F11 the problem is that F11 shows me external code (opencv libraries, std libraries etc).

Is there any other way to don't put lots of breakpoint all over my code?

 int main(void) {
    vector<int> myVec;
    myVec.push_back(1);
    //> Do other stuff
 }

If I try F11 with this code, visual studio will debug the vector library files too, and I want to avoid that. I just want to follow the flow of the code inside my main();


回答1:


Hi as already mentioned in my comment in VS2010 the only way to avoid stepping into STL code is to modify a registry key, as described in this post.

With VS2012 there is another way by using Visualizers.




回答2:


You cannot go into external code (unless maybe showing it as assembly).

You should use F10 to step to the next instead of going inside such a function. You also can use Shift + F11 to return to the next line (after the current function), if you are inside such external function code.



来源:https://stackoverflow.com/questions/11990983/f11-debug-line-by-line-only-my-cpp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!