Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH: Check gdbarch_ptr_bit for x32 core dump
@ 2012-05-11 19:33 H.J. Lu
  2012-05-11 20:30 ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2012-05-11 19:33 UTC (permalink / raw)
  To: GDB

Hi,

This patch checks gdbarch_ptr_bit for x32 core dump.  Tested on
Linux/x86-64.  Ok to install?

Thanks.

H.J.
---
	* amd64-linux-tdep.c (amd64_linux_core_read_description): Check
	gdbarch_ptr_bit for x32 core dump.

diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index acc7303..601ce20 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1273,9 +1290,15 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch,
   switch ((xcr0 & I386_XSTATE_AVX_MASK))
     {
     case I386_XSTATE_AVX_MASK:
-      return tdesc_amd64_avx_linux;
+      if (gdbarch_ptr_bit (gdbarch) == 32)
+	return tdesc_x32_avx_linux;
+      else
+	return tdesc_amd64_avx_linux;
     default:
-      return tdesc_amd64_linux;
+      if (gdbarch_ptr_bit (gdbarch) == 32)
+	return tdesc_x32_linux;
+      else
+	return tdesc_amd64_linux;
     }
 }
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-11 22:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 19:33 PATCH: Check gdbarch_ptr_bit for x32 core dump H.J. Lu
2012-05-11 20:30 ` Mark Kettenis
2012-05-11 21:01   ` H.J. Lu
2012-05-11 22:12     ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox