s390: if -> gdb_assert for tdesc_has_registers check
Before doing the tdesc validation there is a check whether the tdesc has registers or not. This check is not only unnecessary but wrong. First the check is done after a default tdesc is assigned if the original tdesc has no registers. These default tdescs always have registers so the check alway returns true. Second if the default tdesc would not have registers the check only skips the tdesc validation instead of returning an error. This would trigger a gdb_assert later on in tdesc_use_registers. gdb/ChangeLog: * s390-linux-tdep.c (s390_gdbarch_init): Use gdb_assert for tdesc_has_registers check
This commit is contained in:
parent
47c9317e71
commit
650f5e1370
2 changed files with 11 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
|||
2018-01-23 Philipp Rudo <prudo@linux.vnet.ibm.com>
|
||||
|
||||
* s390-linux-tdep.c (s390_gdbarch_init): Use gdb_assert for
|
||||
tdesc_has_registers check
|
||||
|
||||
2018-01-23 Philipp Rudo <prudo@linux.vnet.ibm.com>
|
||||
|
||||
* s390-linux-tdep.c (s390_tdesc_valid): New function.
|
||||
|
|
|
@ -8045,8 +8045,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
tdep->tdesc = tdesc;
|
||||
|
||||
/* Check any target description for validity. */
|
||||
if (tdesc_has_registers (tdesc))
|
||||
{
|
||||
gdb_assert (tdesc_has_registers (tdep->tdesc));
|
||||
if (!s390_tdesc_valid (tdep, tdesc_data))
|
||||
{
|
||||
tdesc_data_cleanup (tdesc_data);
|
||||
|
@ -8054,7 +8053,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
gdbarch_free (gdbarch);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine vector ABI. */
|
||||
#ifdef HAVE_ELF
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue