Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
conio我正在使用 Emacs 和 gdb 来调试使用's的 c++ 程序getch。类似于以下内容:
conio
getch
#include <conio.h> int main(){ int c = getch(); cout << (char) c; }
如果我在 的第一行放置一个断点,则main挂起gdb并且没有任何反应。我认为输入文件 ( run < input.txt) 不会起作用。
main
gdb
run < input.txt
我应该如何调试它?
set new-console on将打开一个新终端,您可以输入该终端并getch运行。
set new-console on
其他方法也可能有效,但我认为这个很好。