From: Kevin Buettner Date: Fri, 12 Apr 2002 07:37:18 +0000 (+0000) Subject: From Jimi X : X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27b1578512b8f5594a84e588a19a6aa49704ffe5;p=binutils-gdb.git From Jimi X : * rs6000-tdep.c (rs6000_gdbarch_init): Compute ``wordsize'' from bfd info. --- 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. */