The default installation from Debian 9's netinst ISO doesn't include gdb or C or C++ compilers. A user would typically run
apt install build-essential gdb to install them.
In certain circumstances - I could reproduce this by using the netinst ISO and choosing to install KDE - the
gdb-minimal package will be installed, which provides a gdb that doesn't include TUI (or python).
mp@debian9$ apt-rdepends -r gdb-minimal
Reverse Depends: plasma-workspace (4:5.8.6-2.1+deb9u1)
Reverse Depends: kde-plasma-desktop (>= 5:92)
Reverse Depends: kde-full (>= 5:92)
Reverse Depends: kde-standard (>= 5:92)
It looks like you have this.
apt install gdb will remove
gdb-minimal and install the full gdb.