2074N/A-/* This file provids the (temporary) glue between the Solaris SPARC
2074N/A- target dependent code and the machine independent SVR4 /proc
2074N/A /* Solaris 7 (Solaris 2.7, SunOS 5.7) and up support two process data
2074N/A models, the traditional 32-bit data model (ILP32) and the 64-bit
2074N/A Note that a 32-bit GDB won't be able to debug a 64-bit target
2074N/A process using /proc on Solaris. */
2074N/A-#if (defined (__arch64__) || \
2074N/A- (defined (PR_MODEL_NATIVE) && (PR_MODEL_NATIVE == PR_MODEL_LP64)))
2074N/A-#define sparc_supply_gregset sparc64_supply_gregset
2074N/A-#define sparc_supply_fpregset sparc64_supply_fpregset
2074N/A-#define sparc_collect_gregset sparc64_collect_gregset
2074N/A-#define sparc_collect_fpregset sparc64_collect_fpregset
2074N/A-#define sparc_sol2_gregset sparc64_sol2_gregset
2074N/A-#define sparc_sol2_fpregset sparc64_sol2_fpregset
2074N/A-#define sparc_supply_gregset sparc32_supply_gregset
2074N/A-#define sparc_supply_fpregset sparc32_supply_fpregset
2074N/A-#define sparc_collect_gregset sparc32_collect_gregset
2074N/A-#define sparc_collect_fpregset sparc32_collect_fpregset
2074N/A-#define sparc_sol2_gregset sparc32_sol2_gregset
2074N/A-#define sparc_sol2_fpregset sparc32_sol2_fpregset
2074N/A+static int from_corefile = -1;
2074N/A supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
2074N/A- sparc_supply_gregset (&sparc_sol2_gregset, regcache, -1, gregs);
2074N/A+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
2074N/A+ int pointer_size = gdbarch_ptr_bit (gdbarch);
2074N/A+ from_corefile = regcache_from_corefile (regcache);
2074N/A+ if ((pointer_size == 32) && (from_corefile == 1))
2074N/A+ sparc32_supply_gregset (&sparc32_sol2_gregset, regcache, -1, gregs);
2074N/A+ sparc64_supply_gregset (&sparc64_sol2_gregset, regcache, -1, gregs);
2074N/A supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs)
2074N/A- sparc_supply_fpregset (&sparc_sol2_fpregset, regcache, -1, fpregs);
2074N/A+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
2074N/A+ int pointer_size = gdbarch_ptr_bit (gdbarch);
2074N/A+ from_corefile = regcache_from_corefile (regcache);
2074N/A+ if ((pointer_size == 32) && (from_corefile == 1))
2074N/A+ sparc32_supply_fpregset (&sparc32_sol2_fpregset, regcache, -1, fpregs);
2074N/A+ sparc64_supply_fpregset (&sparc64_sol2_fpregset, regcache, -1, fpregs);
2074N/A fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
2074N/A- sparc_collect_gregset (&sparc_sol2_gregset, regcache, regnum, gregs);
2074N/A+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
2074N/A+ int pointer_size = gdbarch_ptr_bit (gdbarch);
2074N/A+ from_corefile = regcache_from_corefile (regcache);
2074N/A+ if ((pointer_size == 32) && (from_corefile == 1))
2074N/A+ sparc32_collect_gregset (&sparc32_sol2_gregset, regcache, regnum, gregs);
2074N/A+ sparc64_collect_gregset (&sparc64_sol2_gregset, regcache, regnum, gregs);
2074N/A fill_fpregset (const struct regcache *regcache,
2074N/A prfpregset_t *fpregs, int regnum)
2074N/A- sparc_collect_fpregset (&sparc_sol2_fpregset, regcache, regnum, fpregs);
2074N/A+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
2074N/A+ int pointer_size = gdbarch_ptr_bit (gdbarch);
2074N/A+ from_corefile = regcache_from_corefile (regcache);
2074N/A+ if ((pointer_size == 32) && (from_corefile == 1))
2074N/A+ sparc32_collect_fpregset (&sparc32_sol2_fpregset, regcache, regnum, fpregs);
2074N/A+ sparc64_collect_fpregset (&sparc64_sol2_fpregset, regcache, regnum, fpregs);
2074N/A /* Provide a prototype to silence -Wmissing-prototypes. */