This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
PATCH: Check gdbarch_ptr_bit for x32 core dump
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GDB <gdb-patches at sourceware dot org>
- Date: Fri, 11 May 2012 12:33:36 -0700
- Subject: PATCH: Check gdbarch_ptr_bit for x32 core dump
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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;
}
}