问题是GDB无法使用SFML从程序的某些地方获取调试信息。CLION规格:
- Clion 2016.1.3
- mingw-w64 3.4
- GDB 7.8.1
我找到了一个答案,建议停止反病毒软件一段时间,但行不通。
代码样本:
int main(int argc, char* argv[]) {
sf::RenderWindow window(sf::VideoMode(800, 600), "myproject");
Interface interface (window);
/* Setting up 'interface'*/
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
/* Capture events */
}
window.clear ();
interface.draw (); // Breakpoint here, information captured instantly
}
}
进入interface.draw():
void draw () {
for (FramePtr &ptr : activeFrameStack) // Debugger fails to get info here
ptr->draw (window);
}
获取最近发布的2016.2版本,'命令超时'问题已解决,捆绑的GDB已更新为7.11(https://blog.jetbrains.com/clion.com/clion/clion/2016/07/clion-201616-2汇款/) .