Pyclewn 中的标准输入/输出(vim 的 GDB 前端)

发布于 2024-12-25 02:11:53 字数 508 浏览 2 评论 0原文

我刚刚安装了 Pyclewn。它可以工作并显示变量等。但它不会显示我的程序的输出,当我的程序想要输入某些内容时,它不会执行任何操作(我可以编写“:C运行输出”并且它可以工作。但不适用于标准输入/输出。 它的文档中有一些内容: http://pyclewn.sourceforge.net/_static/pyclewn.html< /a> 但我不明白它说的是什么。

PS:我已经这样做了。现在我想映射例如运行这些命令。但因为 /dev/pts/nn 中的“nn”可能会有所不同,所以我应该手动输入数字(从打开的 xterm 中查看)。当我将一个键映射到一系列 gdb 命令时,我还有另一个问题,它说 gdb 正忙,我可以在命令之间添加“:sleep 100m”,问题就会解决。但在文档中它说我应该启用异步选项。但是当我使用 :Pyclewn 命令从 vim 运行 pyclewn 时,我不知道如何启用异步选项。

I've just installed Pyclewn. It works and shows variables and etc. But it doesn't show my program's output and when my program wants to input something, it doesn't do anything(I can write ":C run output" and it works. but not with standard I/O.
There was something in its documentation: http://pyclewn.sourceforge.net/_static/pyclewn.html
But I didn't understand what it says.

P.S: I've done that. Now I want to map for example to run those commands. but because the "nn" in /dev/pts/nn may vary, I should manually enter the number(see it from the xterm opened). I also have another problem when I map a key to a sequence of gdb commands, it says gdb is busy, I can add ":sleep 100m" between commands and the problem will be soved. but in the documentation it says that I should enable async option. but when I run pyclewn from vim with :Pyclewn command I don't know how to enable the async option.

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

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

发布评论

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

评论(2

梦太阳 2025-01-01 02:11:53

您应该使用 inferior_tty.py 创建一个与正在调试的程序一起使用的终端。

常见问题解答:

:Cshell setsid xterm -e inferior_tty.py &

从这个新生成的窗口中确定要使用的 tty 名称,然后:

:Cset inferior-tty /dev/pts/nn

You should use inferior_tty.py to create a terminal to be used with the program being debugged.

Abridged summary (most relevant bits only) from the FAQ:

:Cshell setsid xterm -e inferior_tty.py &

Determine what the name of the tty to be used is from this newly spawned window, then:

:Cset inferior-tty /dev/pts/nn
魂ガ小子 2025-01-01 02:11:53

或者只需从终端启动 pyclewn ,它就会自动抓取该终端进行输入和输出。

例如:

  pyclewn -c "main.cc other.h other.cc"

Or just start pyclewn from a terminal and it will automatically grab that terminal for input and output.

E.g:

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