I am using the "layout src" tui feature within gdb (amazing if you haven't used it) which allows you to step through the source code, showing the surrounding code in the terminal whilst you step through.
However, occasionally/bordering on frequently I encounter an issue where the terminal output becomes corrupted. The output on the screen becomes mixed, with source code from previous and current stack frames showing. I have seen this on Red Hat 6.5 and CentOS 6. The GDB version is 7.11
The latest instance of this occurring (5 mins ago) seems to have been triggered when I stepped over code which output to the screen.
I have seen this problem in various different code bases, at different companies and its a shame because the gdb tui mode is very helpful.
Does anyone know how to fix this/what causes it?
答案 0 :(得分:2)
当程序输出与tui输出混合时,您所描述的可能是一个已知问题。发生这种情况时,您可以使用命令refresh
或 CTRL + L 键盘快捷方式刷新它们来“修复”tui窗口。见documentation:
refresh
Refresh the screen. This is similar to typing C-L.