0

The up arrow key in gdb is not scrolling through previous commands on one of my ubuntu machines (kudu) but is working on another (similar) machine (cs13):

karl@kudu:~$ gdb --version
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
karl@kudu:~$ uname -a
Linux kudu 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

karl@cs13:~$ gdb --version
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
karl@cs13:~$ uname -a
Linux cs13 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

It doesn't work in gnome-terminal (TERM=xterm) and it also doesn't work in ctrl-alt-f1 (TERM=linux). I've also tried rlwrap gdb and socat READLINE EXEC:gdb with no success.

I have also downloaded and installed GDB 7.9.1, but the arrow keys don't work there either.

Note that the arrow keys are working in bash / other programs.

cronburg
  • 178
  • 9

1 Answers1

1

I had HISTSIZE= in my .bashrc, but it gets interpreted by gdb as a history size of zero. Adding the alias

alias gdb='HISTSIZE=70000000; /usr/local/bin/gdb "$@"'

to my .bashrc fixed the problem.

See https://unix.stackexchange.com/a/213595/121871 for other possible workarounds.

cronburg
  • 178
  • 9