s390: Hook s390 into OSABI mechanism
Do what the title says and distinguish between 31- and 64-bit systems.
The goal is to init the OSABI as late as possible in gdbarch_init so the
OSABI has the chance to overwrite the defaults.
There are two pitfalls to be aware of:
First, the dwarf2 unwinder must be appended before the OSABI is
initialized. Otherwise the OS could add a default unwinder which always
takes control before the dwarf unwinder even gets a chance.
Second, tdesc_use_registers has to be handled with extra care. It sets
several gdbarch hooks, especially gdbarch_register_name, which has to be
overwritten again after the call. Furthermore it deletes the tdesc_data
without checking. Therefore there must not be a call to
tdesc_data_cleanup afterwards or GDB will crash with a double free.
gdb/ChangeLog:
* s390-linux-tdep.c (osabi.h): New include.
(s390_linux_init_abi_31, s390_linux_init_abi_64)
(s390_linux_init_abi_any): New functions.
(s390_gdbarch_init, _initialize_s390_tdep): Adjust.