- we should check all of the sizes.
-
- If this assert() fails, the most likely reason is that GDB was
- built incorrectly. In order to make use of many of the header
- files in /usr/include/sys, GDB needs to be configured so that
- sizeof (long) == 4). */
- gdb_assert (sizeof (*iar) == DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM));
-
- if (register_cached (PC_REGNUM))
- regcache_collect (PC_REGNUM, iar);
- if (register_cached (tdep->ppc_ps_regnum))
- regcache_collect (tdep->ppc_ps_regnum, msr);
- if (register_cached (tdep->ppc_cr_regnum))
- regcache_collect (tdep->ppc_cr_regnum, cr);
- if (register_cached (tdep->ppc_lr_regnum))
- regcache_collect (tdep->ppc_lr_regnum, lr);
- if (register_cached (tdep->ppc_ctr_regnum))
- regcache_collect (tdep->ppc_ctr_regnum, ctr);
- if (register_cached (tdep->ppc_xer_regnum))
- regcache_collect (tdep->ppc_xer_regnum, xer);
+ we should check all of the sizes. */
+ gdb_assert (sizeof (*iar) == register_size (gdbarch,
+ gdbarch_pc_regnum (gdbarch)));
+
+ if (REG_VALID == regcache_register_status (regcache,
+ gdbarch_pc_regnum (gdbarch)))
+ regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch), iar);
+ if (REG_VALID == regcache_register_status (regcache, tdep->ppc_ps_regnum))
+ regcache_raw_collect (regcache, tdep->ppc_ps_regnum, msr);
+ if (REG_VALID == regcache_register_status (regcache, tdep->ppc_cr_regnum))
+ regcache_raw_collect (regcache, tdep->ppc_cr_regnum, cr);
+ if (REG_VALID == regcache_register_status (regcache, tdep->ppc_lr_regnum))
+ regcache_raw_collect (regcache, tdep->ppc_lr_regnum, lr);
+ if (REG_VALID == regcache_register_status (regcache, tdep->ppc_ctr_regnum))
+ regcache_raw_collect (regcache, tdep->ppc_ctr_regnum, ctr);
+ if (REG_VALID == regcache_register_status (regcache, tdep->ppc_xer_regnum))
+ regcache_raw_collect (regcache, tdep->ppc_xer_regnum, xer);