This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v4 01/11] s390: Remove duplicate checks for cached gdbarch at init
- From: Philipp Rudo <prudo at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, Yao Qi <qiyaoltc at gmail dot com>
- Date: Tue, 9 Jan 2018 13:01:34 +0100
- Subject: [PATCH v4 01/11] s390: Remove duplicate checks for cached gdbarch at init
- Authentication-results: sourceware.org; auth=none
- References: <20180109120144.93854-1-prudo@linux.vnet.ibm.com>
When initializing the gdbarch there is a check whether an appropriate
gdbarch already exists in the gdbarch_list. Failing of some of the checks
would lead to a different target description. However
gdbarch_list_lookup_by_info already checks for
if (info->target_desc != arches->gdbarch->target_desc)
continue;
Remove these duplicate checks.
gdb/ChangeLog:
* s390-linux-tdep.c (s390_gdbarch_init): Remove douplicate checks when
looking for cached gdbarch and add comment for remaining.
---
gdb/s390-linux-tdep.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index bdde5c34c8..5f4ed3a9af 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -8048,14 +8048,11 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep = gdbarch_tdep (arches->gdbarch);
if (!tdep)
continue;
- if (tdep->abi != tdep_abi)
- continue;
+ /* A program can 'choose' not to use the vector registers when they
+ are present. Leading to the same tdesc but different tdep and
+ thereby a different gdbarch. */
if (tdep->vector_abi != vector_abi)
continue;
- if ((tdep->gpr_full_regnum != -1) != have_upper)
- continue;
- if (tdep->have_gs != have_gs)
- continue;
if (tdesc_data != NULL)
tdesc_data_cleanup (tdesc_data);
return arches->gdbarch;
--
2.13.5