无法使用 Ctrl-X A 退出 tui 模式,也无法在 tui 模式下查看程序输出
问题A:
- 我在命令行中使用“gdb test”启动gdb
- 在做任何其他事情之前我按ctrl-x,ctrl-a
- 然后我使用“b main”设置断点
- 然后我开始运行使用“r”的程序
到目前为止,如果我按向上箭头键,src 窗口将不会滚动。相反,我的命令窗口中会出现一些内容 - “^[0A”。如果我尝试使用 ctrl-l 刷新屏幕,命令窗口中会出现“^L”。
我认为这不应该发生。在这种情况下,我什至无法使用 cx,ca 退出 tui 模式(将出现“^X^A”)。我做错了什么吗?我意识到只要我在 TUI 界面中使用“run”命令就会出现这个问题。但是,如果我使用“gdb -tui”启动 gdb,我可以在 TUI 中使用 run 命令
问题 B
我在 TUI 模式下看不到程序的输出。可以看到GDB自己的输出,但看不到正在调试的程序的输出。当我使用 ctrl-x、ctrl-a 进入 TUI 以及使用 -tui 命令行选项时,都会发生这种情况。
有什么办法可以解决这个问题吗?
我在网上读过一些 TUI 文章,有些人似乎“专门”使用 TUI。我想TUI可以正常工作,只是有一套规则必须严格遵守?
编辑:我在 ubuntu 11.04 中使用 gnome-terminal
Problem A:
- I start gdb in command line with "gdb test"
- I press ctrl-x,ctrl-a before I do anything else
- Then I set break point using "b main"
- Then I start running the program using "r"
Till this point, if I press the Up arrow key the src window will not scroll. Instead, something will appear in my command window - "^[0A". If I try to refresh the screen with ctrl-l, "^L" is what appears in the command window.
I don't think this is supposed to happen. Under this situation I can't even quit tui mode with c-x,c-a ("^X^A" will appear instead). Am I doing something wrong? I realize this problem occurs so long as I use the "run" command inside the TUI interface. I can, however, use the run command in TUI if I start gdb with "gdb -tui"
Problem B
I can't see the output of my program in TUI mode. GDB's own output can be seen, but not that of the program being debugged. This occurs both when I enter TUI using ctrl-x,ctrl-a and when using -tui command-line option.
Is there any way to fix this?
I've read some TUI articles on the net and some people seem to use TUI "exclusively". I suppose TUI can work properly, it's just there's a set of rules that must be carefully followed?
EDIT: I use gnome-terminal in ubuntu 11.04
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用 -tui 选项运行 gdb (https://bbs.archlinux.org/viewtopic.php ?id=112660)
Run gdb with -tui option instead (https://bbs.archlinux.org/viewtopic.php?id=112660)
~/.inputrc
是 GDB 7.7 中的罪魁祸首,因为:如果我删除这些行,它就可以工作。
以下错误报告中似乎提到了这一点: https://sourceware.org/ bugzilla/show_bug.cgi?id=15163
我已在 https://sourceware.org/ml/gdb/2015-06/msg00009.html< /a> 安德鲁·伯吉斯回答说他有 刚刚提交了一个广受好评的补丁来添加:
所以在未来的版本中我们应该有命令作为快捷方式的替代。
但后来我看到了曙光,从 TUI 转移到了 GDB Dashboard: https://github.com/ cyrus-and/gdb-dashboard 更强大且错误更少。另请参阅:如何在交互过程中突出显示 gdb 输出并为其着色调试?
~/.inputrc
was the culprit in GDB 7.7 because of:If I remove those lines it works.
This seems to be mentioned at in the following bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=15163
I have requested a workaround at https://sourceware.org/ml/gdb/2015-06/msg00009.html and Andrew Burgess replied that he had just submitted a well received patch to add:
so in future versions we should have commands as an alternative to the shortcuts.
But then I saw the light and moved from TUI to GDB Dashboard: https://github.com/cyrus-and/gdb-dashboard which is simply more powerful and less buggy. See also: How to highlight and color gdb output during interactive debugging?
更改您的终端以解决您的第一个问题。我自己曾经使用 gnome-terminal,但后来改为 terminator。有些终端有时不支持像 Alt 这样的键(过去在 vim 中使用一些 Alt+something 映射来体验这一点)
您可以通过“focus winName”将焦点更改为另一个窗口,在您的情况下,使用“focus src”
从这里得到这个
不确定你的第二个问题。祝你好运!
Change your terminal to get rid of your first problem. I used to use gnome-terminal my self, but then changed to terminator. Some terminals don't support keys like Alt sometimes (used to experience this in vim with some Alt+something maps)
You can change forcus to another window by 'focus winName', in your case, use 'focus src'
got this from here
Not sure about your 2nd problem. Good luck!
我认为您正在寻找“接下来的焦点”。它可以在(可以有两个以上)窗口之间切换。我确信这也有一条捷径。请注意,这与 user1888039 的答案几乎相同,因此如果您同意,则应该对该答案进行投票。
I think you are looking for, "focus next." it switches you among (there can be more than two) the windows. I'm sure there is a short-cut for this too. Please note, this is almost the same answer as user1888039, so if you agree you should up-vote that answer.
问题A:
使用 Ctrl+X,然后按 a 进入或退出 TUI 模式。
或者正如您提到的运行 gdb -tui
问题 B:
请注意,您的程序打印可以通过 (gdb) 提示符运行。换句话说,您的程序可能会打印,但之后会打印“(gdb)”。
要轻松检查情况是否确实如此,请尝试每次打印一行超过 6 个字符或多行。
您应该看到打印的一部分。
Problem A:
Use Ctrl+X then press a to enter or exit TUI mode.
Or as you mentioned run gdb -tui
Problem B:
Note that your program print could be ran over by the (gdb) prompt. In other words, it is possible that your program prints but the " (gdb)" is printed over it after.
To easily check if this is indeed the case, try to print either a line longer than 6 characters or multiple lines each time.
You should see part of your print.