Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GDB "layout src" terminal window output corruption

Tags:

debugging

gdb

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?

like image 493
user997112 Avatar asked Jul 12 '17 08:07

user997112


1 Answers

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.
like image 103
ks1322 Avatar answered Oct 15 '22 17:10

ks1322