If I'am debugging files with gdb -tui
the source window always becomes messed up. So every time I hit enter I have to immediately type ctrl+L to get rid of this problem, this is how gdb
refeshes the window. I am working on tty with gnu screen.
Is there a possibility to automatically refresh gdb in tui mode?
If gdb doesn't have this ability Python could be a solution because gdb is able to source Python files, but I don't know about Python.
This Python snippet works fine in Bash but not inside gdb:
import sys
r = "\033[2J" # here I try to emulate [ctrl-L]
t = ""
while 1:
i = sys.stdin.read(1)
t = t +i
if i == '\n':
print(r)
Of course I accept every other language supported by gdb.
Every help is appreciated.
By the way, here is a screencast https://youtu.be/DqiH6Jym1JY that show my problem.
This is the file I used for demonstrating in gdb like the link above show's, mess_up.c
#include <stdio.h>
int main(void){
//int n = 120;
int n;
n = 120;
char stuff[n+2];
printf( "Max: %d\n", n );
printf( "Sizeof int: %d\n", sizeof(int) );
printf( "Sizeof char: %d\n", sizeof(char) );
printf( "Sizeof n: %d\n", sizeof n );
printf( "Sizeof stuff: %d\n", sizeof stuff );
fgets ( stuff , n , stdin );
printf( "The stuff:\n%s\n", stuff );
printf( "Sizeof stuff after input = %d\n", sizeof stuff );
return 0;
}
My actual ncurses version displayed by tic -V
is ncurses 5.9.20140118