Check bits_per_word instead of gdbarch_ptr_bit
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 16 Jun 2012 13:28:06 +0000 (13:28 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 16 Jun 2012 13:28:06 +0000 (13:28 +0000)
* amd64-linux-nat.c (ps_get_thread_area): Check bits_per_word
instead of gdbarch_ptr_bit.
* amd64-nat.c (amd64_native_gregset_reg_offset): Likewise.
(amd64_supply_native_gregset): Likewise.
(amd64_collect_native_gregset): Likewise.
* amd64-tdep.c (amd64_supply_fxsave): Likewise.
(amd64_supply_xsave): Likewise.
(amd64_collect_fxsave): Likewise.
(amd64_collect_xsave): Likewise.

gdb/ChangeLog
gdb/amd64-linux-nat.c
gdb/amd64-nat.c
gdb/amd64-tdep.c

index 1cc8753619a702ce350153fb2b59da2abe5a9a67..d7f4028a9b88b0c8e2a986125072fb3d77ac13be 100644 (file)
@@ -1,3 +1,15 @@
+2012-06-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * amd64-linux-nat.c (ps_get_thread_area): Check bits_per_word
+       instead of gdbarch_ptr_bit.
+       * amd64-nat.c (amd64_native_gregset_reg_offset): Likewise.
+       (amd64_supply_native_gregset): Likewise.
+       (amd64_collect_native_gregset): Likewise.
+       * amd64-tdep.c (amd64_supply_fxsave): Likewise.
+       (amd64_supply_xsave): Likewise.
+       (amd64_collect_fxsave): Likewise.
+       (amd64_collect_xsave): Likewise.
+
 2012-06-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        * amd64-linux-nat.c (AMD64_LINUX_X32_DS): New.
index ce62e2a8ca168199dc74279b65dad7b393485936..eb921bc413035052d5204197b710b1c954b59748 100644 (file)
@@ -442,7 +442,7 @@ ps_err_e
 ps_get_thread_area (const struct ps_prochandle *ph,
                     lwpid_t lwpid, int idx, void **base)
 {
-  if (gdbarch_ptr_bit (target_gdbarch) == 32)
+  if (gdbarch_bfd_arch_info (target_gdbarch)->bits_per_word == 32)
     {
       /* The full structure is found in <asm-i386/ldt.h>.  The second
         integer is the LDT's base_address and that is used to locate
index 68654568a48cdc8ac44841da009cd844e39b4c2a..d79b71bd355c7d55715ab9261da0d2e514f2d05c 100644 (file)
@@ -59,7 +59,7 @@ amd64_native_gregset_reg_offset (struct gdbarch *gdbarch, int regnum)
 
   gdb_assert (regnum >= 0);
 
-  if (gdbarch_ptr_bit (gdbarch) == 32)
+  if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
     {
       reg_offset = amd64_native_gregset32_reg_offset;
       num_regs = amd64_native_gregset32_num_regs;
@@ -96,7 +96,7 @@ amd64_supply_native_gregset (struct regcache *regcache,
   int num_regs = amd64_native_gregset64_num_regs;
   int i;
 
-  if (gdbarch_ptr_bit (gdbarch) == 32)
+  if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
     num_regs = amd64_native_gregset32_num_regs;
 
   if (num_regs > gdbarch_num_regs (gdbarch))
@@ -127,7 +127,7 @@ amd64_collect_native_gregset (const struct regcache *regcache,
   int num_regs = amd64_native_gregset64_num_regs;
   int i;
 
-  if (gdbarch_ptr_bit (gdbarch) == 32)
+  if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
     {
       num_regs = amd64_native_gregset32_num_regs;
 
index 2db5cf0bb26fb34cf8c708d617d7172a53074b89..27f115bb5bd5156cdbac2e2fcfb72232f6f12e3b 100644 (file)
@@ -2802,7 +2802,8 @@ amd64_supply_fxsave (struct regcache *regcache, int regnum,
 
   i387_supply_fxsave (regcache, regnum, fxsave);
 
-  if (fxsave && gdbarch_ptr_bit (gdbarch) == 64)
+  if (fxsave
+      && gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
     {
       const gdb_byte *regs = fxsave;
 
@@ -2824,7 +2825,8 @@ amd64_supply_xsave (struct regcache *regcache, int regnum,
 
   i387_supply_xsave (regcache, regnum, xsave);
 
-  if (xsave && gdbarch_ptr_bit (gdbarch) == 64)
+  if (xsave
+      && gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
     {
       const gdb_byte *regs = xsave;
 
@@ -2852,7 +2854,7 @@ amd64_collect_fxsave (const struct regcache *regcache, int regnum,
 
   i387_collect_fxsave (regcache, regnum, fxsave);
 
-  if (gdbarch_ptr_bit (gdbarch) == 64)
+  if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
     {
       if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
        regcache_raw_collect (regcache, I387_FISEG_REGNUM (tdep), regs + 12);
@@ -2873,7 +2875,7 @@ amd64_collect_xsave (const struct regcache *regcache, int regnum,
 
   i387_collect_xsave (regcache, regnum, xsave, gcore);
 
-  if (gdbarch_ptr_bit (gdbarch) == 64)
+  if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
     {
       if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
        regcache_raw_collect (regcache, I387_FISEG_REGNUM (tdep),