gdb: add a gdbarch_register_name self test, and fix some architectures
This commit adds a self-test that checks that gdbarch_register_name
never returns nullptr for any valid register number.
Most architectures already met this requirement, there were just 6
that failed the new selftest, and are updated in this commit.
Beyond the self-tests I don't have any facilities to test that the
architectures I've adjusted still work correctly.
If you review all the various gdbarch_register_name implementations
then you will see that there are far more architectures that seem like
they might return nullptr in some situations, e.g. alpha, avr, bpf,
etc. This commit doesn't attempt to address these cases as non of
them are hit during the selftest. Many of these cases can never be
hit, for example, in alpha_register_name GDB checks for a register
number less than zero, this case can't happen and could be changed
into an assert.
A later commit in this series will have a general cleanup of all the
various register_name methods, and remove all references to NULL from
their code, however, as that commit will be mostly adjusting code that
is never hit, I want to keep those changes separate.
The selftest has been tested on x86-64, but I don't have access to
suitable systems to fully test any of the *-tdep.c code I've changed
in this commit.