From 2e9157d5ff407b896faf67e01efcd7f943c5032a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 21 Apr 2010 20:22:14 +0000 Subject: Properly read i386 coredump. 2010-04-21 H.J. Lu PR corefiles/11523 * amd64-linux-tdep.c (amd64_linux_core_read_description): Check XCR0 first. * i386-linux-tdep.c (i386_linux_core_read_xcr0): Return 0 if there is no .reg-xstate section. (i386_linux_core_read_description): Check XCR0 first. --- gdb/amd64-linux-tdep.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'gdb/amd64-linux-tdep.c') diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index f249d5dcd17..7376ba7b715 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1269,18 +1269,15 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd) { - asection *section = bfd_get_section_by_name (abfd, ".reg2"); - uint64_t xcr0; - - if (section == NULL) - return NULL; - /* Linux/x86-64. */ - xcr0 = i386_linux_core_read_xcr0 (gdbarch, target, abfd); - if ((xcr0 & I386_XSTATE_AVX_MASK) == I386_XSTATE_AVX_MASK) - return tdesc_amd64_avx_linux; - else - return tdesc_amd64_linux; + uint64_t xcr0 = i386_linux_core_read_xcr0 (gdbarch, target, abfd); + switch ((xcr0 & I386_XSTATE_AVX_MASK)) + { + case I386_XSTATE_AVX_MASK: + return tdesc_amd64_avx_linux; + default: + return tdesc_amd64_linux; + } } static void -- cgit v1.2.1