From 27b1578512b8f5594a84e588a19a6aa49704ffe5 Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Fri, 12 Apr 2002 07:37:18 +0000 Subject: [PATCH] From Jimi X : * rs6000-tdep.c (rs6000_gdbarch_init): Compute ``wordsize'' from bfd info. --- gdb/ChangeLog | 6 ++++++ gdb/rs6000-tdep.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 10a32fd9653..9bd83cc1fc6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-04-12 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_gdbarch_init): Compute ``wordsize'' from + bfd info. + 2002-04-12 Kevin Buettner From Jimi X : diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 72e1fbd3c78..70683af25c6 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2499,7 +2499,11 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } else { - wordsize = 4; + if (info.bfd_arch_info != NULL && info.bfd_arch_info->bits_per_word != 0) + wordsize = info.bfd_arch_info->bits_per_word / + info.bfd_arch_info->bits_per_byte; + else + wordsize = 4; } /* Find a candidate among extant architectures. */ -- 2.30.2