]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[Cell/B.E.] Fix regression due to gdbarch_significant_addr_bit
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 20 Dec 2017 12:59:14 +0000 (13:59 +0100)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 20 Dec 2017 12:59:14 +0000 (13:59 +0100)
On Cell/B.E. multi-architecture debugging we use a "merged" address space
that encodes both the main PowerPC address space and the local store address
spaces of all active SPUs.  This will always occupy 64 bits.

However, gdbarch_addr_bit is set to 32 on SPU, and may be set to 32 as well
on PowerPC.  Since the new gdbarch_significant_addr_bit defaults to the
value of gdbarch_addr_bit, this means addresses may be improperly truncated.

Work around this problem by explicitly setting gdbarch_significant_addr_bit
to 64 both for the SPU target and also for PowerPC target that support
Cell/B.E. execution.

gdb/ChangeLog:
2017-12-20  Ulrich Weigand  <uweigand@de.ibm.com>

* spu-tdep.c (spu_gdbarch_init): Set set_gdbarch_significant_addr_bit
to 64 bits.
(ppc_linux_init_abi): Likewise, if Cell/B.E. is supported.

gdb/ChangeLog
gdb/ppc-linux-tdep.c
gdb/spu-tdep.c

index f314e8e78425164548a2bd842980ca0270f48133..dc6406ac0c6a88aca466416b520ab8d6df831e94 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-20  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * spu-tdep.c (spu_gdbarch_init): Set set_gdbarch_significant_addr_bit
+       to 64 bits.
+       (ppc_linux_init_abi): Likewise, if Cell/B.E. is supported.
+
 2017-12-18  Joel Brobecker  <brobecker@adacore.com>
 
        * ada-lang.c (ada_to_fixed_type_1): Rethrow errors with
index 0e43a64b690a9cc0449bca762bb759705d7388c9..512049026f6384247b95906e80db619076ec67e4 100644 (file)
@@ -1809,6 +1809,10 @@ ppc_linux_init_abi (struct gdbarch_info info,
 
       /* Cell/B.E. cross-architecture unwinder support.  */
       frame_unwind_prepend_unwinder (gdbarch, &ppu2spu_unwind);
+
+      /* We need to support more than "addr_bit" significant address bits
+         in order to support SPUADDR_ADDR encoded values.  */
+      set_gdbarch_significant_addr_bit (gdbarch, 64);
     }
 
   set_gdbarch_displaced_step_location (gdbarch,
index fb9a5d8730b81e7db3a9375f0c6be3563c943176..dda3011ce4eef1e7a855d3374683cdd2175286a3 100644 (file)
@@ -2720,6 +2720,9 @@ spu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_address_class_name_to_type_flags
     (gdbarch, spu_address_class_name_to_type_flags);
 
+  /* We need to support more than "addr_bit" significant address bits
+     in order to support SPUADDR_ADDR encoded values.  */
+  set_gdbarch_significant_addr_bit (gdbarch, 64);
 
   /* Inferior function calls.  */
   set_gdbarch_call_dummy_location (gdbarch, ON_STACK);