Make sure terminal settings are restored before exiting
[deliverable/binutils-gdb.git] / gdb / amd64-tdep.c
index 3e5d1bd8a7cdc62c87a0c77956500e162077b277..5e63b5e674d763f4f9975745913e71ce06d44831 100644 (file)
@@ -39,6 +39,7 @@
 #include "disasm.h"
 #include "amd64-tdep.h"
 #include "i387-tdep.h"
+#include "x86-xstate.h"
 
 #include "features/i386/amd64.c"
 #include "features/i386/amd64-avx.c"
@@ -2718,12 +2719,14 @@ static const struct frame_base amd64_frame_base =
 
 /* Normal frames, but in a function epilogue.  */
 
-/* The epilogue is defined here as the 'ret' instruction, which will
+/* Implement the stack_frame_destroyed_p gdbarch method.
+
+   The epilogue is defined here as the 'ret' instruction, which will
    follow any instruction such as 'leave' or 'pop %ebp' that destroys
    the function's stack frame.  */
 
 static int
-amd64_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
+amd64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   gdb_byte insn;
   struct compunit_symtab *cust;
@@ -2747,8 +2750,8 @@ amd64_epilogue_frame_sniffer (const struct frame_unwind *self,
                              void **this_prologue_cache)
 {
   if (frame_relative_level (this_frame) == 0)
-    return amd64_in_function_epilogue_p (get_frame_arch (this_frame),
-                                        get_frame_pc (this_frame));
+    return amd64_stack_frame_destroyed_p (get_frame_arch (this_frame),
+                                         get_frame_pc (this_frame));
   else
     return 0;
 }
@@ -3118,6 +3121,25 @@ amd64_x32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_ptr_bit (gdbarch, 32);
 }
 
+/* Return the target description for a specified XSAVE feature mask.  */
+
+const struct target_desc *
+amd64_target_description (uint64_t xcr0)
+{
+  switch (xcr0 & X86_XSTATE_ALL_MASK)
+    {
+    case X86_XSTATE_MPX_AVX512_MASK:
+    case X86_XSTATE_AVX512_MASK:
+      return tdesc_amd64_avx512;
+    case X86_XSTATE_MPX_MASK:
+      return tdesc_amd64_mpx;
+    case X86_XSTATE_AVX_MASK:
+      return tdesc_amd64_avx;
+    default:
+      return tdesc_amd64;
+    }
+}
+
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_amd64_tdep (void);
 
This page took 0.024491 seconds and 4 git commands to generate.