如何使用 scanf 和 ddd 来调试程序?

发布于 2024-08-03 13:01:22 字数 113 浏览 2 评论 0原文

ddd遇到scanf语句时,它会显示“等待GDB准备就绪”消息。调试活动在此停止。请指导我克服这个错误。

我使用的是 amd64 速龙处理器。

When ddd encounters a scanf statement, it displays "Waiting until GDB gets ready" message. The debugging activity stops here. Please guide me of overcoming this bug.

I'm using an amd64 athlon processor.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吃素的狼 2024-08-10 13:01:22

我很惊讶在这件事上花了这么多时间,所以虽然我对 ddd 知之甚少,但问题很可能只是 gdb 正在等待在等待 stdin 上的输入时被读取阻塞的程序。如果您直接运行 gdb,则可以使用以下命令将输入​​直接输入到程序中:

run run run run run run run run run input-file

你需要给你的程序一些输入。

I am surprised that so much time has elapsed on this, so although I know little about ddd, it seems very likely that the problem is simply that gdb is waiting for the program which is blocked on a read waiting for input on stdin. If you were running gdb directly, you could direct input to the program by using:

run < input-file

You need to give your program some input.

执手闯天涯 2024-08-10 13:01:22

就像在 gdb 中一样。您可以在 ddd 的底部窗格中输入您的值。只是 ddd 不太擅长绘制光标来表明这是可能的。

It's just like in gdb. You can input your values at the bottom pane of ddd. It's just that ddd is not very good at drawing the cursor to indicate that that's possible.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文