From 0288cee270af0c32fd172b7bd488d42d312d523a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 11 May 2012 22:33:28 +0000 Subject: [PATCH] Check gdbarch_ptr_bit for x32 core dump * amd64-linux-tdep.c (amd64_linux_core_read_description): Check gdbarch_ptr_bit for x32 core dump. --- gdb/ChangeLog | 5 +++++ gdb/amd64-linux-tdep.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 29201a139c6..919d52535ba 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-05-11 H.J. Lu + + * amd64-linux-tdep.c (amd64_linux_core_read_description): Check + gdbarch_ptr_bit for x32 core dump. + 2012-05-11 H.J. Lu * amd64-linux-tdep.c: Include features/i386/x32-linux.c diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index 0436610eba7..cfe6e4b61d7 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1275,9 +1275,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; } } -- 2.30.2