我后来在我的程序中遇到了一些问题,因为源代码和编译后的代码不同,所以它们不会被点击.我决定在我的公共MainWindow()函数上设置一个断点,看看发生了什么.
现在我得到输入中断模式失败的错误,原因如下:源文件'F:\ cAdmin\OO\OO\MainWindow.xaml.cs'不属于正在调试的项目.
我发现这很有趣,因为我的项目存储在我的闪存驱动器(L :)而不是F:.
我重建了我的项目并清理了它(多次),重新启动了我的计算机,移动了我的闪存驱动器,以及我能想到的任何其他内容.
.net debugging visual-studio-2010 visual-studio visual-studio-debugging
我正在使用F11键(Step Into模式)调试给定的C++代码,以便了解调用代码中函数的精确顺序,并且我意识到它永远不会进入某些函数,除非我在某些行设置断点在函数定义中.
我的意思是,如果我从main方法调用一个函数,并且该函数在另一个.cpp中定义,我希望F11调试模式在函数内部逐步进入,以便分析变量的变化.它大部分时间都有,但在某些情况下它只是执行函数而不进入它,并跳转到main方法中的下一行.
为什么会这样?
例:
这是F11永远不会介入的功能:
void VirtualCamera::display (void) {
glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Clear the background of the window
glClear(GL_COLOR_BUFFER_BIT); //Clear the colour buffer (more buffers later on)
glLoadIdentity(); // Load the Identity Matrix to reset our drawing locations
glTranslatef(0.0f, 0.0f, -5.0f);
renderPrimitive(); // Render the primitive
glFlush(); // Flush the OpenGL buffers to the window
}
Run Code Online (Sandbox Code Playgroud)
这是F11循序渐进的主要方法:
void VirtualCamera::CameraMain(int argc, char **argv){
glutInit(&argc, argv); // Initialize GLUT …Run Code Online (Sandbox Code Playgroud)