关于 cgdb & gdbtui 的输入scanf()问题

使用cgdb 和 gdbtui 调试程序时, 遇到scanf函数时 it seems to enter into an infinite loop

According to the info page of cgdb, you need to either:

  • start the program on one terminal, and attach to it with CGDB from another terminal
  • or pass arguments using the tty window

To invoke the tty window, hit 'T' in command mode (escape)

Extracted from the info page:

Sending I/O to the program being debugged

This technique is similar to getting in and out of "GDB mode". The tty window is not visible by default. This is because it is only needed if the user wishes to send data to the program being debugged. To display the tty window, hit `T' while in command mode.

调试到scanf 这行, 进入命令模式(ESC), T 会出现 tty window, 输入要发送给IO的数据, 推出此模式(ESC), 继续n...调试,

原文地址:https://www.cnblogs.com/sanghai/p/6345606.html