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?
What you describe is likely a known issue when program output is getting mixed with tui output. When this happens you can "fix" tui windows by refreshing them either using command refresh
or CTRL+L keyboard shortcut. See documentation:
refresh
Refresh the screen. This is similar to typing C-L.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With