aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-09-09 17:33:54 +0100
committerAndrew Burgess <aburgess@redhat.com>2024-09-10 14:07:11 +0100
commit5ddd0d7eefbb683a09e233b7dfb4a48a04b72b8e (patch)
treea623bf07ab57275150b5808d88529f7e756895a6 /gdb/testsuite
parent258c81da3c13971dc7667f30baf506ececd2cc0e (diff)
downloadbinutils-5ddd0d7eefbb683a09e233b7dfb4a48a04b72b8e.zip
binutils-5ddd0d7eefbb683a09e233b7dfb4a48a04b72b8e.tar.gz
binutils-5ddd0d7eefbb683a09e233b7dfb4a48a04b72b8e.tar.bz2
gdb/python: avoid depending on the curses library
The commit: commit 29c70787112e01cd52b53bf14bdcacb0a11e0725 Date: Sun Sep 8 07:46:09 2024 +0200 [gdb/testsuite] Handle missing curses in gdb.python/py-missing-debug.exp Highlighted that in some cases we might be running on a system with an older version of Python (earlier than 3.7), and on a system for which the curses library has not been installed. In these circumstances the gdb.missing_debug module will not load as it uses curses to provide isalnum() and isascii() functions. To avoid this problem I propose that we copy the isalnum() and isascii() from the Python curses library. These functions are basically trivial and removing the curses dependency means GDB will work in more cases without increasing its dependencies. I did consider keeping the uses of curses and only having the function definitions be a fallback for when the curses library failed to load, but this felt like overkill. The function definitions are both tiny and I think "obvious" given their specifications, so I figure we might as well just use our own definitions if they are not available as builtin methods on the str class. For testing I changed this line: if sys.version_info >= (3, 7): to if sys.version_info >= (3, 7) and False: then reran gdb.python/py-missing-debug.exp, there were no failures. Approved-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/testsuite')
0 files changed, 0 insertions, 0 deletions