summaryrefslogtreecommitdiff
path: root/gdb/s390-linux-tdep.c
diff options
context:
space:
mode:
authorPhilipp Rudo <prudo@linux.vnet.ibm.com>2018-01-30 17:10:08 +0100
committerAndreas Arnez <arnez@linux.vnet.ibm.com>2018-01-30 17:10:08 +0100
commitc81e88797907fc0698abec09767e49cee33b2bd5 (patch)
tree38e91d3ab77eb9a0820eb15f2893f83a6c6e96ba /gdb/s390-linux-tdep.c
parente671cd59d74cec9f53e110ce887128d1eeadb7f2 (diff)
downloadbinutils-gdb-c81e88797907fc0698abec09767e49cee33b2bd5.tar.gz
s390: Fix gdb.base/all-architectures.exp with --enable-targets=all
With 7042632bf79 (s390: Hook s390 into OSABI mechanism) assigning a default target description was moved from s390_gdbarch_init to s390_linux_init_abi_*. This causes problems when GDB is built with --enable-targets=all and the user sets an unsupported OSABI, e.g. "set osabi AIX". In this case there is no valid tdesc, and GDB crashes with an internal error. Fix this by reverting parts of 7042632bf79. gdb/ChangeLog: * s390-linux-tdep.c: Remove includes "features/s390-linux32.c" and "features/s390x-linux64.c". (_initialize_s390_linux_tdep): Remove initialization of tdescs s390_linux32 and s390x_linux64. (s390_linux_init_abi_31, s390_linux_init_abi_64): Don't set default tdesc. * s390-tdep.c: Include "features/s390-linux32.c" and "features/s390x-linux64.c". (s390_tdesc_valid): Add check for tdesc_has_registers. (s390_gdbarch_init): Make sure there is always a valid tdesc. (_initialize_s390_tdep): Initialize tdesc_s390_linux32 and tdesc_s390x_linux64. * s390-linux-tdep.h: Move export of tdesc_s390_linux32 and tdesc_s390x_linux64 to... * s390-tdep.h: ...here.
Diffstat (limited to 'gdb/s390-linux-tdep.c')
-rw-r--r--gdb/s390-linux-tdep.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 9d1351946ea..0e85e710898 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -42,7 +42,6 @@
#include "trad-frame.h"
#include "xml-syscall.h"
-#include "features/s390-linux32.c"
#include "features/s390-linux32v1.c"
#include "features/s390-linux32v2.c"
#include "features/s390-linux64.c"
@@ -52,7 +51,6 @@
#include "features/s390-vx-linux64.c"
#include "features/s390-tevx-linux64.c"
#include "features/s390-gs-linux64.c"
-#include "features/s390x-linux64.c"
#include "features/s390x-linux64v1.c"
#include "features/s390x-linux64v2.c"
#include "features/s390x-te-linux64.c"
@@ -1158,9 +1156,6 @@ s390_linux_init_abi_31 (struct gdbarch_info info, struct gdbarch *gdbarch)
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
tdep->abi = ABI_LINUX_S390;
- if (!tdesc_has_registers (tdesc))
- tdesc = tdesc_s390_linux32;
- tdep->tdesc = tdesc;
s390_linux_init_abi_any (info, gdbarch);
@@ -1178,9 +1173,6 @@ s390_linux_init_abi_64 (struct gdbarch_info info, struct gdbarch *gdbarch)
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
tdep->abi = ABI_LINUX_ZSERIES;
- if (!tdesc_has_registers (tdesc))
- tdesc = tdesc_s390x_linux64;
- tdep->tdesc = tdesc;
s390_linux_init_abi_any (info, gdbarch);
@@ -1199,7 +1191,6 @@ _initialize_s390_linux_tdep (void)
s390_linux_init_abi_64);
/* Initialize the GNU/Linux target descriptions. */
- initialize_tdesc_s390_linux32 ();
initialize_tdesc_s390_linux32v1 ();
initialize_tdesc_s390_linux32v2 ();
initialize_tdesc_s390_linux64 ();
@@ -1209,7 +1200,6 @@ _initialize_s390_linux_tdep (void)
initialize_tdesc_s390_vx_linux64 ();
initialize_tdesc_s390_tevx_linux64 ();
initialize_tdesc_s390_gs_linux64 ();
- initialize_tdesc_s390x_linux64 ();
initialize_tdesc_s390x_linux64v1 ();
initialize_tdesc_s390x_linux64v2 ();
initialize_tdesc_s390x_te_linux64 ();